Code:
--football
function kop(cid, odleglosc, dir)
if(dir=='auto')then
whatDir = getPlayerLookDir(cid)
end
local newpos = getPlayerPosition(cid)
if(whatDir==1)then
newpos.x = newpos.x + odleglosc
elseif(whatDir==2)then
newpos.y = newpos.y + odleglosc
elseif(whatDir==3)then
newpos.x = newpos.x - odleglosc
elseif(whatDir==0)then
newpos.y = newpos.y - odleglosc
end
doCreateItem(2109,1,newpos)
end
function onStepIn(cid, item, pos)
local odleglosc = {1} -- jak daleko ma kopnoc
local strona = {'auto'} -- strona w ktora ma kopnoc
for i=1, #odleglosc do
kop(cid, odleglosc[i], strona[i])
doPlayerSay(cid, 'Gola!!', 16)
doSendMagicEffect(getPlayerPosition(cid), 1)
doRemoveItem(item.uid,1)
end
end
Last edited: