[POMOC]Online players

Započeo Vilko, Januar 11, 2011, 15:36:14 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

E ovako, imam problem. Napravio sam textdraw za online igrace, ali kada neko ode nece mi vratit s recimo 2 na 1 vec ostane na 2 evo koda:

new Text:players;


ongamemodeint

    // TextDraw for Players Online
players = TextDrawCreate(54.000000, 326.000000, "_");
TextDrawBackgroundColor(players, 255);
TextDrawFont(players, 2);
TextDrawLetterSize(players, 0.500000, 1.000000);
TextDrawColor(players, -65281);
TextDrawSetOutline(players, 1);
TextDrawSetProportional(players, 1);

for(new i; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
TextDrawShowForPlayer(i, players);
}
}

OnPlayerConnect

format(strings, 15, "%d/25",GetOnLinePlayers());
TextDrawSetString(players, strings);
TextDrawShowForPlayer(playerid, players);

OnGameModeExit

TextDrawHideForAll(players);
TextDrawDestroy(players);



stock GetOnLinePlayers()
{
new OnLine;
for(new i, g = GetMaxPlayers(); i < g; i++)
if(IsPlayerConnected(i))
OnLine++;
return OnLine;
}

Ja mislim da trebas dodat u OnPlayerDisconnect da ga onda refrehsa!

Nisam naj bolji skripter pa to ovako probam pomoc

Nek mi se javi neko s boljim iskustvom ;)