Quote:
Originally Posted by mati009988
Why it show server name?
How to fix it?
PHP Code:
public RoundEnd() { new name[34] new worstplayer, worstscore for(new i; i > sizeof(Kills); i++) { if(Kills[i] < worstscore) { if(get_user_team(i) == 1 || get_user_team(i) == 2){ worstplayer = i worstscore = Kills[i] } return PLUGIN_CONTINUE } } get_user_name(worstplayer, name, 33)
client_print(0, print_chat, "The worst player is: %s ^nKills: %i", name, worstscore) return PLUGIN_CONTINUE }
|
#1: A name can store a maximum of 31 characters. Change the amount of arrays to 32.
#2: The way it's set up, "i" could be greater than the maximum of 32 players allowed in a server. So I wouldn't be surprised if you got errors in the logs.
#3: Even if you set up #2 correctly, the value of "worstplayer" is being changed constantly. So no matter what, it would always return the last player it looped to.
__________________