Aruna
Members-
Posts
72 -
Joined
-
Last visited
Everything posted by Aruna
-
Hola a todos, estube probando un par de cosas en este script y al colocar /onduty en el debug me sale que 'getPlayerAccount'(a nil value) function giveblood (thePlayer) local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then end outputChatBox ("#1AFF00 El Administrador "..getPlayerName(thePlayer).."#1AFF00 está en servicio",root,255,255,255,true) setElementData(thePlayer, "blood",999999999) end addCommandHandler("onduty", giveblood) function bloodback(thePlayer) local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then end outputChatBox ("#FF0000 El Administrador "..getPlayerName(thePlayer).."#FF0000 está fuera de servicio",root,255,255,255,true) setElementData(thePlayer, "blood",12000) end addCommandHandler("offduty", bloodback)
-
Hola a todos, Tengo un problema con mi MTA que cuando juego un rato (15 a 25 minutos), de forma INESPERADA y SIN AVISO se me cierra el MTA y me sale una ventana con el siguiente Error Alguien tiene idea de que trata este error del crash?? Como podria solucionarlo, Muchas Gracias de antemano
-
no porque uso 2 vps, 1 vps del sv y otro vps de 1gbps para la descarga del sv osea Fastdl
-
Pero no tengo el mta editado
-
Esta es la imagen ya busque el error en el mta wiki error codes y me sale esto CD47 Disconnected: You were banned by %s MTA10\mods\deathmatch\logic\CPacketHandler.cpp:604
-
Hola a todos, quisiera hacer un par de preguntas Yo ayer entre un sv y de la nada me salto un Cartel diciendome Desconnected: You Banned by MTA Reazon: TRAILER Time: 23 hours, 59 minutes, 30 seconds. Que significa eso, y no me deja conectar a ningun servidor ya que me dice que me banearon por 1 dia y fue MTA y quien es MTA
-
sisi function tel(thePlayer) setElementPosition(thePlayer, -474.5,-616.09997558594,18) setPedRotation(thePlayer, 275.82971191406) outputChatBox ( "#ff0000Espera 15 Segundos y serás warpeado al lugar.", thePlayer, 255, 255, 255, true ) end, 15000, 1 ) end addCommandHandler("b123e", tel)
-
Ya Gracias
-
Hola, Una pregunta ya tengo varias quejas con este recurso. El resource es de un warp o teleport que nosotros usamos, Pero se le puede modificar que una vez que typeen el comando tenga que esperar unos 5 o 10 Segundos sin moverse para poder warpearse al lugar. Ya que cuando uno le esta disparando ellos blindean el comando y se warpean al lugar ese y no lo pueden matar. function tel(thePlayer) setElementPosition(thePlayer, 3032.400390625,1135.70019531251135,48.900001525879) setPedRotation(thePlayer, 275.82971191406) end addCommandHandler("warp4", tel)
-
Me funciono de 10, Muchas Gracias no se me habia ocurrido cambiarlo de lugar. Tomas te acordas en el otro post que me hiciste algo de export.ac dimos tantas vueltas y era solo esto
-
@StanMarsh Hola, el primero no se de los pickups 2)_ Para givearte cosas es el addon_give recuerda usar el comando /give con tu cuenta de Administrador para poder givearte cosas. Server Side addEvent("onGIPGive", true) local aclGroup -- // Minimum group in order to access give GUI. local isConfigOkay = true -- // Checking if script works correctly. -- // Adding required information in order to make the addon work correctly. -- addEventHandler("onResourceStart", resourceRoot, function() call (getResourceFromName("DayZ"), "addAddonInfo", "LuxorDayZ", "Panel de Give") aclGroup = get("aclMinimumGroup") if string.find(aclGroup, ",") then aclGroup = split(aclGroup, ',') end if type(aclGroup) == "string" then if not aclGetGroup(aclGroup) then outputError("Error config meta.xml. Bad ACL Group. Resource will not work") isConfigOkay = false return end else for i, val in ipairs(aclGroup) do if not aclGetGroup(aclGroup[i]) then outputError("Error config meta.xml. Bad ACL Group. Resource will not work") isConfigOkay = false return end end end end ) -- // Handling /give command. -- addCommandHandler("give", function(pSource) if not isConfigOkay then return end if type(aclGroup) == "string" then if not isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(pSource)), aclGetGroup(aclGroup)) then return end triggerClientEvent(pSource, "onGIPOpened", pSource) else for i, _ in ipairs(aclGroup) do if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(pSource)), aclGetGroup(aclGroup[i])) then triggerClientEvent(pSource, "onGIPOpened", pSource) break end end end end ) -- // Function to inform. -- function outputError(msg) outputDebugString(msg, 1) outputChatBox(msg, root, 128, 0, 255, true) end -- // Give handler. -- addEventHandler("onGIPGive", root, function(pName, item, quantity) name = getPlayerName ( source ) setElementData(getPlayerFromName(pName), item, quantity) outputChatBox("El Administrador" ..name.. " le ha dado " ..quantity.." "..item.. " para " ..pName, getRootElement(), 0, 137, 255) outputChatBox("Un Administrador Le Ha Dado:"..quantity.." "..item, getPlayerFromName(pName), 128, 0, 255) end ) Client Side addEvent("onGIPOpened", true) local sW, sH = guiGetScreenSize() -- // Variables needed to know the width and height. local w = { gridList = {}, label = {}, editBox = {}, button = {}, comboBox = {} } local items = { ["Armas"] = { "M4", "CZ 550", "Heat-Seeking RPG", "M136 Rocket Launcher", "Winchester 1866", "SPAZ-12 Combat Shotgun", "M79", "AKS-47", "Lee Enfield", "M1911", "M9 SD", "PDW", "MP5A5", "Desert Eagle", "Hunting Knife", "Hatchet", "Crowbar", "Golf Club", "Parachute", "Tear Gas", "Grenade", "Binoculars", }, ["Muriciones"] = { "M4 Mag", "AK Mag", "CZ 550 Mag", "Winchester 1866 Mag", "SPAZ-12 Pellet", "PDW Mag", "MP5A5 Mag", "1866 Slug", "2Rnd. Slug", "M79 Granada", "M9 SD Mag", "M1911 Mag", "Desert Eagle Mag", "Lee Enfield Mag", }, ["Comidas & Bebidas"] = { "Water Bottle", "Pasta Can", "Beans Can", "Burger", "Pizza", "Soda Bottle", "Empty Water Bottle", "Empty Soda Cans", "Scruffy Burgers", "Milk", "Raw Meat", "Cooked Meat" }, ["Mochilas"] = { "Czech Vest Pouch", "Patrol Pack", "Assault Pack (ACU)", "Survival (ACU)", "Alice Pack", "British Assault Pack", "Czech Backpack", "Coyote Backpack", "Origem Backpack", }, ["herramientas"] = { "Box of Matches", "Infrared Goggles", "Night Vision Goggles", "GPS", "Map", "Toolbox", "Watch", "Radio Device" }, ["Equipo Medico"] = { "Bandage", "Morphine", "Medic Kit", "Heat Pack", "Blood Bag", "Painkiller", }, ["Partes De Autos"] = { "Tire", "Engine", "Tank Parts" }, ["Ropa"] = { "Camouflage Clothing", "Ghillie Suit", "Civilian Clothing", "Civilian[F] Clothing", "Survivor Clothing", "Survivor[F] Clothing", "Camouflage Zombie Clothing", "Survivor[F] Clothing", "Ghillie[F] Suit", "Ghillie Suit Desert", "Camouflage[F] Clothing", }, ["Editar Status"] = { "murders", "zombieskilled", "headshots", "banditskilled", "blood", "humanity", "thirst", "food", "alivetime", "bandit", }, ["Otros"] = { "Wood Pile", "Empty Gas Canister", "Full Gas Canister", "Roadflare", "Wire Fence", "Mine", "Tent" } } local isItemSelected = false -- // Window creation code -- addEventHandler("onClientResourceStart", resourceRoot, function() w.main = guiCreateWindow(sW/2 - 179, sH/2 - 165, 358, 330, "Panel Give Objetos LuxorDayZ", false) guiWindowSetSizable(w.main, false) guiSetAlpha(w.main, 1.00) w.gridList.main = guiCreateGridList(10, 26, 151, 291, false, w.main) w.gridList.column = guiGridListAddColumn( w.gridList.main, "Player", 0.85 ) w.label.desc = guiCreateLabel(176, 26, 178, 22, "Elegir Jugador", false, w.main) guiSetFont(w.label.desc, "default-bold-small") w.label.desc2 = guiCreateLabel(233, 210, 60, 22, "Cantidad", false, w.main) guiSetFont(w.label.desc2, "default-bold-small") w.comboBox.category = guiCreateComboBox(171, 65, 266, 160, "-- Elija una categoría--", false, w.main) w.comboBox.itemList = guiCreateComboBox(171, 145, 266, 50, "-- Seleccionar elemento --", false, w.main) w.editBox.quantity = guiCreateEdit(231, 234, 55, 26, "", false, w.main) w.button.give = guiCreateButton(176, 280, 77, 37, "Dar", false, w.main) w.button.close = guiCreateButton(263, 280, 77, 37, "Cerrar", false, w.main) guiSetFont(w.button.give, "default-bold-small") guiSetProperty(w.button.give, "NormalTextColour", "FFAAAAAA") guiSetFont(w.button.close, "default-bold-small") guiSetProperty(w.button.close, "NormalTextColour", "FFAAAAAA") guiSetVisible(w.main, false) guiSetEnabled(w.button.give, false) for key, value in pairs (items) do if type(value) == "table" then guiComboBoxAddItem(w.comboBox.category, key) end end -- // Making quantity be only edited by numbers -- addEventHandler("onClientGUIChanged", w.editBox.quantity, function() guiSetText(source, guiGetText(source):gsub("[^0-9]","")) -- // We remove everything which is not a number check() end) -- // Changing second combobox items when first one changes -- addEventHandler("onClientGUIComboBoxAccepted", w.comboBox.category, function() local text = guiComboBoxGetItemText(w.comboBox.category, guiComboBoxGetSelected(w.comboBox.category)) guiComboBoxClear(w.comboBox.itemList) for i, st in ipairs(items[text]) do guiComboBoxAddItem(w.comboBox.itemList, st) end guiComboBoxAdjustHeight(w.comboBox.itemList, #items[text]) end ) -- // Showing item when second one was accepted. -- addEventHandler("onClientGUIComboBoxAccepted", w.comboBox.itemList, function() isItemSelected = true check() end ) -- // Handling button that closes. -- addEventHandler ( "onClientGUIClick", w.button.close, function() guiSetVisible(w.main, false) showCursor(false) end, false ) -- // Handling give button. -- addEventHandler ( "onClientGUIClick", w.button.give, function() local playerName = guiGridListGetItemText(w.gridList.main, guiGridListGetSelectedItem(w.gridList.main), 1) local item = guiComboBoxGetItemText(w.comboBox.itemList, guiComboBoxGetSelected(w.comboBox.itemList)) if (getPlayerFromName(playerName)) then triggerServerEvent("onGIPGive", localPlayer, playerName, item, tonumber(guiGetText(w.editBox.quantity))) else outputChatBox("Jugador Desconectado ou Nick Errado", 255, 0, 0) end guiSetVisible(w.main, true) showCursor(true) end, false ) addEventHandler("onClientGUIClick", w.gridList.main, check) end ) -- // Remi-X function. Sets height depending on item quantity -- function guiComboBoxAdjustHeight ( combobox, itemcount ) local width = guiGetSize ( combobox, false ) return guiSetSize ( combobox, width, ( itemcount * 20 ) + 20, false ) end -- // Handling when the administrator opens the panel -- -- // Handling when the administrator opens the panel -- addEventHandler("onGIPOpened", root, function() guiGridListClear ( w.gridList.main ) guiSetEnabled(w.button.give, false) isItemSelected = false for id, player in ipairs(getElementsByType("player")) do if player ~= localplayer then local row = guiGridListAddRow ( w.gridList.main ) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column, getPlayerName ( player ), false, false ) end
-
Tomas anda todo bien solo que cuando le cambie esto me tira este error ahi te muestro todo mis debugscript y el script Esto seria siendo lo que modifique para que salga el "name1 was killed name2 with weapon" triggerClientEvent ( "onRollMessageStart", getRootElement(),"#FFFFFF"..getPlayerName(source).." #00ffccwas killed by "..getPlayerName(killer).." #00ffccwith "..(weapon).. ".",0,22,255, "died") y el error que me tira en el DebugScript 3 seria este La Linea 613 vendria siendo la (Linea 105) function kilLDayZPlayer(killer, headshot, weapon) pedCol = false local account = getPlayerAccount(source) if not account then return end killPed(source) triggerClientEvent(source, "hideInventoryManual", source) if getElementData(source, "alivetime") > 10 and not isElementInWater(source) then local x, y, z = getElementPosition(source) if getDistanceBetweenPoints3D(x, y, z, 6000, 6000, 0) > 200 then local x, y, z = getElementPosition(source) local rotX, rotY, rotZ = getElementRotation(source) local skin = getElementModel(source) local ped = createPed(skin, x, y, z, rotZ) pedCol = createColSphere(x, y, z, 1.5) killPed(ped) setTimer(destroyDeadPlayer, 2700000, 1, ped, pedCol) attachElements(pedCol, ped, 0, 0, 0) setElementData(pedCol, "parent", ped) setElementData(pedCol, "playername", getPlayerName(source)) setElementData(pedCol, "deadman", true) setElementData(pedCol, "MAX_Slots", getElementData(source, "MAX_Slots")) local time = getRealTime() local hours = time.hour local minutes = time.minute setElementData(pedCol, "deadreason", getPlayerName(source) .. " is dead. Cause of death: " .. (weapon or "Unknown") .. ". Time of death: " .. hours .. ":" .. minutes .. " o'clock.") end end if killer then if not getElementData(source, "bandit") then addPlayerStats(killer, "humanity", math.random(-2500, -1000)) else addPlayerStats(killer, "humanity", math.random(1000, 2500)) end setElementData(killer, "murders", getElementData(killer, "murders") + 1) if 0 > getElementData(killer, "humanity") then setElementData(killer, "bandit", true) end if getElementData(source, "bandit") == true then setElementData(killer, "banditskilled", getElementData(killer, "banditskilled") + 1) end if headshot == true then setElementData(killer, "headshots", getElementData(killer, "headshots") + 1) end else triggerClientEvent ( "onRollMessageStart", getRootElement(),"#FFFFFF"..getPlayerName(source).." #00FFFF was killed by nobody.",0,22,255, "died") end if pedCol then for i, data in ipairs(playerDataTable) do local plusData = getElementData(source, data[1]) if data[1] == "M1911 Mag" then plusData = math.floor(getElementData(source, data[1]) / 7) elseif data[1] == "M9 SD Mag" then plusData = math.floor(getElementData(source, data[1]) / 15) elseif data[1] == "Desert Eagle Mag" then plusData = math.floor(getElementData(source, data[1]) / 7) elseif data[1] == "PDW Mag" then plusData = math.floor(getElementData(source, data[1]) / 30) elseif data[1] == "MP5A5 Mag" then plusData = math.floor(getElementData(source, data[1]) / 20) elseif data[1] == "AK Mag" then plusData = math.floor(getElementData(source, data[1]) / 30) elseif data[1] == "M4 Mag" then plusData = math.floor(getElementData(source, data[1]) / 20) elseif data[1] == "CZ 550 Mag" then plusData = math.floor(getElementData(source, data[1]) / 5) elseif data[1] == "Lee Enfield Mag" then plusData = math.floor(getElementData(source, data[1]) / 10) elseif data[1] == "1866 Slug" then plusData = math.floor(getElementData(source, data[1]) / 7) elseif data[1] == "M79 Launcher" then plusData = math.floor(getElementData(source, data[1]) / 7) elseif data[1] == "2Rnd. Slug" then plusData = math.floor(getElementData(source, data[1]) / 2) end setElementData(pedCol, data[1], plusData) end local skinID = getElementData(source, "skin") local skin = getSkinNameFromID(skinID) setElementData(pedCol, skin, 1) local backpackSlots = getElementData(source, "MAX_Slots") if backpackSlots == 36 then setElementData(pedCol, "Assault Pack (ACU)", 1) elseif backpackSlots == 45 then setElementData(pedCol, "Alice Pack", 1) elseif backpackSlots == 75 then setElementData(pedCol, "Czech Backpack", 1) elseif backpackSlots == 125 then setElementData(pedCol, "Coyote Backpack", 1) elseif backpackSlots == 55 then setElementData(pedCol, "British Assault Pack", 1) elseif backpackSlots == 24 then setElementData(pedCol, "Patrol Pack", 1) elseif backpackSlots == 26 then setElementData(pedCol, "Vest Pouch Pack", 1) elseif backpackSlots == 16 then setElementData(pedCol, "Survival Pack (ACU)", 1) end end setTimer(setElementPosition, 500, 1, source, 6000, 6000, 0) triggerClientEvent(source, "onClientPlayerDeathInfo", source) setAccountData(account, "isDead", true) setElementData(source, "isDead", true) triggerClientEvent ( "onRollMessageStart", getRootElement(),"#FFFFFF"..getPlayerName(source).." #00ffccwas killed by "..getPlayerName(killer).." #00ffccwith "..(weapon).. ".",0,22,255, "died") destroyElement(getElementData(source, "playerCol")) setTimer(spawnDayZPlayer, 5000, 1, source) end addEvent("kilLDayZPlayer", true) addEventHandler("kilLDayZPlayer", getRootElement(), kilLDayZPlayer)
-
Esto vendria siendo toda la funcion function kilLDayZPlayer(killer, headshot, weapon) pedCol = false local account = getPlayerAccount(source) if not account then return end killPed(source) triggerClientEvent(source, "hideInventoryManual", source) if getElementData(source, "alivetime") > 10 and not isElementInWater(source) then local x, y, z = getElementPosition(source) if getDistanceBetweenPoints3D(x, y, z, 6000, 6000, 0) > 200 then local x, y, z = getElementPosition(source) local rotX, rotY, rotZ = getElementRotation(source) local skin = getElementModel(source) local ped = createPed(skin, x, y, z, rotZ) pedCol = createColSphere(x, y, z, 1.5) killPed(ped) setTimer(destroyDeadPlayer, 2700000, 1, ped, pedCol) attachElements(pedCol, ped, 0, 0, 0) setElementData(pedCol, "parent", ped) setElementData(pedCol, "playername", getPlayerName(source)) setElementData(pedCol, "deadman", true) setElementData(pedCol, "MAX_Slots", getElementData(source, "MAX_Slots")) local time = getRealTime() local hours = time.hour local minutes = time.minute setElementData(pedCol, "deadreason", getPlayerName(source) .. " is dead. Cause of death: " .. (weapon or "Unknown") .. ". Time of death: " .. hours .. ":" .. minutes .. " o'clock.") end end if killer then if not getElementData(source, "bandit") then addPlayerStats(killer, "humanity", math.random(-2500, -1000)) else addPlayerStats(killer, "humanity", math.random(1000, 2500)) end setElementData(killer, "murders", getElementData(killer, "murders") + 1) if 0 > getElementData(killer, "humanity") then setElementData(killer, "bandit", true) end if getElementData(source, "bandit") == true then setElementData(killer, "banditskilled", getElementData(killer, "banditskilled") + 1) end if headshot == true then setElementData(killer, "headshots", getElementData(killer, "headshots") + 1) end end if pedCol then for i, data in ipairs(playerDataTable) do local plusData = getElementData(source, data[1]) if data[1] == "M1911 Mag" then plusData = math.floor(getElementData(source, data[1]) / 7) elseif data[1] == "M9 SD Mag" then plusData = math.floor(getElementData(source, data[1]) / 15) elseif data[1] == "Desert Eagle Mag" then plusData = math.floor(getElementData(source, data[1]) / 7) elseif data[1] == "PDW Mag" then plusData = math.floor(getElementData(source, data[1]) / 30) elseif data[1] == "MP5A5 Mag" then plusData = math.floor(getElementData(source, data[1]) / 20) elseif data[1] == "AK Mag" then plusData = math.floor(getElementData(source, data[1]) / 30) elseif data[1] == "M4 Mag" then plusData = math.floor(getElementData(source, data[1]) / 20) elseif data[1] == "CZ 550 Mag" then plusData = math.floor(getElementData(source, data[1]) / 5) elseif data[1] == "Lee Enfield Mag" then plusData = math.floor(getElementData(source, data[1]) / 10) elseif data[1] == "1866 Slug" then plusData = math.floor(getElementData(source, data[1]) / 7) elseif data[1] == "M79 Launcher" then plusData = math.floor(getElementData(source, data[1]) / 7) elseif data[1] == "2Rnd. Slug" then plusData = math.floor(getElementData(source, data[1]) / 2) end setElementData(pedCol, data[1], plusData) end local skinID = getElementData(source, "skin") local skin = getSkinNameFromID(skinID) setElementData(pedCol, skin, 1) local backpackSlots = getElementData(source, "MAX_Slots") if backpackSlots == 36 then setElementData(pedCol, "Assault Pack (ACU)", 1) elseif backpackSlots == 45 then setElementData(pedCol, "Alice Pack", 1) elseif backpackSlots == 75 then setElementData(pedCol, "Czech Backpack", 1) elseif backpackSlots == 125 then setElementData(pedCol, "Coyote Backpack", 1) elseif backpackSlots == 55 then setElementData(pedCol, "British Assault Pack", 1) elseif backpackSlots == 24 then setElementData(pedCol, "Patrol Pack", 1) elseif backpackSlots == 26 then setElementData(pedCol, "Vest Pouch Pack", 1) elseif backpackSlots == 16 then setElementData(pedCol, "Survival Pack (ACU)", 1) end end setTimer(setElementPosition, 500, 1, source, 6000, 6000, 0) triggerClientEvent(source, "onClientPlayerDeathInfo", source) setAccountData(account, "isDead", true) setElementData(source, "isDead", true) triggerClientEvent ( "onRollMessageStart", getRootElement(),"#FFFFFF"..getPlayerName(source).." #FFFFFFwas killed by "..(getPlayerName(killer) or "unknown")..".",0,22,255, "died") destroyElement(getElementData(source, "playerCol")) setTimer(spawnDayZPlayer, 5000, 1, source) end addEvent("kilLDayZPlayer", true) addEventHandler("kilLDayZPlayer", getRootElement(), kilLDayZPlayer)
-
Gracias Tomas me funciono
-
Quisiera saber como hacer un else osea. Cuando un Jugador(source) es asesinado por un (killer) anda todo perfecto, Ahora cuando el Jugador se muere solo por otras razones se me buguea el script como podria hacer un "else" para poder lograr que si el jugador(source) se muere solo no se buguee el script PD: Arriba en la funcion utilice esto getPlayerName(source) getPlayerName(killer) tostring(weapon) setTimer(setElementPosition, 500, 1, source, 6000, 6000, 0) triggerClientEvent(source, "onClientPlayerDeathInfo", source) setAccountData(account, "isDead", true) setElementData(source, "isDead", true) triggerClientEvent ( "onRollMessageStart", getRootElement(),"#009aff"..getPlayerName(source).. " #FFFFFFfue asesinado por "..getPlayerName(killer).. " #FFFFFFcon "..(weapon).. " . ",0,22,255, "died") destroyElement(getElementData(source, "playerCol")) setTimer(spawnDayZPlayer, 5000, 1, source)
-
addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == equipar) then triggerServerEvent("onClientGiveWeapon", localPlayer, "Equiparme") end end )
-
jajaja Gracias, con razon no andaba. era esto local function canFly() return getTeamName(getPlayerTeam(getLocalPlayer())) == "Admins" end que coloco el otro que posteo de vuelta jeje Gracias
-
Hola, Este resource esta en la comunidad de MTA y quisiera saber como puedo privatizarlo que solo administradores puedan usar el comando ya que, hay algunos admin que entran con su otras cuenta y empiezen a abusar del comando. ya intende de ACL y todas las formas y nada. Server-Side local Superman = {} -- Static global values local rootElement = getRootElement() local thisResource = getThisResource() -- Resource events addEvent("superman:start", true) addEvent("superman:stop", true) -- -- Start/stop functions -- function Superman.Start() local self = Superman addEventHandler("superman:start", rootElement, self.clientStart) addEventHandler("superman:stop", rootElement, self.clientStop) end addEventHandler("onResourceStart", getResourceRootElement(thisResource), Superman.Start, false) function Superman.clientStart() setElementData(client, "superman:flying", true) end function Superman.clientStop() setElementData(client, "superman:flying", false) end Client Side local Superman = {} -- Settings local ZERO_TOLERANCE = 0.00001 local MAX_ANGLE_SPEED = 6 -- In degrees per frame local MAX_SPEED = 1.0 local EXTRA_SPEED_FACTOR = 1.85 local LOW_SPEED_FACTOR = 0.40 local ACCELERATION = 0.025 local EXTRA_ACCELERATION_FACTOR = 1.8 local LOW_ACCELERATION_FACTOR = 0.85 local TAKEOFF_VELOCITY = 1.75 local TAKEOFF_FLIGHT_DELAY = 750 local SMOKING_SPEED = 1.25 local GROUND_ZERO_TOLERANCE = 0.18 local LANDING_DISTANCE = 3.2 local FLIGHT_ANIMLIB = "swim" local FLIGHT_ANIMATION = "Swim_Dive_Under" local FLIGHT_ANIM_LOOP = false local IDLE_ANIMLIB = "cop_ambient" local IDLE_ANIMATION = "Coplook_loop" local IDLE_ANIM_LOOP = true local MAX_Y_ROTATION = 55 local ROTATION_Y_SPEED = 3.8 -- Static global variables local thisResource = getThisResource() local rootElement = getRootElement() local localPlayer = getLocalPlayer() local serverGravity = getGravity() -- -- Utility functions -- local function isPlayerFlying(player) local data = getElementData(player, "superman:flying") if not data or data == false then return false else return true end end local function setPlayerFlying(player, state) if state == true then state = true else state = false end setElementData(player, "superman:flying", state) end local function iterateFlyingPlayers() local current = 1 local allPlayers = getElementsByType("player") return function() local player repeat player = allPlayers[current] current = current + 1 until not player or (isPlayerFlying(player) and isElementStreamedIn(player)) return player end end function Superman:restorePlayer(player) setPlayerFlying(player, false) setPedAnimation(player, false) setElementVelocity(player, 0, 0, 0) setElementRotation(player, 0, 0, 0) --setPedRotation(player, getPedRotation(player)) setElementCollisionsEnabled(player, true) self:destroySmokeGenerators(player) self.rotations[player] = nil self.previousVelocity[player] = nil end function Superman:createSmokeGenerator(player) local generator = createObject(2780, getElementPosition(player)) setElementCollisionsEnabled(generator, false) setObjectScale(generator, 0) return generator end function Superman:createSmokeGenerators(player) if not self.smokeGenerators[player] then local smokeGenerators = {} smokeGenerators[1] = self:createSmokeGenerator(player) attachElements(smokeGenerators[1], player, 0.75, -0.2, -0.4, -40, 0, 60) smokeGenerators[2] = self:createSmokeGenerator(player) attachElements(smokeGenerators[2], player, -0.75, -0.2, -0.4, -40, 0, -60) self.smokeGenerators[player] = smokeGenerators end end function Superman:destroySmokeGenerators(player) if self.smokeGenerators[player] then for k, v in ipairs(self.smokeGenerators[player]) do destroyElement(v) end self.smokeGenerators[player] = nil end end function angleDiff(angle1, angle2) angle1, angle2 = angle1 % 360, angle2 % 360 local diff = (angle1 - angle2) % 360 if diff <= 180 then return diff else return -(360 - diff) end end local function isElementInWater(ped) local pedPosition = Vector3D:new(getElementPosition(ped)) if pedPosition.z <= 0 then return true end local waterLevel = getWaterLevel(pedPosition.x, pedPosition.y, pedPosition.z) if not isElementStreamedIn(ped) or not waterLevel or waterLevel < pedPosition.z then return false else return true end end local function isnan(x) math.inf = 1/0 if x == math.inf or x == -math.inf or x ~= x then return true end return false end local function getVector2DAngle(vec) if vec.x == 0 and vec.y == 0 then return 0 end local angle = math.deg(math.atan(vec.x / vec.y)) + 90 if vec.y < 0 then angle = angle + 180 end return angle end -- -- Initialization and shutdown functions -- function Superman.Start() local self = Superman -- Register events addEventHandler("onClientResourceStop", getResourceRootElement(thisResource), Superman.Stop, false) addEventHandler("onPlayerJoin", rootElement, Superman.onJoin) addEventHandler("onPlayerQuit", rootElement, Superman.onQuit) addEventHandler("onClientRender", rootElement, Superman.processControls) addEventHandler("onClientRender", rootElement, Superman.processFlight) addEventHandler("onClientPlayerDamage", localPlayer, Superman.onDamage, false) addEventHandler("onClientElementDataChange", rootElement, Superman.onDataChange) addEventHandler("onClientElementStreamIn", rootElement, Superman.onStreamIn) addEventHandler("onClientElementStreamOut", rootElement, Superman.onStreamOut) -- Bind keys bindKey("jump", "down", Superman.onJump) -- Register commands addCommandHandler("volar", Superman.cmdSuperman) -- Initializate attributes self.smokeGenerators = {} self.rotations = {} self.previousVelocity = {} end addEventHandler("onClientResourceStart", getResourceRootElement(thisResource), Superman.Start, false) function Superman.Stop() local self = Superman setGravity(serverGravity) -- Restore all players animations, collisions, etc for player in iterateFlyingPlayers() do self:restorePlayer(player) end end -- -- Join/Quit -- function Superman.onJoin(player) local self = Superman local player = player or source setPlayerFlying(player, false) end function Superman.onQuit(reason, player) local self = Superman local player = player or source if isPlayerFlying(player) then self:restorePlayer(player) end end -- -- onDamage: superman is invulnerable -- function Superman.onDamage() local self = Superman if isPlayerFlying(localPlayer) then cancelEvent() end end -- -- onStreamIn: Reset rotation attribute for player -- function Superman.onStreamIn() local self = Superman end function Superman.onStreamOut() local self = Superman if source and isElement(source) and getElementType(source) == "player" and isPlayerFlying(source) then self.rotations[source] = nil self.previousVelocity[source] = nil end end -- -- onDataChange: Check if somebody who is out of stream stops being superman -- function Superman.onDataChange(dataName, oldValue) local self = Superman if dataName == "superman:flying" and isElement(source) and getElementType(source) == "player" and oldValue ~= getElementData(source, dataName) and oldValue == true and getElementData(source, dataName) == false then self:restorePlayer(source) end end -- --double jump -- function Superman.onJump(key, keyState) if
-
Tomas aca esta el debug solo que me colgue un par de dias me re olvide este post jejej function onPlayerWasted(_,killer,weapon) namekiller = getPlayerName(killer) namemuerto = getPlayerName(source) weaponn = tostring(weapon) exports.AC_message:outputTopBar(namekiller.." mato a: "..namemuerto.. " con " ..weaponn, getRootElement(), 255, 0, 0) end addEventHandler("onPlayerWasted",getRootElement(),onPlayerWasted)
-
Server-Side servertrackmode = 1 servertrackedplayer = nil addEvent( "onTrackModeChange", true ) function trackModeChanged ( trackmode, trackedplayer ) servertrackmode = trackmode if trackedplayer then triggerClientEvent ( "onTrackerUpdated", getRootElement(), trackmode, trackedplayer ) servertrackedplayer = trackedplayer else triggerClientEvent ( "onTrackerUpdated", getRootElement(), trackmode ) end end addEventHandler( "onTrackModeChange", getRootElement(), trackModeChanged ) addEvent( "onJoinerSyncrequest", true ) function trackModeSync () if servertrackedplayer ~= nil then triggerClientEvent ( "onTrackerUpdated", source, trackmode, trackedplayer ) else triggerClientEvent ( "onTrackerUpdated", source, trackmode ) end end addEventHandler( "onJoinerSyncrequest", getRootElement(), trackModeSync ) function refreshTrackInfo() if isElement(servertrackedplayer) then local theVehicle = getPedOccupiedVehicle(servertrackedplayer) if theVehicle == false then vehicle = "on foot" else vehicle = getVehicleName(theVehicle) end location = getElementZoneName(servertrackedplayer) city = getElementZoneName(servertrackedplayer, true) local theWeapon = getPedWeapon(servertrackedplayer) weapon = getWeaponNameFromID (theWeapon) armor = getPedArmor(servertrackedplayer) triggerClientEvent (getRootElement(), "onTrackerInfoUpdate", servertrackedplayer, vehicle, location, city, weapon, armor ) end end setTimer(refreshTrackInfo, 10000, 0) Client-Side modelX, modelY, modelZ = 219.9765, 1822.8145, 6.533 -- minimap location showLegend = createColSphere ( modelX, modelY, modelZ, 13 ) --colshape for activating nametags function makeMapMarker (player) local r, g, b = getPlayerNametagColor ( player ) local themarker = createMarker ( modelX, modelY, modelZ, "cylinder", .05, r, g, b, 255 ) setElementData ( player, "Radar_marker", themarker, false ) end function ResourceStart(startedresource) if startedresource == getThisResource() then Radar_items = getElementsByType( "player" ) for k,v in ipairs(Radar_items) do makeMapMarker (v) end setTimer(Radar_check, 250, 0) end end addEventHandler( "onClientResourceStart", getRootElement(), ResourceStart ) function PlayerJoin ( ) makeMapMarker (source) end addEventHandler( "onClientPlayerJoin", getRootElement(), PlayerJoin) function PlayerQuit ( ) destroyElement( getElementData ( source, "Radar_marker" ) ) end addEventHandler( "onClientPlayerQuit", getRootElement(), PlayerQuit) function Radar_check() Radar_items = getElementsByType( "player" ) for k,v in ipairs(Radar_items) do if isElement(v) then x,y,z = getElementPosition ( v ) x = x / 1642.935378 y = y / 1642.935378 z = z / 1642.935378 local themarker = getElementData ( v, "Radar_marker" ) setElementPosition ( themarker, modelX-y, modelY+x, modelZ+z ) --Whack math is because west is north on 3d model end end end function ColShapeHit ( theElement, matchingDimension ) if theElement == getLocalPlayer() then if not mapNamesHandler then mapNamesHandler = addEventHandler ( "onClientRender", root, ClientRender ) end end end addEventHandler("onClientColShapeHit",showLegend,ColShapeHit) function ColShapeLeave ( theElement, matchingDimension ) if theElement == getLocalPlayer() then if mapNamesHandler then removeEventHandler ( "onClientRender", root, ClientRender ) mapNamesHandler = nil end end end addEventHandler("onClientColShapeLeave", showLegend, ColShapeLeave ) function ClientRender () if trackmode == 1 then local Radar_items = getElementsByType( "player" ) for k,v in pairs(Radar_items) do local r, g, b, a = getMarkerColor ( getElementData ( v, "Radar_marker" ) ) local x, y, z = getElementPosition ( getElementData ( v, "Radar_marker" ) ) local zOffset = (k/20)+.3 local screenX, screenY = getScreenFromWorldPosition ( x, y, z + zOffset ) local screenXX, screenYY = getScreenFromWorldPosition ( x, y, z ) --For the marker if screenX ~= false and screenXX ~= false then local name = getPlayerName ( v ) dxDrawText ( name, screenX, screenY, screenX, screenY, tocolor(r, g, b) ) dxDrawLine ( screenX, screenY+13, screenXX, screenYY, tocolor(r,g,b), 1 ) end end elseif trackmode == 2 then local randomalpha = math.random( 70, 200 ) setElementAlpha(holoped, randomalpha) local r, g, b, a = getMarkerColor ( getElementData ( trackedplayer, "Radar_marker" ) ) local x, y, z = getElementPosition ( getElementData ( trackedplayer, "Radar_marker" ) ) local zOffset = .3 local screenX, screenY = getScreenFromWorldPosition ( modelX, modelY, modelZ+.4 ) local screenXX, screenYY = getScreenFromWorldPosition ( x, y, z ) --For the marker if screenX ~= false and screenXX ~= false then local screenXXX, screenYYY = getScreenFromWorldPosition ( modelX, modelY, modelZ+1.5 ) if screenXXX ~= false then local name = getPlayerName (trackedplayer) dxDrawText ( name, screenXXX+40, screenYYY-15, screenX, screenY, tocolor(r, g, b) ) local hp = getElementHealth ( trackedplayer) roundedhp = math.round(hp) if trackedarmor ~= nil then dxDrawText ( "Health: "..roundedhp, screenXXX+40, screenYYY, screenX, screenY, tocolor(r, g, b) ) dxDrawText ( "Armor: "..trackedarmor, screenXXX+40, screenYYY+15, screenX, screenY, tocolor(r, g, b) ) dxDrawText ( "Location: "..trackedlocation..", "..trackedcity, screenXXX+40, screenYYY+30, screenX, screenY, tocolor(r, g, b) ) dxDrawText ( "Weapon: "..trackedweapon, screenXXX+40, screenYYY+45, screenX, screenY, tocolor(r, g, b) ) dxDrawText ( "Vehicle: "..trackedvehicle, screenXXX+40, screenYYY+60, screenX, screenY, tocolor(r, g, b) ) else dxDrawText ( "Scanning...", screenXXX+40, screenYYY, screenX, screenY, tocolor(r, g, b) ) end end dxDrawLine ( screenX, screenY, screenXX, screenYY, tocolor(r,g,b), 1 ) end end end trackedvehicle = nil trackerMarker = createMarker (modelX-7.5596, modelY+.022, modelZ-1.019, "cylinder", 1.5, 255, 255, 0, 40 ) tracker_Window = {} tracker_Button = {} tracker_Grid = {} tracker_Window[1] = guiCreateWindow(123,142,223,228,"Tracking controls",false) guiWindowSetSizable(tracker_Window[1],false) tracker_Player = guiCreateButton(0.0942,0.8114,0.3901,0.136,"track player",true,tracker_Window[1]) tracker_All = guiCreateButton(0.5022,0.8158,0.3901,0.1316,"track all",true,tracker_Window[1]) tracker_Grid = guiCreateGridList(0.0852,0.136,0.8072,0.6491,true,tracker_Window[1]) guiGridListSetSelectionMode(tracker_Grid,2) column = guiGridListAddColumn( tracker_Grid, "Player Name", 0.85 ) guiSetVisible ( tracker_Window[1], false ) trackmode = 1 trackedplayer = nil trackedarmor = nil trackedlocation = nil trackedcity = nil trackedweapon = nil trackedvehicle = nil function showPlayerButton() guiSetVisible ( tracker_Player, true ) end addEventHandler ( "onClientGUIClick", tracker_Grid, showPlayerButton) holoped = createPed ( 0, modelX, modelY, modelZ+1.4 ) setElementAlpha(holoped, 0) setPedFrozen(holoped, true) setElementCollisionsEnabled(holoped, false) setPedVoice(holoped, "PED_TYPE_DISABLED") function showTrackerGui ( hitPlayer, matchingDimension ) if (hitPlayer == getLocalPlayer()) and (isPedOnGround ( getLocalPlayer())) then guiGridListClear(tracker_Grid) guiSetVisible ( tracker_Window[1], true ) guiBringToFront ( tracker_Window[1] ) guiSetVisible ( tracker_Player, false ) showCursor ( true ) for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( tracker_Grid ) guiGridListSetItemText ( tracker_Grid, row, column, getPlayerName(playeritem), false, false ) end end end addEventHandler ( "onClientMarkerHit", trackerMarker, showTrackerGui ) function trackerMarkerLeave ( hitPlayer, matchingDimension ) if (hitPlayer == getLocalPlayer()) then guiSetVisible ( tracker_Window[1], false ) showCursor ( false ) end end addEventHandler ( "onClientMarkerLeave", trackerMarker, trackerMarkerLeave ) function trackplayer() local itemrow,itemcolumn = guiGridListGetSelectedItem(tracker_Grid ) if itemrow ~= -1 then local playerName = guiGridListGetItemText (tracker_Grid, guiGridListGetSelectedItem(tracker_Grid ), 1 ) trackedplayer = getPlayerFromName(playerName) if trackedplayer ~= false then setElementModel(holoped,getElementModel(trackedplayer)) trackmode = 2 triggerServerEvent ("onTrackModeChange", getLocalPlayer(), trackmode, trackedplayer ) end else trackmode = 1 triggerServerEvent ("onTrackModeChange", getLocalPlayer(), trackmode ) end guiSetVisible ( tracker_Window[1], false ) showCursor ( false ) end addEventHandler ( "onClientGUIClick", tracker_Player, trackplayer) function trackall() guiSetVisible ( tracker_Window[1], false ) showCursor ( false ) trackmode = 1 triggerServerEvent ("onTrackModeChange", getLocalPlayer(), trackmode ) setElementAlpha(holoped, 0) end addEventHandler ( "onClientGUIClick", tracker_All, trackall) addEvent( "onTrackerUpdated", true ) function syncTrackMode ( newtrackmode, newtrackedplayer ) if newtrackmode == 1 then trackmode = 1 setElementAlpha(holoped, 0) trackedarmor = nil elseif newtrackmode == 2 then trackmode = 2 trackedplayer = newtrackedplayer setElementModel(holoped,getElementModel(trackedplayer)) trackedarmor = nil end end addEventHandler( "onTrackerUpdated", getRootElement(), syncTrackMode ) function didTrackedplayerQuit() if source == trackedplayer then trackmode = 1 setElementAlpha(holoped, 0) trackedarmor = nil end end addEventHandler( "onClientPlayerQuit", getRootElement(), didTrackedplayerQuit ) function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end addEvent( "onTrackerInfoUpdate", true ) function syncTrackMode(vehicle, location, city, weapon, armor) if vehicle then trackedvehicle = vehicle end if location then trackedlocation = location end if city then trackedcity = city end if weapon then trackedweapon = weapon end if armor then trackedarmor = armor end end addEventHandler( "onTrackerInfoUpdate", getRootElement(), syncTrackMode ) Recuerda cambiar las cordenadas del Client-side a la base y el Market Facil, Ve a tu carpeta de resources, Copia el Server side y Clien-side de RadarArea51, Haz un mapeo del mismo radar del area51 en una base, cambia todas las cordenadas, Ojo Las cordenadas y rotacion tienen que estar bien para que encajen las ubicaciones de cada jugador en el radar de la base recuerda cambiarle el nombre de la carpeta del 2do radar ej: radarbasejls
-
Si pero al sacar el enablenight solo desactivas la noche todo el dia en el server va ser de dia con lo que te pase aun que tengas el enablenight, La noche se vera normal, mas clara como en el GTA comun.
-
Sigo teniendo eso , el tema de la animacion ya lo arregle modificando todo los archivs survivorsystem y surivorsystem_client
-
jaja me re olvide de las imagenes XDD