Sziasztok. Azt szeretném megoldani, hogy admin karakterekre ne tudjanak teleportálni.
itt a quest, köszönöm előre is a segítséget.
quest teleportarea_jucatorului begin
state start begin
when 40004.use begin
local ramas = pc.getqf("next_time") - get_time()
local ramas_min = ramas / 60
if get_time() < pc.getqf("next_time")then
say_title("Teleportálás játékoshoz:")
say("Még "..ramas_min.." percig nem teleportálhatsz!")
else
say_title("Teleportálás játékoshoz:")
say_reward("Írd be a játékos nevét akihez teleportálni szeretnél!")
local name = input()
if pc.is_gm then
say("Erre a személyre a teleportálás nem lehetséges!!")
else
pc.teleport(name)
pc.setqf("next_time", get_time() + 120)
end
end
end
end
end
Az a tabolás meg a code tag ::) ::) ::)
quest teleportarea_jucatorului begin
state start begin
when 40004.use begin
local ramas = pc.getqf("next_time") - get_time()
local ramas_min = ramas / 60
if get_time() < pc.getqf("next_time")then
say_title("Teleportálás játékoshoz:")
say("Még "..ramas_min.." percig nem teleportálhatsz!")
else
say_title("Teleportálás játékoshoz:")
say_reward("Írd be a játékos nevét akihez teleportálni szeretnél!")
local name = input()
if (string.find(name, "[%") then
say("Erre a személyre a teleportálás nem lehetséges!!")
else
pc.teleport(name)
pc.setqf("next_time", get_time() + 120)
end
end
end
end
end
Nem garantálom hogy jó lesz, questben nem használtam még.
if (string.find(name, "[%") then
Annyi biztos hogy string.find kell :D
[spoiler]
variációk...
if (string.find(name, "[") then
if (string.find(name, "[%") then
if (string.find(name, "[") == true then
if (string.find(name, "[%") == true then[/spoiler]
Előre is elnézést, hogy ilyen régi poszthoz ide trollkodok.
A lua regex helyett mintákat használ, tehát nem működhet a fenti példa alapján.
Szvsz: if (string.find(name, "[%") then helyett if (string.find(name, "%p") then
To view the content, you need to Sign In or Register.