AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Make custom kills & deaths count towards rank stats. (https://forums.alliedmods.net/showthread.php?t=156848)

Voltron 05-13-2011 02:12

Make custom kills & deaths count towards rank stats.
 
Let's say I've turned the flashbang into an instant kill grenade.
How can I make the kills and deaths caused by this nade count towards the stats in amx rank?

I've tried:
PHP Code:

user_silentkill(player);
make_deathmsg(owner,player,0,"grenade"); 

But it doesn't work.

pRoxxxDD 05-13-2011 04:21

Re: Make custom kills & deaths count towards rank stats.
 
You must block DeathMsg after user_kill, and then send your death msg.

Hunter-Digital 05-13-2011 05:20

Re: Make custom kills & deaths count towards rank stats.
 
user_silentkill() blocks deathmsg.

About stats... try using ham: ExecuteHamB(Ham_Killed, victim, attacker, gib) to fake the kill.
"gib" you can set to 1 if you want the victim to explode in gibs, if not, just set 0.

Voltron 05-13-2011 07:28

Re: Make custom kills & deaths count towards rank stats.
 
Quote:

Originally Posted by Hunter-Digital (Post 1468444)
About stats... try using ham: ExecuteHamB(Ham_Killed, victim, attacker, gib) to fake the kill.

Doesn't work. I think I'll need to fake a gun, knife or nade kill.

Is there anyway to do that?

Hunter-Digital 05-13-2011 08:38

Re: Make custom kills & deaths count towards rank stats.
 
You could just look at csx module's source and see what it's reading to count kills.

Voltron 05-13-2011 22:47

Re: Make custom kills & deaths count towards rank stats.
 
I found this:
https://forums.alliedmods.net/showthread.php?t=47286

So it looks like it's a bug that was never fixed.

Quote:

Originally Posted by Hunter-Digital (Post 1468519)
You could just look at csx module's source and see what it's reading to count kills.

Yeah I'll try that.

ConnorMcLeod 05-14-2011 01:43

Re: Make custom kills & deaths count towards rank stats.
 
Show more code, where you deal damage for example.

Voltron 05-14-2011 07:33

Re: Make custom kills & deaths count towards rank stats.
 
Quote:

Originally Posted by ConnorMcLeod (Post 1468977)
Show more code, where you deal damage for example.

I've tried all the possible ways of damaging and killing a player.
The kills and deaths are just not being counted.

And now I've got a new idea...
To kill a player with a flashbang, I'm gonna set the users health to 1hp and then spawn a hegrenade on the player and detonate it.
Hopefully CSX will pick that up as a grenade death and count the kills/deaths.

Think it will work?

ConnorMcLeod 05-14-2011 07:36

Re: Make custom kills & deaths count towards rank stats.
 
Send Ham_TakeDamage with nade entity index as inflictor, attacker index as attacker, (1<<24) as damagebit.
I think that's the only thing you have to do, DeathMsg, Damage events gonna be sent by the game.

Voltron 05-14-2011 08:16

Re: Make custom kills & deaths count towards rank stats.
 
Quote:

Originally Posted by ConnorMcLeod (Post 1469108)
Send Ham_TakeDamage with nade entity index as inflictor, attacker index as attacker, (1<<24) as damagebit.
I think that's the only thing you have to do, DeathMsg, Damage events gonna be sent by the game.

If you mean liks this:

PHP Code:

const DMG_GRENADE = (1<<24)

ExecuteHam(Ham_TakeDamageplayerentowner100.0DMG_GRENADE); 

Well it doesn't work. It should... but it doesn't!


All times are GMT -4. The time now is 04:28.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.