Na pocz±tek bêdzie potrzebna namdu¿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:
Kod:
-- Krzeslo elektryczne zrobione przez Krissa -- -- Electric chair by Kriss --
function onUse(cid, item, frompos, item2, topos)
if item.uid == 7666 and item.itemid == 1945 then player1pos = {x=330, y=355, z=12, 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=330, y=355, z=12, 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
Kod:
<action uniqueid="7666" script="krzeslo.lua" />
A teraz skrypt wysy³aj±cy osoba na krzes³o. ots\data\talkactions\scripts execution.lua
Kod:
-- Krzeslo elektryczne zrobione przez Smoczek Leon -- -- Electric chair by Smoczek Leon --
function onSay(cid, words, param) skazany = getPlayerByName(param) krzeslo = {x=330, y=355, z=12}
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
W talkactions.xml dodajemy linijke
Kod:
<talkaction words="execution" script="execution.lua" />
Pogrubion± czcionk± napisa³em pozycje krzes³a.
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.
|