15.07.2013, 21:35
Hi guys, so I got this feature where you /grapple and you get weapon ID 23, and you can grapple hook etc.
What I want is, that if /grapple is enabled and you die, it disables it.
Currently, if you /grapple(enable it) and die, after death you need to /grapple twice to re-enable it.
So I want to make it disabled OnPlayerDeath but I don't know how, I hope you guys can help.
My code:
Thanks for all the up-coming helpers!
What I want is, that if /grapple is enabled and you die, it disables it.
Currently, if you /grapple(enable it) and die, after death you need to /grapple twice to re-enable it.
So I want to make it disabled OnPlayerDeath but I don't know how, I hope you guys can help.
My code:
pawn Код:
CMD:grapple(playerid, params[])
{
if(gPlayerClass[playerid] == SNIPER)
{
SetPVarInt(playerid, "pv_GrappleEnabled", !GetPVarInt(playerid, "pv_GrappleEnabled"));
switch(GetPVarInt(playerid, "pv_GrappleEnabled"))
{
case false:
{
SendClientMessage(playerid, -1, "» Grapple Hooking has been disabled.");
SetPlayerAmmo(playerid, 23, 0);
return 1;
}
case true:
{
SendClientMessage(playerid, -1, "» Grapple Hooking has been enabled.");
GivePlayerWeapon(playerid, 23, 0x7F800000);
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Only snipers can use this!");
return 1;
}
return 0;
}