10.06.2014, 20:29
Below you can find one of the rob commands , and i would like to know how can i make a rob timer so a player won't type the same command 30000 times and ruin the server economy .
pawn Код:
CMD:robstore(playerid,params[])
{
if(gTeam[playerid] == TEAM_COP) return SendClientMessage(playerid,COLOR_RED,"{00FFFF}[SERVER]{EEEEEE}Law Enforcement Officers cannot commit a robbery crime");
new pName[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid,pName,sizeof(pName));
if(GetPlayerWantedLevel(playerid >=1)) return SendClientMessage(playerid,COLOR_RED,"{00FFFF}[SERVER]{EEEEEE}You cant rob a store with a wanted level.");
if(IsInside247[playerid] == 1)
{
new StoreMoney = RandomEx( 10000,30000);
format(string,sizeof(string),"{FF0000}[ROBBERY]{EEEEEE}%s has robbed the 24/7 store of Fort Carson and got %d$",pName,StoreMoney);
SendClientMessageToAll(COLOR_LIGHTGREEN,string);
GameTextForPlayer(playerid,"~y~24/7Store~n~~r~ROBBED",3000,5);
format(string,sizeof(string),"{FF0000}[ROBBERY]{EEEEEE}You've successfully robbed the 24/7 store and got $%d",pName,StoreMoney);
SendClientMessage(playerid,COLOR_LIGHTGREEN,string);
SendClientMessage(playerid,COLOR_RED,"{00FFFF}[SERVER]{EEEEEE}You have gained 3 stars for robbing the 24/7 store");
GivePlayerMoney(playerid,StoreMoney);
SetPlayerWantedLevel(playerid,3);
}
else SendClientMessage(playerid,COLOR_RED,"{00FFFF}[SERVER]{EEEEEE}You need to be inside the 247/7 store");
return 1;
}