Szakal
Frank Jaeger
Its possible to work on 2.0 rev 20? P
Its possible to work on 2.0 rev 20? P
function onUse(cid, item, fromPosition, itemEx, toPosition)
--script maked by Fare, for otland community.
--position of players when pressing switch, change to yourselfs coordinates
local pos1 = {x=875, y=556, z=7, stackpos=1}
local pos2 = {x=874, y=557, z=7, stackpos=1}
local pos3 = {x=874, y=555, z=7, stackpos=1}
local pos4 = {x=910, y=556, z=7, stackpos=1}
local pos5 = {x=911, y=557, z=7, stackpos=1}
local pos6 = {x=911, y=555, z=7, stackpos=1}
-- end of positions
local player1 = getThingfromPos(pos1)
local player2 = getThingfromPos(pos2)
local player3 = getThingfromPos(pos3)
local player4 = getThingfromPos(pos4)
local player5 = getThingfromPos(pos5)
local player6 = getThingfromPos(pos6)
local teleportpos = {x=892, y=556, z=7, stackpos=1} --middle of your soccer field, ball will spawn here
local getteleport = getThingfromPos(teleportpos)
if getteleport.itemid == 1387 then
if isPlayer(player1.uid) == TRUE and isPlayer(player2.uid) == TRUE and isPlayer(player3.uid) == TRUE and isPlayer(player4.uid) == TRUE and isPlayer(player5.uid) == TRUE and isPlayer(player6.uid) == TRUE then
local pos11 = {x=884, y=556, z=7, stackpos=1}
local pos22 = {x=883, y=557, z=7, stackpos=1}
local pos33 = {x=883, y=555, z=7, stackpos=1}
local pos44 = {x=900, y=556, z=7, stackpos=1}
local pos55 = {x=901, y=557, z=7, stackpos=1}
local pos66 = {x=901, y=555, z=7, stackpos=1}
local team1 = getPlayerGUIDByName(getCreatureName(player1.uid))
local team2 = getPlayerGUIDByName(getCreatureName(player4.uid))
setGlobalStorageValue(15024, 0)
setGlobalStorageValue(15025, 0)
setGlobalStorageValue(15026, team1)
setGlobalStorageValue(15027, team2)
setGlobalStorageValue(15029, 0)
broadcastMessage("Football match with "..getPlayerName(player1.uid).."s team and "..getPlayerName(player4.uid).."s team started!", MESSAGE_EVENT_ADVANCE)
doTeleportThing(player1.uid,pos11,0)
doTeleportThing(player2.uid,pos22,0)
doTeleportThing(player3.uid,pos33,0)
doTeleportThing(player4.uid,pos44,0)
doTeleportThing(player5.uid,pos55,0)
doTeleportThing(player6.uid,pos66,0)
doRemoveItem(getteleport.uid,1)
doCreateItem(2109,1,teleportpos)
else
doPlayerSendTextMessage(cid, 22, "You need 2 teams, 3 players in each team, to start the match!")
end
else
doPlayerSendTextMessage(cid, 22, "Need wait until previous command will end the match!")
end
end
@Up
I dont know too ;/
It will work if i change getPlayerGUIDByName to getPlayerName or getCreatureName ?
function onAddItem(moveitem, tileitem, position)
-- middle pos of soccers field, change it to position where ust be your ball spawned!
local ballpos = {x=72, y=384, z=7, stackpos=1}
local ball = getThingfromPos(ballpos)
local komanda1 = "First team"
local komanda2 = "Second team"
if tileitem.actionid == 15027 and moveitem.itemid == 2109 then
local wet = getGlobalStorageValue(15025) + 1
local wet2 = getGlobalStorageValue(15024)
doRemoveItem(moveitem.uid, 1)
doSendMagicEffect(ballpos, 5)
setGlobalStorageValue(15025, wet)
if getGlobalStorageValue(15025) ~= 3 then
doCreateItem(2109, 1, ballpos)
end
doBroadcastMessage("GOOL!!! "..komanda2.."'s team score! "..wet2.." : " ..wet.. " !", MESSAGE_EVENT_ADVANCE)
if getGlobalStorageValue(15025) == 3 then
doBroadcastMessage("Game over! "..komanda2.."'s team win! "..wet2.." : " ..wet.. " !", MESSAGE_EVENT_ADVANCE)
doSetItemActionId(doCreateItem(8058, 1, ballpos), 15029)
end
elseif tileitem.actionid == 15028 and moveitem.itemid == 2109 then
local wet3 = getGlobalStorageValue(15024) + 1
local wet4 = getGlobalStorageValue(15025)
doRemoveItem(moveitem.uid, 1)
doSendMagicEffect(ballpos, 5)
setGlobalStorageValue(15024, wet3)
if getGlobalStorageValue(15024) ~= 3 then
doCreateItem(2109, 1, ballpos)
end
doBroadcastMessage("GOOL!!! "..komanda1.."'s team score! "..wet3.." : " ..wet4.. " !", MESSAGE_EVENT_ADVANCE)
if getGlobalStorageValue(15024) == 3 then
doBroadcastMessage("Game over! "..komanda1.."'s team win! "..wet3.." : " ..wet4.. " !", MESSAGE_EVENT_ADVANCE)
doSetItemActionId(doCreateItem(8058, 1, ballpos), 15029)
end
end
return TRUE
end
can you put the map to download?
[30/12/2003 11:15:25] Lua Script Error: [MoveEvents Interface]
[30/12/2003 11:15:25] data/movements/scripts/football.lua:onAddItem
[30/12/2003 11:15:25] luaGetThingfromPos(). Tile not found
[30/12/2003 11:15:25] Lua Script Error: [MoveEvents Interface]
[30/12/2003 11:15:25] data/movements/scripts/football.lua:onAddItem
[30/12/2003 11:15:25] data/movements/scripts/football.lua:5: attempt to call global 'getPlayerNameByGUID' (a nil value)
[30/12/2003 11:15:25] stack traceback:
[30/12/2003 11:15:25] data/movements/scripts/football.lua:5: in function <data/movements/scripts/football.lua:1>
Who help me?:|Code:[30/12/2003 11:15:25] Lua Script Error: [MoveEvents Interface] [30/12/2003 11:15:25] data/movements/scripts/football.lua:onAddItem [30/12/2003 11:15:25] luaGetThingfromPos(). Tile not found [30/12/2003 11:15:25] Lua Script Error: [MoveEvents Interface] [30/12/2003 11:15:25] data/movements/scripts/football.lua:onAddItem [30/12/2003 11:15:25] data/movements/scripts/football.lua:5: attempt to call global 'getPlayerNameByGUID' (a nil value) [30/12/2003 11:15:25] stack traceback: [30/12/2003 11:15:25] data/movements/scripts/football.lua:5: in function <data/movements/scripts/football.lua:1>
[30/12/2003 19:27:12] Lua Script Error: [Action Interface]
[30/12/2003 19:27:12] data/actions/scripts/football.lua:onUse
[30/12/2003 19:27:12] data/actions/scripts/football.lua:34: attempt to call global 'doBroadcastMessage' (a nil value)
[30/12/2003 19:27:12] stack traceback:
[30/12/2003 19:27:12] data/actions/scripts/football.lua:34: in function <data/actions/scripts/football.lua:1>
Whats now?! :-(Code:[30/12/2003 19:27:12] Lua Script Error: [Action Interface] [30/12/2003 19:27:12] data/actions/scripts/football.lua:onUse [30/12/2003 19:27:12] data/actions/scripts/football.lua:34: attempt to call global 'doBroadcastMessage' (a nil value) [30/12/2003 19:27:12] stack traceback: [30/12/2003 19:27:12] data/actions/scripts/football.lua:34: in function <data/actions/scripts/football.lua:1>
Help plix, I make Football Event
EDITED.
TFS 2.xx for 8.4 :huh::huh:what server do you use? it have "doBroadcastMessage" function?
doBroadcastMessage("Football match with "..getPlayerName(player1.uid).."'s team and "..getPlayerName(player4.uid).."'s team started!", MESSAGE_EVENT_ADVANCE)
broadcastMessage("Football match with "..getPlayerName(player1.uid).."'s team and "..getPlayerName(player4.uid).."'s team started!", MESSAGE_EVENT_ADVANCE)
working on 0.3 beta 2?