Author Topic: Server_CommandCalled  (Read 622 times)

Basically an Event / Server Addon, that checks if a / command has been called. Unlike the Event_Commands, you could call commands without the use of a /cmd blah. Supposedly, since this is server sided, it would check if there is a servercmd function that already exists. So it would be impossible to override something like servercmdSelf Delete.
Would probs be something like this:

Step 1. You create a command, probably with like /createEventCommand COMMAND HERE (Possibly with extra strings and values?)
Step 2. Go to events.
Code: [Select]
(0) [0] onServerCommand - Self - serverCommand = Test1 [1 1(Activated events)]
(1) [0] onServerCommandTrue - Client - Centerprint [You have called Test1!]

This doable?

Sounds possible. Checking if a servercmd exists is just isFunction(serverCmd
  • ) so yeah.


Probably would just involve rewriting Event_Commands to autogenerate functions which always call onServerCommand, rather than call individual onServerCommand1 or whatever.

I actually have something like this from a long time ago, but it was never finished because I couldn't figure out how to trigger creation of commands.

Using /createEventCommand is obviously not acceptable, you'd have to re-create all your commands every time after loading bricks...


Would prefer something like a bindCommand [name] [start] [end] output event, but then it still doesn't run on it's own.
« Last Edit: April 03, 2016, 07:47:24 AM by Zeblote »

I actually have something like this from a long time ago, but it was never finished because I couldn't figure out how to trigger creation of commands.

Using /createEventCommand is obviously not acceptable, you'd have to re-create all your commands every time after loading bricks...


Would prefer something like a bindCommand [name] [start] [end] output event, but then it still doesn't run on it's own.
Make a custom loading system that comes with the event that overrides the default system. Have it parse the event list for commands and create them as necessary?

complex, but doable.

that's definitely the wrong way to go

0. "0" onCmdCalled » Self » ifCmd "ban" "" "" "" "" "1 1"
1. "33" onCmdMatch » Self » fireRelay
2. "33" onRelay » Self » fireRelay
3. "0" onRelay » Self » VCEifValue "<var:pl:isAdmin>" [==] "1" "4 4"
4. "0" onVariableTrue » Player » instantRespawn