Siemka mam skrypt na bramy kt?re otwieraj? si? graczowi z danym UID.
Lecz gdy chce aby brama si? dla mnie otworzy?a to niestety nie dzia?a to. A w DB3 te? czystko a tak?e UID te? dobre poda?em.
Daje kod:
local uprawnieniaSkin = {
[ID]=true; -- tutaj wpisz id skina [ID]
}
local gate={
-- var
object=createObject(5020, 1811.74, -1889.56, 13.41, 0, 0, 90),
marker=createMarker(1811.74, -1889.56, 13.41, "cylinder", 6, 0, 0, 0, 0),
closed=true,
animation=false,
}
gate.open=function()
if gate.animation or not gate.closed then return end
gate.animation=true
moveObject(gate.object, 5000, 1811.74, -1889.56, 10.41, 0, 0, 0, "OutQuad")
setTimer(function()
gate.animation=false; gate.closed=false
end, 6000, 1)
end
gate.close=function()
if gate.closed then return end
gate.animation=true
moveObject(gate.object, 5000, 1811.74, -1889.56, 13.41, 0, 0, 0, "OutQuad")
setTimer(function()
gate.animation=false; gate.closed=true
end, 6000, 1)
end
gate.toggle=function(el)
if not el then return end
local skin = getElementModel (thePlayer)
if uprawnieniaSkin[skin] then
if gate.animation then
return
end
if gate.closed then
gate.open()
setTimer(function()
gate.close()
end, 8000, 1)
end
end
else
outputChatBox("* Brak uprawnien.", el, 255, 0, 0)
end
end
addEventHandler("onMarkerHit", gate.marker, function(el,md)
gate.toggle(el)
end)
Niestety jakie? b??dy w DB3:
ERROR: Loading script failed: [XyzzyRP]/[obiekty]/wb-baza_gangu/brama.lua:53: 'end' expected (to close 'function' at line 37) near 'else'
Pisa?em z g?owy i nie zauwa?y?em, ?e nie da?em end. Teraz powinno by? poprawnie,
local uprawnieniaSkin = {
[ID]=true; -- tutaj wpisz id skina [ID]
}
local gate={
-- var
object=createObject(5020, 1811.74, -1889.56, 13.41, 0, 0, 90),
marker=createMarker(1811.74, -1889.56, 13.41, "cylinder", 6, 0, 0, 0, 0),
closed=true,
animation=false,
}
gate.open=function()
if gate.animation or not gate.closed then return end
gate.animation=true
moveObject(gate.object, 5000, 1811.74, -1889.56, 10.41, 0, 0, 0, "OutQuad")
setTimer(function()
gate.animation=false; gate.closed=false
end, 6000, 1)
end
gate.close=function()
if gate.closed then return end
gate.animation=true
moveObject(gate.object, 5000, 1811.74, -1889.56, 13.41, 0, 0, 0, "OutQuad")
setTimer(function()
gate.animation=false; gate.closed=true
end, 6000, 1)
end
gate.toggle=function(el)
if not el then return end
local skin = getElementModel (thePlayer)
if uprawnieniaSkin[skin] then
if gate.animation then
return
end
end
if gate.closed then
gate.open()
setTimer(function()
gate.close()
end, 8000, 1)
end
else
outputChatBox("* Brak uprawnien.", el, 255, 0, 0)
end
end
addEventHandler("onMarkerHit", gate.marker, function(el,md)
gate.toggle(el)
end)
Co? nie dodaje mi tego end. Musisz wsadzi? end po funkcji if. Zaraz przetestuj? to Ci pode?l?
Teraz powinno by?, ok. Wkrad? si? b??d z end...
Jak co? to testowa?em na id skina: 280 - mo?esz zmieni?
createBlip (1811.74, -1889.56, 10.41, 50)
local uprawnieniaSkin = {
[280]=true; -- tutaj wpisz id skina [ID]
}
local gate={
-- var
object=createObject(5020, 1811.74, -1889.56, 13.41, 0, 0, 90),
marker=createMarker(1811.74, -1889.56, 13.41, "cylinder", 6, 0, 0, 0, 0),
closed=true,
animation=false,
}
gate.open=function()
if gate.animation or not gate.closed then return end
gate.animation=true
moveObject(gate.object, 5000, 1811.74, -1889.56, 10.41, 0, 0, 0, "OutQuad")
setTimer(function()
gate.animation=false; gate.closed=false
end, 6000, 1)
end
gate.close=function()
if gate.closed then return end
gate.animation=true
moveObject(gate.object, 5000, 1811.74, -1889.56, 13.41, 0, 0, 0, "OutQuad")
setTimer(function()
gate.animation=false; gate.closed=true
end, 6000, 1)
end
gate.toggle=function(el)
if not el then return end
local skin = getElementModel (el)
if uprawnieniaSkin[skin] then
if gate.animation then
return
end
if gate.closed then
gate.open()
setTimer(function()
gate.close()
end, 8000, 1)
end
else
outputChatBox("* Brak uprawnien.", el, 255, 0, 0)
end
end
addEventHandler("onMarkerHit", gate.marker, function(el,md)
gate.toggle(el)
end)
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach