Changeweather/Changetime
#1

These do not work weather does not change and either does the time anyone help?

pawn Код:
}
    if(strcmp("/changeweather", cmd, true) == 0)
    {
        new tmp[256], cmdid;

        tmp = strtok(cmdtext, idx);
        if(PlayerInfo[playerid][AdminLevel] < 1) return 0;
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /changeweather [weatherid]");
        cmdid = strval(tmp);

SetWeather(cmdid);
SendClientMessageToAll(COLOR_LIGHTGREEN,"An Admin has changed the weather!");
        return 1;
    }
    if(strcmp("/changetime", cmd, true) == 0)
    {
        new tmp[256], cmdid;

        tmp = strtok(cmdtext, idx);
        if(PlayerInfo[playerid][AdminLevel] < 1) return 0;
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /changetime [time]");
        cmdid = strval(tmp);
     if(cmdid < 0 || cmdid > 24) return SendClientMessage(playerid,COLOR_ORED,"Wrong Time!");
SetWorldTime(cmdid);
SendClientMessageToAll(COLOR_LIGHTGREEN,"An Admin has changed the time!");
        return 1;
    }
Reply
#2

Ok weather one works but time dont
Reply
#3

*Bump!*
Reply
#4

pawn Код:
COMMAND:changetime(playerid, cmdtext[])
{
    new time;
    if(!sscanf(cmdtext, "i", time))
    {
        if(PlayerInfo[playerid][AdminLevel] < 1) return 0;
        if(!strlen(time)) return SendClientMessage(playerid, -1, "Usage: /changetime [time]");
        if(!IsNumeric(time)) return SendClientMessage(playerid, -1, "Numbers only!");
        if(time < 0 || time > 24) return SendClientMessage(playerid, -1, "Wrong time! 0-24");
        SetWorldTime(time);
        SendClientMessageToAll(-1, "An Admin has changed the time!");
    } else return SendClientMessage(playerid, -1, "Usage: /changetime [time]");
    return 1;
}

COMMAND:changeweather(playerid, cmdtext[])
{
    new weather;
    if(!sscanf(cmdtext, "i", weather))
    {
        if(PlayerInfo[playerid][AdminLevel] < 1) return 0;
        if(!strlen(weather)) return SendClientMessage(playerid, -1, "Usage: /changeweather [weatherid]");
        if(!IsNumeric(weather)) return SendClientMessage(playerid, -1, "Numbers only!");
        SetWeather(weather);
        SendClientMessageToAll(-1, "An Admin has changed the weather!");
    } else return SendClientMessage(playerid, -1, "Usage: /changeweather [weatherid]");
    return 1;
}
Zcmd, sscanf needed
Reply
#5

Does not work
Reply
#6

U need to download ZCMD and sscanf! Then, put them into pawno>includes!
Reply
#7

Quote:
Originally Posted by dillo1000
Посмотреть сообщение
Does not work
With that we cant help you. What doesnt work, does it give errors, doesnt it work at all in game, what?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)