Timer Minutes countdown? - 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)
+--- Thread: Timer Minutes countdown? (
/showthread.php?tid=589095)
Timer Minutes countdown? -
karemmahmed22 - 15.09.2015
Ehm, I'm making DM event system, I have to annouce every minute (for 7 mins) that theres an event going it and (mins left)
like
format(blablabla,sizeof(blablabla),"Theres an event going on, %d minutes to join",minutes);
In timer which says the same message for 7 mintues and then, stops the timer
and give player weapons n others
Anyway?
I need just tutorial for how to make this countdown (minutes) without crashing the gamemode.
Re: Timer Minutes countdown? -
karemmahmed22 - 15.09.2015
Bump
Re: Timer Minutes countdown? -
[KHK]Khalid - 15.09.2015
Search!
Re: Timer Minutes countdown? -
karemmahmed22 - 16.09.2015
Why don't you post an tutorial? I already done that, My server crashes everytime i kill the timer.
Re: Timer Minutes countdown? -
amirm3hdi - 16.09.2015
CrashDetect Plugin:
https://sampforum.blast.hk/showthread.php?tid=262796
Re: Timer Minutes countdown? -
[KHK]Khalid - 16.09.2015
Quote:
Originally Posted by karemmahmed22
Why don't you post an tutorial? I already done that, My server crashes everytime i kill the timer.
|
Well then post the code you tried that made your server crash.
AW: Timer Minutes countdown? -
Kaliber - 16.09.2015
Just like this:
PHP Code:
//You can say..u make 10 diffrent Events:
#define MAX_EVENTS 10
new mode; //@top of the script
//OnGameModeInit
SetTimer(!"@event",1000*60*7,1);
/*
For explanation:
1000ms = 1sec
60sec = 1min
7 = 7min
*/
//Then the timer:
@event();@event() {
for(new i=GetPlayerPoolSize()+1; --i!=-1;) {
if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue;
switch(mode) {
case 0: {
//Here is the First event
GivePlayerWeapon(i,24,500); //Give all players a weapon
SetPlayerPos(i,x,y,z); //to set him at a special position
}
case 1: {
//After 14min here is the second event...u can make diffrent things
}
//And so on..
}
}
if(++mode == MAX_EVENTS) mode=0; //To restart the event List..if it was at MAX_EVENTS
return 1;
}