SetTimerEx Problem Not Working Correctly
#1

If I type " /gmx 15 Testing "

pawn Код:
format(gstring,sizeof(gstring),"Admin %s(%d) Has Requested A Server Restart In %d Seconds Reason: %s",aname,playerid,gmxtimer,reason);
            gmxtimer = SetTimerEx("GameModeRestart",seconds*1000,false,"i",i);
            TextDrawSetString(GMXDRAW[i],gstring);
            TextDrawShowForPlayer(i, GMXDRAW[i]);
Out Come Is It Shows the Textdraw my Reason Of Restarting But the Counting Down Seems like its Counting Up instead of Down and Plus it Shows in 1000 And Counts up Flickers real bad.. Weird Counting Like it went retarded Or i scripted it to be retarded... If any one Knows what my issue Is Please Comment.. Thanks..
Reply
#2

Can you show more code please? I made a filterscript for this exact purpose once upon a time, let me see if I can find it.


EDIT: Hm, found it but link has been dead for ages.
Reply
#3

Um you shouldnt Need more code The problem is Right there..

Except the

new gmxtimer;
Reply
#4

Well to be honest, I don't see anything wrong... except how are you updating your text draw to show the count down? Or are you not?
Reply
#5

Um Updating the textdraw makes it even Worse.. Next Suggestion
Still Counts UP....
Reply
#6

Show us the code where you are creating the textdraw , updating its value according to the timer , etc.
Reply
#7

Quote:
Originally Posted by ******
Посмотреть сообщение
Or to put it another way... More code!
Yeah like ****** says: Give us some more code!
Reply
#8

Hehh Okay Here you Go!.....

pawn Код:
CMD:gmx(playerid, params[])
{
    new gstring[128],reason[75],seconds,aname[MAX_PLAYER_NAME],gmxtimer;
    GetPlayerName(playerid,aname,sizeof(aname));
    if(IsPlayerConnected(playerid))
    {
        if (PlayerInfo[playerid][pAdminLevel] >= 4)
        {
            if(sscanf(params, "ds",seconds,reason)) return SendClientMessage(playerid, WARNING, "/gmx (seconds) (reason)");
            if(strval(params) < 1 || strval(params) > 1000000) return SendClientMessage(playerid, WARNING, "Allowed GMX Seconds 1-1000000");
            for(new i = 0; i <MAX_PLAYERS; i++)
            {
            //ShowPlayerDialog(i, DIALOG_SAVESTATS, DIALOG_STYLE_MSGBOX, "Server is restarting","Would you like to save your location", "Yes", "No");
            gmxtimer = SetTimerEx("GameModeRestart",seconds*1000,false,"i",i);
            format(gstring,sizeof(gstring),"Admin %s(%d) Has Requested A Server Restart In %d Seconds Reason: %s",aname,playerid,gmxtimer,reason);
            TextDrawSetString(GMXDRAW[i],gstring);
            TextDrawShowForPlayer(i, GMXDRAW[i]);
            SavePos(i);
            SaveHPA(i);
            SaveWeapsAmmo(i);
            PlayerUpdate(i);
            GameGMX[i] = 0;
            }
        }
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "Do What?");
            return 1;
        }
    }
    return 1;
}
Thats It.... Oh Wait Here The TextDraws

new Text:GMXDRAW[MAX_PLAYERS];

pawn Код:
public OnGameModeExit()
{
    for(new i=0; i <MAX_PLAYERS; i++)
    {
       TextDrawHideForAll(GMXDRAW[i]);
       TextDrawDestroy(GMXDRAW[i]);
    }
    return 1;
}

public OnPlayerConnect(playerid)
{
    for(new i=0; i <MAX_PLAYERS; i++)
    {
    GMXDRAW[i] = TextDrawCreate(1.000000, 437.000000, " ");
    TextDrawBackgroundColor(GMXDRAW[i], 255);
    TextDrawFont(GMXDRAW[i], 1);
    TextDrawLetterSize(GMXDRAW[i], 0.370000, 1.000000);
    TextDrawColor(GMXDRAW[i], 65535);
    TextDrawSetOutline(GMXDRAW[i], 0);
    TextDrawSetProportional(GMXDRAW[i], 1);
    TextDrawSetShadow(GMXDRAW[i], 1);
    TextDrawUseBox(GMXDRAW[i], 1);
    TextDrawBoxColor(GMXDRAW[i], 255);
    TextDrawTextSize(GMXDRAW[i], 639.000000, 0.000000);
    }
        return 1;
}
Reply
#9

But Like I Posted Before... It Counts Up When seconds*1000 = IF i type the time "5"secs for timer to go off it goes 1000 and Multiplys that really fast to 4998 then Gamemode Restarts...

In Stead Of 5 4 3 2 1 restart... YAY bunch of fireworks happen at the end... put at my end a big massive Facepalm of FAIL
Reply
#10

Use this OnPlayerConnect:
pawn Код:
public OnPlayerConnect(playerid)
{
    GMXDRAW[playerid] = TextDrawCreate(1.000000, 437.000000, " ");
    TextDrawBackgroundColor(GMXDRAW[playerid], 255);
    TextDrawFont(GMXDRAW[playerid], 1);
    TextDrawLetterSize(GMXDRAW[playerid], 0.370000, 1.000000);
    TextDrawColor(GMXDRAW[playerid], 65535);
    TextDrawSetOutline(GMXDRAW[playerid], 0);
    TextDrawSetProportional(GMXDRAW[playerid, 1);
    TextDrawSetShadow(GMXDRAW[playerid], 1);
    TextDrawUseBox(GMXDRAW[playerid], 1);
    TextDrawBoxColor(GMXDRAW[playerid], 255);
    TextDrawTextSize(GMXDRAW[playerid], 639.000000, 0.000000);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)