Jump to content

Search the Community

Showing results for tags 'script'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Member Title


Gang


Location


Occupation


Interests

  1. Não estou conseguindo colocar apenas para a ACL "Superior" conseguir mandar anuncio na tela com um Script que peguei na internet alguém ajuda?? Arquivos que contém dentro da pasta, todos os scripts fazem parte do mesmo mod, mas veem em arquivos .lua diferentes. SCR 1 addCommandHandler( global.Comando, function(playerSource, cmd, ...) local text = table.concat({...}, " ") if text then local namePlayer = getPlayerName(playerSource) triggerClientEvent(root, "KKZinho:AnunciarStaff", playerSource, namePlayer, text) end end) SCR 2 global = { ["Duracao"] = 3, -- Duração na tela em segundos. ["Comando"] = "anuncio", -- Comando utilizado. } SCR 3 local screenW,screenH = guiGetScreenSize() local resW,resH = 1366,768 local x,y = (screenW/resW), (screenH/resH) local font = dxCreateFont( "assets/font.ttf", 10 ) local pos_x = x*0 local pos_x2 = x*0 local pos_x3 = x*0 local painelAnuncio = false function drawDx() dxDrawImage(x*20, y*284, x*280, y*200, "assets/main.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText(sendMessage, pos_x2, y*329, x*282, y*468, tocolor(255, 255, 255, 255), 1.00, font, "left", "top", false, true, false, false, false) dxDrawText("@"..nameSender.." #ffffffanunciou:", pos_x3, y*298, x*232, y*317, tocolor(255, 255, 255, 255), 1.00, font, "left", "top", false, true, false, true, false) end function animateDraw() local initialTime = getTickCount() local duration = 1500 function animateInitial() local currentTime = getTickCount() local passedTime = currentTime - initialTime if passedTime >= global.Duracao*1000 then removeEventHandler("onClientRender", root, animateInitial) removeEventHandler("onClientRender", root, drawDx) painelAnuncio = false end local progress = passedTime / duration pos_x = interpolateBetween(0, 0, 0, 20, 0, 0, progress, "OutElastic") pos_x2 = interpolateBetween(0, 0, 0, 33, 0, 0, progress, "OutElastic") pos_x3 = interpolateBetween(0, 0, 0, 89, 0, 0, progress, "OutElastic") setTimer( function() pos_x = interpolateBetween(20, 0, 0, 0, 0, 0, progress, "InElastic") pos_x2 = interpolateBetween(33, 0, 0, 0, 0, 0, progress, "InElastic") pos_x3 = interpolateBetween(89, 0, 0, 0, 0, 0, progress, "InElastic") end, global.Duracao*1000, 1) end if not painelAnuncio then addEventHandler("onClientRender", root, animateInitial) addEventHandler("onClientRender", root, drawDx) painelAnuncio = true end end function callAll(senderName, messageSend) if senderName then if messageSend then nameSender = senderName sendMessage = messageSend animateDraw() playSoundFrontEnd(4) end end end addEvent("KKZinho:AnunciarStaff", true) addEventHandler("KKZinho:AnunciarStaff", getRootElement(), callAll) meta <meta> <script src="KakaG.lua" type="shared"/> <script src="KakaC.lua" type="client"/> <script src="KakaS.lua" type="server"/> <file src="assets/main.png"/> <file src="assets/font.ttf"/> </meta>
  2. Quiero ese guion pero no lo encuentro
  3. Estou tentando por o addcommandhandler mas não consigo de forma nenhuma, se alguém tiver a solução para algum dos 3 scripts a baixo me avisa fznd o favor estou tentando abrir painel DX por comando ao em vez de por bindkey porem não consigo, já tentei de vários jeitos e formas porem nn vai, já pesquisei aqui no fórum, no YouTube porem nn vai function Pdx ( ) dxDrawRectangle(504, 197, 314, 397, tocolor(255, 0, 0, 100), false) dxDrawRectangle(554, 238, 218, 72, tocolor(255, 255, 255, 255), false) dxDrawRectangle(554, 347, 218, 72, tocolor(255, 255, 255, 255), false) dxDrawRectangle(554, 455, 218, 72, tocolor(255, 255, 255, 255), false) end function abrir (_,state) if painel == false then showCursor(true) addEventHandler("onClientRender", root, Pdx) painel = true else showCursor(false) removeEventHandler("onClientRender", root, Pdx) painel = false end end addCommandHandler("disappear", abrir) addCommandHandler("v", abrir) tabem tentei fazer uma versão para uma bussola: --2017 ~ Mark Gyori https://markgyori.eu/ --Contact: [email protected] local sx, sy = guiGetScreenSize() local top = 30 local font1 = dxCreateFont("font.otf", 11) local font2 = dxCreateFont("font.otf", 10) local exibir_bulssola = false local cords = { {0, "N"}, {15, 15}, {30, 30}, {45, "NE"}, {60, 60}, {75, 75}, {90, "E"}, {105, 105}, {120, 120}, {135, "SE"}, {150, 150}, {165, 165}, {170, "S"}, {195, 195}, {210, 210}, {225, "SW"}, {240, 240}, {255, 255}, {270, "W"}, {285, 285}, {300, 300}, {315, "NW"}, {330, 330}, {345, 345} } function draw ( ) local show = 15 local center = math.ceil(show / 2) - 1 local _, _, r = getElementRotation(getCamera()) local pos = math.floor(r / 15) local slotwidth = 40 local smooth = ((r - (pos * 15)) / 15) * slotwidth local left = sx / 2 - ((show + 2) * slotwidth)/2 for i=1, show do local id = i + pos - center if(id > #cords)then id = id - #cords end if(id <= 0)then id = #cords - math.abs(id) end if(cords[id])then local alpha = (tonumber(cords[id][2]) or 0 > 0) and 175 or 255 if(i < center)then alpha = alpha * (i/center) end if(i > center)then alpha = alpha * ((show-i)/center) end dxDrawRectangle(left + slotwidth * i - smooth + (slotwidth / 2 - 1) + 1, top + 10 + 1, 2, 10, tocolor(0, 0, 0, alpha * 0.5)) dxDrawRectangle(left + slotwidth * i - smooth + (slotwidth / 2 - 1), top + 10, 2, 10, tocolor(255, 255, 255, alpha)) dxDrawText(cords[id][2], left + slotwidth * i - smooth + 1, top + 20, left + slotwidth * (i+1) - smooth + 2, top + 40, tocolor(0, 0, 0, alpha * 0.5), 1, font2, "center", "center") dxDrawText(cords[id][2], left + slotwidth * i - smooth, top + 20, left + slotwidth * (i+1) - smooth, top + 40, tocolor(255, 255, 255, alpha), 1, font2, "center", "center") end end dxDrawText("➤", left + 4, top + 26 + 2, left + ((show + 3) * slotwidth) + 30, 0, tocolor(0, 0, 0, 160), 1, font1, "center", "top", false, false, false, false, false, 90) dxDrawText("➤", left, top + 26, left + ((show + 3) * slotwidth) + 30, 0, tocolor(255, 255, 255, 255), 1, font1, "center", "top", false, false, false, false, false, 90) end addCommandHandler("m1", function() if exibir_bulssola = false then addEventHandler("onClientRender", getRootElement(), draw) exibir_bulssola = true else removeEventHandler("onClientRender", getRootElement(), draw) exibir_bulssola = false end end) --->--->--->---> (inclusive tentei mudar a direção a qual ele gira não consegui se alguém souber como avisa)<---<---<---<--- e também tentei para ativar e desativar primeira pessoa na arma através de comando: function zoomarma (thePlayer) setWeaponProperty ( 30 , "poor" , "flag_aim_1st_person" , true ) setWeaponProperty ( 30 , "std" , "flag_aim_1st_person" , true ) setWeaponProperty ( 30 , "pro" , "flag_aim_1st_person" , true ) end addCommandHandeler ("m1", zoomarma ) esse addCommandHandeler não funciona de jeito nenhum
  4. Hola buenas, aclaro que no entiendo mucho sobre programación, he aprendiendo poco a poco viendo tutoriales y modificando una que otra cosa que descargo. El punto es que quiero hacer que este script de TP funcione con autos, que se pueda activar tocando el Claxon del vehículo, para que pueda Tpearme con el mismo vehiculo a un punto en especifico, y así darle un uso para "TP de Garaje", intenté cambiar el BindKey por "horn" y de un interior a otro me lleva a otras cordenadas y de un exterior no se teletransporta, estaría bastante agradecido si me pudiesen ayudar. local interiors = { -- {Ext"X", Ext"Y", Ext"Z", | IDInt, IDDim | IntX, IntY, IntZ | IDInt, IDDim | "Nombre"}, {1177.90234375, -1338.9755859375, 14.912269592285, 0, 0, 447, 2520, -98, 10, 0, "LSMD"}, {1195.3037109375, -1354.92578125, 13.389284133911, 0, 0, 1198.0654296875, -1402.2587890625, 13.257797241211, 0, 0, "Prueba"}, } enterPickup = nil exitPickup = nil local bind = "Enter" local screenW, screenH = guiGetScreenSize() addEventHandler("onClientResourceStart", resourceRoot, function() for i,v in pairs (interiors) do local enterPickup = createPickup(v[1], v[2], v[3], 3, 1318, 1) setElementInterior(enterPickup, v[4]) setElementDimension(enterPickup, v[5]) local exitPickup = createPickup(v[6], v[7], v[8], 3, 1318, 1) setElementInterior(exitPickup, v[9]) setElementDimension(exitPickup, v[10]) addEventHandler("onClientRender", root, function() if (isElementWithinPickup(localPlayer, enterPickup)) and getElementInterior(localPlayer) == getElementInterior(enterPickup) and getElementDimension(localPlayer) == getElementDimension(enterPickup) then dxDrawHelp("Propiedad : "..v[11], "Presiona "..bind.." para entrar.") elseif (isElementWithinPickup(localPlayer, exitPickup)) and getElementInterior(localPlayer) == getElementInterior(exitPickup) and getElementDimension(localPlayer) == getElementDimension(exitPickup) then dxDrawHelp("Propiedad : "..v[11], "Presiona "..bind.." para salir.") end end) bindKey(bind, "down", function() if (isElementWithinPickup(localPlayer, enterPickup)) and getElementInterior(localPlayer) == getElementInterior(enterPickup) and getElementDimension(localPlayer) == getElementDimension(enterPickup) then triggerServerEvent("warpPlayer", localPlayer, localPlayer, v[6], v[7], v[8], v[9], v[10]) elseif (isElementWithinPickup(localPlayer, exitPickup)) and getElementInterior(localPlayer) == getElementInterior(exitPickup) and getElementDimension(localPlayer) == getElementDimension(exitPickup) then triggerServerEvent("warpPlayer", localPlayer, localPlayer, v[1], v[2], v[3], v[4], v[5]) end end) end end) local blips = { -- blip ekleye bilirsiniz. {810.4853515625, -1616.16015625, 13.546875, 10}, } for i,v in pairs (blips) do createBlip(v[1], v[2], v[3], v[4], 2, 255, 255, 255, 255, 0, 100) end function guiGridListGetSelectedItemText ( gridList, column ) local item = guiGridListGetSelectedItem ( gridList ) if item then return guiGridListGetItemText ( gridList, item, column or 1 ) end return false end -- function isElementWithinPickup(theElement, thePickup) if (isElement(theElement) and getElementType(thePickup) == "pickup") then local x, y, z = getElementPosition(theElement) local x2, y2, z2 = getElementPosition(thePickup) if (getDistanceBetweenPoints3D(x2, y2, z2, x, y, z) <= 1) then return true end end return false end function round(num) if ( num >= 0 ) then return math.floor( num + .5 ) else return math.ceil( num - .5 ) end end function convertNumber( number ) local formatted = number while true do formatted, k = string.gsub( formatted, "^(-?%d+)(%d%d%d)", '%1 %2' ) if ( k==0 ) then break end end return formatted end function guiComboBoxAdjustHeight ( combobox, itemcount ) if getElementType ( combobox ) ~= "gui-combobox" or type ( itemcount ) ~= "number" then error ( "Invalid arguments @ 'guiComboBoxAdjustHeight'", 2 ) end local width = guiGetSize ( combobox, false ) return guiSetSize ( combobox, width, ( itemcount * 20 ) + 20, false ) end
  5. It's me again. I was testing my edited vehicle script and found a error, when the player enters in the vehicle, It's doesnt matter the chair, they can turn on the engine even if they sit down behind the driver position. I was wondering, there is a recourse that could prevent this? I mean, only execute the comand "turn on the vehicle" when player is sitting in the driver's chair
  6. Hello everyone. The thing is that I have a performance problem with my mappings. I have them converted to lua on serverside, but I feel that this way it consumes more because they are root. My doubt in this case is how a mapping is more stable and light, so that it does not consume many resources from the clients. How do you consume less? Lua client-side Lua server-side map .map Thank you!
  7. Selamlar Beyler Askeri Rp Sunucum İçin F2 Plugini Gerek Sadece Can Ve Zırh Olcak Yapabilcek Arkadaş Varsa Discorddan İletişime Geçerse Çok İyi Olur TravisSakat#0001
  8. Boa noite mestres! Eu modelei uma nova placa para a viny sem ter que remover a placa original e criar um novo mapa, porém, quando me distancio dela, ela aparece o da viny. Como eu posso usar setOcclusionsEnabled( false ) apenas com o script engineReplaceModel? ^Podem me ajudar por favor?
  9. Boa Tarde, queria saber como faço para remover o bug de renderização, tenho torres modeladas no servidor e editei a área 51 só que o único problema é que ela some e o jogador que esta encima da torre aparece flutando, pq a torre "some". Já tentei ver a distancia não é. Já tentei colocar cada objeto em .Lua e executar modo server e ainda continua o Bug. Tava pesquisando no fórum e teve mais gente com esse problema, pode ser quando remove um objeto no editor de maps ele fica bugado? Não sei mais o que fazer podem me ajudar?
  10. I need help, I'm wanting to implement admins tags in my chat/scoreboard on my tactics server, however, GM is completely compiled and the scoreboard doesn't have the default exports, and even if I create a tag system it makes another chat and it does not replace the gm one, could someone help me?
  11. Galera to fazendo um sistema de painel q vc digita no painel tipo 255, 0, 0 dentro de um carro e seta a cor vermelha no carro q e do rgb 255, 0, 0 e etc. mas da forma que achei que era possivel ao abrir o painel e digitar a cor em rgb eu fiz uma função que na teoria era pra pegar oq foi digitado na editbox e setar oq foi digitado na editbox como cor do carro usando setVehicleColor so q n aparece nada e n seta cor no carro mais se o carro ta vermelho e coloca tipo 255, 0, 0 na editbox e da ok a cor sempre muda pra preto espero q de para entender function SetarCor (playerSource, getMsg) --local mensagem = tonumber(getMsg) local uVehicle = getPedOccupiedVehicle( playerSource ) if isPedInVehicle( playerSource ) then if uVehicle then -- if mensagem == "Vermelho" then setVehicleColor( uVehicle, tonumber(getMsg)) end end --end end addEvent("SetarCor", true) addEventHandler("SetarCor", getRootElement(), SetarCor) PARTE DO CLIENT function rgbtrigger (button, state) if painel == true then if button == "left" and state == "down" then if isCursorOnElement(screenW * 0.6384, screenH * 0.5885, screenW * 0.7379, screenH * 0.6185) then local getMsg = tostring(getElementData(msgstaff, "CMT_Txt")) removeEventHandler("onClientRender", root, dx) triggerServerEvent("SetarCor", getLocalPlayer(), localPlayer, getMsg) painel = false showCursor(false) end end end end addEventHandler("onClientClick", root, rgbtrigger)
  12. eu queria fazer com que quando o player saia do carro de sedex ele tenha 10 segundos para voltar senao o carro despawnaria entao poderia me ajudar com isso
  13. Olá pessoal estou com outro problema diferente agora, basicamente tou com um mod de trancar veiculos aqui porem ele veio com o som de trancar veiculo muito feio, consegui trocar o som quando o player tranca o veiculo sem estar nele porem tou tendo dificuldades para conseguir colocar um som diferente se o player estiver dentro do veiculo server side function doToggleLights ( source, beep ) local theVehicle if ( getElementType(source) == "vehicle" ) then theVehicle = source end if ( getElementType(source) == "player" ) then theVehicle = getElementData ( source, "cl_ownedvehicle" ) end if ( theVehicle ) then if (getElementType(source) == "player") then if not (getPedOccupiedVehicle(source)) then if ( getVehicleOverrideLights ( theVehicle ) ~= 2 ) then -- if the current state isn't 'force on' setVehicleOverrideLights ( theVehicle, 2 ) -- force the lights on -- play sound close to element if ( beep == true ) then local theElement = theVehicle triggerClientEvent ( getRootElement(), "playSoundLockOut", getRootElement(), theElement, 5) end else setVehicleOverrideLights ( theVehicle, 1 ) -- otherwise, force the lights off end else if ( beep == true ) then local theElement = theVehicle triggerClientEvent ( getRootElement(), "playSoundLockIn", getRootElement(), theElement, 5) end end end else end end Obrigado a quem puder ajudar Principalmente ao @Lord Henryque tem me ajudado bastante aqui!
  14. Olá Tenho um sistema de seta mas ta encriptado porem preciso do element data dele para adicionar no velocimetro o desenvolvedor foi o tommy scripter acho se alguem souber os element data das setas agradecia ou outro mod de dar seta
  15. Estou fazendo uma função que preciso que pegue do 200 ate 600 so que na barra de rolagem. E to com dificuldade para fazer ele so contar do 200 ate 600. local volume1 = guiScrollBarGetScrollPosition (source)*10 guiSetText(distH,tostring(volume1)) esta função pega de 0 ~ 1000. Quero que ele conte de 200 ate 600 quando passo a rolagem
  16. Pessoal eu to fazendo um menu no canto direito da tela, com a dxDrawText, funcionou certinho ate olhei no forum para deixar o dxDrawText no canto direito da tela e do lado esquerdo so do lado esquerdo eu consegui fazer, mais o lado direito ele some , vou mostrar uma imagem. Print: https://ibb.co/wsz6929 addEventHandler("onClientRender", getRootElement(), function() local menuCX = screenWidth*0.545 local menuCY = screenHeight*0.135 dxDrawRectangle(menuCX-2, menuCY+110, screenHeight*0.25, screenHeight*0.12, tocolor(0, 0, 0, 170)) dxDrawText("Murders: ",menuCX+3,menuCY+131,0,0,tocolor(255,255,255,255),1, "default", "left", "top", false, false, false, true, false) end) Quando eu coloco o right não aparece mais na tela mais o left funcionou certinho. eu queria que ela fica-se encostado no lado direito da tela
  17. Eu troquei o script de voice do meu server para descobrir porque um script de radinho não funcionava, mas cometi o erro de excluir o original dentro do jogo, ai perdi a pasta. E esse novo, tem o áudio muito baixo. Já configurei o Mtaserver. O anterior eu tinha resolvido em outro tópico que tinham feito, mas aquela solução não esta mais funcionando ;-;
  18. I've been trying to save the position of the player's character and it saves... but in a new table, not in the main one where its the account's name, the character's name and the rest. -> This is what happens<- This is the code I'm using for the "character money, position, and health" // i translated some concepts to english so you can understand easly what I'm trying to make: (server-side) function saveDataCharacter() local x, y, z = getElementPosition(source) local money = getPlayerMoney(source) local health = getElementHealth(source) local sendInfo = exports.mysql:_Exec("INSERT INTO characters (x,y,z, money, health) VALUES (?,?,?,?,?)", x, y, z, money, health) if (sendInfo) then iprint("Data saved") else iprint("Error saving") end end end addEventHandler("onPlayerQuit", getRootElement(), saveDataCharacter)
  19. Boa noite senhores, Estou com problema para salvar uns dados que eu preciso. saveDataMis = { {"_killzombies_"}, {"_killzombies_Max_"}, {"_killzombies_City_"}, {"_explores_"}, {"_explores_timer_"}, {"_explores_timer_Max_"}, } Quero salvar ele usando 2 tabelas para procurar depois do _ ex: level_killzombies_ City (level e cidade (zona) Eu fiz assim component = {"LV01_01", "LV01_02","LV01_03", "LV01_04", "LV01_05", "LV01_06", "LV01_07", "LV01_08", "LV01_09", "LV01_10"} zones = {"Las Venturas", "Los Santos","Tierra Robada", "Bone County", "San Fierro", "Red County", "Whetstone", "Flint County", "Los Santos"} function leveis2() for i,hud in ipairs(component) do leveis = hud end for i,hud2 in ipairs(zones) do zone = hud2 end return leveis,zone end addEventHandler("onPlayerQuit",getRootElement(),function(quitType, reason, responsibleElement) local account = getPlayerAccount(source) if account then if not getElementData(source,"logedin") then return end local level,zone = leveis3() for i,data in ipairs(saveDataMis) do setAccountData(account,tostring(level..data[1]..zone),tonumber(getElementData(source,tostring(level..data[1]..zone)))) end end end) Ele nao esta puxando todos os elementos da tabela, ele so pega o elemento final do component e zones. É meio complicado de explicar. Mais espero que entendam eu preciso so fazer salvar estes elementos. Eu queria editar criar varias linhas na tabela por isso fiz isso. obrigado
  20. I was testing the "create character" system I been working on with a friend, and we did not expect this... when we both register our accounts and create our characters we can't see each other, we are invisibles, I don't know how to prevent this or what did I scripted wrong, please, help This is the part that TP our characters and I think here it's the problem: (Client-Side) addEventHandler("onClientGUIClick", btnSeleccionar, function() showCursor(false) guiSetVisible(ventanaElegirSkinsM, false) setElementPosition ( getLocalPlayer(), 1742.9543457031,-1862.6853027344,13.575992584229) setElementDimension( getLocalPlayer(), 0) setElementRotation( getLocalPlayer(), -0, 0, 357.78338623047) setElementInterior( getLocalPlayer(), 0) triggerServerEvent("descongelar", getLocalPlayer(), localPlayer) setPlayerMoney(2500) All the rest of the code runs like I wanted, the money, the triggerevent, the position, etc, but for some reason, the script send us to different "interiors" or "dimensions". And, most important thing is that when we both create our character, we can't see each other new nickname, the skin neither
  21. I made a login menu for my server, I wanted to put some buildings as a background so I used setCameraMatrix, all works perfectly, but when I try to cancel the camera position and the music (I added playSound too) it doesn't work and the camera keeps far from the player, and the music keeps playing Client-Side function fondoLogin(thePlayer) local cancion = playSound("loginSoundtrack.mp3") setSoundVolume(cancion, 0.5) setElementPosition(thePlayer, -1400.2099609375,106.88999938965,1032.2734375) setElementInterior(thePlayer, 1) setCameraMatrix ( 1709.7098388672,-1449.96484375,151.87727355957, 1537.9990234375,-1276.736328125,238.57434082031, 0, 100 ) triggerServerEvent(source, "parartodo", source) end addEvent("posicionar", true) addEventHandler("posicionar", getLocalPlayer(), fondoLogin) ---------Suposed to stops the music and cameraMatrix---------------- function parartodo(thePlayer, cancion) setCameraTarget (thePlayer) stopSound(cancion) end addEvent("pararmusicaycamara", true) addEventHandler("pararmusicaycamara", getLocalPlayer(), parartodo) Server-Side function registroHRP(user, clavecreada) if(addAccount(user, clavecreada))then outputChatBox("Bienvenido") triggerClientEvent(source, "cerrar", source) logIn(source, getAccount(user, clavecreada), clavecreada) setElementPosition(source, 209.41818237305,-33.872188568115,1001.9296875) setElementInterior(source, 1) setElementDimension(source, 1) setPedRotation(source, 180) triggerClientEvent(source, "pararmusicaycamara", source) else outputChatBox("La cuenta ya existe.") end end -----------"triggerClientEvent(source, "pararmusicaycamara", source)" doesn't work--------------
  22. He estado editando un script de vehiculos para hacerlo funcionar en un RP pero tengo un problema a la hora de ejecutar el comando de cerrar el vehículo, se cierra perfectamente, desde afuera nadie lo puede abrir a menos que el dueño lo abra, pero el tema es que si el dueño cierra por dentro, aún así puedes salir. Investigué un poco y encontré que se podía hacer algo con cancelEvent, he intentado de todo pero nada parece funcionarme con ese comando, algún consejo?
  23. I have been editing a vehicle script to make it work in a RP but I have a problem when executing the command to lock the vehicle, it locks perfectly from the outside, nobody can enter unless the owner unlocks the vehicle, but the problem is that if the owner locks inside, you can still go out. I did some research and found that something could be done with cancelEvent and "onClientVehicleStartExit", I've tried everything but nothing seems to work for me with that command, any advice? This is the code: function setPlayerVehicleLocked(player, vehicle) local vehname = vehicle:getName() if (vehicle:getData("vehicles:locked") == 1) then vehicle:setData("vehicles:locked", 0) vehicle:setLocked(false) player:outputChat("Desbloqueaste tu "..vehname..".", 214, 37, 37) connection:exec("UPDATE vehicles SET locked=? WHERE id=? AND owner=?", 0, vehicle:getData("vehicles:id"), vehicle:getData("vehicles:owner")) elseif (vehicle:getData("vehicles:locked") == 0) then vehicle:setData("vehicles:locked", 1) vehicle:setLocked(true) player:outputChat("Bloqueaste tu "..vehname..".", 141, 229, 22) connection:exec("UPDATE vehicles SET locked=? WHERE id=? AND owner=?", 1, vehicle:getData("vehicles:id"), vehicle:getData("vehicles:owner")) end end function onclientVehicleStartExit() if (vehicle:getData("vehicles:locked") == 0) then cancelEvent(onVehicleStartExit) end end ("onclientVehicleStartExit", root, onVehicleStartExit)
  24. BOA TARDE, Desde já desejo um FELIZ ANO NOVO A TODOS DA COMUNIDADE. Venho pedir a ajuda de voces, ja tentei e tudo e o erro ainda continua. Eu coloquei um Timer quando o "ped" sai de uma ColShope e ele executa este element. So que ele nao reconhece o Element e da o ERRO OBRIGADO Bad argument @ 'setElementData' [Expected element at argument 1] function ZombieExit2(element) if isElement(element) and getElementType(element) == "ped" then local spawn_ztype = tonumber(getElementData(element,"spawn_ztype")) if spawn_ztype == 9 or spawn_ztype == 11 or spawn_ztype == 2 or spawn_ztype == 3 or spawn_ztype == 4 or spawn_ztype == 5 or spawn_ztype == 6 or spawn_ztype == 7 or spawn_ztype == 8 or spawn_ztype == 10 or spawn_ztype == 20 then setElementData(element,"zombieExit",element) setTimer(function(element) setElementData(element,"zombieTimer",getElementData(element)) end,40000,1,element) end end end addEventHandler ( "onColShapeLeave", ColCuboid2, ZombieExit2 )
  25. Hello guys I recently had ideas for setting up a server in MTA. I heard a bit about lua and its characteristics. I wanted to know what programming languages are needed to set up a game server in MTA and manage it from beginner to professional. thank you.
×
×
  • Create New...