AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to make an entity think in HamSandWich (https://forums.alliedmods.net/showthread.php?t=88739)

ot_207 03-28-2009 16:19

How to make an entity think in HamSandWich
 
Already tried:
DllFunc_Think and pev_nextthink

ConnorMcLeod 03-28-2009 16:21

Re: How to make an entity think in HamSandWich
 
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

ot_207 03-28-2009 16:40

Re: How to make an entity think in HamSandWich
 
Quote:

Originally Posted by ConnorMcLeod (Post 791514)
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]

AntiBots 03-28-2009 16:44

Re: How to make an entity think in HamSandWich
 
like this?

set_pev( ent, pev_nextthink, get_gametime() + 0.1 )

ot_207 03-28-2009 16:49

Re: How to make an entity think in HamSandWich
 
Quote:

Originally Posted by AntiBots (Post 791525)
like this?

set_pev( ent, pev_nextthink, get_gametime() + 0.1 )

Like that...

ot_207 03-28-2009 17:03

Re: How to make an entity think in HamSandWich
 
Quote:

Originally Posted by xPaw (Post 791533)
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.

Exolent[jNr] 03-28-2009 17:08

Re: How to make an entity think in HamSandWich
 
Can you show the code?

ot_207 03-28-2009 17:18

Re: How to make an entity think in HamSandWich
 
Quote:

Originally Posted by Exolent[jNr] (Post 791541)
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



xPaw 03-28-2009 17:22

Re: How to make an entity think in HamSandWich
 
did you tryed RegisterHamFromEntity ?

Arkshine 03-28-2009 17:23

Re: How to make an entity think in HamSandWich
 
Not "class" but "info_target" for RegisterHam().


All times are GMT -4. The time now is 09:01.

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