Raised This Month: $ Target: $400
 0% 

Hooking event problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
teh ORiON
Member
Join Date: Sep 2011
Location: Denmark
Old 09-21-2011 , 19:08   Hooking event problem
Reply With Quote #1

Greetings, im having a bit of trouble "hooking" a triggerevent from an i_t_g entity from within TFC.

First of all, I did a test as you can see with the outcommented register_logevent, which calls the function "test", this works perfectly as expected.

When I try to call the function "cmdCam" instead, I get a bunch of errors:

PHP Code:
[ENGINEInvalid player 0 (not in-game)
[
AMXXRun time error 10 (plugin "cam.amxx") (native "attach_view"
Can anyone see what im missing here?

PHP Code:
#include <amxmodx> 
#include <engine> 

new const pl_cm_class[] = "PlayerCamera" 

public plugin_init() 
{   
     
register_logevent("cmdCam",3,"1=triggered""2=SidescrollStart")
     
//register_logevent("test",3,"1=triggered", "2=SidescrollStart")

    
register_think(pl_cm_class,"Think_PlayerCamera")    


public 
cmdCam(id
    
Create_PlayerCamera(id

Create_PlayerCamera(id

    new 
ent
    
while ((ent find_ent_by_class(ent,pl_cm_class)) != 0
    { 
        if (
entity_get_edict(ent,EV_ENT_owner) == id
        { 
            
attach_view(id ent
            return 
        } 
    } 
    
ent create_entity("info_target"
     
    if( !
ent 
        return; 
     
    
entity_set_string(entEV_SZ_classnamepl_cm_class
     
    
entity_set_model(ent"models/rpgrocket.mdl"
     
    
entity_set_byte(entEV_INT_solidSOLID_TRIGGER
    
entity_set_int(entEV_INT_movetypeMOVETYPE_FLYMISSILE
     
    
entity_set_edict(entEV_ENT_ownerid
     
    
entity_set_int(ent,EV_INT_rendermodekRenderTransTexture
    
entity_set_float(entEV_FL_renderamt0.0 
     
    
attach_view(id,ent
    
entity_set_float(entEV_FL_nextthinkget_gametime()) 
    

public 
test(id)
{
    
client_print(id,print_chat"TestTest")
    return 
PLUGIN_CONTINUE

teh ORiON 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 19:31.


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