How can I make this so that it can only be used once after each respawn?
#9

In your CMD:
pawn Код:
if(GetPVarInt(playerid, "gearme") != 1) // 1 means its already used.
{
     SetPVarInt(playerid, "gearme", 1); //Setting to 1, which lets the cmd to detect it on next use. See Above^
     GameTextForPlayer(playerid, "Cheat found! Multiple weapons and full armour given.", 5000, 4);
     GivePlayerWeapon(playerid, 24, 700);
     GivePlayerWeapon(playerid, 31, 1400);
     SetPlayerArmour(playerid, 100);
} else SendClientMessage(playerid, 0xFFFFFFFF, "You can only use it again after death.");
In OnPlayerDeath:
pawn Код:
SetPVarInt(playerid, "gearme", 0); // Setting it to normal.
In OnPlayerDisconnect:
pawn Код:
SetPVarInt(playerid, "gearme", 0); // Setting it to normal.
Hope this helps.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)