04-24-2014, 07:20 AM
Hi, i'm trying to get the player who sent the actual command, I searched around the api docs but couldn't find anything. Is there a way to do it? Thanks.
Getting command sender
|
||
04-24-2014, 07:20 AM
Hi, i'm trying to get the player who sent the actual command, I searched around the api docs but couldn't find anything. Is there a way to do it? Thanks.
04-24-2014, 07:26 AM
Hi,
How are you intercepting commands? When you register the command (using cPluginManager:BindCommand, http://mc-server.xoft.cz/LuaAPI/cPluginM...#functions or using Info.lua file) you give it a handler function, that handler function receives two parameters, the text that the user has sent (split into individual words into a table of strings) and the cPlayer object for the player who sent the command. So a typical command handler does something like this:
Thanks given by: gv1222
04-24-2014, 07:45 AM
| ||
« Next Oldest | Next Newest »
|