[PLS]Help /w and /t
#1

how to make /weather id and /time 0-24
Reply
#2

sscanf and zcmd (or y_commands)

pawn Код:
CMD:weather(playerid, params[])
{
    if (sscanf(params, "i", wid)) return SendClientMessage(playerid, -1, "Usage: /weather [id]");
    SetWeather(wid);
    SendClientMessage(playerid, -1, "Weather changed.");
    return 1;
}

CMD:time(playerid, params[])
{
    new hour;
    if (sscanf(params, "i", hour)) return SendClientMessage(playerid, -1, "Usage: /time [0-24]");
    else if (hour < 0 || hour > 24) return SendClientMessage(playerid, -1, "Usage: /time [0-24]");
    SetWorldTime(hour);
    SendClientMessage(playerid, -1, "Time changed.");
    return 1;
}
Reply
#3

Thanks
Reply
#4

weather and time for player not for wolrd
Reply
#5

Quote:

CMDetweather(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1337)
{
SendClientMessageEx(playerid, COLOR_GRAD1, "Ban khong co quyen thuc hien dieu nay.");
return 1;
}

new weather;
if(sscanf(params, "d", weather)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setweather [weatherid]");

if(weather < 0||weather > 45) { SendClientMessageEx(playerid, COLOR_GREY, " Weather ID can't be below 0 or above 45!"); return 1; }
SetWeather(weather);
gWeather = weather;
SendClientMessageEx(playerid, COLOR_GREY, "Weather set to everyone!");
return 1;
}

I just can help you with weather command for player
Reply
#6

His code will set the weather and Time for everyone.
Try using SetPlayerWeather and SetPlayerTime instead.
Reply
#7

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)