Jump to content

DNL291

Retired Staff
  • Posts

    3,875
  • Joined

  • Days Won

    67

Everything posted by DNL291

  1. Open fr_client.lua and search for the table "wndMain", there you can create the Arena button on the "controls" sub-table. You'll need to create an exported function to be able to open the Arena menu through the freeroam.
  2. Aqui no fórum tem um local em que você pode denunciar esse servidor. Te recomendo fazer sua postagem aqui: Por favor, use um tradutor para que entendam. A linguagem em Português é usada apenas neste local aqui. Se demorarem pra responder, você pode contatar um Admin diretamente, de preferência o ccw.
  3. Você deve ter um anti-vírus, por favor instale um programa e veja se o problema continua. Edit: te recomendo fazer uma verificação assim que instalar o anti-vírus.
  4. I can't see anything wrong by looking at the code, try debugging it: addCommandHandler("exitarena", function (Jogador) if (getElementData(Jogador, "MultiGM")) then if Vehicle[Jogador] and isElement(Vehicle[Jogador]) then destroyElement(Vehicle[Jogador]) end removeElementData(Jogador, "MultiGM") setElementDimension(Jogador, 0) killPed(Jogador) triggerClientEvent(Jogador, getResourceName(getThisResource())..": textScreen", root, "You've left the arena successfully!") --local currentteam = getPlayerTeam (Jogador) -- gets the current players team outputChatBox( "old team: "..tostring(aPlayers[Jogador]) ) outputChatBox( "old team name: "..tostring(getTeamName(aPlayers[Jogador])) ) setPlayerTeam (Jogador, aPlayers[Jogador]) -- sets the team to the one which the player had previously before joining the arena local count1 = countPlayersInTeam (newTeam1) local count2 = countPlayersInTeam (newTeam2) local count3 = countPlayersInTeam (newTeam3) if count1==0 then destroyElement(newTeam1) outputChatBox ( "Miltants have been eliminated." ) end if count2==0 then destroyElement(newTeam2) outputChatBox ( "Invaders have been eliminated." ) end if count3==0 then destroyElement(newTeam3) outputChatBox ( "Insurgents have been eliminated." ) end end end ) See what outputChatBox shows. Add something like this to your Clan tag script: if getElementData(player, "MultiGM") then return outputChatBox() end
  5. Qual anti-vírus você tá usando? Esse tipo de erro pode ser por causa do anti-vírus.
  6. I've edited the code and added that function you mentioned in order to keep all teams balanced, haven't tested it though. Try this: addEventHandler ("onResourceStart", getResourceRootElement(getThisResource()), function() local allGreenzones = getElementsByType ("radararea") for i,v in ipairs (allGreenzones) do local r, g, b, a = getRadarAreaColor (v) if (r == 255) and (g == 0) and (b == 0) and (a == 255) then local x, y = getElementPosition (v) local sx, sy = getRadarAreaSize (v) setRadarAreaFlashing(v, true) local col = createColCuboid (x, y, -50, sx, sy, 7500) setElementID (col, "ColShapeMultiGameMode") end end end ) spawnVehPositions = { {-1292.8455810547, -364.38061523438, 15.8}, {-1350.6311035156, -258.98291015625, 14.14396572113}, {-1467.52734375, -190.3069152832, 14.1484375}, {-1620.8626708984, -51.465915679932, 3.5595684051514}, {-1620.2762451172, -590.58685302734, 14.1484375}, } spawnarena2Positionsmilitants = { {789.79999, -2120.3999, 14.1484375}, {795.5, -2228, 15.4}, {795.70001, -2218.8, 15.2}, } spawnarena2Positionsinvaders = { {649.29999, -2409.3, 83}, {623.40002, -2498.3999, 71.9}, {623.70001, -2497.8, 71.9}, } spawnarena2Positionsinsurgents = { {502.20001, -2297.2, 124.6}, {456.60001, -2256.8999, 128.3}, {450.29999, -2258.3, 128.3}, } addEventHandler("onColShapeLeave", root, function (Jogador) if (getElementData(Jogador, "MultiGM") and getElementByID("ColShapeMultiGameMode")) then if (not getElementData(Jogador, "Morreu")) then if (Vehicle[Jogador] and isElement(Vehicle[Jogador])) then destroyElement(Vehicle[Jogador]) triggerClientEvent(Jogador, getResourceName(getThisResource())..": textScreen", root, "#ffffffWarning:-You've crossed the arena boundary!") end removeElementData(Jogador, "MultiGM") end end end ) addEventHandler("onColShapeHit", root, function (Jogador) if (not getElementData(Jogador, "MultiGM")) and getElementByID("ColShapeMultiGameMode") then if ( getElementDimension(Jogador) == 1 ) then setElementData(Jogador, "MultiGM", "Hydra") elseif ( getElementDimension(Jogador) == 2) then setElementData(Jogador, "MultiGM", "Hunter") end end end ) Vehicle = {} function spawnVehMarker (Jogador) if (getElementDimension(Jogador) == 2) then if (Vehicle[Jogador] and isElement(Vehicle[Jogador])) then destroyElement(Vehicle[Jogador]) end local x, y, z = getElementPosition(Jogador) Vehicle[Jogador] = createVehicle(425, x, y, z+1) --warpPedIntoVehicle(Jogador, Vehicle[Jogador]) setElementData(Jogador, "MultiGM", "Hunter") elseif ( getElementDimension(Jogador) == 1 ) then if (Vehicle[Jogador] and isElement(Vehicle[Jogador])) then destroyElement(Vehicle[Jogador]) end local x, y, z = getElementPosition(Jogador) Vehicle[Jogador] = createVehicle(520, x, y, z+1) --warpPedIntoVehicle(Jogador, Vehicle[Jogador]) setElementData(Jogador, "MultiGM", "Hydra") end end for _, v in ipairs (spawnVehPositions) do MarkerHunter = createMarker(v[1], v[2], v[3]+0.6, "checkpoint", 1, 185, 122, 87, 255 ) MarkerHydra = createMarker(v[1], v[2], v[3]+0.6, "checkpoint", 1, 185, 122, 87, 255 ) setElementDimension(MarkerHunter, 2) setElementDimension(MarkerHydra, 1) addEventHandler("onMarkerHit", MarkerHunter, spawnVehMarker) addEventHandler("onMarkerHit", MarkerHydra, spawnVehMarker) end addEvent(getResourceName(getThisResource())..": respawnPlayer", true) addEventHandler(getResourceName(getThisResource())..": respawnPlayer", root, function () if getElementData(source, "Morreu") == 1 then --setElementPosition(source, pX, pY, pZ) local activeteam = getPlayerTeam (source) if activeteam and getTeamName(activeteam)=="Militants" then local mX, mY, mZ = unpack(spawnarena2Positionsmilitants[math.random(#spawnarena2Positionsmilitants)]) setElementPosition(source, mX, mY, mZ) elseif activeteam and getTeamName(activeteam)=="Invaders" then local inX, inY, inZ = unpack(spawnarena2Positionsinvaders[math.random(#spawnarena2Positionsinvaders)]) setElementPosition(source, inX, inY, inZ) elseif activeteam and getTeamName(activeteam)=="Insurgents"then local isX, isY, isZ = unpack(spawnarena2Positionsinsurgents[math.random(#spawnarena2Positionsinsurgents)]) setElementPosition(source, isX, isY, isZ) end setElementDimension(source, 2) removeElementData(source, "Morreu") elseif getElementData(source, "Morreu") == 2 then local pX, pY, pZ = unpack(spawnVehPositions[math.random(#spawnVehPositions)]) setElementPosition(source, pX, pY, pZ) setElementDimension(source, 1) removeElementData(source, "Morreu") end end ) local newTeam1 local newTeam2 local newTeam3 local aPlayers = {} addEvent(getResourceName(getThisResource())..": addPlayerHunter", true) addEventHandler(getResourceName(getThisResource())..": addPlayerHunter", root, function () if (getPedOccupiedVehicle(source)) then return triggerClientEvent(source, getResourceName(getThisResource())..": textScreen", root, "Get out of your current vehicle to get into GM!") elseif (getElementData(source, "MultiGM") == "Hydra") then removeElementData(source, "MultiGM") end aPlayers[source] = getPlayerTeam (source) local teams = {"Militants","Invaders","Insurgents"} if not getTeamFromName(teams[1]) then newTeam1 = createTeam ( teams[1], 0, 255, 0 ) end if not getTeamFromName(teams[2]) then newTeam2 = createTeam ( teams[2], 100, 0, 20) end if not getTeamFromName(teams[3]) then newTeam3 = createTeam ( teams[3], 50, 100, 50) end local playerTeam = getFewestPlayersTeam() if playerTeam then setPlayerTeam(source, playerTeam) else return end if getTeamName(playerTeam)=="Militants" then local mX, mY, mZ = unpack(spawnarena2Positionsmilitants[math.random(#spawnarena2Positionsmilitants)]) setElementPosition(source, mX, mY, mZ) elseif getTeamName(playerTeam)=="Invaders" then local inX, inY, inZ = unpack(spawnarena2Positionsinvaders[math.random(#spawnarena2Positionsinvaders)]) setElementPosition(source, inX, inY, inZ) elseif getTeamName(playerTeam)=="Insurgents"then local isX, isY, isZ = unpack(spawnarena2Positionsinsurgents[math.random(#spawnarena2Positionsinsurgents)]) setElementPosition(source, isX, isY, isZ) end triggerClientEvent(source, getResourceName(getThisResource())..": textScreen", root, "You entered the Hunter Arena. To exit just type /exitarena") setElementData(source, "MultiGM", "Hunter") --setElementPosition(source, pX, pY, pZ) setElementDimension(source, 2) end ) addEventHandler( "onPlayerQuit", root, function() if aPlayers[source] then aPlayers[source] - nil end end ) function getFewestPlayersTeam() local teams = { newTeam1, newTeam2, newTeam3 } if not teams[1] then return end local teamElement = false local f = 99999 for i=1, 3 do local pcount = countPlayersInTeam( teams[i] ) if pcount < f then f = pcount teamElement = teams[i] end end return teamElement end addEvent(getResourceName(getThisResource())..": addPlayerHydra", true) addEventHandler(getResourceName(getThisResource())..": addPlayerHydra", root, function () if (getPedOccupiedVehicle(source)) then return triggerClientEvent(source, getResourceName(getThisResource())..": textScreen", root, "Get out of your current vehicle to get into GM!") elseif (getElementData(source, "MultiGM") == "Hunter") then elseif (getElementData(source, "MultiGM") == "Hunter") then removeElementData(source, "MultiGM") end triggerClientEvent(source, getResourceName(getThisResource())..": textScreen", root, "You entered the Dogfight Arena. To exit just type /exitarena") local pX, pY, pZ = unpack(spawnVehPositions[math.random(#spawnVehPositions)]) setElementData(source, "MultiGM", "Hydra") setElementPosition(source, pX, pY, pZ) setElementDimension(source, 1) end ) addEventHandler("onPlayerWasted", root, function (_, attacker) if (getElementData(source, "MultiGM")) then triggerClientEvent(source, getResourceName(getThisResource())..": respawnPlayer", root) if (attacker) then if (getElementType(attacker) == "player" and getElementData(attacker, "MultiGM")) then triggerClientEvent(attacker, getResourceName(getThisResource())..": textScreen", root, "You've killed: "..getPlayerName(source).."!") triggerClientEvent(source, getResourceName(getThisResource())..": textScreen", root, "You've been killed by: "..getPlayerName(attacker).."!") elseif (getElementType(attacker) == "vehicle" and getElementData(getVehicleOccupant(attacker), "MultiGM")) then triggerClientEvent(getVehicleOccupant(attacker), getResourceName(getThisResource())..": textScreen", root, "You've killed: "..getPlayerName(source).."!") triggerClientEvent(source, getResourceName(getThisResource())..": textScreen", root, "You've been killed by: "..getPlayerName(getVehicleOccupant(attacker)).."!") end else triggerClientEvent(source, getResourceName(getThisResource())..": textScreen", root, "#ffffffYou've committed suicide!") end end end ) addCommandHandler("exitarena", function (Jogador) if (getElementData(Jogador, "MultiGM")) then if Vehicle[Jogador] and isElement(Vehicle[Jogador]) then destroyElement(Vehicle[Jogador]) end removeElementData(Jogador, "MultiGM") setElementDimension(Jogador, 0) killPed(Jogador) triggerClientEvent(Jogador, getResourceName(getThisResource())..": textScreen", root, "You've left the arena successfully!") local currentteam = getPlayerTeam (Jogador) -- gets the current players team if (currentteam ) then --checks if the player is in a team by checking if playerTeam returned true setPlayerTeam (Jogador, aPlayers[Jogador]) -- sets the team to the one which the player had previously before joining the arena end local count1 = countPlayersInTeam (newTeam1) local count2 = countPlayersInTeam (newTeam2) local count3 = countPlayersInTeam (newTeam3) if count1==0 then destroyElement(newTeam1) outputChatBox ( "Miltants have been eliminated." ) end if count2==0 then destroyElement(newTeam2) outputChatBox ( "Invaders have been eliminated." ) end if count3==0 then destroyElement(newTeam3) outputChatBox ( "Insurgents have been eliminated." ) end end end )
  7. Try this : addEventHandler ("onResourceStart", getResourceRootElement(getThisResource()), function() local allGreenzones = getElementsByType ("radararea") for i,v in ipairs (allGreenzones) do local r, g, b, a = getRadarAreaColor (v) if (r == 255) and (g == 0) and (b == 0) and (a == 255) then local x, y = getElementPosition (v) local sx, sy = getRadarAreaSize (v) setRadarAreaFlashing(v, true) local col = createColCuboid (x, y, -50, sx, sy, 7500) setElementID (col, "ColShapeMultiGameMode") end end end ) spawnVehPositions = { {-1292.8455810547, -364.38061523438, 15.8}, {-1350.6311035156, -258.98291015625, 14.14396572113}, {-1467.52734375, -190.3069152832, 14.1484375}, {-1620.8626708984, -51.465915679932, 3.5595684051514}, {-1620.2762451172, -590.58685302734, 14.1484375}, } spawnarena2Positionsmilitants = { {789.79999, -2120.3999, 14.1484375}, {795.5, -2228, 15.4}, {795.70001, -2218.8, 15.2}, } spawnarena2Positionsinvaders = { {649.29999, -2409.3, 83}, {623.40002, -2498.3999, 71.9}, {623.70001, -2497.8, 71.9}, } spawnarena2Positionsinsurgents = { {502.20001, -2297.2, 124.6}, {456.60001, -2256.8999, 128.3}, {450.29999, -2258.3, 128.3}, } addEventHandler("onColShapeLeave", root, function (Jogador) if (getElementData(Jogador, "MultiGM") and getElementByID("ColShapeMultiGameMode")) then if (not getElementData(Jogador, "Morreu")) then if (Vehicle[Jogador] and isElement(Vehicle[Jogador])) then destroyElement(Vehicle[Jogador]) triggerClientEvent(Jogador, getResourceName(getThisResource())..": textScreen", root, "#ffffffWarning:-You've crossed the arena boundary!") end removeElementData(Jogador, "MultiGM") end end end ) addEventHandler("onColShapeHit", root, function (Jogador) if (not getElementData(Jogador, "MultiGM")) and getElementByID("ColShapeMultiGameMode") then if ( getElementDimension(Jogador) == 1 ) then setElementData(Jogador, "MultiGM", "Hydra") elseif ( getElementDimension(Jogador) == 2) then setElementData(Jogador, "MultiGM", "Hunter") end end end ) Vehicle = {} function spawnVehMarker (Jogador) if (getElementDimension(Jogador) == 2) then if (Vehicle[Jogador] and isElement(Vehicle[Jogador])) then destroyElement(Vehicle[Jogador]) end local x, y, z = getElementPosition(Jogador) Vehicle[Jogador] = createVehicle(425, x, y, z+1) --warpPedIntoVehicle(Jogador, Vehicle[Jogador]) setElementData(Jogador, "MultiGM", "Hunter") elseif ( getElementDimension(Jogador) == 1 ) then if (Vehicle[Jogador] and isElement(Vehicle[Jogador])) then destroyElement(Vehicle[Jogador]) end local x, y, z = getElementPosition(Jogador) Vehicle[Jogador] = createVehicle(520, x, y, z+1) --warpPedIntoVehicle(Jogador, Vehicle[Jogador]) setElementData(Jogador, "MultiGM", "Hydra") end end for _, v in ipairs (spawnVehPositions) do MarkerHunter = createMarker(v[1], v[2], v[3]+0.6, "checkpoint", 1, 185, 122, 87, 255 ) MarkerHydra = createMarker(v[1], v[2], v[3]+0.6, "checkpoint", 1, 185, 122, 87, 255 ) setElementDimension(MarkerHunter, 2) setElementDimension(MarkerHydra, 1) addEventHandler("onMarkerHit", MarkerHunter, spawnVehMarker) addEventHandler("onMarkerHit", MarkerHydra, spawnVehMarker) end addEvent(getResourceName(getThisResource())..": respawnPlayer", true) addEventHandler(getResourceName(getThisResource())..": respawnPlayer", root, function () if getElementData(source, "Morreu") == 1 then local pX, pY, pZ = unpack(spawnVehPositions[math.random(#spawnVehPositions)]) setElementPosition(source, pX, pY, pZ) setElementDimension(source, 2) removeElementData(source, "Morreu") elseif getElementData(source, "Morreu") == 2 then local pX, pY, pZ = unpack(spawnVehPositions[math.random(#spawnVehPositions)]) setElementPosition(source, pX, pY, pZ) setElementDimension(source, 1) removeElementData(source, "Morreu") end end ) local newTeam1 local newTeam2 local newTeam3 local originalteam -- to store the team of player before joining the arena addEvent(getResourceName(getThisResource())..": addPlayerHunter", true) addEventHandler(getResourceName(getThisResource())..": addPlayerHunter", root, function () if (getPedOccupiedVehicle(source)) then return triggerClientEvent(source, getResourceName(getThisResource())..": textScreen", root, "Get out of your current vehicle to get into GM!") elseif (getElementData(source, "MultiGM") == "Hydra") then removeElementData(source, "MultiGM") end originalteam = getPlayerTeam (source) local teams = {"Militants","Invaders","Insurgents"} if not getTeamFromName(teams[1]) then newTeam1 = createTeam ( "Militants", 0, 255, 0 ) newTeam2 = createTeam ( "Invaders", 100, 0, 20) newTeam3 = createTeam ( "Insurgents", 50, 100, 50) end local randomteam = teams[math.random(#teams)] setPlayerTeam(source, getTeamFromName(randomteam)) local activeteam = getPlayerTeam (source) -- joined team if activeteam and getTeamName(activeteam)=="Militants" then local mX, mY, mZ = unpack(spawnarena2Positionsmilitants[math.random(#spawnarena2Positionsmilitants)]) setElementPosition(source, mX, mY, mZ) elseif activeteam and getTeamName(activeteam)=="Invaders" then local inX, inY, inZ = unpack(spawnarena2Positionsinvaders[math.random(#spawnarena2Positionsinvaders)]) setElementPosition(source, inX, inY, inZ) elseif activeteam and getTeamName(activeteam)=="Insurgents"then local isX, isY, isZ = unpack(spawnarena2Positionsinsurgents[math.random(#spawnarena2Positionsinsurgents)]) setElementPosition(source, isX, isY, isZ) end triggerClientEvent(source, getResourceName(getThisResource())..": textScreen", root, "You entered the Hunter Arena. To exit just type /exitarena") setElementData(source, "MultiGM", "Hunter") --setElementPosition(source, pX, pY, pZ) setElementDimension(source, 2) end ) addEvent(getResourceName(getThisResource())..": addPlayerHydra", true) addEventHandler(getResourceName(getThisResource())..": addPlayerHydra", root, function () if (getPedOccupiedVehicle(source)) then return triggerClientEvent(source, getResourceName(getThisResource())..": textScreen", root, "Get out of your current vehicle to get into GM!") elseif (getElementData(source, "MultiGM") == "Hunter") then elseif (getElementData(source, "MultiGM") == "Hunter") then removeElementData(source, "MultiGM") end triggerClientEvent(source, getResourceName(getThisResource())..": textScreen", root, "You entered the Dogfight Arena. To exit just type /exitarena") local pX, pY, pZ = unpack(spawnVehPositions[math.random(#spawnVehPositions)]) setElementData(source, "MultiGM", "Hydra") setElementPosition(source, pX, pY, pZ) setElementDimension(source, 1) end ) addEventHandler("onPlayerWasted", root, function (_, attacker) if (getElementData(source, "MultiGM")) then triggerClientEvent(source, getResourceName(getThisResource())..": respawnPlayer", root) if (attacker) then if (getElementType(attacker) == "player" and getElementData(attacker, "MultiGM")) then triggerClientEvent(attacker, getResourceName(getThisResource())..": textScreen", root, "You've killed: "..getPlayerName(source).."!") triggerClientEvent(source, getResourceName(getThisResource())..": textScreen", root, "You've been killed by: "..getPlayerName(attacker).."!") elseif (getElementType(attacker) == "vehicle" and getElementData(getVehicleOccupant(attacker), "MultiGM")) then triggerClientEvent(getVehicleOccupant(attacker), getResourceName(getThisResource())..": textScreen", root, "You've killed: "..getPlayerName(source).."!") triggerClientEvent(source, getResourceName(getThisResource())..": textScreen", root, "You've been killed by: "..getPlayerName(getVehicleOccupant(attacker)).."!") end else triggerClientEvent(source, getResourceName(getThisResource())..": textScreen", root, "#ffffffYou've committed suicide!") end end end ) addCommandHandler("exitarena", function (Jogador) if (getElementData(Jogador, "MultiGM")) then if Vehicle[Jogador] and isElement(Vehicle[Jogador]) then destroyElement(Vehicle[Jogador]) end removeElementData(Jogador, "MultiGM") setElementDimension(Jogador, 0) killPed(Jogador) triggerClientEvent(Jogador, getResourceName(getThisResource())..": textScreen", root, "You've left the arena successfully!") local currentteam = getPlayerTeam (Jogador) -- gets the current players team if (currentteam ) then --checks if the player is in a team by checking if playerTeam returned true setPlayerTeam (Jogador, originalteam) -- sets the team to the one which the player had previously before joining the arena end local count1 = countPlayersInTeam (newTeam1) local count2 = countPlayersInTeam (newTeam2) local count3 = countPlayersInTeam (newTeam3) if count1==0 then destroyElement(newTeam1) outputChatBox ( "Miltants have been eliminated." ) end if count2==0 then destroyElement(newTeam2) outputChatBox ( "Invaders have been eliminated." ) end if count3==0 then destroyElement(newTeam3) outputChatBox ( "Insurgents have been eliminated." ) end end end ) Type /debugscript 3 if it doesn't work.
  8. Tanto pasta quanto o resource zipado funcionam. O MTA tem uma ferramenta interna que extrai a pasta zipada na execução.
  9. If the loop through all players is useless then remove it. Also, your code is creating the same teams everytime the event gets called. Try this: local newTeam1 = createTeam ( "Militants", 0, 255, 0 ) local newTeam2 = createTeam ( "Invaders", 100, 0, 20) local newTeam3 = createTeam ( "Insurgents", 50, 100, 50) local originalteam -- to store the team of player before joining the arena addEvent(getResourceName(getThisResource())..": addPlayerHunter", true) addEventHandler(getResourceName(getThisResource())..": addPlayerHunter", root, function () if (getPedOccupiedVehicle(source)) then return triggerClientEvent(source, getResourceName(getThisResource())..": textScreen", root, "Get out of your current vehicle to get into GM!") elseif (getElementData(source, "MultiGM") == "Hydra") then removeElementData(source, "MultiGM") end originalteam = getPlayerTeam (source) or nil local teams = {newTeam1,newTeam2,newTeam3} local randomteam = teams[math.random(#teams)] setPlayerTeam(source, randomteam) local activeteam = getPlayerTeam (source) -- joined team if activeteam and getTeamName(activeteam)=="Militants" then local mX, mY, mZ = unpack(spawnarena2Positionsmilitants[math.random(#spawnarena2Positionsmilitants)]) setElementPosition(source, mX, mY, mZ) elseif activeteam and getTeamName(activeteam)=="Invaders" then local inX, inY, inZ = unpack(spawnarena2Positionsinvaders[math.random(#spawnarena2Positionsinvaders)]) setElementPosition(source, inX, inY, inZ) elseif activeteam and getTeamName(activeteam)=="Insurgents"then local isX, isY, isZ = unpack(spawnarena2Positionsinsurgents[math.random(#spawnarena2Positionsinsurgents)]) setElementPosition(source, isX, isY, isZ) end triggerClientEvent(source, getResourceName(getThisResource())..": textScreen", root, "You entered the Hunter Arena. To exit just type /exitarena") setElementData(source, "MultiGM", "Hunter") --setElementPosition(source, pX, pY, pZ) --setElementDimension(source, 2) end )
  10. Use getElementDimension to check it's dimension, then remove the object.
  11. You're using 'source' at line 30, replace it with 'Jogador'.
  12. Regras As regras globais do fórum aplicam-se também a este local. Qualquer atitude odiosa que provoque qualquer tipo de desordem não será tolerada. Os envolvidos serão julgados com o critério do Moderador. Sendo assim, Isso inclui mas não se limita a conteúdos do seguinte gênero: - Ataques contra o servidor ou Staff - Debates fora do contexto do tópico - Acusações de roubo de resources, códigos ou qualquer outra reclamação; Reporte aqui no fórum em vez de postar. Nota: Lembre-se de usar sempre que necessário o botão Report em vez de responder tópico, deixe que o moderador lide com a situação, evitando assim off-topic ou flamewar. Criando a postagem corretamente Descreva corretamente no nome do tópico, o nome do servidor e se achar necessário o modo de jogo; evite nomes imensos no título. Server novo; Meu Server; Entrem; Server MTA; Divulgando meu server - Esses tipos de nomes não são recomendados. Padrão correto (um exemplo): "Default MTA Server - beta v0.1". Claro, o nome varia de acordo com a sua postagem em si. Aborde corretamente o seu servidor na postagem, detalhando tudo o que achar necessário e visando fazer uma divulgação com um conteúdo razoável e repleto de informações.
  13. Ajudo sim, mas eu ainda não sei qual som do carro você quer dizer. Sobre a função função setWorldSoundEnabled: Argumentos: group, index, enabled, immediate Para os 2 primeiros argumentos, você coloca o id do som do GTA. Você pode encontrar o id no jogo usando o comando /showsound 1 setDevelopmentMode(true) habilita o uso desse comando, então use ele primeiro. Esse é o primeiro passo, depois vem a função que toca o som novo no jogo.
  14. O problema aqui foi a grande falta de respeito do #Roots, agindo igual pirralho imaturo no primeiro post. Atitude que pra uma pessoa com quase 5 anos no fórum não deveria acontecer... Poderia ter reportado se fosse o caso (assim como fez o Lord Henry com os outros posts), não precisa citar o Mod e pedir pra fazer isso e aquilo
  15. Não entendi o que tem de errado aqui em divulgar um servidor, pode me explicar o motivo de tanta revolta com o membro do fórum? Ironicamente, você que infringiu regras aqui usando palavras agressivas e utilizando de Backseat moderation.
  16. local staffRankName = staff["Level "..tostring(i)][1] ?
  17. Tente isto: local skins = {["burros"] = 122, ["victor"] = 123, ["Marcos"] = 77} -- id da skin associada ao solicitante function skinprivate(player, commandName) local conta = getPlayerAccount(player) if not conta or isGuestAccount(conta) then return end local contaNome = getAccountName(conta) local skinID = skins[contaNome] or false if skinID then setElementModel( player, skinID ) else outputChatBox("[SERVER] Acesso Negado.", player, 255,0,0,true) end end addCommandHandler("minhaskin", skinprivate);
  18. It's from mapnames resource Afaik. This resource has nothing to do with blips, with that you will only be able to modify the dx with player's name on the F11 map. Edit: If you mean the dx player's name, try this: local restrictedTeams = { ["Admins"] = true, ["Events Organization Zone"] = true } local textFont = "default-bold" local textScale = 1 local heightPadding = 1 local widthPadding = 1 local xOffset = 8 local minAlpha = 10 local textAlpha = 255 local floor = math.floor local w,h = guiGetScreenSize() local function drawMapStuff() if isPlayerMapVisible() then local sx,sy,ex,ey = getPlayerMapBoundingBox() local mw,mh = ex-sx,sy-ey local cx,cy = (sx+ex)/2,(sy+ey)/2 local ppuX,ppuY = mw/6000,mh/6000 local fontHeight = dxGetFontHeight(textScale,textFont) local yOffset = fontHeight/2 local blips = getElementsByType("blip") for k,v in ipairs(blips) do local attached=getElementAttachedTo(v) if isElement(attached) and getElementType(attached)=="player" and canDrawForPlayer( attached ) then local px,py = getElementPosition(attached) local x = floor(cx+px*ppuX+xOffset) local y = floor(cy+py*ppuY-yOffset) local pname = getPlayerName(attached) local nameLength = dxGetTextWidth(pname,textScale,textFont) local r,g,b = getPlayerNametagColor(attached) local _,_,_,a = getBlipColor(v) if a>minAlpha then dxDrawBorderedText(pname,x,y,x+nameLength,y+fontHeight,tocolor(r,g,b,textAlpha),textScale,textFont,"left","top",false,false,false) end end end end end addEventHandler("onClientRender",getRootElement(),drawMapStuff) function canDrawForPlayer( player ) if isElement(player) and getElementType(player) == "player" and getPlayerTeam(player) then return restrictedTeams[ getTeamName(getPlayerTeam(player)) ] end return false end function dxDrawBorderedText(text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak,postGUI) for oX = -1, 1 do for oY = -1, 1 do dxDrawText(text, left + oX, top + oY, right + oX, bottom + oY, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak,postGUI) end end dxDrawText(text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI) end
  19. Essas funções destacadas em laranja são funções do lado server. Você vai precisar chamar o server depois que a gridList for criada. Nesse evento do lado server, você envia os dados com as contas da ACL para o cliente.
  20. Pelo que entendi, essa função vai spawnar o zumbi pro jogador que tiver menos zumbis atrás dele. Sim, dá spawn em 4 zumbis de uma vez. Edit: Como eu disse, a função spawna 4 zumbis, é só modificar a linha, ex: while pacecount < 9 do Nesse código vai permitir 8. Se quiser fazer uma função pra spawnar 8 zumbis pra um determinado jogador tente isto: function SpawnZombiesForPlayer ( thePlayer ) local pacecount = 0 while pacecount < 9 do --4 ZOMBIES AT A TIME TO PREVENT FPS DROP if (table.getn( everyZombie )+pacecount < newZombieLimit ) and (ZombieStreaming == 1) then local xcoord = 0 local ycoord = 0 local xdirection = math.random(1,2) if xdirection == 1 then xcoord = math.random(15,40) else xcoord = math.random(-40,-15) end local ydirection = math.random(1,2) if ydirection == 1 then ycoord = math.random(15,40) else ycoord = math.random(-40,-15) end if isElement(thePlayer) and (getElementData(thePlayer, "zombieProof") ~= true) and (getElementData(thePlayer, "alreadyspawned" ) == true) then triggerClientEvent ( "Spawn_Placement", thePlayer, ycoord, xcoord ) end pacecount = pacecount+1 else pacecount = pacecount+1 end end end
  21. Tente (não testei): local TIMER = false local eventAdded function Anim() local life = getElementHealth(source) if (life < 31) then if isTimer(TIMER) then return end; setPedAnimation(source, "CRACK", "crckdeth2") addEventHandler("onClientRender", root, deadRender) eventAdded = true --setElementData(getLocalPlayer(), "pubg:time", getTickCount() + 120000) --unbindKey ( "lshift", "both", Anim ) TIMER = setTimer( function(player) if isElement(player) then killPed(player) end removeEventHandler("onClientRender", root, deadRender) eventAdded = nil end, 120000, 1, source) elseif life > 30 then check_reset() end end addEventHandler ( "onClientPlayerDamage", root, Anim ) addEventHandler( "onClientPedWasted", root, function() check_reset() end ) function check_reset() if isTimer(TIMER) then killTimer(TIMER) end if eventAdded then removeEventHandler("onClientRender", root, deadRender) eventAdded = nil end end
  22. @Mayconzito, Dá próxima vez crie um tópico por favor. Quanto ao seu problema, eu não sei como funciona esse mod, mas você precisa converter cada objeto para o MTA usando os IDs e substituindo com código Lua.
  23. Você precisa editar a função SpawnZombie. Tem alguns timers criam zumbis em intervalos de tempo.
  24. As especificações do seu PC com certeza tem o potencial pra rodar GTA:SA sem problemas (eu já usei um notebook com o celeron e 900 mb de ram no MTA ). Não sei se você chegou a usar uma versão de SO 64 bits, porque esse que você descreveu é 32, e consequentemente utiliza 2 gb de ram se não me engano. Tenha em mente que em alguns servidores, será exigido um PC mais atual pra processar shaders, coisas que sobrecarregam a ram, scripts mal-otimizados, muitos jogadores, etc. E como você disse, o seu PC já está em uso há mais de 7 anos e esses crash's como você disse, só acontece alguns servidores. Talvez seja realmente problema com hardware ultrapassado - como Lord Henry disse, tem certos shaders que se a sua placa de video não for compatível, o jogo crasha. Você pode usar o MTA Diag e postar o log na seção global de suporte. Por fim, leia este tópico também: https://forum.multitheftauto.com/topic/78081-32-bit-windows-crashing/
  25. onPlayerJoin é um evento do lado server, use o evento "onClientResourceStart" e troque root por resourceRoot. No comando, use os parâmetros: sourcePlayer, commandName, targetPlayerName. function MostrarKills( sourcePlayer, commandName, targetPlayerName ) Verifique se existe um jogador com esse nome, se sim, prossiga a função com getPlayerKills/getPlayerDeaths (que precisam estar no seu código pra ele funcionar) e no lugar de getLocalPlayer() use getPlayerFromName. Um conselho, sempre que criar uma postagem nova, pesquise antes pelo fórum. Já tem vários tópicos relacionados a isso.
×
×
  • Create New...