 |
|
Veteran Member
|

03-09-2017
, 13:23
Re: [HELP] Player Aim At Entity
|
#8
|
Quote:
Originally Posted by Kotoamatsukami
First of all, I am just trying to help here and if this still doesn't help, I am sorry.
I will explain here what I am trying to do. Firstly, catch what the 'id' is aiming, and save the aimed target into 'iEnt'. Then, I check in the while loop if the aimed index( iEnt ) is equal to the entity that the user wanted to aim( ent ). So, I check it( ent == iEnt ). If it's equal then show the HUD message that you wanted to show to the user.
I might be wrong but any improvement or rectification towards my code is greatly welcomed.
Thank you..
PHP Code:
public display_map_name( id )
{
new iEnt, body, entlist[ 32 ], panel
get_user_aiming( id, iEnt, body, 50 )
while( ( ent = find_ent_by_tname( ent, "target_map" ) ) !=0 )
{
if ( is_user_connected( id ) && ent == iEnt )
{
set_hudmessage( g_hud_colour[ 0 ], g_hud_colour[ 1 ], g_hud_colour[ 2 ], -1.0, -1.0, 0, 0.0, 2.0, 0.0, 0.0, 2 )
show_hudmessage( entlist[ ent ], g_mapnames[ g_mapselection[ panel ] ] )
}
panel++
}
}
|
Sadly, it doesn't display anything
|
|
|
|