AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Explode to gibs (https://forums.alliedmods.net/showthread.php?t=270788)

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(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)
    }




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

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