help with timer
#1

Hi , i want to create a timer who is starts whene i run samp-server (cause for map change) a 4:00 min timer countdown so if 0 wait will the next map load then start it again , do you have any idea how to do it ? thanks.
Reply
#2

OnGamemodeInit

SetTimerEx --->

SendRconCommand("changemode (name of new gamemode)");
Reply
#3

forward changeGM(second, msg[]);

public OnGameModeInit()
{
print("Starting timer...");
new changeMSG[50];
format(changeMSG, sizeof(changeMS), "Gamemode changing! Hold on to your hats");
SetTimerEx("changeGM", 240000, false, "s", changeGM);
}

public changeGM(msg[])
{
SendClientMessageToAll(color_red, msg);
SendRconCommand("changemode (new gamemode name)");
return 1;
}

This was just scripted in browser, but this should work.
REP if it did
Reply
#4

i think he means a MAP not a gamemode... and yes you can do it with settimerex: https://sampwiki.blast.hk/wiki/SetTimerEx

and put in the public function:
pawn Код:
forward YourTimer(); // here you define it that it is a public function, you always have to forward a public function
public YourTimer() // here is the public function
{ // opening bracket :D
// destroy all the objects from the map you want to delete so you have to define them first and then use DestroyObject here, so for example: Object[0] = CreateObject.... in your ongamemodeinit and then here use: DestroyObject(Object[0]); make sure you first define the Object[0] so paste on top of your script under #define and #include: new Object[ MAX_OBJECTS];
// and then put here also the new objects you want to load :D
// and also a return
return 1;
} // closing bracket
hope i helped you a little bit... AND READ THE WIKI I POSTED HERE!

greets niels
Reply
#5

these threats will help you ↓

https://sampforum.blast.hk/showthread.php?tid=223550

https://sampforum.blast.hk/showthread.php?tid=269336


https://sampforum.blast.hk/showthread.php?tid=72842
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)