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 Float: Origin[3], Float: Velocity[3]
entity_get_vector(id, EV_VEC_origin, Origin)
new backpackdrop = create_entity("info_target")
if(!backpackdrop) return
entity_set_string(backpackdrop, EV_SZ_classname, g_Classname)
entity_set_model(backpackdrop, g_Model)
new Float:MinBox[3] = {-1.0, -1.0, -1.0}
new Float:MaxBox[3] = {1.0, 1.0, 1.0}
entity_set_vector(backpackdrop, EV_VEC_mins, MinBox)
entity_set_vector(backpackdrop, EV_VEC_maxs, MaxBox)
entity_set_origin(backpackdrop, Origin)
entity_set_int(backpackdrop, EV_INT_effects, 32)
entity_set_int(backpackdrop, EV_INT_solid, 1)
entity_set_int(backpackdrop, EV_INT_movetype, 6)
entity_set_edict(backpackdrop, EV_ENT_owner, id)
VelocityByAim(id, 400 , Velocity)
entity_set_vector(backpackdrop, EV_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(pToucher, pTouched) {
if ( !is_valid_ent(pToucher) ) return
new Classname[32]
entity_get_string(pToucher, EV_SZ_classname, Classname, 31)
new Float:kOrigin[3]
entity_get_vector(pToucher, EV_VEC_origin, kOrigin)
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
__________________