How to add a timer to a command? ( Time between use )
#1

pawn Код:
if(strcmp(cmd, "/robstore", true) == 0)
   {
     if(IsPlayerConnected(playerid))
     {
     new robmoney1 = random(20000);{
     if(PlayerToPoint(100, playerid, -25.884498,-185.868988,1003.546875) || PlayerToPoint(100, playerid, 6.091179,-29.271898,1003.549438) || PlayerToPoint(100, playerid, -30.946699,-89.609596,1003.546875)
     || PlayerToPoint(100, playerid, -25.132598,-139.066986,1003.546875) || PlayerToPoint(100, playerid, -27.312299,-29.277599,1003.557250) || PlayerToPoint(100, playerid, -26.691598,-55.714897,1003.546875)) {
     SendClientMessage(playerid, COLOR_WHITE, "You have succesfully robbed the Store.");
     new sendername1[MAX_PLAYER_NAME];
     GetPlayerName(playerid, sendername1, sizeof(sendername1));
   format(string, sizeof(string), " %s has succesfully robbed the Store.", sendername1);
     format(string, sizeof(string), "** $%d! Was Stolen From The Vault",robmoney1);
     SendClientMessage(playerid,COLOR_DBLUE,string);
     WantedLevel[playerid] = 10;
   GivePlayerMoney(playerid, robmoney1);
   PlayerInfo[playerid][pExp]++;
   playerrobbingstore[playerid] = 1;
   SetTimer("store", 600000, 1);
   }
   }
   }
   }
At the script above, i want to add a timer that when he uses /robstore, he can use it again after 1 hour, how to do that?
Reply
#2

What? you guys dont know how?
Reply
#3

Use variable, so when soemone robs store it's set to 1. After that set a timer which will set that variable back to 0.
Reply
#4

ive done it for him i added to his mode complied etc.... it should be ok now.
Reply
#5

Guys can u make the variable for me? PLEASE HELP IAM NEWB IN THIS STUFF!!
Reply
#6

I could use this too
Reply
#7

Quote:
Originally Posted by Moustafa
Guys can u make the variable for me? PLEASE HELP IAM NEWB IN THIS STUFF!!
ill have another look at it go on my server n test /rob cmd in casino it works fien so should yours
Reply
#8

im not using LVCNR gamemode, iam made this command myself :@
Reply
#9

shoter can you make the command for me too in sscanf format?
Reply
#10

Quote:
Originally Posted by Moustafa
im not using LVCNR gamemode, iam made this command myself :@
i started that cmd off.


n yeah ill make when im up im going sleep.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)