| Depresie |
08-29-2015 17:00 |
[HELP] Explode to gibs
So im trying to edit my nemesis mode, since it got a little boring lately
Bassicaly this plugin will make the player fly away when the nemesis is hitting him
What i want to do now is that, if the player dies from the hit, i want him to explode while in mid air, or when his corpse is hitting the wall :D
any ideeas on how to do it?
PHP Code:
public plugin_init() { register_plugin("ZP Knife Knock Back", "0.0.1", "wbyokomo") CvarPower = register_cvar("kb_power","1000") CvarHeight = register_cvar("kb_height","500") RegisterHam(Ham_TakeDamage, "player", "OnTakeDamagePost", 1) RegisterHam(Ham_Killed, "player", "fw_PlayerKilled") }
public OnTakeDamagePost(victim, inflictor, attacker/*, Float:damage, dmgtype*/) { if(victim == attacker) return HAM_IGNORED; //self damage if(inflictor != attacker) return HAM_IGNORED; //prevent from other damage like bazooka, tripmine we need knife damage only if(!is_user_connected(attacker)) return HAM_IGNORED; //non-player damage if(get_user_weapon(attacker) != CSW_KNIFE) return HAM_IGNORED; //current weapon is not knife if(zp_class_nemesis_get(attacker)) { static Float:fVelocity[3] velocity_by_aim(attacker, get_pcvar_num(CvarPower), fVelocity) fVelocity[2] = get_pcvar_float(CvarHeight) set_pev(victim, pev_velocity, fVelocity) } return HAM_IGNORED; }
public fw_PlayerKilled(victim, attacker, shouldgib) { if(zp_class_nemesis_get(attacker) && !zp_core_is_zombie(victim)) { SetHamParamInteger(3, 2) } }
|