zxmatzx
Advanced OT User
Hello,
I need a yes / no dialog window for OTC. I do not know if there is already a model ready, searched a lot and found nothing related. I know the logic behind this code, I believe it works like TFS Events (onMoveItem, onLook, onTurn) which will expect a
It would be possible to be called by both client and server.
Ex:
Yes/No Dialog Exemple:
How can I do this?
Any help will be welcome! Thanks.
I need a yes / no dialog window for OTC. I do not know if there is already a model ready, searched a lot and found nothing related. I know the logic behind this code, I believe it works like TFS Events (onMoveItem, onLook, onTurn) which will expect a
return true
to actually do the action, but I don't know how to implement it in OTC.It would be possible to be called by both client and server.
Ex:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if itemEx.itemId == 2160 then --if target item == 2161 (crystal coin)
local dialog = showYesNoDialog() --Show Yes/No Dialog Window
if dialog == true then --If dialogResult == Yes(true)
item:remove() --Remove Item
return true --Finish with true
else --If dialogResult == No(false)
return false --Finish with false
end
end
return false --Finish with false by default
end
Yes/No Dialog Exemple:
How can I do this?
Any help will be welcome! Thanks.