SA-MP Forums Archive
problems setting up a timer. - 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: problems setting up a timer. (/showthread.php?tid=385194)



problems setting up a timer. Tag mismatch - HeLiOn_PrImE - 14.10.2012

Hey there!!!
I am trying to use Mick88' s Weather Streamer on my server. I have already implemented those functions on my game mode and they work fine. But now I am trying to put them on a timer and I keep getting these "tag mismatch" warnings. Can someone help me with them?

The timer code is below.Careful, you'll have to get Mick's streamer include, for reading the weather area functions.

Код:
#include <a_samp>
#include <WeatherStreamer>

new Float:WeatherBC[][] = {(42), (17), (3), (9), (40)}; //Bone County
new Float:WeatherTR[][] = {(42), (17), (3), (9), (40)}; // Tierra Robada
new Float:WeatherRC[][] = {(8), (16), (9), (32), (40)}; // Red County
new Float:WeatherFC[][] = {(8), (16), (9), (32), (40)}; // Flint County
new Float:WeatherWS[][] = {(8), (16), (9), (32), (40)}; // Whetstone
new Float:WeatherLS[][] = {(8), (16), (9), (32), (40)}; // Los Santos
new Float:WeatherSF[][] = {(8), (16), (9), (32), (40)}; // San Fierro
new Float:WeatherLV[][] = {(8), (16), (9), (32), (40)}; // Las Venturas

forward weather();
public weather()
{
    new LSW = random(sizeof(WeatherLS));
    new SFW = random(sizeof(WeatherSF));
    new LVW = random(sizeof(WeatherLV));
    new BCW = random(sizeof(WeatherBC));
    new TRW = random(sizeof(WeatherTR));
    new RCW = random(sizeof(WeatherRC));
    new FCW = random(sizeof(WeatherFC));
    new WSW = random(sizeof(WeatherWS));

    SetAreaWeather(WEATHER_AREA_LOS_SANTOS, WeatherLS[LSW][0]);
    SetAreaWeather(WEATHER_AREA_SAN_FIERRO, WeatherSF[SFW][0]);
    SetAreaWeather(WEATHER_AREA_LAS_VENTURAS, WeatherLV[LVW][0]);
    SetAreaWeather(WEATHER_AREA_BONE_COUNTY, WeatherBC[BCW][0]);
    SetAreaWeather(WEATHER_AREA_TIERRA_ROBADA, WeatherTR[TRW][0]);
    SetAreaWeather(WEATHER_AREA_RED_COUNTY, WeatherRC[RCW][0]);
    SetAreaWeather(WEATHER_AREA_FLINT_COUNTY, WeatherFC[FCW][0]);
    SetAreaWeather(WEATHER_AREA_WHETSTONE, WeatherWS[WSW][0]);
}



Re: problems setting up a timer. - Simplyfrag - 15.10.2012

try using a other weather system


Re: problems setting up a timer. - HeLiOn_PrImE - 15.10.2012

Right now I don't think it's the weather system anymore. I did something wrong with the random functions.
Besides, there is no other weather system like this one.


Re: problems setting up a timer. - Babul - 15.10.2012

random() takes integers only, but you declared the weather-ids as floats:
Код:
new Float:WeatherBC[][] = {(42), (17), (3), (9), (40)}; //Bone County
this should be
Код:
new WeatherBC[][] = {(42), (17), (3), (9), (40)}; //Bone County
indeed.. change the others too..


Re: problems setting up a timer. - HeLiOn_PrImE - 15.10.2012

Aaaand they're gone. Warnings from 20 to 0.
So all ID's should be declared as integers, regardless of what they describe?