Raised This Month: $ Target: $400
 0% 

Enemy distance in M


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
wickedd
Veteran Member
Join Date: Nov 2009
Old 05-24-2016 , 21:05   Re: Enemy distance in M
Reply With Quote #4

Quote:
Originally Posted by EFFx View Post
What i made:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Enemy distance"
#define VERSION "1.0"
#define AUTHOR "EFFx"

public plugin_init() 
{
 
register_plugin(PLUGINVERSIONAUTHOR)
}
public 
client_putinserver(id)
 
set_task(1.0,"ShowEnemyDHud",id,_,_,"b")
 
public 
ShowEnemyDHud(id)
{
 if(!
is_user_alive(id) && get_user_team(id) != 1)
 return 
PLUGIN_HANDLED
 
 
new Float:kOrigin], Float:vOrigin];
 
 new 
enemy
 
 pev
idpev_originkOrigin )
 
pevenemypev_originvOrigin )
 
 new 
Float:iDist get_distance_fkOriginvOrigin )   
 new 
Float:iMeters iDist 0.0254  // This will convert it to meters.
 
 
if(get_user_team(id) == get_user_team(enemy))
 return 
PLUGIN_HANDLED
 
 
new szHudEnemyD[50]
 
formatex(szHudEnemyD,charsmax(szHudEnemyD),"Enemy: %d meters",iMeters)
 
set_hudmessage(0,255,0,-1.0,0.70,0,1.0,1.0)
 
show_hudmessage(id,szHudEnemyD)
 return 
PLUGIN_CONTINUE

And like every format that i've searched, the result is:
Post the code you're using because this code would never work.

Edit: If you want to get the closet player near you, then you should use find_ent_in_sphere or find_ent_class. Then use the code I gave you.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 05-24-2016 at 21:08.
wickedd 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 18:42.


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