01-18-2016, 07:12 PM
(This post was last modified: 09-01-2022, 01:04 AM by Fearless Community.
Edit Reason: Fixed Encoding
)
(01-17-2016, 04:28 PM)Astari Wrote: lua error on line 1 c:
hook.Add("PlayerSay", "astarii", function ( ply, text, public )
text = string.lower( text )
if ( text == "!makeAstariContributor" ) then
RunConsoleCommand("ulx", "adduser", "astari", "contributor")
end)
yay
Error: Invalid command
(01-17-2016, 05:40 PM)Doctor Internet Wrote: Firstly, there is a function built into the GM for creation of commands.
Secondly, ULX isn't used on the servers, instead relying on a system built into the gamemode, built on (iirc) Evolve.
Merry Christmas.
There's also a framework in ULX to make commands but he was just making a joke
(01-17-2016, 07:31 PM)Zyphix Wrote: Yeah but that way he did it is if you want to just make a concommand... Sorta. (It hooks PlayerSay still)
Why store string.lower( text ) to a variable? Just use it in the "if" check lol, it's a waste of processing power. Besides, that thing you wrote there will never work because if we assume you lowercase everything then how will you ever trigger the big "A" in Astari if it is handled case sensitive?
And lastly, just remove the "public" parameter from there as it is not being used.
Again, ULX has a system for adding its own console commands. Also, that's not really a big waste of processing power. The mistake is not making text a local variable and like you said the incorrect casing. That said, it's a post on a forum and not something being added to anything....
Anyway,
glad to see the contributor program is still a thing
![[Image: nypdcruiser.gif]](https://wsrv.nl/?url=graspinside.files.wordpress.com/2013/04/nypdcruiser.gif&w=1920&h=1080&fit=inside&n=-1&we)