PDA

View Full Version : hey


Benny42O
10/02/2018, 08:10 PM
Hey, i need a command to set the time and also to change the weather.
Would be cool if anybody can give me that in a FS.

wallen
10/02/2018, 08:12 PM
Scripting help not scripting request

PepsiCola23
10/02/2018, 08:12 PM
use SetWorldTime and SetWeather

Benny42O
10/02/2018, 08:13 PM
Yeah all cool, just asked if anybody here has got the command or maybe a filterscript with both.

PepsiCola23
10/02/2018, 08:17 PM
i basically told you the exact thing to use.
is it that hard?

Benny42O
10/02/2018, 08:19 PM
I just asked if anybody of you got the code, but chill i will create it bymself if noone of u got it.

Mugala
10/02/2018, 08:28 PM
you can simply change a weather from RCON (/rcon weather [ID])

RxErT
10/02/2018, 09:28 PM
If you want it only for the playerid:

CMD:changemyweather(playerid, params[])
{
new weather, string[128];
if(sscanf(params, "i", weather)) return SendClientMessage(playerid, 0xf8f8f8fff, "Syntax: {f00f00}/changemyweather <0 - 45>");
if(weather < 0 || weather > 45) return SendClientMessage(playerid, 0xf8f8f8fff, "ERROR: {FFFFFF}Invalid Weather! <0 - 45>");
SetPlayerWeather(playerid, weather);
format(string, sizeof(string), "{ff0ff0}Your Weather has changed to Weather %d!",weather);
SendClientMessage(playerid, 0xf8f8f8fff, string);
return 1;
}

CMD:changemytime(playerid, params[])
{
new timee, string[128];
if(sscanf(params, "i", timee)) return SendClientMessage(playerid, 0xf8f8f8fff, "Syntax: {f00f00}/changemytime <0 - 23>");
if(timee < 0 || timee > 23) return SendClientMessage(playerid, 0xf8f8f8fff, "ERROR: {FFFFFF}Invalid Time <0 - 23>.");
format(string, sizeof(string), "{ff0ff0}Your time has changed to %d!",timee);
SendClientMessage(playerid, 0xf8f8f8fff, string);
SetPlayerTime(playerid, timee, 0);
return 1;
}

RxErT
11/02/2018, 12:04 PM
Or if you want it for the whole players and controlled by an admin:

CMD:changeweather(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new weather, string[128];
if(sscanf(params, "i", weather)) return SendClientMessage(playerid, 0xf8f8f8fff, "Syntax: {f00f00}/changemyweather <0 - 45>");
if(weather < 0 || weather > 45) return SendClientMessage(playerid, 0xf8f8f8fff, "ERROR: {FFFFFF}Invalid Weather! <0 - 45>");
for(new i = 0; i <= MAX_PLAYERS; i++)
{
SetPlayerWeather(i,weather);
format(string, sizeof(string), "{} {f00f00}an admin has changed the weather to %d!",weather);
SendClientMessage(i, 0xf8f8f8fff, string);
}
}
else
{
SendClientMessage(playerid,0xf8f8f8fff,"ERROR: {f00f00}You are not allowed to use this command!");
}
return 1;
}

CMD:changetime(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new time, string[128];
if(sscanf(params, "i", time)) return SendClientMessage(playerid, 0xf8f8f8fff, "Syntax: {f00f00}/changetime <0 - 23>");
if(time < 0 || time > 23) return SendClientMessage(playerid, 0xf8f8f8fff, "ERROR: {FFFFFF}Invalid time! <0 - 23>");
for(new i = 0; i <= MAX_PLAYERS; i++)
{
SetPlayerTime(i,time);
format(string, sizeof(string), "{} {f00f00}an admin has changed the time to %d!",time);
SendClientMessage(i, 0xf8f8f8fff, string);
}
}
else
{
SendClientMessage(playerid,0xf8f8f8fff,"ERROR: {f00f00}You are not allowed to use this command!");
}
return 1;
}