02-21-2013, 05:23 AM
yes i want to make a login system but i don't want the server admin first edit the Groups.ini before he can use it. I want a "plug and play" plugin
Lua hooks needed!
|
02-21-2013, 05:23 AM
yes i want to make a login system but i don't want the server admin first edit the Groups.ini before he can use it. I want a "plug and play" plugin
02-21-2013, 11:51 PM
I have added a HOOK_EXECUTE_COMMAND hook that fires just before a command handler for the command or console command is executed. The command is already known to have been bound; the permissions haven't been checked yet though.
Note that the same hook is called for both in-game commands and console commands. To tell them apart, use the first parameter, which is the cPlayer issuing the in-game command, or nil for console commands. Thanks given by: NiLSPACE
02-22-2013, 12:04 AM
so i should do something like this:
function OnExecuteCommand(Player, Command) if Auth[Player:GetName()] == false then if Command ~= "/login" then return true end end end
You need to first check if you're getting a Player at all - compare to nil. And don't compare to booleans, that is bad practice and can lead to errors (in C/C++, it is possible that "true != true")
Code: function OnExecuteCommand(Player, CommandSplit) Thanks given by: NiLSPACE
03-20-2013, 04:51 AM
is there a OnBlockChange or something that fires when the fire simulator is working or the fluid simulator or anything else that isn't a player that changes a block?
03-20-2013, 05:56 AM
I don't think so, because that would put quite a strain. Already the blockchanges are the most expensive operation of the TickThread.
What if, instead, you could ask at each tick for the list of changed blocks, per chunk? That, to me, seems more likely to get implemented.
03-20-2013, 06:23 AM
yes that could be usefull
03-20-2013, 06:25 AM
Still, don't count on that being added anytime soon
04-07-2013, 09:37 PM
Maybe you can also add a OnTakingDamage and if you do return true you won't even get the damage animation.
04-08-2013, 05:32 PM
OnTakeDamage is already working as an "in progress"-style hook, so I'd rather add some kind of processing to that, perhaps adding a new member to TakeDamageInfo.
|
« Next Oldest | Next Newest »
|