03.09.2012, 18:08
Hello, I am making a roleplay server and I'm currently scripting a tazer.
However, when I withdraw a tazer it will replace the current gun(pistol) with a sdpistol. When I holster it, I planned to make it so it would give the tazer back, however I only get weapon 0 back.
This is my code:
However, when I withdraw a tazer it will replace the current gun(pistol) with a sdpistol. When I holster it, I planned to make it so it would give the tazer back, however I only get weapon 0 back.
This is my code:
pawn Код:
CMD:tazer(playerid, params[])
{
new replace;
if(tazer[playerid] == 0)
{
replace = PlayerInfo[playerid][pGuns][2];
GivePlayerValidWeapon(playerid, 23, 9999);
tazer[playerid] = 1;
new string[56];
format(string, sizeof(string), "* %s unholsters his tazer.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE);
return 1;
}
if(tazer[playerid] == 1)
{
tazer[playerid] = 0;
new string[56];
GivePlayerValidWeapon(playerid, replace, 6000);
format(string, sizeof(string), "* %s holsters his tazer. (debug %i)", GetPlayerNameEx(playerid), replace);
ProxDetector(30.0, playerid, string, COLOR_PURPLE);
return 1;
}
return 1;
}