Raised This Month: $51 Target: $400
 12% 

info_target needs changing.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
devu4
Member
Join Date: Apr 2012
Old 07-26-2013 , 13:39   info_target needs changing.
Reply With Quote #1

I have uploaded a Jailbreak soccer ball plugin with this post, when the soccer ball is created it's class type is "info_target"

I need someone to change this to class_ball or something different from info_target . This is because I have another plugin which contains same type of entity. When I pick up that entity it changes into a ball. Which I don't want. And sometimes the when I touch the ball it changes into the other entity.

I have tried just replacing the info_target but then it gives me this error after changing it to class_ball

HAMSANDWICH] Failed to retrieve classtype for "class_ball"

Jailmod-Sjball.sma
devu4 is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 07-26-2013 , 18:01   Re: info_target needs changing.
Reply With Quote #2

PHP Code:
set_pev(entity,pev_classname,"class_ball"); 
Then i the enother plugin do a check of classname
__________________
simanovich is offline
devu4
Member
Join Date: Apr 2012
Old 07-26-2013 , 18:44   Re: info_target needs changing.
Reply With Quote #3

Quote:
Originally Posted by simanovich View Post
PHP Code:
set_pev(entity,pev_classname,"class_ball"); 
Then i the enother plugin do a check of classname
I really do not understand.
I cannot code so I would be grateful if someone did it for me or told me clearly so i can do it my self. Thanks for the message anyway!
devu4 is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 07-26-2013 , 20:52   Re: info_target needs changing.
Reply With Quote #4

it seems classname of the ball is "ball". If you think it's not, try to put a print after the entity created that will show you the classname of the ball.
akcaliberg is offline
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
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:05.


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