This repository was archived by the owner on Feb 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
SetPlayerNoReload
GtakillerIV edited this page Nov 15, 2014
·
13 revisions
Allows a player to continuously shoot without reloading
This function does not freeze the player's ammo.
If the player's ammo runs out, it'll decrease until the ammo is equal to the amount of bullets(in negative). When that happens, the player's weapon will disappear.
playerid
The player's id.
bool:Toggle
Whether you want to enable it or not.
Can be either true
or false
.
0 if the player is not connected
CMD:noreload(playerid, params[])
{
//If the player has the SA-MP+ plugin installed
if(IsUsingSAMPP(playerid))
{
static bool:noReload[MAX_PLAYERS];
//If player already has no-reload mode enabled
if(noReload[playerid])
{
//Turn off his no-reload mode and send him a message
//saying no-reload is now turned off
SetPlayerNoReload(playerid, false);
SendClientMessage(playerid, -1, "No-reload mode set to OFF");
noReload[playerid] = false;
}
//If no-reload mode is not enabled
else
{
//If the player is online
if(IsPlayerConnected(playerid))
{
SetPlayerNoReload(playerid, true);
//Enable it and send a message
SendClientMessage(playerid, -1, "No-reload mode set to ON");
noReload[playerid] = true;
}
}
}
else
{
SendClientMessage(playerid, -1, "You need the SA-MP+ plugin");
}
return 1;
}