Raised This Month: $ Target: $400
 0% 

drop dead body


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-20-2010 , 22:01   Re: drop dead body
Reply With Quote #1

i now got this code and it crashes my game as soon as i spawn.

i don't know what i did wrong.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <cstrike>

#define SetFirstThink(%1,%2) entity_set_int( %1, EV_INT_iuser1, %2 ) 
#define CheckFirstThink(%1) entity_get_int( %1, EV_INT_iuser1 ) 

#define SetStopThink(%1,%2) entity_set_int( %1, EV_INT_iuser2, %2 ) 
#define CheckStopThink(%1) entity_get_int( %1, EV_INT_iuser2 ) 

#define SetHeight(%1,%2) entity_set_float( %1, EV_FL_fuser1, %2 ) 
#define GetHeight(%1) entity_get_float( %1, EV_FL_fuser1 ) 

// new Float: height[33]

new boolcorpse_up
new boolcorpse_down

public plugin_init()
{    
    
register_plugin("Mario Bros Death""1.0""Drekes")
    
    
register_event("ClCorpse""Event_ClCorpse""b")
    
register_event("DeathMsg""Event_DeathMsg""b")
    
    
register_forward(FM_Think"Fw_Think")
}

public 
Event_ClCorpse(id)
    return 
PLUGIN_HANDLED
    
public Event_DeathMsg(id)
{
    
// Get info from real corpse
    
new model[12]
    
cs_get_user_model(idmodel11)

    new 
Floatorigin[3]
    
pev(idpev_originorigin)
    
    
make_new_corpse(idmodelFloatorigin)
    
}

public 
make_new_corpse(idmodel[12], Floatorigin[3])
{
    
// Start making new corpse
    
new corpse engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"));

    
set_pev(corpsepev_classname"fake_corpse")

    
engfunc(EngFunc_SetModelcorpsemodel)
    
set_pev(corpsepev_solid2)
    
set_pev(corpsepev_originorigin)

    
set_pev(corpsepev_animtime2.0)
    
set_pev(corpsepev_framerate1.0)
    
set_pev(corpsepev_sequence54)

    
corpse_up true
}

public 
Fw_Think(corpse)
{
    if(!
is_valid_ent(corpse))
        return 
        
    if(
CheckStopThink(corpse))
        return

    if(
CheckFirstThink(corpse))
        
SetFirstThink(corpse0)

    new 
FloatflHeight GetHeight(corpse)

    if(
corpse_up)
    {
        if(
GetHeight(corpse) >= 100.0)
        {
            
corpse_up false
            corpse_down 
true
        
}
        
flHeight += 0.5
    
}

    if(
corpse_down)
    {
        if(
GetHeight(corpse) <= -100.0)
        {
            
corpse_down false
        
}
        
flHeight -= 0.5
    
}
    
SetHeight(corpseflHeight)

    if(!
corpse_up && !corpse_down)
        
remove_entity(corpse)

__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-20-2010 , 22:27   Re: drop dead body
Reply With Quote #2

DeathMsg is a global event, not per player.

http://wiki.amxmodx.org/Half-Life_1_...vents#DeathMsg

----------------------------

You never set the entity to think.

----------------------------

Why are you using more global variables for the entity instead of the examples I gave you with those functions?

----------------------------

That global variable is redundant.
If one is true, it is expected that the other is false.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 03:34.


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