General > Developers Corner
PlayerSay running after ULX
JamminR:
Not really.
I thought I'd used it in a script before, but realized the one I thought I had not.
I do know now that if I'd continued updating my script, I'd have switched over to using it.
Tinker with it. Create a function that echos it's parameters back to you and call it from the hook.
Also, while looking through my old code, you could use ULibPlayerTarget or ULibPlayersTargets too.
Basically, Run those hooks and if asay or psay are in the command, check the words list.
See my OLD now broken code on how I used to look for certain commands, then bounce them back to the original caller here
https://forums.ulyssesmod.net/index.php/topic,4507.0.html
Basically, all three hooks mentioned allow you to interrupt the natural flow of ULX (or any ULib addon that calls commands or targets players), then lets you do other stuff, or allow normally.
StaTiiKxKALEB:
--- Quote from: JamminR on May 13, 2016, 06:59:41 PM ---Not really.
I thought I'd used it in a script before, but realized the one I thought I had not.
I do know now that if I'd continued updating my script, I'd have switched over to using it.
Tinker with it. Create a function that echos it's parameters back to you and call it from the hook.
Also, while looking through my old code, you could use ULibPlayerTarget or ULibPlayersTargets too.
Basically, Run those hooks and if asay or psay are in the command, check the words list.
See my OLD now broken code on how I used to look for certain commands, then bounce them back to the original caller here
https://forums.ulyssesmod.net/index.php/topic,4507.0.html
Basically, all three hooks mentioned allow you to interrupt the natural flow of ULX (or any ULib addon that calls commands or targets players), then lets you do other stuff, or allow normally.
--- End quote ---
Appreciate it. Thanks man.
roastchicken:
--- Quote from: JamminR on May 13, 2016, 06:22:14 PM ---ULibCommandCalled would likely be better.
Return false if blocked word(s) are found in args, command used was "ulx asay" or "ulx psay", do whatever to calling player.
--- End quote ---
Interesting. I wasn't aware you had the possibility of stopping commands via a hook.
JamminR:
--- Quote from: roastchicken on May 13, 2016, 07:40:53 PM ---Interesting. I wasn't aware you had the possibility of stopping commands via a hook.
--- End quote ---
Yeah, over the years we've had questions about hooking into targeting and called commands, so over time command and targeting hooks have been thrown in.
I've not even played with ULibCommandCalled like I thought I had.
There are four quick easy ones that can be used to modify or add to commands being called.
ULibCommandCalled can prevent if wanted (and of course, do something else if wanted)
ULibPlayerTarget and ULibPlayerTargets can prevent, and even pass back modified target info.
ULibPostTranslatedCommand - do stuff after commands are called
Navigation
[0] Message Index
[*] Previous page
Go to full version