Raised This Month: $ Target: $400
 0% 

[Help] Ultimate Gore for HLDM


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
frank_freeman
Member
Join Date: Nov 2012
Old 08-07-2013 , 05:34   [Help] Ultimate Gore for HLDM
Reply With Quote #1

So I found this one in my plugin archive, but I can't get this to work.

There are no blood trails, no body explosions (even if the body gets hit/killed with a huge shot charge) and in no way any more gore.

Here comes the code - maybe anyone can help me out with that:

PHP Code:
/*
     v0.1 - [28.09.2011] First release
    v0.1a - [29.09.2011] Fixed little bug in cs 1.6
    v0.1b - [12.10.2011] Fixed blood stream
    
    v0.2 - [08.01.2012]
        
        1)new code
        2)removed cvars
        3)blood fountain now more real!
        4)new system body explode
        5)now only dead(explode) bodies dissapears 
        6)zBot fix code include (need`s - "hamsandwich_zBot_FIX")
    
    IDEA TAKEN FROM: "Ultimate Gore" - "JTP10181"
    
    http://aghl.ru/forum/ - Russian Half-Life and Adrenaline Gamer Community
*/

/* *************** */
/* >>> OPTIONS <<< */
/* *************** */

#define Half_Life     // remove comment for Half-Life
#define zBot_on_server     // enable this if you have zBot on server! (works on "cs/csz" ONLY!) *NEED`s* - "hamsandwich_zBot_FIX" - PLUGIN!
#define BLOOD_FOUTAIN     // remove comment if you need`s blood fountain, if comment - default explode mode will be enabled

/* ******************* */
/* >>> END OPTIONS <<< */
/* ******************* */

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN     "hl_ultimate_gore_upd"
#define VERSION "0.2"
#define AUTHOR     "Turanga_Leela"

#define LINUX_OFFSET        5
#define CS_last_hit_group    75 
#define HL_last_hit_group    90 

#define BLOOD_COLOR_RED        247
#define BLOOD_STREAM_RED    70
#define CL_CORPSE_MSG        122     // DOD = 126
#define BODY            0

enum _:BODY_EXPLODE
{
    
DEFAULT_EXPLODE,
    
NEVER_EXPLODE,
    
ALWAYS_EXPLODE
}

#if !defined Half_Life    
new g_hidden_body

#if defined zBot_on_server
public zBot_entered_the_game(id)
{
    
RegisterHamFromEntity(Ham_Killedid"player_killed_pre"0)
}    

public 
zBot_change_data(idzBot_alivezBot_in_game)
{
    if(
id && << (id 1) & zBot_alive)
    {
        
player_spawned_post(id)
    }
}
#endif

public player_spawned_post(id)
{
    
g_hidden_body &= ~(<< (id 1))        
}

public 
cL_Corpse()
{
    if(
<< (get_msg_arg_int(12) - 1) & g_hidden_body)
    {
        return 
PLUGIN_HANDLED
    
}
        
    return 
PLUGIN_CONTINUE
}
#endif
    
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
#if !defined Half_Life    
    
register_message(CL_CORPSE_MSG"cL_Corpse")
    
RegisterHam(Ham_Spawn"player""player_spawned_post"1)
#endif    
    
RegisterHam(Ham_Killed"player""player_killed_pre"0)    
}

