[Help] gamemode changer
#1

hey i have my Cod4 samp server and i want it to change gamemode every 20 mins automaticly change grom GameMode0 to GameMode1
so i tryed to make it and it turned out lik this: (it didnt work)

Код:
//ongamemodeint 
SetTimer("ResetServer", 300000, 1);
//elsewere

forward Restart();
forward mapname();
forward ResetServer();
public OVER()
{
	GameTextForAll("~r~ Time Limit Reached ~b~ Please Wait....", 2500 , 0);
	SetTimer("Restart", 10000 , 0);
	}


public Restart()
{
	GameTextForAll("~g~ Next Round~r~...", 2500, 0);
	SendRconCommand("changemode lvdm2"); // /gmx will just reload the mode currently loaded.
	return 1;
}


public mapname()
{
  SendRconCommand("lvdm2");
	return 1;
}
can anyone have a look at this or change it and tell me why it isnt working

Thanks: Flake
Reply
#2

I think problem is here :
Код:
public OVER()
{
	GameTextForAll("~r~ Time Limit Reached ~b~ Please Wait....", 2500 , 0);
	SetTimer("Restart", 10000 , 0);
	}
Change over to ResetMode or somthing like that (what you got at OnGameModeint)
To this :
Код:
public ResetServer()
{
	GameTextForAll("~r~ Time Limit Reached ~b~ Please Wait....", 2500 , 0);
	SetTimer("Restart", 10000 , 0);
	}
Reply
#3

Quote:
Originally Posted by MaykoX
I think problem is here :
Код:
public OVER()
{
	GameTextForAll("~r~ Time Limit Reached ~b~ Please Wait....", 2500 , 0);
	SetTimer("Restart", 10000 , 0);
	}
Change over to ResetMode or somthing like that (what you got at OnGameModeint)
To this :
Код:
public ResetServer()
{
	GameTextForAll("~r~ Time Limit Reached ~b~ Please Wait....", 2500 , 0);
	SetTimer("Restart", 10000 , 0);
	}
ok i will test this now
Reply
#4

thanks man this works
Reply
#5

Update: this isnt working for some reason it restarts the whole server and it dosent change gamemode:

Код:
//ongamemodeint
SetTimer("ResetServer", 300000, 1);

//on bottom of script 
forward Restart();
forward mapname();
forward ResetServer();
public ResetServer()
{
	GameTextForAll("~r~ Time Limit Reached ~b~ Please Wait....", 2500 , 0);
	SetTimer("Restart", 10000 , 0);
	}


public Restart()
{
	GameTextForAll("~g~ Next Round~r~...", 2500, 0);
	SendRconCommand("changemode lvdm2"); // /gmx will just reload the mode currently loaded.
	return 1;
}


public mapname()
{
  SendRconCommand("lvdm2");
	return 1;
}
Reply
#6

How do I change minutes for changing gm?
Which one I need to change?
Help!

Maybe atleast 8 minutes
Reply
#7

try this : (untested)
under ongamemodeinit :

Код:
SetTimer("gamemodechange", 10000, 1); // change 10000 to whatever time u want in milliseconds

bottom of ur script :

Код:
forward gamemodechange();
public gamemodechange()
{
     GameTextForAll("~r~ Time Limit Reached ~b~ Please Wait....", 2500 , 0);
  	SendRconCommand("changemode lvdm2");
     SendRconCommand("map lvdm2");
  	return 1;
}
Reply
#8

Quote:
Originally Posted by [TF
Sasori ]
How do I change minutes for changing gm?
Which one I need to change?
Help!

Maybe atleast 8 minutes
SetTimer("restart", 10000, 1); // change the 10000 to whatever time u want in milliseconds
Reply
#9

pawn Код:
forward ExitGamemodeFunc();

public OnGameModeInit()
{
  SetTimer("ExitGamemodeFunc",/*your time in milliseconds here*/,false);
  //other code here...
  return 1;
}

ExitGamemodeFunc()
{
  GameModeExit();
}
Untested but should work.

When the gamemode ends it should load up gamemode1, then gamemode2 etc if you have this code in those gamemodes.
Reply
#10

oh,by the way,Im using this scripts:

Код:
//ongamemodeint
SetTimer("ResetServer", 300000, 1);
//elsewere

forward Restart();
forward mapname();
forward ResetServer();
public ResetServer()
{
	GameTextForAll("~r~ Time Limit Reached ~b~ Please Wait....", 2500 , 0);
	SetTimer("Restart", 10000 , 0);
	}


public Restart()
{
	GameTextForAll("~g~ Next Round~r~...", 2500, 0);
	SendRconCommand("changemode lvdm2"); // /gmx will just reload the mode currently loaded.
	return 1;
}


public mapname()
{
  SendRconCommand("lvdm2");
	return 1;
}

Result:
Код:
C:\Documents and Settings\user\Desktop\SAMPS\sa-mp0.3\filterscripts\test.pwn(2) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\SAMPS\sa-mp0.3\filterscripts\test.pwn(10) : error 017: undefined symbol "GameTextForAll"
C:\Documents and Settings\user\Desktop\SAMPS\sa-mp0.3\filterscripts\test.pwn(11) : error 004: function "SetTimer" is not implemented
C:\Documents and Settings\user\Desktop\SAMPS\sa-mp0.3\filterscripts\test.pwn(17) : error 017: undefined symbol "GameTextForAll"
C:\Documents and Settings\user\Desktop\SAMPS\sa-mp0.3\filterscripts\test.pwn(18) : error 017: undefined symbol "SendRconCommand"
C:\Documents and Settings\user\Desktop\SAMPS\sa-mp0.3\filterscripts\test.pwn(25) : error 017: undefined symbol "SendRconCommand"
C:\Documents and Settings\user\Desktop\SAMPS\sa-mp0.3\filterscripts\test.pwn(26) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.

Help plox
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)