TOD not working [++REP]
#1

Hello friends this cmd is not working why please help me
pawn Код:
CMD:tod(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 1337)
    {
        new string[128], time;
        if(sscanf(params, "d", time)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /tod [time] (0-23)");

        SetWorldTime(time);
        gTime = time;
        format(string, sizeof(string), "Time set to %d:00.", time);
        BroadCast(COLOR_GRAD1, string);
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    }
    return 1;
}
Reply
#2

Please Help Me Please
Reply
#3

Try it with an integer:

pawn Код:
if(sscanf(params, "i", time))
Reply
#4

and if his solution doesn't work.
than try this one:
pawn Код:
if(sscanf(params, "n", time))
Reply
#5

Why "n"?
Reply
#6

he's using the NGRP script.

Let me break it down.

The time in the NGRP script is streamed with stuff like Sync functions.

Learn ur facts
Reply
#7

putting it simply ; Remove the Sync function.
Reply
#8

Both Not Working
Reply
#9

Please Someone help me
Reply
#10

Command looks fine and it must work so its not the cmd..by the way make it more simple
pawn Код:
CMD:tod(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    new string[128], time;
    if(sscanf(params, "d", time)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /tod [time] (0-23)");
    SetWorldTime(time);
    gTime = time;
    format(string, sizeof(string), "Time set to %d:00.", time);
    BroadCast(COLOR_GRAD1, string);
    return 1;
}
And you dont need that gTime unless you use it to detect time...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)