02-13-2013, 06:40 AM
i think HOOK_CHAT is broken becouse if i use return false with OnChat() i still can just talk.
Lua hooks needed!
|
02-13-2013, 06:40 AM
i think HOOK_CHAT is broken becouse if i use return false with OnChat() i still can just talk.
02-13-2013, 07:00 AM
You need to return true to refuse the chat message. False means "continue processing".
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
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.
testing it now but i have to wait until it starts to rain
oh it works with the rainy plugin to 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.
02-14-2013, 05:57 AM
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.
02-14-2013, 06:01 AM
just return true in OnWeatherChanging() should make it stop rain forever?
02-14-2013, 06:09 AM
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
02-15-2013, 06:57 AM
So how's my hook, does it work? Can I close the issue?
02-15-2013, 07:04 AM
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 |
« Next Oldest | Next Newest »
|