SA-MP Forums Archive
Question and help - 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: Question and help (/showthread.php?tid=486258)



Question and help - MahdiGames - 07.01.2014

I'v a problem with textdraw in my server iv to reload fs to fix it by rcon , here is pics

or
http://postimg.org/image/70v9m3e7x/
or

or
http://i43.tinypic.com/2u5t088.png

Also i want to ask how much timers i must put in server as max , to avoid lags?

Thanks for reading!


Re: Question and help - MahdiGames - 07.01.2014

Help?


Respuesta: Question and help - Swedky - 07.01.2014

A Timer is not necessary, looks at this example:

pawn Код:
new UsersConnected; // We create a variable that counts the players.

public OnPlayerConnect(playerid)
{
    UsersConnected ++; // We add the value whenever a player connects
    new string[25];
    format(string, sizeof(string), "Players online: %i.", UsersConnected);
    TextDrawSetString(Text:text, string); // It changes 'Text:text'.
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    UsersConnected --; // We diminish the value whenever a player connects
    new string[25];
    format(string, sizeof(string), "Players online: %i.", UsersConnected);
    TextDrawSetString(Text:text, string); // It changes 'Text:text'.
    return 1;
}



Respuesta: Question and help - OTACON - 07.01.2014

pawn Код:
new data[30];
format(data, sizeof(data), "players online: %d.", CountingOnlinePlayers());
TextDrawSetString(Text:text, data);
pawn Код:
stock CountingOnlinePlayers(){
    new count=0;
    for(new player, user = GetMaxPlayers(); player != user; player++){
        if(IsPlayerConnected(player)){count++;}
    }return count;
}



Re: Question and help - MahdiGames - 08.01.2014

Thanks what about textdraw ? this problem ?