ULX

Author Topic: aVoN's extra fun commands  (Read 15702 times)

0 Members and 1 Guest are viewing this topic.

Offline aVoN

  • Newbie
  • *
  • Posts: 2
  • Karma: 3
aVoN's extra fun commands
« on: May 23, 2006, 04:05:40 AM »
Heyho!
I made this script for my server and thought: Why not release it here?
It's nothing grandious or special, but it has some further fun commands for ULX.

The first one:
ulx_flag or "say !flag"
<user> [<text> [<text size> [<red> [<green> [<blue> [<alpha>]]]]]] - sets a text on a players head, readable for all, except him

The textsize is choseable from 1 to 8 which is one of the following ones: "ToolModeHelp","ToolMode","DefaultSmall","Default","Trebuchet24","CloseCaption_Normal","CloseCaption_Bold","ClientTitleFont"

Then to the "ming" command
ulx_minge or "say !minge"
<user> [<text>]- minges a player by sending MingeBag on his screen and making the background very weird
This floods a players view with the word MingeBag (when <text> is empty) or any custom text.

ulx_stuck or "say /stuck"
Simply unstucks a player when is is stuck anywhere.

Have fun with it. Download here

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: aVoN's extra fun commands
« Reply #1 on: May 23, 2006, 06:27:54 AM »
Good work aVoN! Thanks for contributing! :)
Experiencing God's grace one day at a time.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: aVoN's extra fun commands
« Reply #2 on: May 23, 2006, 03:45:49 PM »
Oh darn you, you made my float plugin obsolete.

Hehe, good work.


JamminR

  • Guest
Re: aVoN's extra fun commands
« Reply #3 on: June 07, 2006, 08:33:54 AM »
Fun commands.
However, ulx_flag apparently tracks by userid only, not steamid.
I've seen players leave that had flags, new players join, and they pick up the same user id as the previous player, and therefore get the flag.

Haven't tried, but presume ulx_minge does too.

I've verified visually that its not the same person leaving, changing name, then coming back ... steam ids are different.

Could an author correct this? I know ulx prop protect/spawn protector itself tracks steamids for players using arrays, but, my lua experience with arrays isn't good enough for me to even try converting the commands necessary.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: aVoN's extra fun commands
« Reply #4 on: June 07, 2006, 03:23:55 PM »
Well in the script, it searches for !flag X and sets X as the target. Then the script sets text above X's head, which is the way it should be, so I would assume its a problem with the way ULX works, not the script. Though I could be wrong, I haven't looked at it.


Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: aVoN's extra fun commands
« Reply #5 on: June 07, 2006, 03:30:21 PM »
Once again you blame ULX for something that is not it's fault GD....

This is a problem with GMod, since you have to specify the entid for the text. An easy fix would be to listen for a disconnect.

I am in no way saying that this problem exists (might be user error), but if it did, that would be the most likely reason for it being so.
Experiencing God's grace one day at a time.

JamminRJ

  • Guest
Re: aVoN's extra fun commands
« Reply #6 on: June 07, 2006, 04:28:27 PM »
I've looked. The script uses userid for sure for its flag portions.
Code to grab userid from name provided...
Code: [Select]
function cc_playerflag( userid, args, argv, argc )
local target = getUser( userid, argv[ 1 ] )
if target == nil then
return
end
blah blah code to set colors and alpha blah blah
Code to set text above head...
Code: [Select]
        _GModText_Start( texts[textsize] );
_GModText_SetColor( red, green, blue, alpha );
_GModText_SetTime( 9999, 0, 0 );
_GModText_SetEntityOffset( vector3( 0, 0, 60 ) );
_GModText_SetEntity( target );
_GModText_SetText( argv[2] );
_GModText_Send( 0, 2000+target );
the sentEntity( target ) uses the userid

I like the fact I can flag someone (or minge, which I don't really use cause we are all minges at new things in life) and have them leave, then come back and still get the flag, so adding Playerremove isn't something I'd like.
However, having the steamid tracked for the time (9999, or whatever I set to) instead of userid would
1) Fix the 'different person joins and gets same flag' issue, and
2) Still allow admins to track any flags set on troublemakers, or anyone else, that might leave and come back within that time under a different name or IP.

I figure theres not really an easy (at least for me) way to add the code to track steamids in arrays.
In easy script like english, I figure it would be
Code: [Select]
set a time variable ? tracktime = blah
playerflag (get nickname, text)
target = get userid of nickname
track = get steamid of userid, add to array for tracktime
blah blah set color, give userid text for tracktime blah blah
onspawn if steamid isin (look through array of steamids) then add text for tracktime again
else do nothing
(if someone really wanted to get even more complicated, figure out some way to remove time they've already been in array, but, I figure if you're using flag to track troublemakers, they leave, then come back, part of the punishment is getting tracktime reset)

The ulx_minge does the same (userid)
So, it would do same, as I've noticed on my server userids get recycled quite a bit it seems.

Jewcookie

  • Guest
Re: aVoN's extra fun commands
« Reply #7 on: June 08, 2006, 05:59:41 AM »
This script is pretty cool Avon! Nice work!!   I can't help you guys with the script cause i know about lua. Only the problem with the userid instead of steamid isn't a big deal for me. I rather have it working from the init folder witch it doesn't  ???.
It gives an error at line 67: attempt to call global "ULX_COMMAND" (a nil value). Hope you guys know why it does that.   ;D

JamminR

  • Guest
Re: aVoN's extra fun commands
« Reply #8 on: June 08, 2006, 08:04:15 AM »
Jewcookie,
 1) You _have_ to have ULX for this to work. Commands in it rely on ULX.
 2) If you have ULX, make sure its the latest version, and place Avons script in your lua/ulx/modules folder.
 Anything there gets executed after ULX gets executed. Kind of like in the original lua/init folder, but afterwards so scripts that rely on ULX commands have them in 'memory' already (so to speak).
ulx_init.lua has to be in the lua/init folder to tell the ULX code that set commands to run first.
 Hope that helps.

Jewcookie

  • Guest
Re: aVoN's extra fun commands
« Reply #9 on: June 08, 2006, 03:05:22 PM »
JamminR, thnx alot! That worked. I had alot of troubles with different scripts cause i always put them in the init folder and had to load the script with the lua_openscript command. Very anoying. But problem solved!  ;D

Offline aVoN

  • Newbie
  • *
  • Posts: 2
  • Karma: 3
Re: aVoN's extra fun commands
« Reply #10 on: June 09, 2006, 03:31:04 AM »
Ok, i wasn't here now for a long time. I Know the issues with the wrong flags. I only added them for fun because some admins requested them on my server to make fun on some evil mingebags like "warning minge". I never really used them.

Offline Nex

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: aVoN's extra fun commands
« Reply #11 on: July 20, 2006, 11:33:27 PM »
DEAD LINK!!!  ;D

Offline Silver

  • Newbie
  • *
  • Posts: 8
  • Karma: 1
Re: aVoN's extra fun commands
« Reply #12 on: August 01, 2006, 06:50:19 PM »
This is good. Very nice work, aVoN.

Offline naka

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Re: aVoN's extra fun commands
« Reply #13 on: August 04, 2006, 11:19:50 AM »
Sounds good, but the link is broken can someone upload it somewheres?