Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Robtimer help

$
0
0
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.

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;
}

And a timer, this is the part i dont know what to do.

Code:

forward RobTimer(playerid);
public RobTimer(playerid)
{
        SendClientMessage(playerid,COLOR_ORANGE,"You can now rob again.");
        return 1;
}

What should i add more? I don't know a thing about timers.

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>