Raised This Month: $ Target: $400
 0% 

How to make an entity think in HamSandWich


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 03-28-2009 , 16:19   How to make an entity think in HamSandWich
Reply With Quote #1

Already tried:
DllFunc_Think and pev_nextthink
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-28-2009 , 16:21   Re: How to make an entity think in HamSandWich
Reply With Quote #2

set pev_nextthink make an entity think
you can hook it registering Ham_Think
you can make it instant think using Ham_Think of DLLFunc_Think
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 03-28-2009 , 16:40   Re: How to make an entity think in HamSandWich
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
set pev_nextthink make an entity think
you can hook it registering Ham_Think
you can make it instant think using Ham_Think of DLLFunc_Think
I've registered the entity in ham as think. And after creating the entity I've used dllfunc/pev_nextthink. No result ...
[That is what I meant in the first place]
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.

Last edited by ot_207; 03-28-2009 at 16:44.
ot_207 is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 03-28-2009 , 16:44   Re: How to make an entity think in HamSandWich
Reply With Quote #4

like this?

set_pev( ent, pev_nextthink, get_gametime() + 0.1 )
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 03-28-2009 , 16:49   Re: How to make an entity think in HamSandWich
Reply With Quote #5

Quote:
Originally Posted by AntiBots View Post
like this?

set_pev( ent, pev_nextthink, get_gametime() + 0.1 )
Like that...
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Old 03-28-2009, 16:59
xPaw
This message has been deleted by xPaw.
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 03-28-2009 , 17:03   Re: How to make an entity think in HamSandWich
Reply With Quote #6

Quote:
Originally Posted by xPaw View Post
whats the problem?
If I use set_pev(ent,pev_nextthink,get_gametime() + 0.5)
and register 2 forwards: 1 in fakemeta and 1 in ham ( FM_Think, Ham_Think) [I register the forwards before setting nextthink!!!]
The fakemeta forword will work and the Ham will not.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-28-2009 , 17:08   Re: How to make an entity think in HamSandWich
Reply With Quote #7

Can you show the code?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 03-28-2009 , 17:18   Re: How to make an entity think in HamSandWich
Reply With Quote #8

Quote:
Originally Posted by Exolent[jNr] View Post
Can you show the code?
Sure:

PHP Code:
public plugin_init()
{
    
register_plugin("Test","0.0","OT")
    
RegisterHam(Ham_Think,"class","ham_think")
    
register_forward(FM_Think,"fm_think")

    new 
ent engfuncEngFunc_CreateNamedEntityengfuncEngFunc_AllocString"info_target" ) )
    
set_peventpev_classname"class" )
    
set_peventpev_nextthinkget_gametime() + 0.1)
}

public 
ham_think(ent)
{
    
server_print("Yummy ent")
    
set_peventpev_nextthinkget_gametime() + 0.1)
    return 
HAM_IGNORED
}
public 
fm_think(ent)
{
    static 
classname[6];
    
peventpev_classnameclassnamesizeof classname );
    
    if( !
equalclassname"class" ) )
        return 
FMRES_IGNORED;
    
    
server_print("Fake entity, no taste")
    
set_peventpev_nextthinkget_gametime() + 0.1)
    return 
FMRES_IGNORED

__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 03-28-2009 , 17:22   Re: How to make an entity think in HamSandWich
Reply With Quote #9

did you tryed RegisterHamFromEntity ?
__________________
xPaw is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-28-2009 , 17:23   Re: How to make an entity think in HamSandWich
Reply With Quote #10

Not "class" but "info_target" for RegisterHam().
Arkshine 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 09:01.


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