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

[Any] Nearest Player - Distance and Direction to nearest Player


Post New Thread Reply   
 
Thread Tools Display Modes
Author
dordnung
Veteran Member
Join Date: Apr 2010
Plugin ID:
3593
Plugin Version:
1.0.0
Plugin Category:
Fun Stuff
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Shows the distance and direction to the nearest player
    Old 03-25-2013 , 22:02   [Any] Nearest Player - Distance and Direction to nearest Player
    Reply With Quote #1

    Nearest Player - Distance and Direction to nearest Player




    About this plugin:

    With this plugin players can see the distance, the direction and the name to/of the nearest player.

    The direction is given in up/right/down/left and the 4 diagonals, based on the angles of the player.

    The distance can be shown in feet and meter.

    You can define which players can see the direction, the distance or/and the name of the nearest player

    Also this plugin can use the Auto Updater



    Con Vars:
    • nearest_player_name
      • You can define which flags a player needs to see the name of the nearest player. You can use just one flag or more (like "abg" or just "s"). Empty to activate for all.
    • nearest_player_distance
      • You can define which flags a player needs to see the distance to the nearest player. You can use just one flag or more (like "abg" or just "s"). Empty to activate for all.
    • nearest_player_direction
      • You can define which flags a player needs to see the direction to the nearest player. You can use just one flag or more (like "abg" or just "s"). Empty to activate for all.
    • nearest_player_unit
      • 1 = Use feet as unit, 0 = Use meters as unit.



    Installation:
    1. Download the Nearest Player.zip and unzip it
    2. Edit the Config in "cfg/sourcemod/nearest_player.txt"
    3. Upload the addons and the cfg folder to your game dir
    4. Load it via console, map change or server restart

    OR
    1. Download the nearest_player.smx and upload it to the "addons/sourcemod/plugins" folder
    2. Download the nearest_player.phrases.txt and upload it to the "addons/translations" folder
    3. Download the nearest_player.cfg edit it, and upload it to the "cfg/sourcemod" folder
    4. Load it via console, map change or server restart


    Optional: For automatically update install the Updater Plugin

    To compile it, you need the AutoExecConfig include



    Some Pictures:







    Downloads:
    Attached Files
    File Type: smx nearest_player.smx (10.6 KB, 471 views)
    File Type: txt nearest_player.phrases.txt (116 Bytes, 528 views)
    File Type: cfg nearest_player.cfg (926 Bytes, 502 views)
    File Type: sp Get Plugin or Get Source (nearest_player.sp - 1078 views - 10.2 KB)
    File Type: zip Nearest Player.zip (15.4 KB, 477 views)
    __________________

    Last edited by dordnung; 03-28-2013 at 08:18.
    dordnung is offline
    friagram
    Veteran Member
    Join Date: Sep 2012
    Location: Silicon Valley
    Old 03-25-2013 , 22:33   Re: [Any] Nearest Player - Distance and Direction to nearest Player
    Reply With Quote #2

    Plural of foot is feet, but this is pretty cool. I could see it being used for some other things like location to other entities and props. Don't know if you plan on modifying it for other uses, but I might once i get time ot test it out.

    I would use this for dev quite a bit to toggle on stuff like func_brush or other random entities of interest.. Perhaps also draw some tempents like sprites or beams to the objects.. Like a green one to the closest, and red to farthest, or use a gradient that uses a color that increases in intensity for close objects but dulls for far ones.
    __________________
    Profile - Plugins
    Add me on steam if you are seeking sp/map/model commissions.
    friagram is offline
    chuj
    Member
    Join Date: Jan 2012
    Location: Kraków, Poland
    Old 03-27-2013 , 10:30   Re: [Any] Nearest Player - Distance and Direction to nearest Player
    Reply With Quote #3

    CreateTimer(0.2, checkPlayers, _, TIMER_REPEAT);

    0.5 wouldn't be enough? I think it lags a little on 32 players CSGO server.

    EDIT: And could you add command for player to turn on/off showing this?

    Last edited by chuj; 03-27-2013 at 10:46.
    chuj is offline
    dordnung
    Veteran Member
    Join Date: Apr 2010
    Old 03-27-2013 , 11:38   Re: [Any] Nearest Player - Distance and Direction to nearest Player
    Reply With Quote #4

    Quote:
    Originally Posted by friagram View Post
    Plural of foot is feet, but this is pretty cool. I could see it being used for some other things like location to other entities and props. Don't know if you plan on modifying it for other uses, but I might once i get time ot test it out.

    I would use this for dev quite a bit to toggle on stuff like func_brush or other random entities of interest.. Perhaps also draw some tempents like sprites or beams to the objects.. Like a green one to the closest, and red to farthest, or use a gradient that uses a color that increases in intensity for close objects but dulls for far ones.

    I noticed the little spelling mistake , but these pics i made before^^. But you can change the text anyway in the translation file.


    Quote:
    Originally Posted by chuj View Post
    CreateTimer(0.2, checkPlayers, _, TIMER_REPEAT);

    0.5 wouldn't be enough? I think it lags a little on 32 players CSGO server.

    EDIT: And could you add command for player to turn on/off showing this?

    I don't think a 0.2 seconds timer is to expensive. But i can add a cvar to change the check duration. Because i think 0.2 is more fluent than 0.5.

    And i will also add that option to turn it on/off
    __________________
    dordnung is offline
    zeroibis
    Veteran Member
    Join Date: Jun 2007
    Old 03-27-2013 , 17:31   Re: [Any] Nearest Player - Distance and Direction to nearest Player
    Reply With Quote #5

    war3 uses a lot of .1 second timers that do a lot of stuff and do not lag. SM is very fast, if this was ES I would be worried though...
    __________________
    zeroibis is offline
    chuj
    Member
    Join Date: Jan 2012
    Location: Kraków, Poland
    Old 03-28-2013 , 06:10   Re: [Any] Nearest Player - Distance and Direction to nearest Player
    Reply With Quote #6

    Could you attach the includes?

    Edit: Neverming, found it.

    Last edited by chuj; 03-28-2013 at 06:44.
    chuj is offline
    friagram
    Veteran Member
    Join Date: Sep 2012
    Location: Silicon Valley
    Old 03-28-2013 , 07:44   Re: [Any] Nearest Player - Distance and Direction to nearest Player
    Reply With Quote #7

    Even running ongameframe isnt THAT bad, and that is about as bad as it gets...
    __________________
    Profile - Plugins
    Add me on steam if you are seeking sp/map/model commissions.
    friagram is offline
    Drixevel
    AlliedModders Donor
    Join Date: Sep 2009
    Location: Somewhere headbangin'
    Old 03-28-2013 , 08:07   Re: [Any] Nearest Player - Distance and Direction to nearest Player
    Reply With Quote #8

    Quote:
    Originally Posted by Popoklopsi View Post
    Also this plugin can use the Auto Updater



    Optional: For automatically update install the Updater Plugin
    Assuming you're using the tony GoD-Tony created, I looked at the code and it doesn't use both(why would it). Also, the Optional link is broken.

    - Jack

    Last edited by Drixevel; 03-28-2013 at 08:09.
    Drixevel is offline
    dordnung
    Veteran Member
    Join Date: Apr 2010
    Old 03-28-2013 , 08:19   Re: [Any] Nearest Player - Distance and Direction to nearest Player
    Reply With Quote #9

    Ha, i'm sry, wrong link and broken link

    Sure, i'm using tony's one.
    __________________
    dordnung is offline
    medic917
    Senior Member
    Join Date: Aug 2014
    Old 11-21-2015 , 01:20   Re: [Any] Nearest Player - Distance and Direction to nearest Player
    Reply With Quote #10

    can someone fix it for tf2 where it only shows distance to players that spawns? So it only works on spawn triggers.

    When people die and respawn, they don't see other players until they respawn.
    When people join server they don't see anyone until someone repawns.
    medic917 is offline
    Reply



    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 22:15.


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