Raised This Month: $ Target: $400
 0% 

Solved [ H3LP ] Find entity in half the sphere?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 07-27-2017 , 14:00   Re: [ H3LP ] Find entity in half the sphere?
Reply With Quote #9

I tried to do the following:

Code:
public fw_Item_PostFrame(entity) {     if (!is_valid_ent(entity))         return HAM_IGNORED;     static id     id = get_pdata_cbase(entity, OFFSET_WEAPONOWNER, OFFSET_LINUX_WEAPONS)     if (!is_user_alive(id))         return HAM_IGNORED;     if (!GetPlayerBit(g_has_plasma_caster, id))         return HAM_IGNORED;     static Float:origin[3]     entity_get_vector(id, EV_VEC_origin, origin)     static victim     victim = -1     static traceline, Float:victim_origin[3], Float:vector[3], classname[32]     while ((victim = find_ent_in_sphere(victim, origin, 1000.0)))     {         if (!is_user_alive(victim))             continue;         if (avp_core_is_yautja(victim))             continue;         if (!is_in_viewcone(victim, origin))             continue;         entity_get_vector(victim, EV_VEC_origin, victim_origin)         traceline = trace_line(id, origin, victim_origin, vector)         if (!traceline)         {             message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id)             write_byte(TE_SPRITE)             write_coord(floatround(victim_origin[0]))             write_coord(floatround(victim_origin[1]))             write_coord(floatround(victim_origin[2]))             write_short(sprite_aim)             write_byte(3)             write_byte(200)             message_end()         }         else         {             entity_get_string(entity, EV_SZ_classname, classname, charsmax(classname))             client_print(id, print_chat, "%s", classname)         }         break;     }           return HAM_IGNORED; }

However, trace_line is returning the index of the weapon I am using, in the case, the AWP. Any suggestions?
__________________








CrazY. 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 23:11.


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