Raised This Month: $ Target: $400
 0% 

info_target needs changing.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 07-26-2013 , 21:45   Re: info_target needs changing.
Reply With Quote #5

If i remmeber correctly, hamsandwich can't retrive custom classnames which are different from engine's ones.

If you do
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <hamsandwich>

public plugin_init()
{
    
// This is just an example plugin
    
    
new iEnt CreateEnt()
}

new const 
g_szBallClassName[]  = "ball_entity"
stock CreateEnt()
{
    new 
iEnt create_entity("info_target")
    
    
entity_set_string(iEntEV_SZ_classnameg_szBallClassName)
    
    
RegisterHam(Ham_Think"ball_entity""fw_Think"// This will fail
    
RegisterHam(Ham_Think"info_target""fw_Think"// This would work, but you need to filter classname
    
    
RegisterHamFromEntity(Ham_ThinkiEnt"fw_Think"// Don't know if this would work, try it?
    
    
return iEnt
    
}

public 
fw_Think(iEnt)
{
        
// Filtering classnames ...
    
static szClassName[32]
    
entity_get_string(iEntEV_SZ_classnameszClassName31)
    
    if(!
equal(g_szBallClassNameszClassName))
    {
        return;
    }
    
    
// Code here ...

__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 07-26-2013 at 21:45.
pokemonmaster is offline
 



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 06:32.


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