public 
player_killed_pre(ididattackershouldgib)
{
    if(
shouldgib NEVER_EXPLODE)
    {
#if !defined Half_Life                
        
switch(<< get_pdata_int(idCS_last_hit_groupLINUX_OFFSET) & << HIT_HEAD)
#else
        
switch(<< get_pdata_int(idHL_last_hit_groupLINUX_OFFSET) & << HIT_HEAD)
#endif
        
{
            case 
BODY:    return    
        
            default:
            {
#if defined BLOOD_FOUTAIN            
                
new damage pev(idpev_dmg_take)
            
                if(
damage 1)
                {
                    return
                }
            
                else if(
damage 500)
                {    
                    
damage 500
                
}
                
                if(
random_float(0.0, (1000.0 damage)) > 1.0)
                {
                    new
                    
                    
Float:victim_origin[3],
                    
Float:killer_origin[3],
                    
max_damage
                    
                    pev
(idpev_originvictim_origin)
                    
victim_origin[2] += 17
                    
                    
if(pev_valid(idattacker))
                    {
                        
pev(idattackerpev_originkiller_origin)
                        
                        
killer_origin[0] = (victim_origin[0] - killer_origin[0]) * random_float(0.50.75)
                        
killer_origin[1] = (victim_origin[1] - killer_origin[1]) * random_float(0.50.75)
                        
killer_origin[2] = floatsqroot(damage get_distance_f(victim_originkiller_origin))
                    }
                    
                    else
                    {
                        
killer_origin[0] = random_float(-256.0256.0)
                        
killer_origin[1] = random_float(-256.0256.0)
                        
killer_origin[2] = random_float(256.01024.0)
                    }
                    
                    switch(
damage)
                    {
                        case 
1..25:    max_damage 75     
                        
case 26..50:    max_damage 82     
                        
case 51..75:    max_damage 89         
                        
case 76..100:    max_damage 96         
                        
case 101..125:    max_damage 103     
                        
case 126..150:    max_damage 110     
                        
case 151..200:    max_damage 117     
                        
case 201..225:    max_damage 124     
                        
case 226..250:    max_damage 131     
                        
case 251..275:    max_damage 138     
                        
case 276..300:    max_damage 145     
                        
case 301..325:    max_damage 152     
                        
case 326..350:    max_damage 159     
                        
case 351..375:    max_damage 166     
                        
case 376..400:    max_damage 173     
                        
case 401..425:    max_damage 180     
                        
case 426..450:    max_damage 187     
                        
case 451..475:    max_damage 194     
                        
case 476..500:    max_damage 201
                    
}
                    
                    
blood_stream(victim_originkiller_originmax_damage)    
                
                    return
                }
#endif                
#if !defined Half_Life                                    
                
g_hidden_body |= << (id 1)
#endif
#if defined BLOOD_FOUTAIN                
                
SetHamParamInteger(BODY_EXPLODEALWAYS_EXPLODE)
#else
                
new damage pev(idpev_dmg_take)
                
                if(
damage 1)
                {
                    return
                }
            
                else if(
damage 500)
                {    
                    
damage 500
                
}
                
                if(
random_float(0.0, (1000.0 damage)) <= 1.0)
                {
                    
SetHamParamInteger(BODY_EXPLODEALWAYS_EXPLODE)
                }            
#endif
            
}
        }
    }
}

#if defined BLOOD_FOUTAIN    
blood_stream(Float:origin[], Float:velocity_vec[], damage)
{
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
    
write_byte(TE_BLOODSTREAM)
    
    
engfunc(EngFunc_WriteCoordorigin[0])
    
engfunc(EngFunc_WriteCoordorigin[1])
    
engfunc(EngFunc_WriteCoordorigin[2])
    
    
engfunc(EngFunc_WriteCoordvelocity_vec[0])
    
engfunc(EngFunc_WriteCoordvelocity_vec[1])
    
engfunc(EngFunc_WriteCoordvelocity_vec[2])
    
    
write_byte(BLOOD_STREAM_RED)
    
write_byte(damage)
    
    
message_end()
}
#endif 

Last edited by frank_freeman; 08-08-2013 at 04:11. Reason: changed to php
frank_freeman is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 08-07-2013 , 13:48   Re: [Help] Ultimate Gore for HLDM
Reply With Quote #2

Please use the tags to make this readable.
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
frank_freeman
Member
Join Date: Nov 2012
Old 08-07-2013 , 14:32   Re: [Help] Ultimate Gore for HLDM
Reply With Quote #3

Quote:
Originally Posted by joshknifer View Post
Please use the tags to make this readable.
don't know, if I got it right - but I hope it's better now
frank_freeman is offline
vamppa
Senior Member
Join Date: Apr 2010
Location: The Netherlands
Old 08-07-2013 , 20:27   Re: [Help] Ultimate Gore for HLDM
Reply With Quote #4

hldm or AG?

also if you want php tags are better.
(php) (/php) replace () with []
vamppa is offline
frank_freeman
Member
Join Date: Nov 2012
Old 08-08-2013 , 04:12   Re: [Help] Ultimate Gore for HLDM
Reply With Quote #5

ah I see - it's really better now

the plugin should work with HLDM
frank_freeman 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 14:32.


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