Getting player with most kills
#1

SOLVED
Reply
#2

Instead of storing the player kills at MostKills I would store the playerid who has them:

pawn Код:
if(RoundKills[playerid] > RoundKills[MostKills] || MostKills == INVALID_PLAYER_ID)
      MostKills = playerid;
This way you don't need a second loop the determine who was the player that has had most kills.


Make sure you're correctly resetting the variable RoundKills for every player after every round; You need to reset it at onplayerconnect / onplayerdisconnect too.

Set MostKills as INVALID_PLAYER_ID at the end of every round.
Reply
#3

Doesnt work :\ now it doesnt say any message at all when the round ends.
Reply
#4

Are you setting the MostKills variable to every player in a loop or just playerid? I know it sounds silly but

"RoundKills[playerid] = 0; ( at each round)"

Makes it sound like it... unless of course the loop variables are playerid..
Reply
#5

SOLVED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)