Originally Posted by
randall
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"]);
}
}
PHP Code:
player.sexp > first["exp"]
I have only looked at the code casually, but isn't first["exp"] a string (level.brakdanych = "^1BRAK DANYCH")? So, how is the game not throwing an error saying that an int can't be compared to a string?