05.06.2012, 09:22
Alright i need some help with Bank Robbery system, So the problem is,
Its not doing what i want it to do, This is what i want it to do.
So pretty much, i want it to give the player who is robbing the bank the loot if he is at the robbank point for more then 10 minutes, Here is the hole lining of my script, Any help would be much appreciated, Thanks.
Код:
SetTimerEx("GiveLoot", 1, false,"i",playerid);
Код:
forward GiveLoot(); public GiveLoot() { foreach(Player, i) { if(IsAtRobBankPoint(i)) { GivePlayerCash(i, 400000); } } return 1; }
Код:
//START: Bank Robbery Command forward UnsetBankRob(); public UnsetBankRob() { BankRobbedRecently = 0; return 1; } forward GiveLoot(); public GiveLoot() { foreach(Player, i) { if(IsAtRobBankPoint(i)) { GivePlayerCash(i, 400000); } } return 1; } CMD:robbank(playerid, params[]) { new success = random(2); if(BankRobbedRecently == 1) { SendClientMessage(playerid, COLOR_GREY, "* This location was robbed recently, try again later"); return 1; } if(PlayerInfo[playerid][pRobTime] >= 1) { SendClientMessage(playerid, COLOR_GREY, "* You already attempted or robbed a place recently, please wait.-jake is god"); return 1; } if(!IsAtRobBankPoint(playerid)) { if(GetPlayerWeapon(playerid) >= 24 && GetPlayerWeapon(playerid) <= 40) { if(PlayerInfo[playerid][pDuty] == 0) { if(success == 1) { SendClientMessage(playerid, COLOR_ORANGE, "* You are now Robbing the Los Santos bank, please remain in the checkpoint for 500 Seconds!"); RobbingTime[playerid] = 30; WantedPoints[playerid] = 6; SetPlayerCriminal(playerid,255, "Robbing the Bank"); PlayerInfo[playerid][pRobTime] = 0; BankRobbedRecently = 1; SetTimerEx("GiveLoot", 1, false,"i",playerid); SetTimerEx("UnsetBankRob", 86400000, false, "i", playerid); } else { SendClientMessage(playerid, COLOR_ORANGE, "* You failed to rob the Bank!"); WantedPoints[playerid] = 2; SetPlayerCriminal(playerid,255, "Attempted to rob the Bank"); PlayerInfo[playerid][pRobTime] = 0; BankRobbedRecently = 1; SetTimerEx("UnsetBankRob", 43200000, false, "i", playerid); } } else { SendClientMessage(playerid, COLOR_GREY, "* Go Off duty first!"); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "* You need a deadly weapon to perform this Act!"); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "* You're not at the Bank Rob Point!"); return 1; } return 1; } //END: Bank Robbery Command