28.09.2011, 09:36
pawn Код:
new Canrob[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/rob", true) == 0) // If they type /rob
{
if(IsPlayerInCheckpoint(playerid)) // Check if they are in a checkpoint
{
if(CanRob[playerid] == 1)
{
GivePlayerMoney(playerid, random(2000+1)); // Give the player the money!
Canrob[playerid] = 0;
SetTimerEx("CanRob",60000,false,"i",playerid);
else return SendClientMessage(playerid,-1,"You must wait 60 seconds before robbing again!");
}
return 1; //return one to prevent "SERVER: Unknown command"
}
return 0;
}
forward CanRob(playerid);
public CanRob(playerid)
{
Canrob[playerid] = 1;
return 1;
}