PDA

View Full Version : Help with Zombie event_killed


Xoom3r.Net
11-28-2010, 07:50 AM
Well, I have an alternate integer for player score, stored in CBasePlayer. I would like to give the player points when player kills zombies. I find it hard to do. Basically I want to execute thispPlayer->m_iAvePoints = pPlayer->m_iAvePoints + 100;And my question is how do I define pPlayer to work properly on AI? I mean so that in the zombie code, it will get the attacker and give him points.

audryzas
11-28-2010, 08:46 AM
If i recall correctly event_killed has takedamage info. So you should get who is attacker from that data, check IsPlayer() and then cast it to player.

Oh and this would be faster than typing that whole time pPlayer->m_iAvePoints += 100; :D

Xoom3r.Net
11-28-2010, 09:11 AM
If i recall correctly event_killed has takedamage info. So you should get who is attacker from that data, check IsPlayer() and then cast it to player.

Oh and this would be faster than typing that whole time pPlayer->m_iAvePoints += 100; :D

I'll try your method. Also I use my code this way, just because I'm lazy, I use the same piece to load player points and multiply them.