Weather - 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: Weather (
/showthread.php?tid=298703)
Weather -
vent - 22.11.2011
So, i have got an problem.
The weather wont change.
pawn Код:
#define COLOR_LIGHTBLUE 0x33CCFFAA //vдrv
#define ilmaaeg 60000*3 //aeg
new Ilm;
forward Ilm();
public Ilm()
{
Ilm = random(20);
SetWeather(Ilm);
switch(Ilm)
{
case 0:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Pдikseline");
case 1:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Pдikseline");
case 2:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Pдikseline");
case 3:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Pдikseline");
case 4:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Pдikseline");
case 5:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Pдikseline");
case 7:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Pдikseline");
case 8:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Vihmane");
case 9:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Paks udu");
case 10:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Pдikseline");
case 11:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Kuumalaine");
case 12:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Palav ilm");
case 13:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Palav ilm");
case 14:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Palav ilm");
case 15:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Suur torm");
case 16:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Vдga palav ilm");
case 17:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Vдga palav ilm");
case 18:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Vдga palav ilm");
case 19:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] Liivatorm");
case 20:SendClientMessageToAll(COLOR_LIGHTBLUE,"[Ilm] ???");
}
}
Re: Weather -
JaTochNietDan - 22.11.2011
Have you set a timer anywhere? You can't expect a callback to get called by itself
For example in OnGameModeInit:
pawn Код:
SetTimer("Ilm", ilmaaeg, true);
Also I would suggest using an array to store the strings, then you wouldn't have to deal with that big long switch statement
Re: Weather -
vent - 22.11.2011
Whoops, my bad. It works now. +rep for you. ;>