Changeweather/Changetime
#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


Messages In This Thread
Changeweather/Changetime - by dillo1000 - 22.07.2011, 16:24
Re: Changeweather/Changetime - by dillo1000 - 22.07.2011, 16:44
Re: Changeweather/Changetime - by dillo1000 - 03.08.2011, 17:07
Re: Changeweather/Changetime - by Wesley221 - 03.08.2011, 17:36
Re: Changeweather/Changetime - by dillo1000 - 04.08.2011, 10:50
AW: Changeweather/Changetime - by samtey - 04.08.2011, 10:55
Re: Changeweather/Changetime - by Wesley221 - 04.08.2011, 11:17

Forum Jump:


Users browsing this thread: 1 Guest(s)