SA-MP Forums Archive
Speed - 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: Speed (/showthread.php?tid=633687)



Speed - Loinal - 05.05.2017

PHP код:
//OnPlayerSpawn
SetTimer("RandBotMsgs"20000true); 
PHP код:
new bmsgTDswitch;
forward RandBotMsgs();
public 
RandBotMsgs()
{
    ForEach(
iMAX_PLAYERS)
    {
    if(
IsPlayerConnected(i))
    {
    
bmsgTDswitch ++;
    switch(
bmsgTDswitch)
    {
        case 
1:
        {
        
TextDrawSetString(Textdraw7,"Welcome to ZoneX Enjoy your stay don't forget to add our server to your favorites~n~~n~~n~");
        }
        case 
2:
        {
        
Topscore();
        }
        case 
3:
        {
        
Topcash();
        }
    case 
4:
    {
        
TextDrawSetString(Textdraw7,"Read ~g~/rules~w~ to avoid getting banned from our server~n~~n~~n~");
        
bmsgTDswitch 0;
    }
      }
          }
      }
    return 
true;

When there is 2 players or more the textdraw be very fast not 8 seconds


Re: Speed - CobraWoW - 05.05.2017

new bmsgTDswitch;
forward RandBotMsgs();
public RandBotMsgs()
{
bmsgTDswitch ++;
switch(bmsgTDswitch)
{
case 1: TextDrawSetString(Textdraw7,"Welcome to ZoneX Enjoy your stay don't forget to add our server to your favorites~n~~n~~n~");
case 2: Topscore();
case 3: Topcash();
case 4:
{
TextDrawSetString(Textdraw7,"Read ~g~/rules~w~ to avoid getting banned from our server~n~~n~~n~");
bmsgTDswitch = 0;
}
}
return true;
}


Re: Speed - Vince - 06.05.2017

That still suffers from the exact same problem. A new message is sent for each connected player, which is not what is desired. I assume these textdraws to be global so there is no need for the loop at all. CobraWoW actually got the right mindset, despite the lack of formatting in his/her post.