26.04.2012, 09:23
So i have my Robbank System the only problem is when a player rob the bank after 10mins robbing they will get the Cash but the cash wont save in the player and i need help if someone already rob the bank they can only rob the bank for 9hours please i need help about this
Код:
}
enum pInfo
{
pCash,
};
new PlayerInfo[MAX_PLAYERS][pInfo];
new alreadyrobbed[MAX_PLAYERS];
new robbing[MAX_PLAYERS];
forward bankrob(playerid);
forward robbedoff(playerid);
public bankrob(playerid)
{
SendClientMessage(playerid, COLOR_WHITE, " Your finished robbing the bank, Run now");
GivePlayerMoney(playerid, 350000);
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+350000;
alreadyrobbed[playerid] = 1;
robbing[playerid] = 0;
SetTimerEx("robbedoff", 3600000, false, "i", playerid);
SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");
SendClientMessageToAll(COLOR_GREEN, " It looks like the bankrobber got the cash.");
SendClientMessageToAll(COLOR_GREEN, " The cops is currently waiting outside.");
SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");
return 1;
}
public robbedoff(playerid)
{
alreadyrobbed[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, " You can now rob the bank again");
return 1;
}
CMD:robbank(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(robbing[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " You are already robbing the bank, please slow down");
return 1;
}
if(alreadyrobbed[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You already robbed the bank! Wait 1 hour.");
return 1;
}
if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2394.66, -1593.87, 785.62)) // Change X Y Z to the location you want
{
SendClientMessage(playerid, COLOR_GREY, " You are not at the bank !");
return 1;
}
SendClientMessage(playerid, COLOR_REALRED, " You started to rob the bank, This will take 10 minutes");
SetTimerEx("bankrob", 600000, false, "i", playerid);
robbing[playerid] = 1;
SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");
SendClientMessageToAll(COLOR_GREEN, " The bank is currently getting robbed.");
SendClientMessageToAll(COLOR_GREEN, " We are currently waiting for the cops");
SendClientMessageToAll(COLOR_GREEN, " We will report more when we get more information");
SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");
}
return 1;


