Raised This Month: $ Target: $400
 0% 

Can't make a eng2fm fakedamage function work


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 07-15-2008 , 19:15   Can't make a eng2fm fakedamage function work
Reply With Quote #1

PHP Code:
stock DamagePlayer(iddamagedamageTypeorigin[3])
    {
    new 
entityengfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"trigger_hurt"))
    
    
//Damage
    
set_kvd(0KV_ClassName"trigger_hurt")
    
set_kvd(0KV_KeyName"dmg")
    
set_kvd(0KV_Valuedamage)
    
set_kvd(0KV_fHandled0)
    
dllfunc(DLLFunc_KeyValueentity0)
    
    
//Damage Type
    
set_kvd(1KV_ClassName"trigger_hurt")
    
set_kvd(1KV_KeyName"damagetype")
    
set_kvd(1KV_ValuedamageType)
    
set_kvd(1KV_fHandled0)
    
dllfunc(DLLFunc_KeyValueentity1)
    
    
//Origin
    
set_kvd(2KV_ClassName"trigger_hurt")
    
set_kvd(2KV_KeyName"origin")
    
set_kvd(2KV_Valueorigin)
    
set_kvd(2KV_fHandled0)
    
dllfunc(DLLFunc_KeyValueentity2)
    
    
//Spawn the entity
    
dllfunc(DLLFunc_Spawnentity)
    
    
//Touch entity and the player
    
dllfunc(DLLFunc_Touchentityid)
    
    
//Remove the entity
    
engfunc(EngFunc_RemoveEntityentity)
    } 
When I use it like this to make a player kill another (with gibs):
PHP Code:
DamagePlayer(targethealthDMG_ALWAYSGIB|DMG_ENERGYBEAMorigin
the game crashes, but I can't find which function makes it crash.
__________________
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
 


Thread Tools
Display Modes

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 05:35.


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