Skder
Wiek: 26 Na forum: 3063 dni Posty: 3
Nick w MP: Maximus
Piwa : 3
Witam, mam skrypt pow?dz, ale chce zeby ona by?a do okreslonej wysoko?ci a ona moze unosi? si? nieskonczono?c w g?r? a chcia? bym ?eby mniej wiecej max 3/4 zala?o mc, pom?g? by mi kto? w tym? jestem zielony
local level = 0
function floodSA ( source , command , speed )
if ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( source )), aclGetGroup ( "Admin" ))) then
if ( speed ) then
if ( isTimer ( waterTimer )) then
killTimer ( waterTimer )
destroyElement ( floodWater )
setWaterLevel ( 0 )
level = 0
outputDebugString ( "Poprzednie powodzie zosta?y zatrzymane przez serwer." )
end
local speed = tonumber ( speed )
floodWater = createWater (- 2998 ,- 2998 , 0 , 2998 ,- 2998 , 0 ,- 2998 , 2998 , 0 , 2998 , 2998 , 0 )
-- outputChatBox ( "--------------------------------" , getRootElement (), 255 , 0 , 0 )
-- outputChatBox ( "[i] POW?DZ! Udaj si? na wysok? g?re(np MC) aby przetrwa?![i]" , getRootElement (), 255 , 0 , 0 )
-- outputChatBox ( "--------------------------------" , getRootElement (), 255 , 0 , 0 )
waterTimer = setTimer ( addSomeWater , 100 , 0 , speed )
outputDebugString ( "Flooding started by " .. getPlayerName ( source ).. " at a speed of " .. speed .. "." )
else
outputChatBox ( "Musisz okre?li? pr?dko??." , source , 255 , 0 , 0 )
end
else
outputChatBox ( "Musisz by? administratorem, aby tego uzy?!!" , source , 255 , 0 , 0 )
end
end
addCommandHandler ( "powodz" , floodSA )
function addSomeWater ( speed )
level = level + speed / 100
setWaterLevel ( level )
end
function stopFlood ( source , command )
if ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( source )), aclGetGroup ( "Admin" ))) then
if ( isTimer ( waterTimer )) then
killTimer ( waterTimer )
destroyElement ( floodWater )
setWaterLevel ( 0 )
level = 0
outputDebugString ( "Flooding stopped by " .. getPlayerName ( source ).. "." )
-- outputChatBox ( "THE FLOOD HAS PASSED, RETURN TO YOUR HOMES!" , getRootElement (), 255 , 0 , 0 )
else
outputChatBox ( "There is no flood to stop." , source , 255 , 0 , 0 )
end
else
outputChatBox ( "musisz by? administratorem, aby u?y? tego polecenia!" , source , 255 , 0 , 0 )
end
end
addCommandHandler ( "powodz-stop" , stopFlood )
function resetWater ()
setWaterLevel ( 0 )
end
addEventHandler ( "onResourceStop" , getResourceRootElement ( getThisResource ()), resetWater )
Ostatnio zmieniony przez Atroth 2018-05-19, 13:07, w całości zmieniany 2 razy