22.08.2014, 08:38
how to make /weather id and /time 0-24
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;
}
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; } |