
Originally Posted by
malyczolg
hi , thanks work
but if i have 100exp bot have 200exp l'm on the dvar
Who can help me?
Because your script is totally wrong. The biggest mistake is the waiting in the 'for' cycle. Try this, it causes the result you'd like to see: (not tested!)
PHP Code:
checkStatus()
{
level.brakdanych = "^1BRAK DANYCH";
first = [];
first["player"] = undefined;
first["name"] = level.brakdanych;
first["exp"] = level.brakdanych;
first["rank"] = level.brakdanych;
players = getEntarray("player", "classname");
for (i = 0; i < players.size; i++)
{
player = players[ i ];
if (! isDefined(player.pers["team"]) || player.pers["team"] == "spectator")
continue;
if (! isDefined(first["player"]) || player.sexp > first["exp"])
{
first["player"] = player;
first["name"] = player.name;
first["exp"] = player.sexp;
first["rank"] = player.poziom;
}
}
for (i = 0; i < players.size; i++)
{
player = players[ i ];
player setClientCvar("first_player",
"First Player: Name:" + first["name"] +
" His Exp IS:" + first["exp"] +
" His rank IS:" + first["rank"]);
}
}