detect self kill ?
hi, i need to detect a self kill, in console "player killed self with x", how i can ?
example player killed self with x worlspawn , or player killed self with grenade i need to detect the self-killed playerid |
Re: detect self kill ?
PHP Code:
|
Re: detect self kill ?
thanks
|
Re: detect self kill ?
Just something to keep in mind.. If you plan to call any natives on the killer, include an is_user_connected() check because he could be disconnected when the kill happens (e.g. tossing a grenade and disconnect).
|
Re: detect self kill ?
redivcram's code will only detect suicide if the victim is the same as the attacker, so this will work when you kill yourself with a grenade, but won't detect falling to your death, etc.
You need to also check the weapon name and see if it's "worldspawn", "trigger_hurt", "door", "door_rotating", etc. |
Re: detect self kill ?
worldspawn is entity index 0, so check if killer is 0
for other entities (if you need them), check if killer is greater than maxplayers |
Re: detect self kill ?
Fixed my code. +1 for all.
|
All times are GMT -4. The time now is 12:34. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.