SA-MP Forums Archive
when it is weather text Double - 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: when it is weather text Double (/showthread.php?tid=437177)



when it is weather text Double - Luca12 - 14.05.2013

so I have public weather and the problem is when it's weather time then text is double if you know what I mean

example

Hello everyone today will me rainy

that is example and the problem is this



Hello everyone today will me rainy
Hello everyone today will me rainy


that is the problem text be double instead one. Thanks


Re: when it is weather text Double - Private200 - 14.05.2013

Use format instead of SendClientMessateToAll. The double text is not always like that. It will be doubled based on the users online in server. What I'm speaking about is:

pawn Код:
new string[256];

      format(string, 256, "Hello everyone. Today weather will be raining.");
      SendClientMessageToAll(0xFF0000FF, string);



Re: when it is weather text Double - Luca12 - 14.05.2013

can asky one more thing i wonder how to make if I don't know if are the dark example on the server how to make to write hello everyone its's dark if you know what I mean or it's a day hello eveery one good day if you know what I mean.


Re: when it is weather text Double - Private200 - 14.05.2013

Using SetPlayerWeather, you can just random it and then, use cases.

pawn Код:
case 1:
{
      new string[256];

      SetPlayerWeather(playerid, 08);
      format(string, 256, "Hello everyone. There are some clouds in the sky.");
      SendClientMessageToAll(0xFF0000FF, string);
}
case 2:
{
      // etc like that
}
Look my Random Function thread to see how it works out.


Re: when it is weather text Double - Luca12 - 14.05.2013

i have all of that but i need just when it's day then to write that it's day or is they a dark if the evening


Re: when it is weather text Double - Private200 - 14.05.2013

Then, do something like this:

pawn Код:
// In your 'OnGameModeInIt'

SetTimer("time", 1000, true);

// Somewhere in your script

forward time(playerid);
public time(playerid)
{
    new hour, minutes;
    GetPlayerTime(playerid, hour, minutes);
    if(hour == 12 && minutes == 01)
    {
         SendClientMessage(playerid, 0xFF0000FF, "Evening just started. Time is 12:01");
    }
    else if(hour == 00 && minutes == 01)
    {
         SendClientMessage(playerid, 0xFF0000FF, "Morning just started. Time is 00:01.");
    }
    return 1;
}
And so, although, change the 'SendClientMessage' to 'SendClientMessageToAll' and use the format I gave up.