Raised This Month: $ Target: $400
 0% 

[HELP] Explode to gibs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 08-29-2015 , 17:00   [HELP] Explode to gibs
Reply With Quote #1

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

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(victiminflictorattacker/*, 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(attackerget_pcvar_num(CvarPower), fVelocity)
        
fVelocity[2] = get_pcvar_float(CvarHeight)
        
set_pev(victimpev_velocityfVelocity)
    }
    
    return 
HAM_IGNORED;
}

public 
fw_PlayerKilled(victimattackershouldgib)
{
    if(
zp_class_nemesis_get(attacker) && !zp_core_is_zombie(victim))
    {
        
SetHamParamInteger(32)
    }

Depresie is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:14.


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