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

Quote:
Originally Posted by DaRealz
Посмотреть сообщение
WEll... im new to this kinda, but i might be able to help.
This might be wasting space in the script to do this, but this is how i do it:
put this at the top of the script
pawn Код:
new gearme; //or some other name
Then after, for your command, do this:
pawn Код:
if (strcmp("/gearme", cmdtext, true, 10) == 0)
{
     if(gearme = 1)
     {
          SendClientMessage(playerid,0xFFFFFFFF,"You already geared youself !");
     }
     else if(gearme = 0)
     {
     GameTextForPlayer(playerid, "Cheat found! Multiple weapons and full armour given.", 5000, 4);
     GivePlayerWeapon(playerid, 24, 700);
     GivePlayerWeapon(playerid, 31, 1400);
     SetPlayerArmour(playerid, 100);
     gearme = 1; //This should make it so now, if u do it again, it will do the first thing where it says you already geared yourself
     }
     return 1;
}
then under OnPlayerDeath
pawn Код:
gearme = 0; //if you want to beable to /gearup again after you die
And on OnPlayerConnect
pawn Код:
gearme = 0;
NOT TESTED | NOT SURE IF IT WORKS
Код:
new gearme;
should be
Код:
new gearme[MAX_PLAYERS];
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)