<hamsandwich>
What i am trying to do is make a block where you could set start destination and end destination like BCM has it. I look at the BCM code but its different. Hmmm am i on the right track on getting this to work?
PHP Code:
new const g_property1_name[TOTAL_BLOCKS][] =
{
"Name"
}
new const g_property2_name[TOTAL_BLOCKS][] =
{
"Destination"
}
ActionTeleportBlock(id, ent)
{
new tele = entity_get_int(ent, EV_INT_iuser1);
if ( !tele ) return PLUGIN_HANDLED;
static property[5];
GetProperty(ent, 1, property);
entity_set_vector(id, str_to_num(property), g_set_velocity[id]);
GetProperty(ent, 2, property);
g_set_velocity[id][2] = str_to_float(property);
entity_set_int(id, EV_INT_gaitsequence, 6);
static Float:tele_origin[3];
entity_get_vector(tele, EV_VEC_origin, tele_origin);
new player = -1;
do
{
player = find_ent_in_sphere(player, tele_origin, 16.0);
if ( !is_user_alive(player)
|| player == id
|| cs_get_user_team(id) == cs_get_user_team(player) ) continue;
user_kill(player, 1);
}
while ( player );
entity_set_vector(id, EV_VEC_origin, tele_origin);
static Float:velocity[3];
entity_get_vector(id, EV_VEC_velocity, velocity);
velocity[2] = floatabs(velocity[2]);
entity_set_vector(id, EV_VEC_velocity, velocity);
return PLUGIN_HANDLED;
}
Anyone know how to make this work?
__________________