Code:
public event_new_round() {
for(new i=0;i<=get_maxplayers();i++) {
new killer = g_killer[i]
g_killer[i]=0
if(is_user_connected(i) && killer) {
if(get_user_frags(killer) >= 5 && get_user_frags(killer) <= 10) {
new kills = get_user_frags(killer)
new health = get_cvar_num("amx_5kills")
set_user_health(killer, health)
client_print(killer, print_chat, "For having %i kills you will start with %i helath", kills, health)
}
else if(get_user_frags(killer) >= 11 && get_user_frags(killer) <= 20) {
new kills = get_user_frags(killer)
new health = get_cvar_num("amx_11kills")
set_user_health(killer, health)
client_print(killer, print_chat, "For having %i kills you will start with %i helath", kills, health)
}
else if(get_user_frags(killer) >= 21) {
new kills = get_user_frags(killer)
new health = get_cvar_num("amx_21kills")
set_user_health(killer, 40)
client_print(killer, print_chat, "For having %i kills you will start with %i helath", kills, health)
}
}
}
}
Even a noob can get more than 5 kills in a map.
This whole section runs on every new round.
Let's break it down. A server will usually run a map for about 30 mins.
30 mins is a lot of time, even for a noob to get five kills.
Once the noob gets 5 kills or more, they will start every round after that with 80hp. The noob has now been handicapped. Granted your plugin does check if the player killed someone but even if a person killed someone then died, they would still be stored as g_killer until the new round.
Another variable to consider.....bomb success/defuse rewards.
For every successfull bomb explosion/defusion, the player is awarded +3 frags.
Now, lets say they have 1 frag at new round. Player kills one player. Now 2 frags. Player plants bomb and successfully explodes. Player is now stored as g_killer and is awarded 3 frags for bomb explosion. Now although the players frag count is 5, they only actually got 1 frag. So now the player is being "handicapped" for doing his map objective.
After about 15 mins of maptime, everyone will be starting with 60 hp or less.
You said you want the handicap reset on mapchange, but your plugin constantly runs and checks every new round for current frag count then proceeds to set each players health based on what their current frag count is. So actually, your plugin isnt reseting the handicap every map change.
Please refer to my first post.