Lua hooks needed!
#81
i think HOOK_CHAT is broken becouse if i use return false with OnChat() i still can just talk.
Reply
Thanks given by:
#82
You need to return true to refuse the chat message. False means "continue processing".
Reply
Thanks given by:
#83
oh yes sorry. i tried both return true and false but it did nothing.
EDIT: Wait it works now. but now i have another problem. i made a plugin with a command but when i use that command the server sais Unknown Command. howerver the command is still executed.

EDIT: Nevermind. i forgot return true ;S
Reply
Thanks given by:
#84
I added the HOOK_WEATHER_CHANGING hook and with it I quite changed a lot of weather code. I hope I got it right, but I'm unable to test with a client, unfortunately. Can you guys test it out for me? Probably with some sort of a weather plugin.

Rev 1210.
Reply
Thanks given by:
#85
testing it now Smile but i have to wait until it starts to rain Sad

oh it works with the rainy plugin to Smile but i think it uses the function OnWeatherChanged becouse i have HOOK_WEATHER_CHANGING but i get this error:
Quote:Error in plugin SunnyForever: Could not find function OnWeatherChanged()

hmm it seems to use both function OnWeatherChanged and function OnWeatherChanging becouse i get an error if i am missing one of them.
Reply
Thanks given by:
#86
Yes, it should get triggered upon any change of the weather, be it built-in ticking or change by a plugin. Anything that calls cWorld:SetWeather().

First the OnWeatherChanging() is called, allowing you to modify the weather that will be changed to. Then the weather is changed and then OnWeatherChanged() is called.

If not, then there's something wrong.
Reply
Thanks given by:
#87
just return true in OnWeatherChanging() should make it stop rain forever?
Reply
Thanks given by:
#88
It needn't - if the server loads a world with rain, it will continue raining forever.
To make a permanent sunshine, do a
Code:
return true, eWeather_Sunny
Reply
Thanks given by:
#89
So how's my hook, does it work? Can I close the issue?
Reply
Thanks given by:
#90
I didn't get it to work but i propably did something wrong.
function OnWeatherChanging()
	LOGINFO("Still Sunny")
	return true, eWeather_Sunny
end

function OnWeatherChanged()
return true, eWeather_Sunny
end
Reply
Thanks given by:




Users browsing this thread: 14 Guest(s)