SA-MP Forums Archive
How to add a timer to a command? ( Time between use ) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to add a timer to a command? ( Time between use ) (/showthread.php?tid=87562)



How to add a timer to a command? ( Time between use ) - Moustafa - 21.07.2009

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?


Re: How to add a timer to a command? ( Time between use ) - Moustafa - 21.07.2009

What? you guys dont know how?


Re: How to add a timer to a command? ( Time between use ) - Sergei - 21.07.2009

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.


Re: How to add a timer to a command? ( Time between use ) - [top_Shoter] - 21.07.2009

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


Re: How to add a timer to a command? ( Time between use ) - Moustafa - 21.07.2009

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


Re: How to add a timer to a command? ( Time between use ) - Pawno_Master - 21.07.2009

I could use this too


Re: How to add a timer to a command? ( Time between use ) - [top_Shoter] - 21.07.2009

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


Re: How to add a timer to a command? ( Time between use ) - Moustafa - 21.07.2009

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


Re: How to add a timer to a command? ( Time between use ) - Pawno_Master - 21.07.2009

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



Re: How to add a timer to a command? ( Time between use ) - [top_Shoter] - 21.07.2009

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.