SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 19/06/2014, 08:34 PM   #1
KingHual
High-roller
 
KingHual's Avatar
 
Join Date: Jun 2010
Location: Bulgaria
Posts: 2,424
Reputation: 1303
Default [WIP] SA-MP+ - Adding new features to SA-MP

WARNING: The plugin is no longer being developed. You're free to fork it and continue working on it.




First off, I'd like to say that this plugin is in PRE-ALPHA. The basics have been finished, but it's a long way from being stable.


Features:
  • Uses SA-MP's plugin SDK, along with sampGDK, to be in sync with SA-MP
  • Backwards-compatible - A server that has the plugin running can handle players not using SA-MP+ (unless specifically told to kick them if they don't use it), a client that uses SA-MP+ can join servers which are not using SA-MP+


Functions:

Show/hide a specific component of a player's HUD (or all of it):
Code:
native ToggleHUDComponentForPlayer(playerid, componentid, bool:toggle);

Component IDs:
Code:
HUD_COMPONENT_ALL
HUD_COMPONENT_AMMO
HUD_COMPONENT_WEAPON
HUD_COMPONENT_HEALTH
HUD_COMPONENT_BREATH
HUD_COMPONENT_ARMOUR
HUD_COMPONENT_MINIMAP
HUD_COMPONENT_CROSSHAIR
HUD_COMPONENT_MONEY

Change a player's vehicle radio station (only works when the player is in a vehicle):
Code:
native SetRadioStationForPlayer(playerid, stationid);

Station IDs:
Code:
RADIO_PLAYBACKFM
RADIO_KROSE
RADIO_KDST
RADIO_BOUNCEFM
RADIO_SFUR
RADIO_LOSSANTOS
RADIO_RADIOX
RADIO_CSR
RADIO_KJAHWEST
RADIO_MASTERSOUNDS
RADIO_WCTR
RADIO_UTP
RADIO_OFF

Set wave height (value of 0-5 recommended):
Code:
native SetWaveHeightForPlayer(playerid, Float:height);
Code:
native SetWaveHeightForAll(Float:height);

Toggle a player's ability to enter the pause menu:
Code:
native TogglePauseMenuAbility(playerid, bool:toggle);

Check if a player is in the pause menu:
Code:
native IsPlayerInPauseMenu(playerid);

Set a player's HUD colours:
Code:
native SetPlayerHUDComponentColour(playerid, componentid, colour);

Colour component IDs:
Code:
HUD_COLOUR_MONEY_POSITIVE
HUD_COLOUR_MONEY_NEGATIVE
HUD_COLOUR_ARMOUR
HUD_COLOUR_HEALTH
HUD_COLOUR_BREATH
HUD_COLOUR_AMMO
HUD_COLOUR_WANTED_LEVEL
HUD_COLOUR_RADIO_TUNED
HUD_COLOUR_RADIO_UNTUNED

Toggle whether a player can do a specific action:
Code:
native TogglePlayerAction(playerid, actionid, bool:toggle);

Action IDs:
Code:
PLAYER_ACTION_ALL
PLAYER_ACTION_SPRINT
PLAYER_ACTION_ENTER_CAR
PLAYER_ACTION_CROUCH
PLAYER_ACTION_FIRE_WEAPON
PLAYER_ACTION_UNKNOWN
PLAYER_ACTION_SWITCH_WEAPON
PLAYER_ACTION JUMP

Toggle player no-reload:
Code:
native SetPlayerNoReload(playerid, bool:toggle);

Get a player's current screen resolution:
Code:
native GetPlayerResolution(playerid, &width, &height);

Check if a player is using the SAMP+ plugin:
Code:
native IsUsingSAMPP(playerid);

Set a player's blur intensity (SA-MP's is 0, default is 36):
Code:
native SetPlayerBlurIntensity(playerid, intensity);

Set a player's game speed:
Code:
native SetPlayerGameSpeed(playerid, Float:speed);

Toggle a player's ability to drive cars on water:
Code:
native TogglePlayerDriveOnWater(playerid, bool:toggle);

Toggle a player's ability to do anything. Difference between this and TogglePlayerControllable is the player can move their camera:
Code:
native TogglePlayerFrozen(playerid, bool:toggle);

Toggle whether a player uses ped animations. Difference between this and UsePlayerPedAnims is that this function can be applied to a specific player, anytime:
Code:
native SetPlayerPedAnims(playerid, bool:toggle);

Toggle a player's ability to reload when they switch weapons (useful to avoid quick-reload):
Code:
native TogglePlayerSwitchReload(playerid, bool:toggle);

