Well, you might have noticed that the function 'registerCreatureEvents' needs to be repeated each time an event is registered in login.lua
And if you use more creaturevents, you'll need to have more lines.
then with an easy custom function, you can reduce that to this:
(SkullCheck is in the list supposing that you are using fraghandler)
that way the login.lua looks shorter and cleaner.
And if you use more creaturevents, you'll need to have more lines.
Lua:
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
then with an easy custom function, you can reduce that to this:
Lua:
function registerEvents(cid)
_event = {"Mail", "GuildMotd", "Idle", "SkullCheck", "ReportBug", "AdvanceSave"}
for i = 1, # _event do registerCreatureEvent(cid, _event[i]) end end
that way the login.lua looks shorter and cleaner.