I am not sure about setting time limit for my GM.
#1

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.
Reply
#2

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
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)