• Print

Author Topic: Find Player (V2) - Locate a player anywhere in a map  (Read 42447 times)

0 Members and 1 Guest are viewing this topic.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Find Player (V2) - Locate a player anywhere in a map
« on: April 29, 2006, 12:49:49 pm »
I was on a huge map on a server and I just couldn't find my friends, so I made this script.

Simply type '!find playername' and the player your looking for will be located

Version 2:
* Now makes finding players easier (Fading lines didn't quite cut it on huge maps like b6_mountain)
* Sets the players name over their head for 10 seconds, seeable through walls and objects within a few hundred feet
* Sends a slow AR2 rifle bullet to the player, so you can follow it ( http://img75.imageshack.us/img75/3138/gmconstruct00423gt.jpg )

[I tried to set your view to the player, but It was always off for some reason]
(Thanks arosner for the vecAdd, *claps*)




Download version 2:
http://ulyssesmod.net/gd/findplayer.html
« Last Edit: December 18, 2006, 06:58:49 pm by Golden-Death »


Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Find Player - Locate a player anywhere in a map
« Reply #1 on: May 01, 2006, 06:52:45 pm »
Nice work!

Isn't vecAdd a GMod included function?
Experiencing God's grace one day at a time.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Find Player - Locate a player anywhere in a map
« Reply #2 on: May 01, 2006, 10:24:13 pm »
If you mean my referance to arosner, yeah, I just didn't know how to do it :P

Has come in handy on Rexys server


Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Find Player (V2) - Locate a player anywhere in a map
« Reply #3 on: May 07, 2006, 10:30:30 pm »
Version 2


H²-=NooB=-

  • Guest
Re: Find Player (V2) - Locate a player anywhere in a map
« Reply #4 on: May 08, 2006, 05:08:38 pm »
The problem about setting player angle is z is always 0 or -0 ... dumb garry. The _PlayerGetShotAng() does give a Z value :)

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Find Player (V2) - Locate a player anywhere in a map
« Reply #5 on: May 08, 2006, 06:46:35 pm »
The problem about setting player angle is z is always 0 or -0 ... dumb garry. The _PlayerGetShotAng() does give a Z value :)

You see it as -0 because you're printing the value of the vector directly. This only prints to two decimal precision, but if you print the whole thing you'd see it can be something like -0.000067.
Experiencing God's grace one day at a time.

JamminR

  • Guest
Re: Find Player (V2) - Locate a player anywhere in a map
« Reply #6 on: June 07, 2006, 04:48:45 pm »
Golden Death, could you make two versions within one file?

ulx_find = finds person, shows everyone
ulx_sfind = finds person, shows only person requesting it (silent)

I believe the text float can't be made private, can it?
But at least some other arrow/bullet indication would be helpful.

Everytime I use find on a large gmod map when someone says 'Hey JamminR, come look at my ...',
people always seem more interested in the find lua than they do whatever someone is trying to show off.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Find Player (V2) - Locate a player anywhere in a map
« Reply #7 on: June 07, 2006, 09:01:34 pm »
I'd love to, but it seems my host is suspended and I have no access to my stuff...


Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Find Player (V2) - Locate a player anywhere in a map
« Reply #8 on: June 07, 2006, 09:06:21 pm »
Looks like I can still get on FTP :)
Show all
Code: Lua
  1. function cc_ulxfind( userid, args, argv, argc )
  2.         local target = getUser( userid, argv[ 1 ] )
  3.         if target == nil then
  4.         return
  5. end
  6.  
  7.  
  8. local mepos = _EntGetPos(userid)
  9. local userpos = _EntGetPos(target)
  10. local toadd = vector3(0,0,2000)
  11. local toadd2 = vector3(0,0,40)
  12. local topme = vecAdd( mepos, toadd2);
  13. local toppos = vecAdd( userpos, toadd);
  14.  
  15.             _EffectInit()
  16.                 _EffectSetEnt(target)
  17.                 _EffectSetOrigin(userpos)
  18.                 _EffectSetStart(mepos)
  19.                 _EffectSetScale(50)
  20.                 _EffectSetMagnitude(5)
  21.                 _EffectSetRadius(10)
  22.             _EffectDispatch("FadingLineTeam")
  23.  
  24.             _EffectInit()
  25.                 _EffectSetEnt(target)
  26.                 _EffectSetOrigin(userpos)
  27.                 _EffectSetStart(topme)
  28.                 _EffectSetScale(200)
  29.                 _EffectSetMagnitude(10)
  30.                 _EffectSetRadius(20)
  31.             _EffectDispatch("GunShipTracer")
  32.  
  33.             _EffectInit()
  34.                 _EffectSetEnt(target)
  35.                 _EffectSetOrigin(userpos)
  36.                 _EffectSetStart(toppos)
  37.                 _EffectSetScale(50)
  38.                 _EffectSetMagnitude(5)
  39.                 _EffectSetRadius(10)
  40.             _EffectDispatch("FadingLineTeam")
  41.  
  42.                 local player = _PlayerInfo( target, "name");
  43.  
  44.                 _GModText_Start( "CloseCaption_Bold" );
  45.                 _GModText_SetColor( 255,0,0,255 );
  46.                 _GModText_SetTime( 10, 0, 0.5 ); --How long it stays, and the fading times
  47.                 _GModText_SetEntityOffset( vector3( 0, 0, 40 ) ); --Messages appear 35 Units above Players
  48.                 _GModText_SetEntity( target ); --Entity/Player the message will follow
  49.                 _GModText_SetText( "Player: "..player ); --Set the message
  50.                 _GModText_Send( 0, 50+userid );
  51.  
  52.  
  53.        
  54.  
  55.                 ulx_tsay( userid, "Player "..player.." has been located." ) ;
  56.  
  57.        
  58.        
  59. end
  60.  
  61. --Optional, I'd prefer if it was left alone--
  62. function givecred()
  63.         for i = 1, _MaxPlayers() do
  64.                 ulx_tsay( i, "Find Player script by Golden-Death." ) ;
  65.         end
  66. end
  67.  
  68. CONCOMMAND("findcredit", givecred)
  69. --End optional--
  70. ULX_CONCOMMAND( "ulx_find", cc_ulxfind, _, "Locates a player for you", 1, "!find" )

