Ulysses

Ulysses Stuff => Ulysses Release Archives => Releases => Releases for ULib v1.* => Topic started by: Golden-Death on November 05, 2006, 11:28:13 AM

Title: Text floating plugin (ULX v2)
Post by: Golden-Death on November 05, 2006, 11:28:13 AM
Original thread:
http://forums.ulyssesmod.net/index.php/topic,50.0.html

I didn't think any one wanted it, but since Ltp0wer requested it, here it is.

---------------------------------------------
New Features

Limitations
---------------------------------------------



Usage:
Say:
!text (player) (red) (green) (blue) (transparency) ("message")

Example:
!text gol 255 0 0 255 "I am an admin"

Remember, quotes are needed on the message part if it contains spaces.
Have fun!


http://ulyssesmod.net/gd/ulxv2scripts/textfloat/ulx_textfloat.lua
Title: Re: Text floating plugin (ULX v2)
Post by: Megiddo on November 05, 2006, 11:29:09 AM
Download?
Title: Re: Text floating plugin (ULX v2)
Post by: Golden-Death on November 05, 2006, 12:45:53 PM
 Download links are overrated :P
Title: Re: Text floating plugin (ULX v2)
Post by: Megiddo on November 05, 2006, 01:33:17 PM
Good job GD!
Title: Re: Text floating plugin (ULX v2)
Post by: Ltp0wer on November 08, 2006, 04:16:45 PM
Haha, sweet.

Exactly what I wanted.


Thanks man, A+ job.
Title: Re: Text floating plugin (ULX v2)
Post by: Golden-Death on November 09, 2006, 10:11:22 PM
 8)
Title: Re: Text floating plugin (ULX v2)
Post by: Ltp0wer on November 13, 2006, 03:39:10 PM
I have an idea. I'd like if I was able to float text on props aswell.

Like, what you are pointing at, you'd type "!proptext 255 255 255 255 MESSAGE"


Just a thought.
Title: Re: Text floating plugin (ULX v2)
Post by: Golden-Death on November 13, 2006, 05:29:13 PM
Well, I could just change a few lines of code, I don't know if it will work though.

use !textprop (player who is looking at prop) (red) (green) (blue) (alpha) (message) (z offset)

where the Z offset is how high above the prop it floats, since the prop size will vary. (Players head height is 35 or so)

Code: [Select]
--------------------------------------------------------------------
--             Do Not Edit Below: Use the cvars to set            --
--------------------------------------------------------------------




function cc_ulxtextfloatprop( userid, args, argv, argc )
if argc < 7 then
ULib.tsay( userid, ulx.LOW_ARGS )
return
end

local targets, err = ULib.getUsers( argv[ 1 ], _, true ) -- Enable keywords
if not targets then
ULib.tsay( userid, err )
return
end

for _, v in ipairs( targets ) do

  _GModText_Start( "Default" );
  _GModText_SetColor( argv[2],argv[3],argv[4],argv[5]);
  _GModText_SetTime( 9999, 0.5, 0.5 ); --How long it stays, and the fading times
  _GModText_SetEntityOffset( vector3( 0, 0, argv[7] ) ); --Messages appear 35 Units above Players
local trace = PlayerLookTrace(v, 9999)
local fent = _TraceGetEnt();
  _GModText_SetEntity( fent ); --Entity/Player the message will follow
  _GModText_SetText( argv[6]); --Set the message
  _GModText_Send( 0, math.random(1,500) );


end

end

function ulx.cleartext(userid, args, argv, argc )
for i=1, _MaxPlayers() do
if IsPlayerOnline(i) then
_GModText_HideAll(i)
end
end
end
ulx.CONCOMMAND( "textfloatprop", cc_ulxtextfloatprop, "<user><red><green><blue><alpha><message><location offset in Z> Set text above players", ACCESS_SLAY, "!textprop" )
ulx.CONCOMMAND( "cleartext", ulx.cleartext, "Remove all text floating around", ACCESS_SLAY, "!cleartext" )
Title: Re: Text floating plugin (ULX v2)
Post by: Ltp0wer on November 13, 2006, 05:44:03 PM
Well, I could just change a few lines of code, I don't know if it will work though.

use !textprop (player who is looking at prop) (red) (green) (blue) (alpha) (message) (z offset)

where the Z offset is how high above the prop it floats, since the prop size will vary. (Players head height is 35 or so)

Code: [Select]
--------------------------------------------------------------------
--             Do Not Edit Below: Use the cvars to set            --
--------------------------------------------------------------------




function cc_ulxtextfloatprop( userid, args, argv, argc )
if argc < 7 then
ULib.tsay( userid, ulx.LOW_ARGS )
return
end

local targets, err = ULib.getUsers( argv[ 1 ], _, true ) -- Enable keywords
if not targets then
ULib.tsay( userid, err )
return
end

for _, v in ipairs( targets ) do

  _GModText_Start( "Default" );
  _GModText_SetColor( argv[2],argv[3],argv[4],argv[5]);
  _GModText_SetTime( 9999, 0.5, 0.5 ); --How long it stays, and the fading times
  _GModText_SetEntityOffset( vector3( 0, 0, argv[7] ) ); --Messages appear 35 Units above Players
local trace = PlayerLookTrace(v, 9999)
local fent = _TraceGetEnt();
  _GModText_SetEntity( fent ); --Entity/Player the message will follow
  _GModText_SetText( argv[6]); --Set the message
  _GModText_Send( 0, math.random(1,500) );


end

end

function ulx.cleartext(userid, args, argv, argc )
for i=1, _MaxPlayers() do
if IsPlayerOnline(i) then
_GModText_HideAll(i)
end
end
end
ulx.CONCOMMAND( "textfloatprop", cc_ulxtextfloatprop, "<user><red><green><blue><alpha><message><location offset in Z> Set text above players", ACCESS_SLAY, "!textprop" )
ulx.CONCOMMAND( "cleartext", ulx.cleartext, "Remove all text floating around", ACCESS_SLAY, "!cleartext" )

But will that still allow me to do it on players?