Change gamemode time
#1

So how would i set a timer which changes the gamemode??
Reply
#2

https://sampwiki.blast.hk/wiki/SetTimer
https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#3

Im a bit dum so can u tell me if i understood this correct?

This is the code:

Код:
forward message();
 
public OnGameModeInit( )
{
	print("Starting timer...");
	SetTimer("message",1000,false);
}
 
public message()
{
	print("1 second has passed.");
}
Код:
SetTimer("message",1000,false);
So that makes it call that public message(), and that 1000 means 1sec?

So for changing gamemode i would need to put there something like this?: (but where should i put this?)

Код:
gamemode = 1;
Reply
#4

Yes, 1 second is 1000 miliseconds.

So, the gamemode restart would look like this:
pawn Код:
forward Timer();
 
public OnGameModeInit()
{
  SetTimer("Timer", 3600000, false); // 3600000 is 1 hour.
  return 1;
}
 
public Timer()
{
  SendRconCommand("gmx");
  return 1;
}
If you want to change to another gamemode then use:
pawn Код:
SendRconCommand("changemode modename");
Reply
#5

Quote:
Originally Posted by Don Correlli
Yes, 1 second is 1000 miliseconds.

So, the gamemode restart would look like this:
pawn Код:
forward Timer();
 
public OnGameModeInit()
{
  SetTimer("Timer", 3600000, false); // 3600000 is 1 hour.
  return 1;
}
 
public Timer()
{
  SendRconCommand("gmx");
  return 1;
}
If you want to change to another gamemode then use:
pawn Код:
SendRconCommand("changemode modename");
ok that helps very much, but i have like 5 good gamemods, so how i can make it work with all of them, or do i have to put that in every gamemod...?
Reply
#6

pawn Код:
SendRconCommand("changemode modename");
This is what you need.

In first gamemode, enter the name of the gamemode2, in the gamemode2 enter the name of the gamemode3 and so on.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)