• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Bank Robbery System [HELP!]
#1
PHP Code:
// Bank Robbery

new robbing[MAX_PLAYERS];

new 
alreadyrobbed[MAX_PLAYERS];

new 
robbingTimer[MAX_PLAYERS];

forward bankrob(playerid);

forward robbedoff(playerid);



public 
bankrob(playerid)

{

? ?new 
robcash random(25000)  35000;

? ?
SendClientMessage(playeridCOLOR_WHITE" Your finished robbing the bank, Run now");

? ?
GiveMoney(playeridrobcash);

? ?
//SendClientMessage(playerid, COLOR_WHITE, "You've been rob {33CC33}%s{FFFFFF}Dollars from the bank vault.", FormatNumber(robcash));

? ?alreadyrobbed[playerid] = 1;

? ?
robbing[playerid] = 0;

? ?
robbingTimer[playerid] = SetTimerEx("robbedoff"3600000false"i"playerid);

? ?
SendClientMessageToAll(COLOR_ORANGE"||----------Latest News----------||");

? ?
SendClientMessageToAll(COLOR_WHITE" It looks like the bankrobber got the cash.");

? ?
SendClientMessageToAll(COLOR_WHITE" The cops is currently waiting outside.");

? ?
SendClientMessageToAll(COLOR_ORANGE"||----------Latest News----------||");

? ?return 
1;

}

public 
robbedoff(playerid)

{

? ?
alreadyrobbed[playerid] = 0;

? ?
SendClientMessage(playeridCOLOR_WHITE" You can now rob the bank again [/report to ask an admin to approve.]");

? ?return 
1;





PHP Code:
public OnPlayerDeath(playeridkilleridreason)

{

? ?
// Bank Robbey

? ?KillTimer(robbingTimer[playerid]);

? ?
robbing[playerid] = 0;

? ?
SendClientMessageToAll(COLOR_ORANGE"||----------Latest News----------||");

? ?
SendClientMessageToAll(COLOR_WHITE" Los Santos Police have been caught the suspect. ");

? ?
SendClientMessageToAll(COLOR_ORANGE"||----------Latest News----------||");

return 
1;





PHP Code:
public OnPlayerDisconnect(playeridreason)

{

? ?
/*// Bank Robbey

? ?KillTimer(robbingTimer[playerid]);

? ?robbing[playerid] = 0;

? ?SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");

? ?SendClientMessageToAll(COLOR_WHITE, " Los Santos Police have been caught the suspect. ");

? ?SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");*/ 



PHP Code:
CMD:robbank(playeridparams[])

{

if(
robbing[playerid] == 1)

? ? ? return 
SendErrorMessage(playerid" You are already robbing the bank, please slow down");



? ?if(
alreadyrobbed[playerid] == 1)

? ? ? return 
SendErrorMessage(playerid"You already robbed the bank! Wait 1 hour.");

? ? ? ? ? ? ? 

? if (!
Inventory_HasItem(playerid"C4"))

? ? ? return 
SendErrorMessage(playerid"You don't have a C4.");

? ? ? ? ? ?

? ?if(!
IsPlayerInRangeOfPoint(playerid5.01435.3354,-981.6418,983.6462)) return SendErrorMessage(playerid"You are not at the bank !");



? ?
SendClientMessage(playeridCOLOR_WHITE" You started to rob the bank, This will take 10 minutes");

? ?
SetTimerEx("bankrob"600000false"i"playerid);

? ?
robbing[playerid] = 1;

? ?
Inventory_Remove(playerid"C4");

? ?
SendClientMessageToAll(COLOR_ORANGE"||----------Latest News----------||");

? ?
SendClientMessageToAll(COLOR_WHITE" The bank is currently getting robbed.");

? ?
SendClientMessageToAll(COLOR_WHITE" Los Santos Police units are on the way.");

? ?
SendClientMessageToAll(COLOR_WHITE" We will report more when we get more information");

? ?
SendClientMessageToAll(COLOR_ORANGE"||----------Latest News----------||");

? ?return 
1;





when player die/quit its gives the msg of the suspect is down but if he stays online for 10min he still get the cash and also if he's relog after quiting he still get the cash after 10 minutes.

Also sometimes the?" Los Santos Police have been caught the suspect. " message showing for no reason

Have any idea how to fix it?
  Reply


Messages In This Thread
Bank Robbery System [HELP!] - by Fuzzy - 2019-09-24, 12:37 PM
RE: Bank Robbery System [HELP!] - by akosd127 - 2020-03-15, 12:26 AM

Forum Jump: