Jump to content

FuriouZ

Members
  • Posts

    459
  • Joined

  • Last visited

Everything posted by FuriouZ

  1. It needs to close first function somevhere
  2. setTimer( function() guiSetText(label_totalPlayers, #getElementsByType("player").." players online") guiSetText(label_freeroamPlayers, "Online: "..countPlayersInArena("Freeroam")) guiSetText(label_currentArena, ""..getElementData(localPlayer, "Arena")) guiSetText(label_playerName, getPlayerName(localPlayer)) guiSetText(label_playerMoney, convertNumber(getPlayerMoney (localPlayer)).." $") end , 100, 0 ) -- -- -- contPlayersInArena(arenaName) local playerCount = 0 for _,player in ipairs (getElementsByType("player")) do if getElementData(player,"Arena") == arenaName then playerCount = playerCount+1 end return playerCount end local freeroamCount = countPlayersInArena("Freeroam") outputChatBox(tostring(freeroamCount),root) tryed many ways but still says nil value freeroamCount or countPlayersInArena guiSetText(label_freeroamPlayers, "Online: "..countPlayersInArena("Freeroam")) --Another way still guiSetText(label_freeroamPlayers, "Online: "..freeroamCount)
  3. countPlayersInArena a nil value guiSetText(label_freeroamPlayers, "Online: "..countPlayersInArena("Freeroam")) --Another way still guiSetText(label_freeroamPlayers, "Online: "..freeroamCount)
  4. What ? first codes working, but i want add more datas there
  5. Thanks both of you ! edit: But how i can count in another too widhout creating new function ? tried something, but it is worng function countPlayers() countFreeroamPlayers = 0 countStuntagePlayers = 0 for _, player in ipairs(getElementsByType("player")) do if (getElementData(player, "Arena") == "Freeroam") then countFreeroamPlayers = countFreeroamPlayers + 1 elseif (getElementData(player, "Arena") == "Stuntage") then countStuntagePlayers = countStuntagePlayers + 1 end end return countFreeroamPlayers, countStuntagePlayers end
  6. Hey! My question is how i can count players like countPlayersInTeam , but i want count all players who have same data Hard to explain this for example How i can count all players who's data is this ? setElementData(source, "Arena", "Freeroam")
  7. I still don't understand what is the problem ? I am setting player team in another resource addEvent("onPlayerStuntageEnter", true) addEventHandler("onPlayerStuntageEnter",getRootElement(), function() -- -- setPlayerTeam(source, Stuntage) -- -- If i join stuntage team, i still can't use "R" key .. nothing happens and there's no errors in debug
  8. I don't get it, what do you mean ? I am setting player team in another resource
  9. Hello, i have problem, that when i repair car by pressing "r", then it makes lag for the server And it you spam it, then it crashes server out , how i should fix it ? client: function fixVehicle() triggerServerEvent("stuntage:RequestFix", getLocalPlayer()) end -- -- -- ddEventHandler ( "onClientRender", root, function() local gTeam = getPlayerTeam(localPlayer) local StuntageTeam = getTeamFromName("Stuntage Arena") if ( gTeam and StuntageTeam and gTeam == StuntageTeam ) then bindKey("R","down", fixVehicle) -- -- -- server addEvent("stuntage:RequestFix",true); addEventHandler("stuntage:RequestFix",getRootElement(), function() if (isPedInVehicle (source)) then theVehicle = getPedOccupiedVehicle(source) fixVehicle(theVehicle) else cancelEvent() end end )
  10. There was some mistakes in first code, but thanks , got it working now
  11. Hello! I have a problem or question how i can bind key in client to server function I tried many ways ,but still i cant figure it out so here's the code I know the problem is in bindKey function, but i can't find correct way to do it client: addEventHandler ( "onClientResourceStart", getRootElement(), function() local gTeam = getPlayerTeam(localPlayer) local StuntageTeam = getTeamFromName("Stuntage Arena") if ( gTeam and StuntageTeam and gTeam == StuntageTeam ) then bindKey(source,"R","down", (triggerServerEvent("onPlayerRequestFix", getLocalPlayer())) else unbindKey(source,"R","down", (triggerServerEvent("onPlayerRequestFix", getLocalPlayer())) end end ) server: addEvent("onPlayerRequestFix",true); addEventHandler("onPlayerRequestFix",getRootElement(), function() if (isPedInVehicle (source)) then theVehicle = getPedOccupiedVehicle(source) fixVehicle(theVehicle) else cancelEvent() end end )
  12. Crazy, how's the process going ?
  13. Hello again! So, i have question that is possible to setTimer for eventHandler? Well, i wan't to do that the player doesn't spawn immediately if he gets killed, there will be some timer like 5 seconds and then player spawns again. Yeah, i am not good at explaining Here's something wrong, i don't really know how to do it Debug says Bad adgument @ getPlayerTeam line 115 and Bad argument @ addEventHandler [Expected function at argument 3, got lua-timer] (Widhout timer everything works fine) --Server side addEventHandler( "onPlayerWasted", getRootElement(), setTimer( function() local gPlayerTeam = getPlayerTeam(source) --Line 115 local gFreeroam = getTeamFromName("Freeroam Arena") local gStuntage = getTeamFromName("Stuntage Arena") local gHay = getTeamFromName("Hay Arena") if gPlayerTeam and gFreeroam and gPlayerTeam == gFreeroam then fadeCameraEffect() local freeroamX, freeroamY, freeroamZ, freeroamRot = unpack(freeroamSpawns[math.random(#freeroamSpawns)]) spawnPlayer(source, freeroamX, freeroamY, freeroamZ, freeroamRot) -- -- elseif gPlayerTeam and gStuntage and gPlayerTeam == gStuntage then fadeCameraEffect() local stuntageX, stuntageY, stuntageZ = unpack(stuntageSpawns[math.random(#stuntageSpawns)]) spawnPlayer(source, stuntageX, stuntageY, stuntageZ) -- -- elseif gPlayerTeam and gHay and gPlayerTeam == gHay then fadeCameraEffect() spawnPlayer(source, 6.75989, -3.06701, 3.11719, 0) -- -- end end, 1000, 1))
  14. You probably won't get anything free in this world.
  15. Dammn, i forgot that lol, thanks
  16. Hey, i have problem with guiSetText IMG: client: local usernameBox = guiCreateEdit(0.15, 0.18, 0.71, 0.13, "", true, loginWindow) local passwordBox = guiCreateEdit(0.15, 0.43, 0.71, 0.13, "", true, loginWindow) -- -- -- addEventHandler("onClientGUIClick",root, function() local regUsername = guiGetText(usernameBox) --Line 82 local regPassword = guiGetText(passwordBox) --Line 83 if source == registerButton then if regUsername ~= "" and regPassword ~= "" then triggerServerEvent("onPlayerRequestRegister",getLocalPlayer(),getLocalPlayer(),regUsername,regPassword) end end end) --#Login addEventHandler("onClientGUIClick",root, function() local logUsername = guiGetText(usernameBox) --Line 69 local logPassword = guiGetText(passwordBox) --Line 70 if source == loginButton then if logUsername ~= "" and logPassword ~= "" then triggerServerEvent("onPlayerRequestLogin", getLocalPlayer(), getLocalPlayer(), logUsername, logPassword) end end end)
  17. I know, i did example to him. And yes, i did it with 10 minutes, i took some functions from my own gamemode.
  18. 10minutes.. client: exports.scoreboard:scoreboardAddColumn("World") addEventHandler("onClientPlayerJoin", getRootElement(), function() setElementData(localPlayer, "World", "Lobby") end) --#Draw World Gui function drawWorldGUI() lobby = guiCreateWindow(0.26, 0.39, 0.48, 0.21, "World GUI", true) guiWindowSetMovable(lobby, false) guiWindowSetSizable(lobby, false) guiSetVisible(lobby,false) FreeroamBtn = guiCreateButton(0.04, 0.59, 0.30, 0.35, "Freeroam", true, lobby) StuntBtn = guiCreateButton(0.35, 0.59, 0.30, 0.35, "Stunt", true, lobby) FunBtn = guiCreateButton(0.67, 0.59, 0.30, 0.35, "FUN", true, lobby) lobbyBtn = guiCreateButton(0.66, 0.36, 0.08, 0.03, "Lobby", true) guiSetVisible(lobbyBtn,false) Info = guiCreateLabel(0.05, 0.13, 0.90, 0.42, "Welcome\nSelect world to play", true, lobby) guiSetFont(Info, "default-bold-small") guiLabelSetHorizontalAlign(Info, "center", false) guiLabelSetVerticalAlign(Info, "center") end addEventHandler("onClientResourceStart", resourceRoot, drawWorldGUI) --#Bind GUI bindKey("F1", "down", function() if guiGetVisible(lobby) == true then guiSetVisible(lobby,false) guiSetVisible(lobbyBtn,false) showCursor(false) else guiSetVisible(lobby,true) guiSetVisible(lobbyBtn,true) showCursor(true) end end) addEventHandler("onClientGUIClick", root, function() if source == FreeroamBtn then outputChatBox("Succesfully joined Freeroam World", 0, 200, 0, true) setElementData(localPlayer, "World", "Freeroam") triggerServerEvent("onPlayerFreeroamEnter", getLocalPlayer()) elseif source == StuntBtn then outputChatBox("Succesfully joined Stunt World", 0, 200, 0, true) setElementData(localPlayer, "World", "Stunt") triggerServerEvent("onPlayerStuntEnter", getLocalPlayer()) elseif source == FunBtn then outputChatBox("Succesfully joined Fun World", 0, 200, 0, true) setElementData(localPlayer, "World", "Fun") triggerServerEvent("onPlayerFunEnter", getLocalPlayer()) elseif source == LobbyBtn then outputChatBox("Succesfully joined Lobby", 0, 200, 0, true) setElementData(localPlayer, "World", "Lobby") triggerServerEvent("onPlayerLobbyEnter", getLocalPlayer()) end end) server: --#Freeroam World Functions addEvent("onPlayerFreeroamEnter", true) addEventHandler("onPlayerFreeroamEnter", getRootElement(), function() setElementDimension(source, 0) setElementInterior(source, 0) end) --#Stunt World Functions addEvent("onPlayerStuntEnter", true) addEventHandler("onPlayerStuntEnter", getRootElement(), function() setElementDimension(source, 1) setElementInterior(source, 0) end) --#Fun World Functions addEvent("onPlayerFunEnter", true) addEventHandler("onPlayerFunEnter", getRootElement(), function() setElementDimension(source, 2) setElementInterior(source, 0) end)
  19. Hello, i have a question How i can move default hay blocks to the another dimension ? I tried with setElementDimension but yeah, it works, but some blocks dissapearing and loading slow or something Here's the default server-side code --Modified by Ransom players = getElementsByType ( "player" ) scoreboardRes = getResourceFromName("scoreboard") addEventHandler("onResourceStop",getResourceRootElement(getThisResource()), function() call(scoreboardRes,"removeScoreboardColumn","Current level") call(scoreboardRes,"removeScoreboardColumn","Max level") call(scoreboardRes,"removeScoreboardColumn","Health") end ) function spawnFunct ( passedPlayer ) if (not isElement(passedPlayer)) then return false end r = 20 angle = math.random(133, 308) --random angle between 0 and 359.99 centerX = -12 centerY = -10 spawnX = r*math.cos(angle) + centerX --circle trig math spawnY = r*math.sin(angle) + centerY --circle trig math spawnAngle = 360 - math.deg( math.atan2 ( (centerX - spawnX), (centerY - spawnY) ) ) spawnPlayer ( passedPlayer, spawnX, spawnY, 3.3, spawnAngle ) end for k,v in ipairs(players) do --Game start spawn spawnFunct ( v ) end function playerJoin ( ) fadeCamera ( source, true ) spawnFunct ( source ) end addEventHandler ( "onPlayerJoin", root, playerJoin ) function playerWasted ( ) setTimer ( spawnFunct, 3000, 1, source ) end addEventHandler ( "onPlayerWasted", root, playerWasted ) -- To do: -- * Dynamic circle spawn -- Options: local options = { x = 4, y = 4, --z = 49, -- +1 z = get("levels") - 1, -- +1 --b = 245, b = get("blocks"), r = 4 } -- Don't touch below! local matrix = {} local objects = {} local moving = {} local xy_speed local z_speed local barrier_x local barrier_y local barrier_r function move () --outputDebugString("move entered") local rand repeat rand = math.random( 1, options.b ) until (moving[rand] ~= 1) local object = objects[ rand ] local move = math.random( 0, 5 ) --outputDebugString("move: " .. move) local x,y,z local x2,y2,z2 = getElementPosition ( object ) --Purge old player positions for x = 1,options.x do for y = 1,options.y do for z = 1,options.z do if (matrix[x][y][z] == 2) then matrix[x][y][z] = 0 end end end end --Fill in new player positions local players = getElementsByType( "player" ) for k,v in ipairs(players) do x,y,z = getElementPosition( v ) x = math.floor(x / -4 + 0.5) y = math.floor(y / -4 + 0.5) z = math.floor(z / 3 + 0.5) if (x >= 1) and (x <= options.x) and (y >= 1) and (y <= options.y) and (z >= 1) and (z <= options.z) and (matrix[x][y][z] == 0) then matrix[x][y][z] = 2 end end x = x2 / -4 y = y2 / -4 z = z2 / 3 if (move == 0) and (x ~= 1) and (matrix[x-1][y][z] == 0) then moving[rand] = 1 local s = 4000 - xy_speed * z setTimer (done, s, 1, rand, x, y, z) x = x - 1 matrix[x][y][z] = 1 --outputDebugString("moving obj") moveObject ( object, s, x2 + 4, y2, z2, 0, 0, 0 ) elseif (move == 1) and (x ~= options.x) and (matrix[x+1][y][z] == 0) then moving[rand] = 1 local s = 4000 - xy_speed * z setTimer (done, s, 1, rand, x, y, z) x = x + 1 matrix[x][y][z] = 1 --outputDebugString("moving obj") moveObject ( object, s, x2 - 4, y2, z2, 0, 0, 0 ) elseif (move == 2) and (y ~= 1) and (matrix[x][y-1][z] == 0) then moving[rand] = 1 local s = 4000 - xy_speed * z setTimer (done, s, 1, rand, x, y, z) y = y - 1 matrix[x][y][z] = 1 --outputDebugString("moving obj") moveObject ( object, s, x2, y2 + 4, z2, 0, 0, 0 ) elseif (move == 3) and (y ~= options.y) and (matrix[x][y+1][z] == 0) then moving[rand] = 1 local s = 4000 - xy_speed * z setTimer (done, s, 1, rand, x, y, z) y = y + 1 matrix[x][y][z] = 1 --outputDebugString("moving obj") moveObject ( object, s, x2, y2 - 4, z2, 0, 0, 0 ) elseif (move == 4) and (z ~= 1) and (matrix[x][y][z-1] == 0) then moving[rand] = 1 local s = 3000 - z_speed * z setTimer (done, s, 1, rand, x, y, z) z = z - 1 matrix[x][y][z] = 1 --outputDebugString("moving obj") moveObject ( object, s, x2, y2, z2 - 3, 0, 0, 0 ) elseif (move == 5) and (z ~= options.z) and ((matrix[x][y][z+1] == 0) or ((z ~= options.z-1) and (matrix[x][y][z+1] == 2) and (matrix[x][y][z+2] ~= 1))) then moving[rand] = 1 local s = 3000 - z_speed * z setTimer (done, s, 1, rand, x, y, z) z = z + 1 matrix[x][y][z] = 1 --outputDebugString("moving obj") moveObject ( object, s, x2, y2, z2 + 3, 0, 0, 0 ) end -- setTimer ("move", 100 ) end function onThisResourceStart ( ) call(scoreboardRes,"addScoreboardColumn","Current level") call(scoreboardRes,"addScoreboardColumn","Max level") call(scoreboardRes,"addScoreboardColumn","Health") --outputChatBox("* Haystack-em-up v1.44 by Aeron", root, 255, 100, 100) --PFF meta is good enough --Calculate speed velocity xy_speed = 2000 / (options.z + 1) z_speed = 1500 / (options.z + 1) --Clean matrix for x = 1,options.x do matrix[x] = {} for y = 1,options.y do matrix[x][y] = {} for z = 1,options.z do matrix[x][y][z] = 0 end end end --Place number of haybails in matrix local x,y,z for count = 1,options.b do repeat x = math.random ( 1, options.x ) y = math.random ( 1, options.y ) z = math.random ( 1, options.z ) until (matrix[x][y][z] == 0) matrix[x][y][z] = 1 objects[count] = createObject ( 3374, x * -4, y * -4, z * 3 ) --, math.random ( 0, 3 ) * 90, math.random ( 0, 1 ) * 180 , math.random ( 0, 1 ) * 180 ) end --Place number of rocks in matrix for count = 1,options.r do repeat x = math.random ( 1, options.x ) y = math.random ( 1, options.y ) z = math.random ( 1, options.z ) until (matrix[x][y][z] == 0) matrix[x][y][z] = 1 createObject ( 1305, x * -4, y * -4, z * 3, math.random ( 0, 359 ), math.random ( 0, 359 ), math.random ( 0, 359 ) ) end --Calculate tower center and barrier radius barrier_x = (options.x + 1) * -2 barrier_y = (options.y + 1) * -2 if (options.x > options.y) then barrier_r = options.x / 2 + 20 else barrier_r = options.y / 2 + 20 end --Place top-haybail + minigun createObject ( 3374, barrier_x, barrier_y, options.z * 3 + 3 ) thePickup = createPickup ( barrier_x, barrier_y, options.z * 3 + 6, 3, 2880, 1 ) setTimer ( move, 100, 0 ) setTimer ( barrier, 1000, 1) fadeCamera ( getRootElement(), true ) end function barrier () local barrier = createColCircle ( barrier_x, barrier_y, barrier_r ) addEventHandler ( "onColShapeLeave", barrier, function ( p ) if ( getElementType ( p ) == "player" ) then killPed ( p ) outputChatBox( "* Killed: Don't walk away.", p, 255, 100, 100 ) end end ) end function onPickupHit ( player ) if source == thePickup then outputChatBox( "* " .. getPlayerName ( player ) .. " made it to the top!", root, 255, 100, 100, false ) toggleControl ( player, "fire", true ) destroyElement( source ) end end function done ( id, x, y, z ) moving[id] = 0 matrix[x][y][z] = 0 end --addEventHandler( "onResourceStart", root, function() onMapLoad() end) --addEventHandler( "onPickupHit", root, function() onPickupHit() end) --addEventHandler( "onPlayerJoin", root, function() onPlayerJoin() end) addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), onThisResourceStart) addEventHandler( "onPickupHit", root, onPickupHit) Here's my edited version --Modified by Ransom players = getElementsByType ( "player" ) scoreboardRes = getResourceFromName("scoreboard") addEventHandler("onResourceStop",getResourceRootElement(getThisResource()), function() call(scoreboardRes,"removeScoreboardColumn","Current level") call(scoreboardRes,"removeScoreboardColumn","Max level") call(scoreboardRes,"removeScoreboardColumn","Health") end ) --[[ function spawnFunct ( passedPlayer ) if (not isElement(passedPlayer)) then return false end r = 20 angle = math.random(133, 308) --random angle between 0 and 359.99 centerX = -12 centerY = -10 spawnX = r*math.cos(angle) + centerX --circle trig math spawnY = r*math.sin(angle) + centerY --circle trig math spawnAngle = 360 - math.deg( math.atan2 ( (centerX - spawnX), (centerY - spawnY) ) ) spawnPlayer ( passedPlayer, spawnX, spawnY, 3.3, spawnAngle ) setElementDimension(passedPlayer, 3) end for k,v in ipairs(players) do --Game start spawn spawnFunct ( v ) end ]] function playerJoin ( ) fadeCamera ( source, true ) spawnFunct ( source ) end addEventHandler ( "onPlayerJoin", root, playerJoin ) function playerWasted ( ) setTimer ( spawnFunct, 3000, 1, source ) end addEventHandler ( "onPlayerWasted", root, playerWasted ) -- To do: -- * Dynamic circle spawn -- Options: local options = { x = 4, y = 4, --z = 49, -- +1 z = get("levels") - 1, -- +1 --b = 245, b = get("blocks"), r = 4 } -- Don't touch below! local matrix = {} local objects = {} local moving = {} local xy_speed local z_speed local barrier_x local barrier_y local barrier_r function move () --outputDebugString("move entered") local rand repeat rand = math.random( 1, options.b ) until (moving[rand] ~= 1) local object = objects[ rand ] --Shodown settings setElementDimension(object, 3) local move = math.random( 0, 5 ) --outputDebugString("move: " .. move) local x,y,z local x2,y2,z2 = getElementPosition ( object ) --Purge old player positions for x = 1,options.x do for y = 1,options.y do for z = 1,options.z do if (matrix[x][y][z] == 2) then matrix[x][y][z] = 0 end end end end --Fill in new player positions local players = getElementsByType( "player" ) for k,v in ipairs(players) do x,y,z = getElementPosition( v ) x = math.floor(x / -4 + 0.5) y = math.floor(y / -4 + 0.5) z = math.floor(z / 3 + 0.5) if (x >= 1) and (x <= options.x) and (y >= 1) and (y <= options.y) and (z >= 1) and (z <= options.z) and (matrix[x][y][z] == 0) then matrix[x][y][z] = 2 end end x = x2 / -4 y = y2 / -4 z = z2 / 3 if (move == 0) and (x ~= 1) and (matrix[x-1][y][z] == 0) then moving[rand] = 1 local s = 4000 - xy_speed * z setTimer (done, s, 1, rand, x, y, z) x = x - 1 matrix[x][y][z] = 1 --outputDebugString("moving obj") moveObject ( object, s, x2 + 4, y2, z2, 0, 0, 0 ) elseif (move == 1) and (x ~= options.x) and (matrix[x+1][y][z] == 0) then moving[rand] = 1 local s = 4000 - xy_speed * z setTimer (done, s, 1, rand, x, y, z) x = x + 1 matrix[x][y][z] = 1 --outputDebugString("moving obj") moveObject ( object, s, x2 - 4, y2, z2, 0, 0, 0 ) elseif (move == 2) and (y ~= 1) and (matrix[x][y-1][z] == 0) then moving[rand] = 1 local s = 4000 - xy_speed * z setTimer (done, s, 1, rand, x, y, z) y = y - 1 matrix[x][y][z] = 1 --outputDebugString("moving obj") moveObject ( object, s, x2, y2 + 4, z2, 0, 0, 0 ) elseif (move == 3) and (y ~= options.y) and (matrix[x][y+1][z] == 0) then moving[rand] = 1 local s = 4000 - xy_speed * z setTimer (done, s, 1, rand, x, y, z) y = y + 1 matrix[x][y][z] = 1 --outputDebugString("moving obj") moveObject ( object, s, x2, y2 - 4, z2, 0, 0, 0 ) elseif (move == 4) and (z ~= 1) and (matrix[x][y][z-1] == 0) then moving[rand] = 1 local s = 3000 - z_speed * z setTimer (done, s, 1, rand, x, y, z) z = z - 1 matrix[x][y][z] = 1 --outputDebugString("moving obj") moveObject ( object, s, x2, y2, z2 - 3, 0, 0, 0 ) elseif (move == 5) and (z ~= options.z) and ((matrix[x][y][z+1] == 0) or ((z ~= options.z-1) and (matrix[x][y][z+1] == 2) and (matrix[x][y][z+2] ~= 1))) then moving[rand] = 1 local s = 3000 - z_speed * z setTimer (done, s, 1, rand, x, y, z) z = z + 1 matrix[x][y][z] = 1 --outputDebugString("moving obj") moveObject ( object, s, x2, y2, z2 + 3, 0, 0, 0 ) end -- setTimer ("move", 100 ) end function onThisResourceStart ( ) --outputChatBox("* Haystack-em-up v1.44 by Aeron", root, 255, 100, 100) --PFF meta is good enough --Calculate speed velocity xy_speed = 2000 / (options.z + 1) z_speed = 1500 / (options.z + 1) --Clean matrix for x = 1,options.x do matrix[x] = {} for y = 1,options.y do matrix[x][y] = {} for z = 1,options.z do matrix[x][y][z] = 0 end end end --Place number of haybails in matrix local x,y,z for count = 1,options.b do repeat x = math.random ( 1, options.x ) y = math.random ( 1, options.y ) z = math.random ( 1, options.z ) until (matrix[x][y][z] == 0) matrix[x][y][z] = 1 objects[count] = createObject ( 3374, x * -4, y * -4, z * 3 ) --, math.random ( 0, 3 ) * 90, math.random ( 0, 1 ) * 180 , math.random ( 0, 1 ) * 180 ) setElementDimension ( objects[count], 2 ) end --Place number of rocks in matrix for count = 1,options.r do repeat x = math.random ( 1, options.x ) y = math.random ( 1, options.y ) z = math.random ( 1, options.z ) until (matrix[x][y][z] == 0) matrix[x][y][z] = 1 --Shodown settings rocks = createObject ( 1305, x * -4, y * -4, z * 3, math.random ( 0, 359 ), math.random ( 0, 359 ), math.random ( 0, 359 ) ) setElementDimension(rocks, 3) end --Calculate tower center and barrier radius barrier_x = (options.x + 1) * -2 barrier_y = (options.y + 1) * -2 if (options.x > options.y) then barrier_r = options.x / 2 + 20 else barrier_r = options.y / 2 + 20 end --Place top-haybail + minigun mg = createObject ( 3374, barrier_x, barrier_y, options.z * 3 + 3 ) setElementDimension(mg, 3) thePickup = createPickup ( barrier_x, barrier_y, options.z * 3 + 6, 3, 2880, 1 ) setElementDimension(thePickup, 3) setTimer ( move, 100, 0 ) --setTimer ( barrier, 1000, 1) fadeCamera ( getRootElement(), true ) end --[[ function barrier () local barrier = createColCircle ( barrier_x, barrier_y, barrier_r ) addEventHandler ( "onColShapeLeave", barrier, function ( p ) if ( getElementType ( p ) == "player" ) then killPed ( p ) outputChatBox( "* Killed: Don't walk away.", p, 255, 100, 100 ) end end ) end ]] function onPickupHit ( player ) if source == thePickup then outputChatBox( "* " .. getPlayerName ( player ) .. " made it to the top!", root, 255, 100, 100, false ) toggleControl ( player, "fire", true ) destroyElement( source ) end end function done ( id, x, y, z ) moving[id] = 0 matrix[x][y][z] = 0 end --addEventHandler( "onResourceStart", root, function() onMapLoad() end) --addEventHandler( "onPickupHit", root, function() onPickupHit() end) --addEventHandler( "onPlayerJoin", root, function() onPlayerJoin() end) addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), onThisResourceStart) addEventHandler( "onPickupHit", root, onPickupHit)
  20. FuriouZ

    clear debug?

    Hello, is there any way to clear debugscript log ? Widhout restarting server. Thanks
×
×
  • Create New...