Toggle a player's infinite sprint ability:
Code:
native TogglePlayerInfiniteRun(playerid, bool:toggle);

Set a player's maximum aircraft height:
Code:
native SetPlayerAircraftHeight(playerid, Float:height);

Get a player's maximum aircraft height:
Code:
native Float:GetPlayerAircraftHeight(playerid);

Set a player's maximum jetpack height:
Code:
native SetPlayerJetpackHeight(playerid, Float:height);

Get a player's maximum jetpack height:
Code:
native Float:GetPlayerJetpackHeight(playerid);


Callbacks:

Code:
public OnPlayerOpenPauseMenu(playerid)
Code:
public OnPlayerClosePauseMenu(playerid)
Code:
public OnPlayerEnterPauseSubmenu(playerid, from, to)
Code:
public OnDriverDriveByShot(playerid)
Code:
public OnPlayerStunt(playerid, stunttype, money, details[])
* details[] length is always 6. Every stunt type fills the 6 details with different values, -1 the detail isn't used. For example, a stunt with type STUNT_TYPE_INSANE would fill the 1st detail with the jump height, 2nd detail with jump distance, 3rd detail with rotation, 4th detail with number of flips, and would set the rest to -1 as they're unused.

Code:
public OnPlayerResolutionChange(playerid, width, height)
Code:
public OnPlayerSAMPPConnect(address[], port)
* this is a low-level callback that's called when a client tries to establish an unprocessed connection. Returning 0 would reject the client's SA-MP+ connection

Code:
public OnPlayerSAMPPJoin(playerid, bool:has_plugin)

Stunt types:
Code:
STUNT_TYPE_TWO_WHEELS
STUNT_TYPE_INSANE
STUNT_TYPE_WHEELIE
STUNT_TYPE_STOPPIE

Submenu IDs:
Code:
PAUSE_ID_STATS
PAUSE_ID_STARTGAME
PAUSE_ID_BRIEF
PAUSE_ID_AUDIOSETTINGS
PAUSE_ID_DISPLAYSETTINGS
PAUSE_ID_MAP
PAUSE_ID_DEFAULTSETTINGS
PAUSE_ID_AUDIODEFAULTSETTINGS
PAUSE_ID_CONTROLLERDEFAULTSETTINGS
PAUSE_ID_USERTRACKOPTIONS
PAUSE_ID_LANGUAGE
PAUSE_ID_OPTIONS
PAUSE_ID_QUITGAME
PAUSE_ID_CONTROLLERSETUP
PAUSE_ID_REDEFINECONTROLS
PAUSE_ID_FOOTVEHICLECONTROLS
PAUSE_ID_MOUSESETTINGS
PAUSE_ID_JOYPADSETTINGS
PAUSE_ID_MAIN


Experimental:

Code:
native SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size, inner_colour = 0xFF0000FF, middle_colour = 0xFF0000FF, outer_colour = 0xFF0000FF);

Code:
native SetPlayerRaceCheckpoint(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size, colour = 0xFF0000FF);

Code:
native SetPlayerCheckpointColour(playerid, inner, middle, outer);
Code:
native SetPlayerRaceCheckpointColour(playerid, colour);


Screenshots:

Altered HUD colours:


SetPlayerCheckpoint with custom colours:


SetPlayerRaceCheckpoint with custom colour:



Currently working on:
  • Server browser


Upcoming features:
  • Additional server.cfg options
  • Versioning
  • Unhandled connection ping and timeout
  • CRC checks
  • Update mechanism
  • More fonts
  • Many more functions I can't think of right now, unlimited possibilities!


Credits:
  • The SA-MP team - SA-MP, SA-MP plugin SDK
  • Kevin Jenkins - RakNet
  • Zeex (xeeZ) - sampGDK
  • Whitetiger - contributing
  • Josstaa - contributing
  • gtakillerIV - contributing


Downloads:

Everything is hosted on a GitHub repository:
* Loader.exe is hardcoded, you might need to recompile it with your own settings until I've added proper injection


Installation:
Currently, clientside installation isn't straight-forward, but an installer is on the TODO list.
  • Client: Place both sampp.dll and Loader.exe in your SA-MP directory, launch Loader.exe (as I previously stated, you might need to manually compile Loader.exe at the moment)
  • *Server: Place sampp.dll in your server's plugins folder, add sampp to the plugins list in server.cfg, start the server

*You might need to forward the port after the SA-MP server's port (e.g. if the SA-MP server's port is 7777, you might need to forward 777
__________________

Last edited by KingHual; 28/05/2017 at 05:43 PM. Reason: updated links
KingHual is offline   Reply With Quote
Old 19/06/2014, 08:42 PM   #2
Dignity
High-roller
 
