Raised This Month: $12 Target: $400
 3% 

Hostage foll.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 09-09-2006 , 09:06   Hostage foll.
Reply With Quote #1

I want to create a ent at my (the players) current position and then make all hostages follow it.
I couldn't get it working so I'm asking here now
I think the ent needs some special propties for the hostage to follow but i'm not sure

Thanks
__________________
Sig(h)!

Last edited by Obbin; 09-09-2006 at 09:15.
Obbin is offline
Old 09-09-2006, 09:56
VEN
This message has been deleted by VEN. Reason: because it is not really a correct info
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 09-09-2006 , 10:28   Re: Hostage foll.
Reply With Quote #2

I stood in front of the hostage and aimed at it
Why dosn't this work?

Code:
#include <amxmodx> #include <fakemeta> #include <engine> #include <cstrike> public plugin_init() {     register_plugin("Hostage auto escape", ".01b1", "Obbin")     register_clcmd("host", "get_hitent") } public get_hitent(id) {     new iEnt, bodyPart, Float:fDistance     fDistance = get_user_aiming(id, iEnt, bodyPart, 999999)     client_print(id, print_chat, "you hit %i", iEnt)     new classname[32]     entity_get_string(iEnt, EV_SZ_classname, classname, 31)         if (equal(classname, "hostage_entity"))     {         client_print(id, print_chat, "IT IS A HOST")         new follent = CreateFollEnt(id)         cs_set_hostage_foll(iEnt, follent)     }         return PLUGIN_HANDLED } public CreateFollEnt(id) {     //Get player's origin as a Float     new Float:origin[3]     entity_get_vector(id,EV_VEC_origin,origin)         //Create Entity     new ent = create_entity("info_target")         //Set Classname (Good to use in order to find out if a player touches an object w/ this classname. Use pfn_touch for such an ocation.)     entity_set_string(ent,EV_SZ_classname,"host_foll")         //Set Model     //entity_set_model(ent,"models/ghw_health.mdl")         //Set Origin     entity_set_origin(ent,origin)         //Set Movetypem Solidtype + Owner     //entity_set_int(ent, EV_INT_solid,SOLID_BBOX)     //entity_set_int(ent,EV_INT_movetype,MOVETYPE_FLY)     //entity_set_edict(ent,EV_ENT_owner,33)         //Set Model's play sequence (Framerate 1.0 means normal speed + sequence 0 is the idle sequence)     //entity_set_float(ent,EV_FL_framerate,1.0)     //entity_set_int(ent,EV_INT_sequence,0)     return ent }
__________________
Sig(h)!
Obbin is offline
Old 09-09-2006, 13:15
VEN
This message has been deleted by VEN. Reason: ill repost since edit is quite different
VEN
Veteran Member
Join Date: Jan 2005
Old 09-09-2006 , 13:43   Re: Hostage foll.
Reply With Quote #3

You must create your entity in plugin_precache.

For the entity it's not necessary to be close to a hostage. For example:

You can be close and not visible but hostage will follow.
You can be close but not visible and hostage will not follow.
You can be far but visible and hostage will follow.
You can be far and visible but hostage will not follow.

Generally speaking you can't say for sure whether hostage will follow the entity or not.
So the best is to put your entity closer and make it visible (in view) to a hostage.

Last edited by VEN; 09-09-2006 at 14:02.
VEN is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 09-09-2006 , 15:54   Re: Hostage foll.
Reply With Quote #4

Thanks a lot VEN!
EDIT:
Works like a charm
__________________
Sig(h)!

Last edited by Obbin; 09-09-2006 at 16:29.
Obbin is offline
Reply


Thread Tools
Display Modes

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:19.


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