I am not sure about setting time limit for my GM. - 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: I am not sure about setting time limit for my GM. (
/showthread.php?tid=365773)
I am not sure about setting time limit for my GM. -
bhuvanesh - 04.08.2012
Hey guys,
I have a problem with setting time limit for a round.For instance say the round limit is 10 mins after 10mins elapses I want the next GM to be loaded.I also want the textdarw for it to be show on the bottom right of the scree.I mean the time limit should keep ticking.I would be really thankful if someone could help me sorting this.
Here :
http://i50.tinypic.com/909c2c.jpg
Regards,
Bhuvanesh.
Respuesta: I am not sure about setting time limit for my GM. -
HarlemSAMP - 04.08.2012
I have a low experience regarding dynamic GM changes, but i'm sure you need to add a Timer for OnGameModeIni in every GM script to show up a textdraw (with a timer ofc) that runs for everyone, if i'm not correct feel free to ignore this, as i stated before, i do not have much knowledge about this kind of GM changes
Re: I am not sure about setting time limit for my GM. -
[MM]RoXoR[FS] - 04.08.2012
Here is the tutorial
pawn Код:
//At top of your script add
new Text:GameTime; //Textdraw
new gMin=9,gSec=59; //Time you want GM to run
new gTime; //Timer
Under OnGameModeInIt()
pawn Код:
GameTime = TextDrawCreate(513.000000, 372.000000, "~r~09 ~w~: ~b~59");
TextDrawBackgroundColor(GameTime, 255);
TextDrawFont(GameTime, 1);
TextDrawLetterSize(GameTime, 0.570000, 4.500000);
TextDrawColor(GameTime, -1);
TextDrawSetOutline(GameTime, 1);
TextDrawSetProportional(GameTime, 1);
TextDrawUseBox(GameTime, 1);
TextDrawBoxColor(GameTime, 120);
TextDrawTextSize(GameTime, 600.000000, -60.000000);
gTime = SetTimer("UpdateTime",1000,true);
Under OnPlayerConnect Add
pawn Код:
TextDrawShowForPlayer(playerid,GameTime);
And anywhere add
pawn Код:
forward UpdateTime();
public UpdateTime()
{
new str[50];
--gSec;
if(gSec == -1)
{
gSec = 59;
--gMin;
}
if(gMin<0)
{
format(str,sizeof(str),"~Time Up",gMin,gSec);
TextDrawSetString(GameTime,str);
KillTimer(gTime);
SendRconCommand("changemode GMname");
return 1;
}
format(str,sizeof(str),"~r~%d ~w~: ~b~%d",gMin,gSec);
TextDrawSetString(GameTime,str);
return 1;
}