This repository has been archived by the owner on Feb 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
TogglePlayerSwitchReload
GtakillerIV edited this page Nov 16, 2014
·
2 revisions
Allows or denies a player's gun to automatically reload after switching guns
playerid
The player's id.
bool:toggle
Whether to auto reload or not.
Can be true
or false
.
0 if the player is not connected
CMD:toggleswitch(playerid, params[])
{
//If the player has the SA-MP+ plugin installed
if(IsUsingSAMPP(playerid))
{
static bool:switchEnabled[MAX_PLAYERS];
//If the player's gun will already reload after switching guns
if(switchEnabled[playerid])
{
TogglePlayerSwitchReload(playerid, false);
SendClientMessage(playerid, -1, "Your gun will no longer reload once you switch guns");
switchEnabled[playerid] = false;
}
//If not
else
{
TogglePlayerSwitchReload(playerid, true);
SendClientMessage(playerid, -1, "Your gun will now reload after switching guns");
switchEnabled[playerid] = true;
}
}
//If not
else
{
SendClientMessage(playerid, -1, "You need the SA-MP+ plugin");
}
return 1;
}
See Also