Checking if played died from falling.
Hi, i don't know how to do this, but how can i check in DeathMsg if played died from falling?
Thanks -zacky |
Re: Checking if played died from falling.
probably the killer will be same as attacker oO
|
Re: Checking if played died from falling.
Actually the killer will be 0. So:
Code:
|
Re: Checking if played died from falling.
Actually xPaw is right, i have in DeathMsg checking if victim is killer, and remove 5 xp from him, but it even happens when changing team, and i dont want like that, so thats why i want to check if victim died from falling.
EDIT: Sorry, you wer're right hleV, i just tried in game, didnt lose 5 xp by falling. Thanks hleV +karma |
Re: Checking if played died from falling.
Is this for DeathRun?
|
Re: Checking if played died from falling.
Quote:
|
Re: Checking if played died from falling.
RegisterHam(Ham_TakeDamage, "player", "fw_damage")
public fw_damage(id, inf, attacker, Float:damage, damagetype){ if((damagetype & DMG_FALL) && get_user_health(id) - floatround(damage) <= 0) //----your code----// } |
Re: Checking if played died from falling.
DeathMsg way :
Code:
Ham way : Code:
|
Re: Checking if played died from falling.
Quote:
Quote:
EDIT: I think i can use the ham way since im using both DeathMsg and Ham_Killed EDIT2: Shouldnt this: PHP Code:
PHP Code:
|
Re: Checking if played died from falling.
Using DeathMsg, you have just to check if killer is equal to 0 and weapon to "worldspawn". I've put the param directly in the registe_event() but you can do the check in the callback too. You can use 2 register_event() too.
|
| All times are GMT -4. The time now is 18:25. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.