24.06.2011, 06:23
Quote:
if (strcmp("/gearme", cmdtext, true, 10) == 0)
{ GameTextForPlayer(playerid, "Cheat found! Multiple weapons and full armour given.", 5000, 4); GivePlayerWeapon(playerid, 24, 700); GivePlayerWeapon(playerid, 31, 1400); SetPlayerArmour(playerid, 100); return 1; } For instance, after a player types /gearme, he/she can't use this command again unless they respawn/die. (It's to keep people from entering /gearme over and over and over again.) |
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
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;
}
pawn Код:
gearme = 0; //if you want to beable to /gearup again after you die
pawn Код:
gearme = 0;