Private (This will only make the overhead text and message saying the player has been found be visible to you, the effects will be visible to all)
Code: Lua
  1. function cc_ulxfind( userid, args, argv, argc )
  2.         local target = getUser( userid, argv[ 1 ] )
  3.         if target == nil then
  4.         return
  5. end
  6.  
  7.  
  8. local mepos = _EntGetPos(userid)
  9. local userpos = _EntGetPos(target)
  10. local toadd = vector3(0,0,2000)
  11. local toadd2 = vector3(0,0,40)
  12. local topme = vecAdd( mepos, toadd2);
  13. local toppos = vecAdd( userpos, toadd);
  14.  
  15.             _EffectInit()
  16.                 _EffectSetEnt(target)
  17.                 _EffectSetOrigin(userpos)
  18.                 _EffectSetStart(mepos)
  19.                 _EffectSetScale(50)
  20.                 _EffectSetMagnitude(5)
  21.                 _EffectSetRadius(10)
  22.             _EffectDispatch("FadingLineTeam")
  23.  
  24.             _EffectInit()
  25.                 _EffectSetEnt(target)
  26.                 _EffectSetOrigin(userpos)
  27.                 _EffectSetStart(topme)
  28.                 _EffectSetScale(200)
  29.                 _EffectSetMagnitude(10)
  30.                 _EffectSetRadius(20)
  31.             _EffectDispatch("GunShipTracer")
  32.  
  33.             _EffectInit()
  34.                 _EffectSetEnt(target)
  35.                 _EffectSetOrigin(userpos)
  36.                 _EffectSetStart(toppos)
  37.                 _EffectSetScale(50)
  38.                 _EffectSetMagnitude(5)
  39.                 _EffectSetRadius(10)
  40.             _EffectDispatch("FadingLineTeam")
  41.  
  42.                 local player = _PlayerInfo( target, "name");
  43.  
  44.                 _GModText_Start( "CloseCaption_Bold" );
  45.                 _GModText_SetColor( 255,0,0,255 );
  46.                 _GModText_SetTime( 10, 0, 0.5 ); --How long it stays, and the fading times
  47.                 _GModText_SetEntityOffset( vector3( 0, 0, 40 ) ); --Messages appear 35 Units above Players
  48.                 _GModText_SetEntity( target ); --Entity/Player the message will follow
  49.                 _GModText_SetText( "Player: "..player ); --Set the message
  50.                 _GModText_Send( userid, 50+userid );
  51.  
  52.  
  53.        
  54.         _PrintMessage( userid, HUD_PRINTTALK, "Player "..player.." has been located." )
  55.  
  56.  
  57.        
  58.        
  59. end
  60.  
  61. --Optional, I'd prefer if it was left alone--
  62. function givecred()
  63.         for i = 1, _MaxPlayers() do
  64.                 ulx_tsay( i, "Find Player script by Golden-Death." ) ;
  65.         end
  66. end
  67.  
  68. CONCOMMAND("findcredit", givecred)
  69. --End optional--
  70. ULX_CONCOMMAND( "ulx_find", cc_ulxfind, _, "Locates a player for you", 1, "!find" )


JamminR

  • Guest
Re: Find Player (V2) - Locate a player anywhere in a map
« Reply #9 on: June 08, 2006, 06:38:33 pm »
GoldenDeath, THANKS!
 Glad you were able to get your stuff.
Pay your bill!! :P
 (I'm joking. I hope whatever prevented you from paying gets fixed, and isn't too tragic)

I'll try to find time this weekend to teach myself to set a variable, and then use an if/then statement to not perform the tracer effects if run silent mode.

I probably wont get a chance.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Find Player (V2) - Locate a player anywhere in a map
« Reply #10 on: June 08, 2006, 08:38:33 pm »
Heh, I don't know whats going on, the site is run by a friend, so no clue.


UberMensch

  • Guest
Re: Find Player (V2) - Locate a player anywhere in a map
« Reply #11 on: June 16, 2006, 07:26:10 am »
Does this go in the ulx/modules folder?

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Find Player (V2) - Locate a player anywhere in a map
« Reply #12 on: June 16, 2006, 03:14:14 pm »
Indeed it does


Yoyo

  • Guest
Re: Find Player (V2) - Locate a player anywhere in a map
« Reply #13 on: January 07, 2007, 06:18:13 pm »
Will this work with versions 2 and up? (And by 2 I meen ULX v2.21)

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Find Player (V2) - Locate a player anywhere in a map
« Reply #14 on: January 08, 2007, 03:33:26 pm »
No, you could try the V2 plugin, but I have no clue if it's compatible with gmod 10.


  • Print