Na początek będzie potrzebna nam duża sala z ogrodzonym krzeslem i dzwignia Następnie tworzymy w ots\data\actions\scripts plik krzeslo.lua i wklejamy do niego następujący tekst:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 7666 and item.itemid == 1945 then player1pos = {x=xxx, y=xxx, z=x, stackpos=253} player1 = getThingfromPos(player1pos)
if player1.itemid > 0 then player1heal = getPlayerHealth(player1.uid) player1mana = getPlayerMana(player1.uid) smierc = (player1mana) + (player1heal)
doPlayerAddHealth(player1.uid,-smierc) doSendMagicEffect(player1pos,11)
doTransformItem(item.uid,item.itemid+1) else doPlayerSendCancel(cid,"Lack convicted :(")
end
elseif item.uid == 7666 and item.itemid == 1946 then player1pos = {x=xxx, y=xxx, z=xxx, stackpos=253} player1 = getThingfromPos(player1pos)
if player1.itemid > 0 then player1heal = getPlayerHealth(player1.uid) player1mana = getPlayerMana(player1.uid) smierc = (player1mana) + (player1heal)
doPlayerAddHealth(player1.uid,-smierc) doSendMagicEffect(player1pos,11)
doTransformItem(item.uid,item.itemid-1) else doPlayerSendCancel(cid,"Lack convicted :(")
end
else return 0 end
return 1
end
i dodajemy linijkę w actions.xml
<action uniqueid="7666" script="krzeslo.lua" />
A teraz skrypt wysyłający osoba na krzesło. ots\data\talkactions\scripts execution.lua
function onSay(cid, words, param) skazany = getPlayerByName(param) krzeslo = {x=xxx, y=xxx, z=xxx}
if getPlayerAccess(cid) >= 1 then if isPlayer(skazany) > 0 then if words == "execution" then doTeleportThing(skazany, krzeslo) doPlayerSendTextMessage(cid, 19,"Player "..param.." condemn to electric chair") end else doPlayerSendCancel(cid,"Player is not online.") end end end
<talkaction words="execution" script="execution.lua" />
Tam gdzie jest "x" mają być wpisane współżędne krzesła A do dźwigni dajemy uinquedid: 7666
I będzie działało to tak: GM/God/Tutor zauważył osobę która używa np mc albo tibie auto. Wpisuje execution "nick_gracza i osoba ta jest teleportowana na krzesło. Następnie gm może dać wiadomość że zaraz odbędzie się egzekucja tego i tego zioma. Następnie ciągnie za czerwoną gałeczkę (Dog in the Fod:P). Skazany zostaje porażony prądem i umiera.
Zapraszam do komentowania!
|