Tazer problem
#2

You need to add a function to replace your tazer with your Silence Pistol for example :

PHP код:
new pTazerReplace[MAX_PLAYERS]; 
Define that up

Now you made a define , now go under :

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate
Then put that :

PHP код:
if((newstate == || newstate == || newstate == || newstate == 9) && pTazer[playerid] == 1)
    {
        
RemovePlayerWeapon(playerid23);
        
GivePlayerWeapon(playeridpTazerReplace[playerid], 60000);
        
pTazer[playerid] = 0;
    } 
Now on your tazer command add under :
PHP код:
if(GetPVarInt(playerid"Tazer") == 1
add that :
PHP код:
pTazerReplace[playerid] = PlayerInfo[playerid][pGuns][2];
if(
PlayerInfo[playerid][pGuns][2] != 0RemovePlayerWeapon(playeridPlayerInfo[playerid][pGuns][2]);
GivePlayerValidWeapon(playerid2360000);
Action(playerid"takes his tazer out of his belt.");
pTazer[playerid] = 1
Now lets add when you type /tazer again it holster the tazer

PHP код:
        }
        else
        { 
PHP код:
RemovePlayerWeapon(playerid23);
GivePlayerValidWeapon(playeridpTazerReplace[playerid], 60000);
Action(playerid"puts his tazer back into his belt.");
pTazer[playerid] = 0
Now add under :

PHP код:
public OnPlayerConnect(playerid
PHP код:
pTazerReplace[playerid] = 0
That's will define when the player connects to the server it will set his tazer to 0

Now add under :

PHP код:
public OnPlayerDisconnect(playeridreason
PHP код:
if(pTazer[playerid] == 1GivePlayerValidWeapon(playerid,pTazerReplace[playerid],60000); 
I hope that I helped if you need any question just ask here
Reply


Messages In This Thread
Tazer problem - by xdarren - 14.09.2013, 14:42
Re: Tazer problem - by Mark_Samp - 14.09.2013, 15:23
Re: Tazer problem - by xdarren - 14.09.2013, 16:31
Re: Tazer problem - by Nothis - 14.09.2013, 20:07
Re: Tazer problem - by Nothis - 14.09.2013, 20:13
Re: Tazer problem - by Mark_Samp - 14.09.2013, 20:18

Forum Jump:


Users browsing this thread: 1 Guest(s)