Total Kills of a team
Is it possible to add up the kills of all the players in same team and display on hud?
I already have created the hud just cant get the kills to add up. Thank you for your help. |
Re: Total Kills of a team
Detect kill, check team of killer, add +1 to a global variable depending on the team, show that in the hud.
|
Re: Total Kills of a team
Quote:
But we register a death event then what? I mean how do you detect a kill Like new attacker = get_user_id New team = get_user_team(attacker) something like this? |
Re: Total Kills of a team
Quote:
Then get the attacker,(read_data(1) IIRC), team = get_user_team(attacker), globalVariable[team]++. |
Re: Total Kills of a team
Quote:
Still just the one global variable? |
Re: Total Kills of a team
Quote:
Code:
#include <amxmodx> |
Re: Total Kills of a team
It's almost fine. You need to use a task to display the hud message(so it gets updated every time the variables change). So you should do something like set_task(1.0, "hudmessage", .flags = "b") in plugin_init. Also change the hudmessage hold time from 12.0 to something like 2.0(last param from set_dhudmessage).
|
Re: Total Kills of a team
Quote:
Add a victim condition too if so how? |
Re: Total Kills of a team
Check if victim (Second param) is dead, or use Ham_Killed instead (And check if victim is not attacker).
https://forums.alliedmods.net/showthread.php?t=190333 Another method is to make a looping thread where you loop throughout all players and get their kills. |
Re: Total Kills of a team
Quote:
Quote:
Code:
if(Team ==1 && attacker != victim) |
| All times are GMT -4. The time now is 17:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.