SA-MP Forums Archive
[PLS]Help /w and /t - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [PLS]Help /w and /t (/showthread.php?tid=533055)



[PLS]Help /w and /t - goldenpower - 22.08.2014

how to make /weather id and /time 0-24


Re: [PLS]Help /w and /t - Stinged - 22.08.2014

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;
}



Re: [PLS]Help /w and /t - goldenpower - 22.08.2014

Thanks


Re: [PLS]Help /w and /t - goldenpower - 22.08.2014

weather and time for player not for wolrd


Re: [PLS]Help /w and /t - Kenxxx - 23.08.2014

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


Re: [PLS]Help /w and /t - DavidBilla - 23.08.2014

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


Re: [PLS]Help /w and /t - goldenpower - 23.08.2014

thanks