17.11.2010, 19:27
(
Last edited by blackwave; 28/12/2010 at 05:29 PM.
)
Setting the weather withTogglePlayerClock ON
Well, it's not really usefull, but I wanted just to show you how to set gta's game weather with the "TogglePlayerClock", because when you tries to set weather with this clock, nothing happens.
First: put on your gamemode or filterscript's top:
On "OnPlayerConnect", put:
On "OnPlayerCommandText":
Now, I recommend to do a stock, which's faster for Set everyone else's weather, and avoid bugs ( I tested).
Put it on gamemode or filterscript's end:
Also put these stocks underneath, below this one above:
Now, after the last callback, or even after this stock above, put the code:
NOTE: that's just something I thought, and not really usefull, but Im posting, always
__________________________________________________ _______________________________________________
Well, it's not really usefull, but I wanted just to show you how to set gta's game weather with the "TogglePlayerClock", because when you tries to set weather with this clock, nothing happens.
First: put on your gamemode or filterscript's top:
Code:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
Code:
TogglePlayerClock(playerid, true);
Code:
dcmd(setallweather,13,cmdtext);
Put it on gamemode or filterscript's end:
Code:
stock SetAllWeather(weather) { for(new i = 0; i < MAX_PLAYERS; i++) SetPlayerWeather(i, weather); }
Code:
stock clockon(true) { for(new i = 0; i < MAX_PLAYERS; i++) TogglePlayerClock(i, true); } stock clockoff(false) { for(new i = 0; i < MAX_PLAYERS; i++) TogglePlayerClock(i, false); }
Code:
dcmd_setallweather(playerid, params[]) { new time,string[128],name[30]; GetPlayerName(playerid, name, 30); time = strval(params); if(!strlen(params)) return SendClientMessage(playerid, 0x33CCFFAA, "USAGE: /setallweather <ID>"); if(tempo > 2009) return SendClientMessage(playerid, 0x33CCFFAA, "Choose an weather lower than 2010"); format(string,sizeof(string),"ADMIN: %s set everyone weather's for %d", name, time); SendClientMessageToAll(0x33CCFFAA, string); clockoff(false); SetAllWeather(time); clockon(true); return 1; }
__________________________________________________ _______________________________________________