[Death Match] Player wins, draws [Need Help]
#1

i need your help to make a function in which when maps finishes a gametext appears with the name of highest killer and if there is two or more than two killers a gametext appears with the draw message.

Thank You.
Reply
#2

Extremely easy to make, use the search bar, I'm sure you'll be able to find something.

Whenever you kill someone, add 1 to a kill variable for a player, and then loop through all the players and check who has the highest. Then, check if more than 1 person has the highest score, and if so, show the draw message.

Really easy, and I don't feel like making it for someone who doesn't want to search.
Reply
#3

understood everything, but a little bit help need. I don't know how to check highest kills Please give me any source or any idea. And what is search bar?
Reply
#4

EDIT: I searched and I found one easily. You should learn to use the search bar.

pawn Код:
new Player;
for(new i=0; i<MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
         if(Kills[i] > Kills[Player]) Player = i;
    }
}
Just an example. This checks if the players kills are greater than the previously looped players kills, and if it is, it sets him as highest.

Then, you should also check if the highest values are equal by looping again and checking if any player has the same amount of kills as the player with the highest kills (it will choose the person with the highest ID, since it loops from 0 to MAX PLAYERS).
Reply
#5

Working great. I have put this in the end of the map. but a problem this loop appears in the end of the round and i have a doubt that does it calculates whole player kills or map kills, because i want only killls of map.
Reply
#6

Then whenever you get a kill on a map, increase a player variable, and then use that variable for the example loop thing I showed above. Then, if you want to erase it, just set it to 0 whenever the new round starts.
Reply
#7

Thank you for this kind help. May i contact you if i get any problems regarding to this?
+ REP.
Reply
#8

Sure, PM me if anything comes up.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)