SA-MP Forums Archive
[Help] gamemode changer - 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: [Help] gamemode changer (/showthread.php?tid=124613)



[Help] gamemode changer - Flake. - 31.01.2010

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


Re: [Help] gamemode changer - MaykoX - 31.01.2010

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);
	}



Re: [Help] gamemode changer - Flake. - 31.01.2010

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


Re: [Help] gamemode changer - Flake. - 31.01.2010

thanks man this works


Re: [Help] gamemode changer - Flake. - 01.02.2010

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;
}



Re: [Help] gamemode changer - MinZ|Spark - 17.03.2010

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

Maybe atleast 8 minutes


Re: [Help] gamemode changer - aircombat - 17.03.2010

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;
}



Re: [Help] gamemode changer - aircombat - 17.03.2010

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


Re: [Help] gamemode changer - biltong - 17.03.2010

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.


Re: [Help] gamemode changer - MinZ|Spark - 17.03.2010

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