So, i want to make this when a player robs the casino, he can't rob it again until the time pass [30 mins]. I've done something like this.
And a timer, this is the part i dont know what to do.
What should i add more? I don't know a thing about timers.
Code:
CMD:robbank(playerid,params[])
{
if(PlayerInfo[playerid][pVIP] == 1)
{
if(GetPlayerInterior(playerid) == 3)
{
new rand=75000 +(random(35000));
new Pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, Pname, sizeof(Pname));
new str[100];
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;
}
Code:
forward RobTimer(playerid);
public RobTimer(playerid)
{
SendClientMessage(playerid,COLOR_ORANGE,"You can now rob again.");
return 1;
}