Raised This Month: $ Target: $400
 0% 

Block Radio Command [SOLVED] | Create entity in front of Player [SOLVED]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Grinf4ce
Senior Member
Join Date: May 2006
Old 07-20-2008 , 04:57   Re: Create entity in front of Player
Reply With Quote #8

Hello Alka,
i taked a look in the plugin and created the function which drop a entity in front of me.

PHP Code:
new g_Classname[] = "func_backpack"
new g_Model[] = "models/tfm/backpack.mdl"

public drop_backpack(id) {
    new 
FloatOrigin[3], FloatVelocity[3]
    
entity_get_vector(idEV_VEC_originOrigin)

    new 
backpackdrop create_entity("info_target")
    if(!
backpackdrop) return

    
entity_set_string(backpackdropEV_SZ_classnameg_Classname)
    
entity_set_model(backpackdropg_Model)

    new 
Float:MinBox[3] = {-1.0, -1.0, -1.0}
    new 
Float:MaxBox[3] = {1.01.01.0}
    
entity_set_vector(backpackdropEV_VEC_minsMinBox)
    
entity_set_vector(backpackdropEV_VEC_maxsMaxBox)

    
entity_set_origin(backpackdropOrigin)

    
entity_set_int(backpackdropEV_INT_effects32)
    
entity_set_int(backpackdropEV_INT_solid1)
    
entity_set_int(backpackdropEV_INT_movetype6)
    
entity_set_edict(backpackdropEV_ENT_ownerid)

    
VelocityByAim(id400 Velocity)
    
entity_set_vector(backpackdropEV_VEC_velocity ,Velocity)

I tryed to "touch" the entity, but nothing happens..:
PHP Code:
public plugin_init() {
    
register_touch("player","*","hook_touch");
}

public 
hook_touch(pToucherpTouched) {
    if ( !
is_valid_ent(pToucher) ) return

    new 
Classname[32]
    
entity_get_string(pToucherEV_SZ_classnameClassname31)
    new 
Float:kOrigin[3]
    
entity_get_vector(pToucherEV_VEC_originkOrigin)

    if(
equal(Classname,g_Classname)) 
    {
        if ( !
is_valid_ent(pTouched) ) return
        
        
// Aufgehoben
        
client_print(pTouched,print_chat,"[TEST] You touched the entity dude..")
        
remove_entity(pToucher)
    }

Whats wrong? :-S
Please help me :-/

- Grinf4ce
__________________
Grinf4ce 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 05:29.


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