Nos sziasztok! Azzal a kérdéssel fordulok felétek,hogy van az alap ZeroMTA avagy Valhalla-ban az árvíz script. És ha beírom mta.config file-ba akkor magától elindul. Azt szeretném megcsinálni,hogy ne induljon el csak egy bizonyos parancsra. Ez lehetséges?
local targetLevel = 20 -- Client side
local duration = 3600000
local startTick
local currentLevel = 0
addEventHandler(\'onClientResourceStart\', resourceRoot,
function()
startTick = getTickCount()
triggerServerEvent(\'onPlayerReady\', resourceRoot)
end
)
local function render()
resetWaterColor()
local passed = getTickCount() - startTick
if passed >= duration then
setWaterLevel(targetLevel)
removeEventHandler(\'onClientRender\', root, render)
return
end
setWaterLevel(targetLevel * (passed/duration))
end
addEventHandler(\'onClientRender\', root, render)
addEvent(\'doSetWaterLevel\', true)
addEventHandler(\'doSetWaterLevel\', resourceRoot,
function(level)
setWaterLevel(level)
currentLevel = level
startTick = getTickCount() - duration*(level/targetLevel)
end
)
local startTick -- Server side
local targetLevel = 20
local duration = 3600000
addEventHandler(\'onResourceStart\', resourceRoot,
function()
createWater(-2998, -2998, 0, 2998, -2998, 0, -2998, 2998, 0, 2998, 2998, 0)
startTick = getTickCount()
end
)
addEvent(\'onPlayerReady\', true)
addEventHandler(\'onPlayerReady\', resourceRoot,
function()
local passed = getTickCount() - startTick
if passed > duration then
passed = duration
end
triggerClientEvent(client, \'doSetWaterLevel\', resourceRoot, targetLevel * (passed/duration))
end
)