[Help] Aim @player shows total kills?
Hello,
I want to show a players' total kills in a small hudmessage when pointing at that guy. My problem: after "Killz:" everybody seems to have the same value. Here is my code so far: Code:
BIG THX! @mods: sorry for all the mess :/ |
Re: [Help] Aim @player shows total kills?
I don't see a reason for that code not to work, but I'd like to suggest two changes.
1. Make the body variable a global one, since you don't use it anyway, so that it is not re-created every frame. 2. Remove if_user_alive(u_guy), I don't think you can look at a dead player, I may be wrong. Also, I don't know if you know this: Quote:
|
Re: [Help] Aim @player shows total kills?
Quote:
|
Re: [Help] Aim @player shows total kills?
Make sure you realise that the stats get's updated by respawn:
Quote:
Code:
|
Re: [Help] Aim @player shows total kills?
Thx for helping me guys :)
- I'll make the body variable global. Won't that get inconsistent values as I point at several players? Recreating the value every time was the secure way - I get the kill value from rank stats. Every round start the rank seems to update, so that works good so far - Is there any other way to update the kill display, but still using rank stats? Cuz now the kills only update every round start. I dunno know why but somehow the kill values are shown correctly for each player now. I just deleted the csstats.dat file and now everything works fine? LOL |
Re: [Help] Aim @player shows total kills?
You could count the kills youself, like i did on esf:
Code:
|
Re: [Help] Aim @player shows total kills?
The reason I would make the body variable global is because you don't ever make use of the data stored in that variable. If you do use that data elsewhere in the plugin, don't make it global. It's not a big deal either way, just a slight optimization.
With dutchmeat's example, hook onto the DeathMsg event. |
Re: [Help] Aim @player shows total kills?
sorry, i forgot,
Code:
register_message(get_user_msgid("DeathMsg"), "Kills") |
Re: [Help] Aim @player shows total kills?
Ah thx dutchmeat i'll try that. :)
|
| All times are GMT -4. The time now is 06:56. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.