Weather Timer?
#1

Okay I have a weather timer here and it does not send the Message..

pawn Код:
forward Weather(playerid, reason);
public Weather(playerid, reason)
{
    SetWeather(random(10));
    switch(reason)
    {
        case 1:
        {
            SendClientMessage(playerid, COLOR_ORANGERED, "[WEATHER] Sunny with a chance of a slight breeze");
        }
        case 2:
        {
            SendClientMessage(playerid, COLOR_ORANGERED, "[WEATHER] Cloudy with alot of wind");
        }
    }
    return 1;
}
Reply
#2

Maybe you forgot something, I'll make you a new one, just follow the tutorial!
1. add
Код:
forward RandomWeather();
2. search "enum pinfo" and then add:
Код:
enum weather_info
{
	wt_id,
	wt_text[255]
};

new gRandomWeatherIDs[][weather_info] =
{
	{1,"Plavo nebo"},
	{2,"Plavo nebo"},
	{3,"Plavo nebo"},
	{7,"Plavo nebo"},
	{8,"Oluja"},
	{9,"Hladno i maglovito"},
	{10,"Čisto Plavo nebo"},
 	{11,"Vrućina"},
	{12,"Normalno,Suncano"},
	{16,"Kiљovito"}
};
3. go on "ongamemodeinit" and add
Код:
SetTimer("RandomWeather", 600000, 1);
4. go on at the end of Scripts and add
Код:
public RandomWeather()
{
	new rand = random(sizeof(gRandomWeatherIDs));
	new strout[256];
	format(strout, sizeof(strout), "Vremenska prognoza: Vrijeme ce biti %s", gRandomWeatherIDs[rand][wt_text]);
	SetWeather(gRandomWeatherIDs[rand][wt_id]);
	SendClientMessageToAll(COLOR_LIGHTGREEN,strout);
	print(strout);
}
This code is on croatian language,easily translate If there is something not good to say.
SORRY FOR MY BAD ENGLISH!
Reply
#3

Show your timer command
Propably you use SetTimer so reason = 0
Reply
#4

Quote:
Originally Posted by gr56
Посмотреть сообщение
Show your timer command
Propably you use SetTimer so reason = 0
The tierm works it changes the weather but the Message don't show :/
Reply
#5

Код:
forward Weather(playerid, reason);
public Weather(playerid, reason)
{
    new weather = random(10);
    SetWeather(weather);
    switch(weather)
    {
        case 1:
        {
            SendClientMessage(playerid, COLOR_ORANGERED, "[WEATHER] Sunny with a chance of a slight breeze");
        }
        case 2:
        {
            SendClientMessage(playerid, COLOR_ORANGERED, "[WEATHER] Cloudy with alot of wind");
        }
    }
    return 1;
}
Try this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)