Guten abend/morgen
ich hab mal mir einw etter system machen lassen nur das komsiche ist das es irgendwie nicht geht das wetter ist in jeder stadt gleich
new Weather[3],
WetterRandomLS[] = { 1,2,3,15 },
WetterRandomSF[] = { 5,6,16 },
WetterRandomLV[] = { 1,2,3,4,5,18 };
ongamemodeini
SetTimer("Wetter",60000, 1);
SetTimer("SetWetter",300000, 1);
Wetter();
publicex Wetter()
{
new string[128];
Weather[0] = WetterRandomLS[random(sizeof(WetterRandomLS))];
Weather[1] = WetterRandomSF[random(sizeof(WetterRandomSF))];
Weather[2] = WetterRandomLV[random(sizeof(WetterRandomLV))];
format(string,sizeof(string), "UPDATE `wetter` SET `LS` = '%d',`SF` = '%d',`LV` = '%d' WHERE ID = '1'", Weather[0], Weather[1], Weather[2]);
mysql_query(string);
printf("%s", string);
return 1;
}
publicex SetWetter()
{
new Float:xx, Float:yy, Float:zz,string[128];
for(new i=0; i< GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, xx, yy, zz);
if((xx > -992.5172 && xx < 4000.0000) && (yy < 528.0000 && yy > -4000.0000)) //Los Santos
{
SetPlayerWeather(i, Weather[0]);
printf("Wetter ID: %d", Weather[0]);
format(string,sizeof(string), "UPDATE `samp_weather` SET `LS` = '%d' WHERE `ID` = '1'", Weather[0]);
mysql_query(string);
}
if((xx > -4000.0000 && xx< -992.5172) && (yy < 4000.0000 && yy > -4000.0000)) //San Fierro
{
SetPlayerWeather(i, Weather[1]);
printf("Wetter ID: %d", Weather[1]);
format(string,sizeof(string), "UPDATE `samp_weather` SET `SF` = '%d' WHERE `ID` = '1'", Weather[1]);
mysql_query(string);
}
if((xx > -992.5172 && xx< 4000.0000) && (yy < 4000.0000 && yy > 528.0000)) //Las Venturas
{
SetPlayerWeather(i, Weather[2]);
printf("Wetter ID: %d", Weather[2]);
format(string,sizeof(string), "UPDATE `samp_weather` SET `LV` = '%d' WHERE `ID` = '1'", Weather[2]);
mysql_query(string);
}
}
}
return 1;
}
würde mich über eine fehler meldung freun