[HELP] What am I doing wrong here?
I'm trying to write a plugin that displays the number of enemies still alive on the other team.
It does not work and I can't figure out why.. Problems: When I test it with bots, the counter show 0. When I test it with humans, the counter still show 0. Counter is only visible for CTs WARNING [46]: tag mismatch: if (get_user_team(victim) == CS_TEAM_T) WARNING [51]: tag mismatch: if (get_user_team(victim) == CS_TEAM_CT) Questions when problems are solved: How do I make it so that players can enable/disable this function. Is this code hard on the CPU, will it cause the server to lag? Thank you very much. Code:
|
Re: [HELP] What am I doing wrong here?
You're totally wrong. Let me explain every single thing that you did wrong:
1. You don't need to create a global array in this situation, same as the integers. You should just create them in the function itself. 2. You're setting the hud's parameters in the init, wtf? Do it in the function, same as 1. 3. The tag mismatch, is because you're using get_user_team() native which returns numbers with CS_TEAM_T/CS_TEAM_CT. You should use 1/2 or change to cs_get_user_team(). 4. You don't need to decrease the number in the death msg because get_players() has "a" flag which returns only alive players. 5. You don't need to use the loop to show the alive players. So, the right thing to do, is simple: PHP Code:
|
| All times are GMT -4. The time now is 04:42. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.