[Action]System Piłki Nożnej
Strona 1 z 1
[Action]System Piłki Nożnej
Witam.
Posiadam system Piłki Nożnej.
Instrukcja:
1.
a) W actrions/scripts tworzymy plik o nazwie: fut.lua i wpisujemy tam:
a) Wchodzimy w Movements/scripts i tworzymy nowy plik o nazwie: fut.lua i wpisujemy do niego:
Screen:
Boisko musicie zrobić sami w Map Edytorze. Pozdrawiam.
Posiadam system Piłki Nożnej.
Instrukcja:
1.
a) W actrions/scripts tworzymy plik o nazwie: fut.lua i wpisujemy tam:
- Kod:
</-- Script By Potreco =D -->
function onUse(cid,item,frompos,item2,topos)
pos1 = {x = 344,y = 248,z = 7}
pos2 = {x = 337,y = 248,z = 7}
poscentro2 = {x = 335,y = 242,z = 7}
poscentro1 = {x = 346,y = 242,z = 7}
idbola = 2160 -- Id do item que irá ser utilizado como bola
tempo = 2*60*1000 -- Tempo de duração de cada partida
outfit1 = {lookType = 128, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94, lookAddons = getCreatureOutfit(cid).lookAddons}--Outfit que o time 1 utilizará
outfit2 = {lookType = 128, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = getCreatureOutfit(cid).lookAddons} --Outfit do time 2
time1 = getSpectators(pos1,2,0)
time2 = getSpectators(pos2,2,0)
if getGlobalStorageValue(20003) == -1 then
setGlobalStorageValue(20003,1)
if time1 then
for i = 1,#time1 do
doSetCreatureOutfit(time1[i], outfit1,tempo)
doTeleportThing(time1[i],poscentro1)
end
end
if time2 then
for i = 1,#time2 do
doSetCreatureOutfit(time2[i], outfit2,tempo)
doTeleportThing(time2[i],poscentro2)
end
end
doCreateItem(idbola,poscentro1)
doBroadcastMessage("Começa o jogo!")
addEvent(function()
players = getSpectators(poscentro1,12,5)
if players ~= nil then
for i = 1,#players do
doTeleportThing(players[i],pos1)
end
end
doBroadcastMessage("Fim de jogo! O placar foi de: Time 1 "..getGlobalStorageValue(20000).." x "..getGlobalStorageValue(20001).." Time 2")
setGlobalStorageValue(20000,0)
setGlobalStorageValue(20001,0)
setGlobalStorageValue(20003,-1)
end,tempo)
end
return TRUE
end
- Kod:
<action actionid="5555" event="script" value="fut.lua"/>
a) Wchodzimy w Movements/scripts i tworzymy nowy plik o nazwie: fut.lua i wpisujemy do niego:
- Kod:
</-- Script By Potreco =D -->
function onAddItem(moveitem, tileitem, position, cid)
gol1 = {
{x=328,y=240,z=7},
{x=329,y=244,z=7}
}
gol2 = {
{x=352,y=240,z=7},
{x=353,y=244,z=7}
}
poscentro2 = {x = 335,y = 242,z = 7}
poscentro1 = {x = 346,y = 242,z = 7}
if inArea(position,gol1[1],gol1[2]) then
doBroadcastMessage("Gol do time 1!")
setGlobalStorageValue(20000,getGlobalStorageValue(20000) + 1)
doRemoveItem(moveitem.uid)
doCreateItem(moveitem.itemid,poscentro1)
elseif inArea(position,gol2[1], gol2[2]) then
doBroadcastMessage("Gol do time 2!")
setGlobalStorageValue(20001,getGlobalStorageValue(20001) + 1)
doRemoveItem(moveitem.uid)
doCreateItem(moveitem.itemid,poscentro2)
end
return true
end
function inArea(p,pos1,pos2)
if p.x >= pos1.x and p.x <= pos2.x then
if p.y >= pos1.y and p.y <= pos2.y then
if p.z == pos1.z then
return true
end
end
end
return false
end
- Kod:
<movevent type="AddItem" tileitem="0" itemid="2160" event="script" value="fut.lua"/>
Screen:
Boisko musicie zrobić sami w Map Edytorze. Pozdrawiam.
Similar topics
» [NPC]Egg System
» Reborn System
» [TalkActions] Transform System
» [8.54] Absorb System
» Saga System [CreatureEvents&Npc]
» Reborn System
» [TalkActions] Transform System
» [8.54] Absorb System
» Saga System [CreatureEvents&Npc]
Strona 1 z 1
Permissions in this forum:
Nie możesz odpowiadać w tematach
|
|