28.09.2017, 20:41
PHP Code:
new JustRobbed[MAX_PLAYERS];
PHP Code:
CMD:robbank(playerid,params[])
{
if(PlayerInfo[playerid][pVIP] == 1 && JustRobbed[playerid] == 0)
{
if(GetPlayerInterior(playerid) == 3)
{
new rand=75000 +(random(35000));
new Pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, Pname, sizeof(Pname));
new str[100];
JustRobbed[playerid] = 1;
new str1[100];
format(str,sizeof(str),"You've robbed the bank and got $ %d from the robbery", rand);
format(str1,sizeof(str1)," %s has robbed the bank of Las Venturas and stole $ %d", Pname, rand);
SendClientMessageToAll(COLOR_ORANGE,str1);
SendClientMessage(playerid,COLOR_WHITE,str);
GivePlayerMoney(playerid, rand);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
SetTimer("RobTimer",300000,0);
}
else SendClientMessage(playerid,COLOR_RED,"You're not inside the bank to rob it.");
}
else SendClientMessage(playerid,COLOR_RED,"You're not a VIP Member to rob the bank.");
return 1;
}
PHP Code:
forward RobTimer(playerid);
public RobTimer(playerid)
{
SendClientMessage(playerid,COLOR_ORANGE,"You can now rob again.");
JustRobbed[playerid] = 0;
return 1;
}