-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sendToPlayer error #31
Comments
Please post the full script that crashes the server. |
modaldialog = {
title = "Offline Training",
message = "Choose your room",
buttons = {
{ id = 1, text = "Go" },
},
buttonEnter = 1,
choices = {
{ id = 1, text = "Sword" },
{ id = 2, text = "Axe" },
{ id = 3, text = "Club" },
{ id = 4, text = "Distance" },
{ id = 5, text = "Magic Level" }
},
popup = false
}
function onStepIn(cid, item, position, fromPosition)
local ModalWindow = ModalWindow(1001, title, message)
if ModalWindow:getId() == 1001 then
ModalWindow:doAddButton(buttons)
ModalWindow:setDefaultEscapeButton(-1)
ModalWindow:doAddChoice(choices)
ModalWindow:setDefaultEnterButton(buttonEnter)
ModalWindow:setPriority(popup)
end
ModalWindow:sendToPlayer(cid)
registerCreatureEvent(cid, "Offline")
return true
end This is my offline train portal... |
Change: |
:O ty, more leaving only the cid is not easier? |
I've fixed the crash, but I will leave this issue open to look into allowing cid instead of a player object. |
You should be able to pass cid directly now. |
Just a question. This works without using: |
This works without your modaldialog table, yes. Title and message are just strings. Example: |
The function get title and get message no have use in script... |
They return the title or message from the ModalWindow object. Just because "you" as a programmer know what you passed to the constructor doesn't make them redundant. |
I know that this are just parameters, but in the script posted by Bruno, the values comes from nowhere.
|
|
I fixed yesterday, now I got home and had answered it in school... Dalkon, this script was a little less work with mine, I'll create a function with it :3 But I have not seen the functionality the "get" functions... Exemple my script: function onModalWindow(cid, modalWindowId, buttonId, choiceId)
if modalWindowId == 1001 then
if buttonId == 1 or buttonId == 29 or buttonId == 0 then
local pos = 0
if (choiceId == 1) then
pos = {x=98, y=45, z=15}
elseif (choiceId == 2) then
pos = {x=108, y=45, z=15}
elseif (choiceId == 3) then
pos = {x=117, y=45, z=15}
elseif (choiceId == 4) then
pos = {x=98, y=55, z=15}
elseif (choiceId == 5) then
pos = {x=117, y=55, z=15}
end
doTeleportThing(cid, pos)
end
end
return true
end PS. Buttton 29 and 0 is enter button... |
The function ModalWindow:sendToPlayer close the server (segmentation fault)
The text was updated successfully, but these errors were encountered: