Skrypty & Kody Komenda NP !Teleport Reborn

Zapalniczka

Active User
Zarejestrowany
Dołączył
Luty 2, 2015
Posty
132
Liczba reakcji
2
Ma ktos moze komende na teleport pod questa, ze np za 500g teleportuje w dane miejsce?? tfs 0.3.6
 
Odp: Komenda NP !Teleport Reborn

local pos = {x=1,y=1,z=1}
local gi = 2160

function onSay(cid, words, param)
if(getPlayerItem(cid, gi) == 500) then
doTeleportThing(cid, pos)
end
return TRUE
end
 
Ostatnia edycja:
Odp: Komenda NP !Teleport Reborn

Nie dziala :( a i jeszcze jedno jak ktos ma pz to nie moze tp dac
 
Odp: Komenda NP !Teleport Reborn

co nie dziala jak dziala
 
Odp: Komenda NP !Teleport Reborn

<talkaction words="!pq" hide="yes" event="script" value="tpdp.lua"/>
dalem skrypt do scipts i nie dziala..

---------- Tre?? dodana o 17:05 ----------

ref!!

---------- Tre?? dodana o 17:05 ----------

function onSay(cid, words, param)
topos = {x=30057, y=30080, z=7}
topos = {x=30040, y=30082, z=7}
topos = {x=30034, y=30092, z=7}
topos = {x=30061, y=30094, z=7}
if isPremium(cid) and
isPlayer(cid) == TRUE and
getCreatureCondition(cid, CONDITION_INFIGHT) == false and
exhaustion.get(cid,61266) == false then
doTeleportThing(cid,topos)
exhaustion.set(cid,61266,60)
doSendMagicEffect(getCreaturePosition(cid), 148)
doSendAnimatedText(getCreaturePosition(cid), '~Teleport~', (101))
doPlayerSendTextMessage(cid, 22, "Uzyles Teleport, Nastepny za Minute!")
else
doPlayerSendCancel(cid,"nie posiadasz gold.")
end
end

przerobic moze ten skrypt zeby zabieral gold

---------- Tre?? dodana o 17:05 ----------

function onSay(cid, words, param)
topos = {x=30057, y=30080, z=7}
topos = {x=30040, y=30082, z=7}
topos = {x=30034, y=30092, z=7}
topos = {x=30061, y=30094, z=7}
if isPremium(cid) and
isPlayer(cid) == TRUE and
getCreatureCondition(cid, CONDITION_INFIGHT) == false and
exhaustion.get(cid,61266) == false then
doTeleportThing(cid,topos)
exhaustion.set(cid,61266,60)
doSendMagicEffect(getCreaturePosition(cid), 148)
doSendAnimatedText(getCreaturePosition(cid), '~Teleport~', (101))
doPlayerSendTextMessage(cid, 22, "Uzyles Teleport!")
else
doPlayerSendCancel(cid,"Nie Posiadzasz Premium.")
end
end

Moze ktos przerobi ten skrypt zeby zabieralo gold
 
Odp: Komenda NP !Teleport Reborn

Nie siedzialem na 0.3.6 ale sprobuj ten;

[LUA]local topos = {x = 30057, y = 30080, z = 7} -- wpisz pozycje gdzie ma teleportowac

function onSay(cid, words, param)
if isPremium(cid) and getCreatureCondition(cid, CONDITION_INFIGHT) == false and exhaustion.get(cid,61266) == false and getPlayerItem(cid, 2160) == 500 then
doTeleportThing(cid, topos)
exhaustion.set(cid, 61266, 60)
doPlayerRemoveItem(cid, 2160, 500)
doSendMagicEffect(getCreaturePosition(cid), 148)
doSendAnimatedText(getCreaturePosition(cid), "~Teleport~", (101))
doPlayerSendTextMessage(cid, 22, "Uzyles Teleport!")
else
return doPlayerSendCancel(cid,"Musisz posiadac konto premium, 500 crystal coin, nie toczyc walki oraz odczekac chwile po ostatnim teleporcie.")
end
return true
end[/LUA]

Nie rozumiem tylko dlaczego masz kilka roznych pozycji
 
Ostatnia edycja:
Odp: Komenda NP !Teleport Reborn

Kur*a nie dziala ;( moze byc ze przez komende reload talkaction nie lapie??
albo daj talkaction do tego
 
Odp: Komenda NP !Teleport Reborn

Kur*a nie dziala ;( moze byc ze przez komende reload talkaction nie lapie??
albo daj talkaction do tego

Jakies bledy w konsoli lub kliencie?

Plik powinien sie nazywac tpdp.lua

Talkactions:
[XML]<talkaction words="!pq" event="script" value="tpdp.lua"/>[/XML]
 
Odp: Komenda NP !Teleport Reborn

data/talkactions/scripts/tpdp.lua:7: attempt to call global 'getPlayerItem' (a nil value)
stack traceback:
data/talkactions/scripts/tpdp.lua:7: in function <data/talkactions/scripts/tpdp.lua:1>
 
Odp: Komenda NP !Teleport Reborn

data/talkactions/scripts/tpdp.lua:7: attempt to call global 'getPlayerItem' (a nil value)
stack traceback:
data/talkactions/scripts/tpdp.lua:7: in function <data/talkactions/scripts/tpdp.lua:1>

[LUA]local topos = {x = 30057, y = 30080, z = 7}

function onSay(cid, words, param)
if isPremium(cid) and getCreatureCondition(cid, CONDITION_INFIGHT) == false and exhaustion.get(cid,61266) == false and getPlayerItemCount(cid, 2160) >= 500 then
doTeleportThing(cid, topos)
exhaustion.set(cid, 61266, 60)
doPlayerRemoveItem(cid, 2160, 500)
doSendMagicEffect(getCreaturePosition(cid), 148)
doSendAnimatedText(getCreaturePosition(cid), "~Teleport~", (101))
doPlayerSendTextMessage(cid, 22, "Uzyles Teleport!")
else
return doPlayerSendCancel(cid,"Musisz posiadac konto premium, 500 crystal coin, nie toczyc walki oraz odczekac chwile po ostatnim teleporcie.")
end
return true
end[/LUA]
 
Odp: Komenda NP !Teleport Reborn

No i Ciebie Ziomeczek Kocham <3
 
Odp: Komenda NP !Teleport Reborn

[lua]local config = {pos = {x = 30057, y = 30080, z = 7}, cost = 50000, timetotp = 7, exhaust = 60} -- pozycja, koszt(1 = 1gp, 50000 = 5cc), czas w sekundach po jakim grasz dostanie tp, czas do ponownego u?ycia scrolla.

local function teleport(cid)
if not getCreatureCondition(cid, CONDITION_INFIGHT) then
event2 = doTeleportThing(cid, config.pos)
else
stopEvent(event2)
end
end

local function doSendEffect(cid, c)
if not getCreatureCondition(cid, CONDITION_INFIGHT) then
event = doSendAnimatedText(getCreaturePosition(cid), config.timetotp-c, math.random(200))
else
stopEvent(event)
doPlayerSendCancel(cid,"Teleport anulowany.")
end
end

function onSay(cid, words, param)
if isPremium(cid) then
if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE then
if exhaustion.get(cid,61266) == false then
if doPlayerRemoveMoney(cid, config.cost) == TRUE then
exhaustion.set(cid, 61266, config.exhaust)
for c = 0, config.timetotp do
addEvent(doSendEffect, c * 1000, cid, c)
end
addEvent(teleport, config.timetotp * 1000, cid)
doPlayerSendTextMessage(cid, 22, "Uzyles teleport, zaraz zostaniesz przeteleportowany!")
else
doPlayerSendCancel(cid,"Musisz posiadac ".. config.cost.. " gold coins.")
end
else
doPlayerSendCancel(cid,"Musisz odczekac chwile")
end
else
doPlayerSendCancel(cid,"Nie mozesz toczyc walki!")
end
else
doPlayerSendCancel(cid,"Musisz posiadac konto premium.")
end
return true
end[/lua]
 
Ostatnia edycja:
Odp: Komenda NP !Teleport Reborn

?ap bardziej rozbudowane jakby? chcia?. ;>
[lua]local config = {pos = {x = 30057, y = 30080, z = 7}, cost = 50000, timetotp = 7, exhaust = 60} -- pozycja, koszt(1 = 1gp, 50000 = 5cc), czas w sekundach po jakim grasz dostanie tp, czas do ponownego u?ycia scrolla.

local function doSendEffect(cid, c)
doSendAnimatedText(getCreaturePosition(cid), config.timetotp-c, math.random(200))
end

function onSay(cid, words, param)
if isPremium(cid) then
if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE then
if exhaustion.get(cid,61266) == false then
if doPlayerRemoveMoney(cid, config.cost) == TRUE then
exhaustion.set(cid, 61266, config.exhaust)

addEvent(doTeleportThing, config.timetotp * 1000, cid, config.pos)
for c = 0, config.timetotp do
addEvent(doSendEffect, c * 1000, cid, c)
end

doPlayerSendTextMessage(cid, 22, "Uzyles teleport, zaraz zostaniesz przeteleportowany!")

else
doPlayerSendCancel(cid,"Musisz posiadac ".. config.cost.. " gold coins.")
end
else
doPlayerSendCancel(cid,"Musisz odczekac chwile")
end
else
doPlayerSendCancel(cid,"Nie mozesz toczyc walki!")
end
else
doPlayerSendCancel(cid,"Musisz posiadac konto premium.")
end
return true
end[/lua]

Gracz wpisze !pq, zaatakuje kogos i dalej sie przeteleportuje po 7 sekundach?

Wiem ze jest stopEvent ale to tylko bardziej komplikuje skrypt
 
Odp: Komenda NP !Teleport Reborn

Poprawione. :wink:
 
Ostatnia edycja:
Odp: Komenda NP !Teleport Reborn

No ladnie, ale mozna tez bez stopEvent, tylko wtedy trzeba by bylo jakiegos 'exhaust' dodac w onSay

[LUA]local topos = {x = 30057, y = 30080, z = 7}

function teleport(cid)
if getCreatureCondition(cid, CONDITION_INFIGHT) == false and getPlayerItemCount(cid, 2160) >= 500 then
doTeleportThing(cid, topos)
exhaustion.set(cid, 61266, 60)
doPlayerRemoveItem(cid, 2160, 500)
doSendMagicEffect(getCreaturePosition(cid), 148)
doSendAnimatedText(getCreaturePosition(cid), "~Teleport~", (101))
doPlayerSendTextMessage(cid, 22, "Uzyles Teleport!")
else
return doPlayerSendCancel(cid,"Teleport anulowany.")
end
return true
end

function onSay(cid, words, param)
if isPremium(cid) and getCreatureCondition(cid, CONDITION_INFIGHT) == false and exhaustion.get(cid, 61266) == false and getPlayerItemCount(cid, 2160) >= 500 then
addEvent(teleport, 7000, cid)
doPlayerSendTextMessage(cid, 22, "Uzyles teleport, zaraz zostaniesz przeteleportowany!")
else
return doPlayerSendCancel(cid,"Musisz posiadac konto premium, 500 crystal coin, nie toczyc walki oraz odczekac chwile po ostatnim teleporcie.")
end
return true
end[/LUA]

Zastanawia mnie czemu nie uzyles:

[LUA]doPlayerRemoveItem(cid, 2160, 500)[/LUA]

Lub:

[LUA]doPlayerRemoveMoney(cid, config.cost)[/LUA]

jest tylko if - instrukcja warunkowa ktora sprawdza czy jest gold, ale nigdzie nie widze zeby zabieralo z BP
 
Ostatnia edycja:
Odp: Komenda NP !Teleport Reborn

W takim razie prosz? sprawdzi? jak dzia?a doPlayerRemoveMoney z funkcj? warunkow? je?eli.
 
Odp: Komenda NP !Teleport Reborn

Przydatne :D

Ale nie tutaj -> Gracz wpisze !pq, zabierze mu golda, wlaczy pz i sie nie przeteleportuje
 
Odp: Komenda NP !Teleport Reborn

[MENTION=441820]mackerel[/MENTION] mozna oddac gold graczowi w funkcji teleport lub sendEffect ;d
 
Back
Do góry