-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
- 0 replies
- 637 views
-
script alguém pode me ajudar nessa spells aqui, queira que colocassem pro meu personagem ficar inatingível por 6 segundos e podendo atacar livremente
By lazaroszz,
- 0 answers
- 1163 views
-
- 0 replies
- 2273 views
-
- 0 answers
- 3415 views
-
- 3 answers
- 4607 views
-

Question
Krono 128
Alguém poderia me ajudar com a conclusão desse script? ele não dá nenhum erro no console, porém também não funciona.
O script está tão bagunçado quanto minhas idéias, por isso já peço desculpas antecipadamente.
function onSay(cid, words, param)
local p = string.explode(param, ",")
local cmd = {"create", "delete", "change"}
local teleport = getplayerposition(cid)
if p[1] and p[2] then
if p[1] == cdm[1] then--se parametro 1 for = create
if db.executeQuery("SELECT `name` FROM `teleports` WHERE `name` = '" .. p[2] .."'") == false then -- se o nome escolido for falso
db.executeQuery("INSERT INTO `teleports`(`name`, `x`, `y`, `z`) VALUES (" .. p[2] .. "," .. teleport.x .. "," .. teleport.y .. "," .. teleport.z)
else
doPlayerSendCancel(cid, "Esse teleport já existe")
end
elseif p[1] == cdm[2] then--se parametro 1 for = delete
if db.executeQuery("SELECT `name` FROM `teleports` WHERE `name` = '" .. p[2] .."'") == true then -- se o nome escolido for verdadeiro
db.executeQuery("DELETE FROM `teleports` WHERE `name` = '" .. p[2] .."'")
else
doPlayerSendCancel(cid, "Esse teleport não existe")
end
elseif p[1] == cdm[3] then--se parametro 1 for = change
if db.executeQuery("SELECT `name` FROM `teleports` WHERE `name` = '" .. p[2] .."'") == true then -- se o nome escolido for falso
db.executeQuery("INSERT INTO `teleports`(`name`, `x`, `y`, `z`) VALUES (" .. p[2] .. "," .. teleport.x .. "," .. teleport.y .. "," .. teleport.z)
else
doPlayerSendCancel(cid, "Esse teleport não pode ser modificado")
end
end
end
end
obrigado
Link to comment
https://xtibia.com/forum/topic/237839-comando-criador-de-teleport-tfs-1x/Share on other sites
6 answers to this question
Recommended Posts