02.08.2012, 12:06
Add this to the top of your mode: (Under defines, includes, etc.. Where more variables should be)
Change the command to this:
In OnPlayerConnect, add this:
pawn Код:
new alreadyrobbed[MAX_PLAYERS];
pawn Код:
if(strcmp(cmdtext, "/robbank", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(robbing[playerid] == 1) return SendClientMessage(playerid, 0xAFAFAFAA, "You Are Already Robbing The Bank!");
if(alreadyrobbed[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFAA, "You Already Robbed The Bank Lately, Please Wait 1 Hour!");
if(!IsPlayerInRangeOfPoint(playerid, 15.0, 2394.35,-1593.94,785.62)) return SendClientMessage(playerid, 0xAFAFAFAA, "You Are Not At The Bank!");
SendClientMessage(playerid, 0xFFFF00AA "You Have Robbed The Los Santos Local Bank And Stole $500,000!");
robbing[playerid] = 1;
LoopingAnim(playerid,"ped", "ARRESTgun", 4.0, 0, 1, 1, 1, 0);
GivePlayerMoney(playerid, 1000000);
SendClientMessageToAll(0xFF9900AA, "||----------Breaking News----------||");
SendClientMessageToAll(0x33CCFFAA, " The Los Santos Bank Has Been Robbed!");
SendClientMessageToAll(0x33CCFFAA, " We Advise Everyone To Stay Away From The Area");
SendClientMessageToAll(0x33CCFFAA, " Untill Further Notice.");
SendClientMessageToAll(0xFF9900AA, "||----------Breaking News----------||");
}
return 1;
}
pawn Код:
robbing[playerid] = false;
alreadyrobbed[playerid] = false;