14.09.2013, 15:23
You need to add a function to replace your tazer with your Silence Pistol for example :
Define that up
Now you made a define , now go under :
Then put that :
Now on your tazer command add under :
add that :
Now lets add when you type /tazer again it holster the tazer
Now add under :
That's will define when the player connects to the server it will set his tazer to 0
Now add under :
I hope that I helped if you need any question just ask here
PHP код:
new pTazerReplace[MAX_PLAYERS];
Now you made a define , now go under :
PHP код:
public OnPlayerStateChange(playerid, newstate, oldstate)
PHP код:
if((newstate == 2 || newstate == 3 || newstate == 7 || newstate == 9) && pTazer[playerid] == 1)
{
RemovePlayerWeapon(playerid, 23);
GivePlayerWeapon(playerid, pTazerReplace[playerid], 60000);
pTazer[playerid] = 0;
}
PHP код:
if(GetPVarInt(playerid, "Tazer") == 1)
PHP код:
pTazerReplace[playerid] = PlayerInfo[playerid][pGuns][2];
if(PlayerInfo[playerid][pGuns][2] != 0) RemovePlayerWeapon(playerid, PlayerInfo[playerid][pGuns][2]);
GivePlayerValidWeapon(playerid, 23, 60000);
Action(playerid, "takes his tazer out of his belt.");
pTazer[playerid] = 1;
PHP код:
}
else
{
PHP код:
RemovePlayerWeapon(playerid, 23);
GivePlayerValidWeapon(playerid, pTazerReplace[playerid], 60000);
Action(playerid, "puts his tazer back into his belt.");
pTazer[playerid] = 0;
PHP код:
public OnPlayerConnect(playerid)
PHP код:
pTazerReplace[playerid] = 0;
Now add under :
PHP код:
public OnPlayerDisconnect(playerid, reason)
PHP код:
if(pTazer[playerid] == 1) GivePlayerValidWeapon(playerid,pTazerReplace[playerid],60000);
