Raised This Month: $ Target: $400
 0% 

drop dead body


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-20-2010 , 20:48   Re: drop dead body
Reply With Quote #4

I make this, but it give runtime error 4: index out of bounds.

normally i would check if he is alive and if he is a player to fix this, but this is none of those, and idea how i can fix this. And if this sucks, tell it and i'll do something else instead.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>

new Floatheight[33]

new 
boolFirstThink[33] = false
new boolStopThink[33] = false

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)

    
FirstThink[corpse] = true
    StopThink
[corpse] = false
}

public 
Fw_Think(corpse)
{
    if(
StopThink[corpse])
        return

    if(
FirstThink[corpse])
    {    
        
height[corpse] = 0.0
        FirstThink
[corpse] = false
    
}

    new 
classname[32]
    new 
FloatDeadOrigin[3]

    
pev(corpsepev_classnameclassname31)
    
pev(corpsepev_originDeadOrigin)


    if (!
equal(classname"fake_corpse"))
        return

    
set_pev(corpsepev_nextthinkget_gametime() + 0.1)
    
dllfunc(DLLFunc_Thinkcorpse)

    
height[corpse] += 0.5

    
if(height[corpse] >= 100.0)
    {
        
drop_corpse(corpse)
        
StopThink[corpse] = true
    
}
}

public 
drop_corpse(corpse)
{
    if(
FirstThink[corpse])
    {    
        
height[corpse] = 0.0
        FirstThink
[corpse] = false
    
}

    new 
classname[32]
    new 
FloatDeadOrigin[3]

    
pev(corpsepev_classnameclassname31)
    
pev(corpsepev_originDeadOrigin)


    if (!
equal(classname"fake_corpse"))
        return

    
height[corpse] -= 0.5

    
if(height[corpse] <= -100.0)
    {
        
drop_corpse(corpse)
    }

__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
 



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