Join Date: May 2013
Location: Belgium
Posts: 1,701
Reputation: 996
Default Re: [In Development] SA-MP+ - Adding new features to SA-MP

Great work!

Last edited by Dignity; 07/08/2014 at 06:56 PM.
Dignity is offline   Reply With Quote
Old 19/06/2014, 08:46 PM   #3
Kar
High-roller
 
Kar's Avatar
 
Join Date: May 2010
Location: Black Asylum
Posts: 3,277
Reputation: 429
Default Re: [In Development] SA-MP+ - Adding new features to SA-MP

what the.. okay let's see how this goes.

To Kalcor, do you see how much people want these extra functions in sa-mp? Look at YSF, now look at this... this really shows something man..
__________________
Kar is online now   Reply With Quote
Old 19/06/2014, 09:02 PM   #4
Mriss
Gangsta
 
Join Date: Jan 2014
Location: Notepad ++
Posts: 547
Reputation: 38
Default Re: [In Development] SA-MP+ - Adding new features to SA-MP

Nice work!
Mriss is offline   Reply With Quote
Old 19/06/2014, 09:03 PM   #5
Kaperstone
High-roller
 
Kaperstone's Avatar
 
Join Date: May 2011
Location: Home
Posts: 3,172
Reputation: 599
Default Re: [In Development] SA-MP+ - Adding new features to SA-MP

A fix for the "You're banned from this server" would be nice
__________________
Quote:
Originally Posted by Paulice View Post
Quote:
Originally Posted by Xeon™ View Post
Just wow, thinking... how you did know that samp or anything about programming exists without G00gle

Thinking...
G00gle isn't closing or going down... It would make no sense to find out about SA-MP while I'm on its forum... lmao

Kaperstone is offline   Reply With Quote
Old 19/06/2014, 09:10 PM   #6
[D]ry[D]esert
Gangsta
 
[D]ry[D]esert's Avatar
 
Join Date: Jan 2012
Location: In Pokemon world
Posts: 522
Reputation: 27
Default Re: [In Development] SA-MP+ - Adding new features to SA-MP

Wow, that is insane!
__________________
We're back with more features and more fun!

A.K.A [Mew]
_______________________________________________
[D]ry[D]esert is offline   Reply With Quote
Old 19/06/2014, 09:11 PM   #7
iZN
High-roller
 
Join Date: Jun 2010
Location: Pakistan
Posts: 2,473
Reputation: 565
Default Re: [In Development] SA-MP+ - Adding new features to SA-MP

Quote:
Originally Posted by xkirill View Post
A fix for the "You're banned from this server" would be nice
That's already possible with OnIncomingConnection and RCON command "reloadbans".

Great work King_Hual, can I return 1 though?
__________________
iZN is offline   Reply With Quote
Old 19/06/2014, 09:11 PM   #8
Patrick
Guest
 
Posts: n/a
Default Re: [In Development] SA-MP+ - Adding new features to SA-MP

What a brilliant work, I really love ToggleHUDComponentForPlayer but it requires Client Sided Files Anyways nicely done.

Quote:
Originally Posted by iZN View Post
That's already possible with OnIncomingConnection and RCON command "reloadbans".
It does not work often, sometimes it still shows the banned message when you timed out.
  Reply With Quote
Old 19/06/2014, 09:15 PM   #9
Mellnik
Gangsta
 
Mellnik's Avatar
 
Join Date: Dec 2011
Location: Paradise Falls, CAℕADA
Posts: 794
Reputation: 369
Default AW: [In Development] SA-MP+ - Adding new features to SA-MP

Interesting! Will post some suggestions soon.
Mellnik is offline   Reply With Quote
Old 19/06/2014, 09:16 PM   #10
KingHual
High-roller
 
KingHual's Avatar
 
Join Date: Jun 2010
Location: Bulgaria
Posts: 2,424
Reputation: 1303
Default Re: [In Development] SA-MP+ - Adding new features to SA-MP

I'd be happy to get some suggestions!
__________________
KingHual is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
New Features. Tupuc General 2 16/06/2012 07:30 AM
[help]Adding features. Tamao_Serizawa Scripting Help 3 10/01/2012 11:28 AM
Odd bug with the SA-MP GUi features. Elorreli Client Support 3 10/02/2010 08:53 PM
Help! About 0.3 Features.. [TR]Driftking Help Archive 2 19/12/2009 06:49 PM
0.3 features lockdown now, can someone summarize the new features? yezizhu Help Archive 12 20/09/2009 05:47 AM


All times are GMT. The time now is 03:15 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.