Search the Community
Showing results for tags 'lua'.
-
Hi friends, I have a small problem In the console it gives this warning Bad argument @ 'setElementModel' [Expected element at argument 1, got number '100'] Which corresponds to the following line setElementModel (tonumber(getElementData(accSys:getPlayerAcc(thePlayer), "cSkin"))) cods ---- admin duty skin ---- addCommandHandler("a209", function ( thePlayer, command ) if tonumber(getElementData(accSys:getPlayerAcc(thePlayer), "pAdmin")) < 10 then return false end setElementData(accSys:getPlayerAcc(thePlayer), "dSkin", 209) setElementModel (thePlayer, 209) end) --- admin off skin ---- addCommandHandler("o209", function ( thePlayer, command ) if tonumber(getElementData(accSys:getPlayerAcc(thePlayer), "pAdmin")) < 10 then return false end setElementModel (tonumber(getElementData(accSys:getPlayerAcc(thePlayer), "cSkin"))) end) in part of ---- admin duty skin ---- There is no problem in the ---- admin duty skin ---- part but In the second part, --- admin off skin ----, when I order, Warning comes The second part must set the player model from the part of cSkin But it does not and gives high warning Sorry for the bad English language Please help me, my only hope is you
-
Mas não consigo, algo da errado no 'isElementInRange', alguém poderia me ajudar? addCommandHandler("car", function(thePlayer,veh) local x, y, z = getElementPosition (thePlayer) local veh = getElementsByType('vehicle') if isElementInRange(veh, x, y, z, 25) then outputChatBox("teste",thePlayer,255,255,255,true) end end end ) Print do erro: https://prnt.sc/12bhy03
-
Пытались уже таблицой сделать не чего не вышло Очень странно! Что же не так?
-
Anyone can send me a working yt mp3 converter API? Or how to create one, to play music from youtube on my server?
-
Eu sou novo no fórum e novo em script em lua, queria saber qual o problema que o meu script de limpar chat não funciona, o que eu quero fazer é com que a ACL Staff consiga usar o comando... ( esse é o server side ) function limpar(player) local accountname = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)) , aclGetGroup("Staff")) then outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") triggerClientEvent(root, "limparchat", root, getPlayerName( player ) ) else outputChatBox("Você não tem acessa a este comando !", player, 255, 100, 100, true) end end addCommandHandler("chat", limpar) (EDIT) O Erro do debug é este abaixo
-
Welcome to my store If you want to buy from Turkey, please contact me on Discord (Hexon#0388) Contacts Discord: Hexon#0388 E-mail: [email protected] YouTube: https://www.youtube.com/hexondev Facebook: https://www.facebook.com/hexondev If you found a bug please ontat me on Discord (Hexon#0388) [MTA:SA] Fire system 0.2 (UPDATED AT 05/02/2021) [MTA:SA] WhatsApp messenger [MTA:SA] Animation system with custon anim support & anim circle [MTA:SA] Taximeter [MTA:SA] Car trailer [MTA:SA] Scratch card game [MTA:SA] Spinner with new design [MTA:SA] Pointing system [MTA:SA] Spike system (Free) [MTA:SA] Weapon skin panel [MTA:SA] Garbage collector job (Bone attach required!) [MTA:SA] Trucker job [MTA:SA] Container carrier job (FREE) [MTA:SA] Container crane job [MTA:SA] Attachment system [MTA:SA] Drone system [MTA:SA] Lightbar editor with multiple lightbar support and custom siren sound [MTA:SA] Lightbar editor with multiple lightbar support [MTA:SA] Lightbar editor with custom siren sound [MTA:SA] Lightbar editor [MTA:SA] CSGO style spinner
-
function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end function playerHasItem(player, itemID) for i, v in pairs(getElementData(player, 'TS:InventarioInfo')) do if type(v) == 'table' then if v['Item'] == tonumber(itemID) then return true end end end return false end function returnQntdItem(player, itemID) if (player) then for i, v in pairs(getElementData(player, "TS:InventarioInfo")) do if (type(v) == "table") then if (v['Item'] == tonumber(itemID)) then return v['Quantidade'] end end end end return false end function verificarDistancia (player, abordado) if player and abordado then local x,y,z = getElementPosition(player) local x2,y2,z2 = getElementPosition(abordado) local distancia = getDistanceBetweenPoints3D(x,y,z,x2,y2,z2) if distancia then return distancia end end end local items = { [9] = "Cerveja(s)", } function revista (thePlayer, commandName, id) if (tonumber(id)) then local targetPlayer = getPlayerID(tonumber(id)) if (targetPlayer) then if (verificarDistancia (thePlayer, targetPlayer) > 5) then outputChatBox ("O jogador com este ID não está perto o suficiente para ser revistado.", thePlayer, 255, 150, 0) return end for i, item in pairs (items) do if (playerHasItem (targetPlayer, i) == true) then else outputChatBox ("Mochila Vazia") outputChatBox ("Libere o Cidadão") end end else outputChatBox ("✘#ffffffINFO#0037FF✘➺ #ffffff O Cidadão tem "..returnQntdItem (targetPlayer, i).." "..item.." em sua mochila!", thePlayer, 0, 55, 255, true) end end end addCommandHandler ("revistar", revista) ja tentei de todas formas esse codigo e não consigo alguem poderia me dizer aonde esta o erro ou me ajudar no codigo?
-
download it here https://github.com/rivor/dayz-mta screenshots http://prntscr.com/heso7h http://prntscr.com/hesp1n http://prntscr.com/hesp9l http://prntscr.com/hespjo http://prntscr.com/hesqgu http://prntscr.com/hesqqz http://prntscr.com/hesrb8 http://prntscr.com/hesrhg http://prntscr.com/hesrqh http://prntscr.com/hessgx http://prntscr.com/hested
-
Sou iniciante em lua e estou tentando criar um script que faça com que quando o player esteja no "ModoPassivo" e pegue um veículo, o veículo dele fique blindado, e quando ele saia do "ModoPassivo" o veículo fique normal. Acontece que simplesmente não funciona. Alguem poderia me ajudar apontando onde errei ou algo do tipo? Server: function test47 (thePlayer) if getElementData ( thePlayer, "ModoPassivo" ) == true then local theVehicle = getPedOccupiedVehicle (thePlayer) if theVehicle and isElement (theVehicle) then setVehicleDamageProof (theVehicle, true) else setVehicleDamageProof (theVehicle, false) end end end
-
PORTÃO QUE ABRE E FECHAR DEPOIS DE INICIAR UM ASSALTO
iamVitoor posted a topic in Programação em Lua
Eu tenho um sistema de assalto e quero colocar um portão na porta da loja para que o assaltante não saia da loja; O portão vai fechar quando o player iniciar o roubo e vai abrir quando o roubo terminar, alguém consegue me ajudar? -
--Função no SERVER addEvent ("DS: Pegar_armas", true) addEventHandler ("DS: Pegar_armas", root, function (jogador, plano) if plano == "Bronze" then for _, v in ipairs (armas_bronze) do if not exports.inventario: hasItemS (jogador, v) then extensions.inventario: giveItem (jogador, v, 1, 1, 1, 1) end end elseif plano == "Prata" then for _, v in ipairs (armas_prata) do if not exports.inventario : hasItemS (jogador, v) depois exporta.inventario: giveItem (jogador, v, 1, 1, 1, 1) end end elseif plano == "Ouro" então triggerEvent ("TS: giveItem", source, source, 28, 1) - Arma elseif plano == "Diamante" then for _, v in ipairs (armas_diamante) do if not extensions.inventario: hasItemS (jogador, v) depois exportações.inventario: giveItem (jogador, v, 1, 1, 1, 1) end end end end) Essa função funciona da seguinte maneira, o jogador abre o painel e ao clicar para pegar armas esse elemento 'triggerEvent ("TS: giveItem", source, source, 28, 1)' seta no invetario do mesmo a arma com id 28 e 1 quantidade, na primeira vez funciona normalmente mas na segunda ele incrementa automaticamente 2 quantiade e assim sucessivamnete, o erro pode estar nesta parte?
-
Доброго времени суток. Возникла необходимость читать на JS файлы, располагающиеся в http://mta/... (как правило там же, где и сам index.html). Вариант с input type = file отпадает, так как отсутствует возможность инжектнуть туда путь (путь к файлам не должен передаваться пользователем вручную). Пробовал разные костыли, но все они не работают из соображений безопасности ( как например загнать в css селектор в свойство content содержимое файла ). Остается вариант скачивания через XMLHttpRequest (возможен наверно аналог через fetch ). Не ясно еще возможно ли скачивание с локалхоста на локалхост. (Вопрос еще в том насколько быстро оно работать будет. Если будет.) P.S: Вариант препроцессинга html страницы на луа ( впихивание содержимого файла в значение какого либо dom объекта ) отпадает сразу, тк. суть задачи читать файлы именно на JS и именно в CEF.
-
Eu peguei uma skin da net que supostamente ela foi feita com varias camadas para txd de roupas e etc... Porem eu sou novo mexendo com modelagens e texturas no MTA, Gostaria de saber se alguem sabe algum jeito de eu trocar camada por camada? Imagem da modelagem que mostra as camadas: https://prnt.sc/veg627 no jogo a skin vem padrão "nua"
-
- skins
- modelagens
- (and 4 more)
-
Hello everyone, my name is Shay. I'm a 19 year old scripter from USA who started a good community called CoreMTA. This community is dedicated towards teaching people how to script. We also occasionally post public scripts for download on our website, which are free to download and edit. It's our goal to help the MTA community as much as possible. If you have any questions feel free to message me, email me, hit me up on discord, whatever you need. ~ ShayF Website: CoreMTA Forums: CoreMTA Forums Discord: CoreMTA Discord
-
ola pessoal, estou procurando um script que quando dou /melimpa ou tanto faz o cmd ele limpa as acl e grupos atribuidos a essa conta, não sei quais funções tenho que usar, pfv me ajudem.
-
Queria editar um bau de armas e munição acrescentando um sistema onde a facção possa guardar uma quantia de dinheiro. Porém ela seria acessavel pela facção podendo adicionar uma quantia (todos os depositos seria acumulado em apenas uma conta bancaria) e retira-la. porem membros de corporação também teria acesso para apenas retirar dinheiro de la, assim esvaziando suposto "cofre". é possivel ?
-
Olá estou com problemas em meu emprego, todo mundo mesmo quem não está atrabalhando neste emprego consegue spawnar o veiculo do trabalho apenas indo até o marker, tentei por uma proteção que faça com quem tem a skin do emprego consiga pegar o carro e o destruir. porém nenhum resultado se conseguirem me ajudar agraçederia muito. local marker = createMarker(2681.17285, -1957.08862, 12.7, "cylinder", 1.0, 0, 0, 255, 255) local Dmarker = createMarker(2679.63989, -1968.49829, 12.5, "cylinder", 3.0, 255, 0, 0, 100) function enterVehicle ( player, seat, jacked ) --quando um jogador entra em um veículo policeLimpador = { [552]=true} --ID Veiculos Policiais policeLimpadorSkins = { [27]=true } --ID Skins Policiais if ( policeLimpador[getElementModel(source)] ) and ( not policeLimpadorSkins[getElementModel(player)] ) then --se o veículo é um dos 4 carros da polícia, ea pele não é uma pele polícia cancelEvent() outputChatBox ( "#ff0000Somente Motoristas podem entrar neste veiculo", player, 255, 255, 255, true ) --and tell the player why end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) --add an event handler for onVehicleStartEnter function Vehicle( thePlayer ) if getElementType(thePlayer) == "player" then local x,y,z = getElementPosition(thePlayer) veh = createVehicle(552, 2687.59, -1970.002, 13.547, -0, 0, 266.348 ) warpPedIntoVehicle(thePlayer, veh) end end addEventHandler("onMarkerHit", marker, enterVehicle) function destroy (hitElement) if getElementType(hitElement) == "Vehicle" then destroyElement(hitElement) end end addEventHandler("onMarkerHit", Dmarker, destroy)
-
Queria saber se é possivel assim que o carro for destruido no desmanche por outro player, fazer com que o dono do carro receba a mensagem de que seu veiculo foi destruido. se sim como? abaixo é o codigo que estou tentado implementar esse funcionamento. local blipLocal = createBlip(1768, -2040, 14, 24) local marker = createMarker (1768, -2040, 12.7, "cylinder", 3, 255, 155, 30, 150); local acceptCar = true; local timerCurrent = 300000; setTimer(function() if (acceptCar == false) then setElementVisibleTo ( marker, root, true ); setElementVisibleTo ( blipLocal, root, true ); acceptCar = true; outputChatBox("#FFFF00[DESMANCHE] #FFFFFFO DESMANCHE ESTÁ A PROCURA POR VEICULOS NOVAMENTE.", root, 255, 255, 255, true); end end, timerCurrent,0) addEventHandler ( "onResourceStart", getRootElement(), function ( ) outputChatBox("#FFFF00[DESMANCHE] #FFFFFFO DESMANCHE ESTÁ COMPRANDO VEICULOS.", root, 255, 255, 255, true); end ) addEventHandler("onMarkerHit", marker, function (player) if (acceptCar == true) then local carPlayer = getPedOccupiedVehicle(player); if not (carPlayer) then return end acceptCar = false; valueCar = math.random(2500, 15000); destroyElement(carPlayer); givePlayerMoney(player, valueCar); outputChatBox("#FFFF00[DESMANCHE] #FFFFFFPARABÉNS VOCÊ RECEBEU #00ff00$"..valueCar.." #FFFFFFPOR VENDER ESTE VEICULO AO DESMANCHE.", player, 255, 255, 255, true) outputChatBox("#FFFF00[DESMANCHE] #FFFFFFO DESMANCHE ACABOU DE COMPRAR UM VEICULO E ENCERROU SUAS ATIVIDADES.", root, 255, 255, 255, true); setElementVisibleTo ( marker, root, false ); setElementVisibleTo ( blipLocal, root, false ); end end )
-
Bom Dia, Gostaria que alguém pudesse explicar como instalar o plugin MTA LUA, para o Notepad++, Estava lendo o Topico, mas não consegui entender muito bem e nem achar o Download!, Desde ja Obrigado!
-
A simple script of dressable characters and deformable faces. You can move every vertex of the head with a simple displacement shader. The script is in test state right now, I'll create a new editor later. Hope you like it.
- 17 replies
-
- 20
-
-
-
Hello dear community. I'm doing a Error Tooltip Resource, I created an Error Client File for all the Errors from my Main Register Resource, and I tried to call that resource by Functions on the same resource, How can I call a Function from the same resource and get The Object File that I want?... This is my code - Error File (InitTooltipMessage.lua) ---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•--- ---| |--- ---| Script by "Kyonax - Pilar Perfeccionista" Synchronous member |--- ---| Github: https://github.com/Kyonax • G-Mail: [email protected] |--- ---| Code Script from Montgomery Country RP |--- ---| Resource-Script: [init] |--- ---| Name-Script: [InitTooltipMessage] |--- ---| Function-Script: Save all the posible Script Errors |--- ---| |--- ---| DEV-DATE: 31/08/2020 |--- ---| Server Script |--- ---| number: 001 |--- ---| MIT License |--- ---| |--- ---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•--- local tooltip = { error = { notDataDigit = { name = 'notDataDigit', syntax = 'NULL LABEL', message = 'El campo actual debe ser completado', description = 'El campo en donde te encuentras, es un campo de entrada, es decir necesitas ingresar información para poder continuar.', type = 'ERROR', number = '1' }, notFoundAccount={ name = 'notFoundAccount', syntax = 'NULL QUERY LOGIN', message = 'No se ha podido encontrar la cuenta en la Base de Datos.', description='Se ha recibido valor NULL al realizar la búsqueda Query del Usuario en la Base de Datos, es decir que el valor Buscado no existe en la Base de Datos.', type = 'ERROR', number = '2' }, notEqual = { name = 'notEqual', syntax = 'NOT EQUAL LABEL', message = 'Los datos ingresados no son iguales.', description = 'Se ha obtenido un ERROR de similitud a la hora de comparar dos valores que deben ser exactamente iguales.', type = 'ERROR', number = '3' } incorrectInformation ={ name = 'incorrectInformation', syntax = 'NOT EQUAL QUERY', message = 'La información ingresada es incorrecta.', description = 'La comparación de el dato obtenido de la Base de Datos y el Ingresado ha devuelto un ERROR de similitud, es decir los datos ingresados no son iguales a los registrados en la base de datos.', type = 'ERROR', number = '4' }, notFoundVariables = { name = 'notFoundVariables', syntax = 'NULL INFORMATION', message = 'Las variables esenciales tienen como valor NULL.', description = 'Variables necesarias para le ejecución del código son de valor NULL, lo que indica que los valores no han sido digitadas o que han sido corrompidos.', type = 'ERROR', number = '5' }, existAccount = { name = 'existAccount', syntax = 'MULTIPLE VALUES QUERY', message = 'El usuario digitado no se encuentra disponible.', description = 'El nombre de usuario para crear la cuenta ya se encuentra registrado en la Base de Datos, lo que causa un error de multiples valores registrados.', type = 'ERROR', number = '6' }, existDiscordID = { name = 'existDiscordID', syntax = 'MULTIPLE VALUES QUERY', message = 'La ID de Discord digitada ya se encuentra en uso.', description = 'La ID de Discord se encontró en la base de datos, lo que quiere decir que otra cuenta está registrada con esta ID.', type = 'ERROR', number = '7' }, notValidPassword = { name = 'notValidPassword', syntax = 'LOW SECURITY ACCOUNT', message = 'La contraseña no es segura', description = 'Existen algunos requerimientos para acceder al Servidor, uno de ellos es tener una contraseña de más de 6 carácteres.', type = 'ERROR', number = '8' } } } local function getError(name) return tooltip.error[name] end local function getTooltip(name) return tooltip.error[name].syntax...' '...tooltip.error[name].message...' '...' ['...tooltip.error[name].type...' #' ...tooltip.error[name].number...']' end and I tried to call the getTooltip Function from another File called - RegisterBackend.lua - It's a Server Lua File local test = exports['[init]']:getTooltip('notFoundAccount').message local test2 = exports['[init]']:getError('notFoundAccount').type Both Files are on the same Resource call [Init] And this is my Meta.xml Code <!--ERROR--> <file src="src/error/InitTooltipMessage.lua" type='client'></file> <!--Exported Functions--> <export function='getError' type='client'></export> <export function='getTooltip' type='client'></export> The error that I get when I run the Code is this What I need to do? to call correctly Plss I'm Stuck in this
-
Çiftçi Mesleğinin Script Yapımı 1.Client.lua 2.server.lua 3.shared.lua 4.meta.xml Client .lua İçeriği -- Reappersz İyi Oyunlardiler. local dxMarker = createMarker(markerT[1],markerT[2],markerT[3]-0.1, "cylinder", 1, 255, 255, 255, 0) local ped = createPed(skinTractor,markerT[1],markerT[2],markerT[3]) setElementRotation(ped, 0, 0, 90) addEventHandler( "onClientRender", root, function () local x, y, z = getElementPosition(dxMarker) local Mx, My, Mz = getCameraMatrix() if (getDistanceBetweenPoints3D(x, y, z, Mx, My, Mz) <= 20) then local WorldPositionX, WorldPositionY = getScreenFromWorldPosition(x, y, z +1, 0.07) if (WorldPositionX and WorldPositionY) then dxDrawText("Çiftçi Mesleği", WorldPositionX - 1, WorldPositionY + 1, WorldPositionX - 1, WorldPositionY + 1, tocolor(0, 0, 0, 255), 1.52, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Çiftçi Mesleği", WorldPositionX - 1, WorldPositionY + 1, WorldPositionX - 1, WorldPositionY + 1, tocolor(255, 255, 255, 255), 1.50, "default-bold", "center", "center", false, false, false, false, false) end end end ) --------------------------------------------- local markerState = 1 function getMarkerCurrentState () return markerState end function updateMarkerCurrentState () markerState = markerState + 1 end function restoreMarkerCurrentState () markerState = 1 end function isMarchEnd () if getMarkerCurrentState () >= #tractorMarks then return true else return false end end local markerT = createMarker(markerT[1],markerT[2],markerT[3]-1, "cylinder", 1, 255, 255, 255, 0) local blip = createBlipAttachedTo(markerT, 25) setBlipVisibleDistance(blip, 400) function centerWindow ( center_window ) local sx, sy = guiGetScreenSize ( ) local windowW, windowH = guiGetSize ( center_window, false ) local x, y = ( sx - windowW ) / 2, ( sy - windowH ) / 2 guiSetPosition ( center_window, x, y, false ) end local sw,sh = guiGetScreenSize() local window={} local label={} local button={} wndTra = guiCreateWindow(0,0,400,120,"Çiftçi Mesleği",false) centerWindow(wndTra) guiSetVisible(wndTra,false) labeTra = guiCreateLabel(5,25,390,50," Merhaba, bu tarlayı traktör ile sürmeni istiyorum,\nbunu yapabilirmisin ?.",false,wndTra) guiSetFont(labeTra, "default-bold-small") guiLabelSetHorizontalAlign(labeTra, "center", false) buttonTra1 = guiCreateButton(10,70,180,35,"...",false,wndTra) guiSetFont(buttonTra1,"default-bold-small") guiSetProperty(buttonTra1, "NormalTextColour", "FF00FF00") buttonTra2 = guiCreateButton(210,70,180,35,"Hayır Kalsın.",false,wndTra) guiSetFont(buttonTra2,"default-bold-small") guiSetProperty(buttonTra2, "NormalTextColour", "FFFF0000") function createMarkerTractor(player) if player == getLocalPlayer() then m = tractorMarks[ getMarkerCurrentState () ] updateMarkerCurrentState () local marker = createMarker(m[1],m[2],m[3]-1, "corona", 2, 0, 255, 0, 80) setElementData(marker,"tractor_mark",true) setElementData(player,"tractor_mark",marker) local blip = createBlip(m[1],m[2],m[3],41,3) setElementData(player,"tractor_blip",blip) local obj = createObject(804,m[1],m[2],m[3]) setObjectScale(obj, 1.0) setElementCollisionsEnabled (obj, false) setElementData(player,"tractor_obj",obj) end end function deleteMarkerTractor(player) if player == getLocalPlayer() then local marker = getElementData(player,"tractor_mark") local blip = getElementData(player,"tractor_blip") local obj = getElementData(player,"tractor_obj") if marker then if isElement(marker) then destroyElement(marker) end end if blip then if isElement(blip) then destroyElement(blip) end end if obj then if isElement(obj) then destroyElement(obj) end end end end addEvent("deleteMarkerTractor", true) addEventHandler("deleteMarkerTractor", getRootElement(), deleteMarkerTractor) function startClick() local player = getLocalPlayer() if (source == buttonTra1) then guiSetVisible(wndTra,false) showCursor(false) local state = getElementData(player,"tractor_works") if not state then triggerServerEvent("start_Tractor",player,player) setElementData(player,"tractor_works",0) createMarkerTractor(player) outputChatBox("#1E90FF[BİLGİ] #FFFFFFİşe başladınız, işarete sürün.",255,255,255,true) setElementData(player,"Model Danışmanı",getElementModel(player)) setElementModel(player,158) setElementData(player,"tractor_plus",0) setElementData(player,"Kazanılan Gelir",moneyTra) else triggerServerEvent("stop_Tractor",player,player) local hodok = tonumber(state) local profit = getElementData(player,"Kazanılan Toplam kon") if not profit then profit = 0 end setElementData(player,"Kazanılan Toplam Kon",nil) setElementData(player,"Şuan Kazanılan Kon",nil) triggerServerEvent("giveMoneyTractor",player,player,profit) setElementData(player,"tractor_works",nil) setElementModel(player,getElementData(player,"Önceki Cilt Danışamanı")) deleteMarkerTractor(player) end elseif (source == buttonTra2) then guiSetVisible(wndTra,false) showCursor(false) end end addEventHandler("onClientGUIClick", getRootElement(), startClick) function onClientMarkerHit(player, mdim) if player == getLocalPlayer() then if mdim then local veh = getPedOccupiedVehicle(player) local state = getElementData(player,"tractor_works") if getElementData(source,"tractor_mark") then if veh then setElementData(player,"tractor_plus",tonumber(getElementData(player,"tractor_plus")) + 1) if getElementData(player,"tractor_plus") >= #tractorMarks then restoreMarkerCurrentState () local pacienty = tonumber(getElementData(player,"tractor_plus")) if pacienty > 0 then setElementData(player,"tractor_works",tonumber(state) + pacienty) setElementData(player,"tractor_plus",0) if not getElementData(player,"kazanılan total ") then setElementData(player,"kazanılan total",0) end if not getElementData(player,"total") then setElementData(player,"total",0) end setElementData(player,"kazanılan total",getElementData(player,"kazanılan total") + getElementData(player,"kazanlan total")) deleteMarkerTractor(player) outputChatBox("#1E90FF[BİLGİ] #FFFFFFKazanç : #00FF00"..getElementData(player,"total kazanılan").." #FFFFFFmoney.",255,255,255,true) outputChatBox("#1E90FF[BİLGİ] #FFFFFFMaaşınızı aldınız.",255,255,255,true) end else deleteMarkerTractor(player) createMarkerTractor(player) end end end end end end addEventHandler("onClientMarkerHit", getRootElement(), onClientMarkerHit) addEventHandler ( "onClientMarkerHit", getRootElement(), function(ply) if ply ~= localPlayer then return end if source == markerT then local state = getElementData(ply,"tractor_works") local veh = getPedOccupiedVehicle(ply) if not veh then guiSetVisible(wndTra,true) showCursor(true) if not state then guiSetText(buttonTra1,"İşe Başla.") else guiSetText(buttonTra1,"İşi Bitir.") end end end end) Bu Client.lua İçeriğimiz Sırada Server.Lua -- Türkçe Çeviri Reappersz---- -- Reappersz İyi Oyunlardiler. function start_Tractor(player) local veh = createVehicle(531,spawnTractor[1],spawnTractor[2],spawnTractor[3], 0, 0, 160) setElementData(player,"tractor_veh",veh) trailer = createVehicle(610, 0, 0, 4, 0, 0, 160) attachTrailerToVehicle(veh, trailer) setElementData(player,"trailer_veh",trailer) setElementData(veh,"tractor_plus",0) warpPedIntoVehicle(player,veh) setElementData(veh, "vehicle:Work", true) setElementData(veh, "vehicle:Work:Owner", player) end addEvent("start_Tractor", true) addEventHandler("start_Tractor", getRootElement(), start_Tractor) function enterVehicle ( player ) local data = getElementData(source, "vehicle:Work") if not data then return end local owner = getElementData(source, "vehicle:Work:Owner") if owner ~= player then cancelEvent() outputChatBox("#1E90FF[BİLGİ] #FFFFFFBu araç senin değil...",player,255,255,255,true) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) function stop_Tractor(player) local state = getElementData(player,"tractor_works") local veh1 = getElementData(player,"tractor_veh") local veh2 = getElementData(player,"trailer_veh") if state then if veh1 then destroyElement(veh1) setElementData(player,"tractor_veh",nil) end if veh2 then destroyElement(veh2) setElementData(player,"trailer_veh",nil) end end triggerClientEvent("deleteMarkerTractor",player,player) end addEvent("stop_Tractor", true) addEventHandler("stop_Tractor", getRootElement(), stop_Tractor) function giveMoneyTractor(player, summa) local state = getElementData(player,"tractor_works") if state then givePlayerMoney(player, summa) outputChatBox("#1E90FF[BİLGİ] #FFFFFFİşi bitirdin. Maaşın #00FF00"..summa.." #FFFFFF$.",player,255,255,255,true) end end addEvent("giveMoneyTractor", true) addEventHandler("giveMoneyTractor", getRootElement(), giveMoneyTractor) function job_quit_Medik() local player = source local state = getElementData(player,"tractor_works") if state then local veh = getElementData(player,"tractor_veh") if veh then destroyElement(veh) setElementData(player,"tractor_veh",nil) end end end addEventHandler("onPlayerQuit", root, job_quit_Medik) function onVehicleStartEnter( player, seat, jacked ) local veh = source local pveh = getElementData(player,"tractor_veh") if veh == pveh then setElementData(player,"Уничтожение_Автобуса",nil) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), onVehicleStartEnter) setTimer(function() for lol,player in ipairs(getElementsByType("player")) do local pveh = getElementData(player,"tractor_veh") if pveh then local driverA = getVehicleOccupant(pveh) if driverA == player then if getElementData(player,"Уничтожение_Автобуса") then setElementData(player,"Уничтожение_Автобуса",nil) end else if getElementData(player,"Уничтожение_Автобуса") then setElementData(player,"Уничтожение_Автобуса",tonumber(getElementData(player,"Уничтожение_Автобуса")) - 1) if tonumber(getElementData(player,"Уничтожение_Автобуса")) < 0 then setElementData(player,"Уничтожение_Автобуса",nil) stop_Tractor(player) outputChatBox("#1E90FF[BİLGİ] #FFFFFFİşten ayrıldın.",player,255,255,255,true) end end end end end end,1000,0) function onVehicleExit(player,seat) if seat == 0 then local pveh = getElementData(player,"tractor_veh") if source == pveh then setElementData(player,"Уничтожение_Автобуса",60) outputChatBox("#1E90FF[BİLGİ] #FFFFFFİşi dönmelisin yoksa 60 saniye sonra yok olacak.",player,255,255,255,true) end end end addEventHandler("onVehicleExit", getRootElement(), onVehicleExit) function onPlayerWasted() giveMoneyTractor(source) end addEventHandler("onPlayerWasted", getRootElement(), onPlayerWasted) function onPlayerQuit() giveMoneyTractor(source) end addEventHandler("onPlayerQuit", getRootElement(), onPlayerQuit) Buda Server.lua ' İçeriğimiz İçinden Editlemeler Değişiklikler Yapılabilir Sıradaki İçeriğimiz Shared.lua İçeriğidir -- Türkçe Çeviri Reappersz -- -- Reappersz İyi Oyunlardiler. markerT = {-103.97047424316,9.280517578125,3.1171875} -- Harita İşaretlemesi. skinTractor = 158 -- ID рабочего скина. moneyTra = math.random(1500,10000) -- Satılanların geliri. spawnTractor = {-123.93685150146,58.673442840576,3.1171875} -- Traktor Işınlama. tractorMarks = { -- Koleksiyon Kordinatları. {-129.10345458984,44.776748657227,3.1171875}, {-140.21569824219,35.499088287354,3.1171875}, {-138.20004272461,22.663047790527,3.1171875}, {-148.60707092285,14.514667510986,3.1171875}, {-145.90365600586,3.4965758323669,3.1171875}, {-156.54542541504,-6.012909412384,3.1171875}, {-154.13597106934,-17.593681335449,3.1171875}, {-164.40188598633,-27.394626617432,3.1171875}, {-162.29643249512,-39.118156433105,3.1171875}, {-171.7504119873,-45.86404800415,3.1171875}, {-169.89549255371,-58.790817260742,3.1171875}, {-179.14767456055,-66.964935302734,3.1171875}, {-180.8540802002,-80.188659667969,3.1171875}, {-192.09867858887,-82.351318359375,3.1171875}, {-194.74926757813,-68.188079833984,3.1171875}, {-184.73794555664,-59.438095092773,3.1171875}, {-187.86322021484,-46.48645401001,3.1171875}, {-176.4867401123,-37.576705932617,3.1171875}, {-178.89535522461,-23.708335876465,3.1171875}, {-167.26829528809,-14.703594207764,3.1171875}, {-169.14628601074,0.85636925697327,3.1171875}, {-157.40020751953,11.213445663452,3.1171875}, {-163.81475830078,27.186906814575,3.109395980835}, {-151.95930480957,38.768440246582,3.1171875}, {-155.29359436035,53.715530395508,3.1171875}, {-144.55880737305,61.669063568115,3.1171875}, {-153.22250366211,73.040794372559,3.1171875}, {-164.96725463867,64.920394897461,3.1171875}, {-160.10667419434,51.389507293701,3.1171875}, {-172.44535827637,43.420669555664,3.1171875}, {-168.49655151367,27.312816619873,3.1171875}, {-181.05578613281,18.532829284668,3.109395980835}, {-176.61128234863,4.3219885826111,3.109395980835}, {-188.57684326172,-7.4416480064392,3.109395980835}, {-186.15411376953,-23.690855026245,3.1171875}, {-199.10632324219,-34.989559173584,3.1171875}, {-196.35543823242,-49.323276519775,3.1171875}, {-207.32098388672,-57.854675292969,3.1171875}, {-204.13220214844,-74.361557006836,3.1171875}, {-214.03121948242,-81.115821838379,3.1171875}, {-222.42245483398,-71.313377380371,3.1171875}, {-211.78359985352,-60.138431549072,3.1171875}, {-217.53211975098,-41.33757019043,3.1171875}, {-205.04089355469,-31.443368911743,3.1171875}, {-207.49635314941,-12.911985397339,3.1171875}, {-195.17124938965,-1.4358625411987,3.109395980835}, {-199.52687072754,22.681520462036,3.1171875}, {-187.56085205078,33.805614471436,3.1171875}, {-190.6788482666,50.106971740723,3.1171875}, {-178.33522033691,60.7131690979,3.1171875}, {-182.21771240234,76.404037475586,3.1171875}, {-191.54174804688,87.14820098877,3.1171875}, {-203.26365661621,79.401123046875,3.1171875}, {-199.90397644043,61.27318572998,3.1171875}, {-212.61807250977,50.887119293213,3.1171875}, {-209.3896484375,34.510997772217,3.1171875}, {-221.73179626465,23.422630310059,3.1171875}, {-217.9956817627,8.4652395248413,3.1171875}, {-231.29121398926,-4.3941593170166,3.109395980835}, {-227.30709838867,-17.375923156738,3.1171875}, {-238.58776855469,-26.8854637146,3.1171875}, {-234.0107421875,-40.141651153564,3.1171875}, {-245.84834289551,-50.500583648682,3.1171875}, {-243.30256652832,-64.259651184082,3.1171875}, {-253.69897460938,-70.972732543945,3.1171875}, {-261.44381713867,-60.243770599365,3.1171875}, {-264.31607055664,-45.27653503418,3.1171875}, {-253.13627624512,-37.03816986084,3.1171875}, {-256.28436279297,-21.476554870605,2.5999567508698}, {-243.57893371582,-5.2200374603271,2.8984375}, {-246.77336120605,13.520101547241,2.5481338500977}, {-232.55879211426,27.493730545044,2.8690776824951}, {-235.26802062988,47.376792907715,2.5473833084106}, {-221.7456817627,60.752349853516,2.8304569721222}, {-226.7194519043,72.61767578125,2.5015366077423}, {-214.16030883789,83.426750183105,2.7792901992798}, {-217.92860412598,94.814697265625,2.4680054187775}, {-227.80729675293,97.381309509277,2.0782046318054}, {-227.83094787598,81.953834533691,2.3373956680298}, {-242.23078918457,74.386619567871,1.953736782074}, {-236.50303649902,54.08487701416,2.4138503074646}, {-253.51921081543,43.162837982178,1.965989947319}, {-248.65715026855,20.133153915405,2.3974192142487}, {-265.92660522461,3.4994027614594,1.9778387546539}, {-260.5168762207,-20.83599281311,2.453197479248}, {-276.29504394531,-35.595523834229,2.0164685249329}, {-271.26129150391,-54.640983581543,3.1171875}, } Ve Son Adım Meta.XML İçeriğimiz <meta> <script src="shared.lua" type="shared" cache="false"/> <script src="client.lua" type="client" cache="false"/> <script src="server.lua" type="server"/> </meta> Bu Adımları Yaptıktan Sonra Meslek Dosyamızı Bir Zip Açarak İçine Atın Bunları Ardından Servere Yükleme Yapıp Startlayın ve refreshleyin
-
¡Hola, buen día, adjuntaré mi problema de manera detallada...! Quiero cambiar el sonido del motor de la Wayfarer a una similitud con una Harley Davidson, por ello usé *getVehicleCurrentGear* cuando la moto esté parada reproduzca un sonido, si ya existe, no haga más, si acelera, cambie y elimine el que existía para evitar sonido acumulado pero soy principiante en creación de scripts, ¿Algún consejo? function isSoundFinished(theSound) return ( getSoundPosition(theSound) == getSoundLength(theSound) ) end function HarleyDavidsonSound() for _, vehicles in pairs(getElementsByType("vehicle")) do if(getElementModel(vehicles) == 586) then setWorldSoundEnabled( 7, 0, false) setWorldSoundEnabled( 7, 1, false) local x,y,z = getElementPosition( vehicles ) local gear = getVehicleCurrentGear( vehicles ) print(gear) if gear == 1 then motor = playSound3D("motor.wav", x, y, z, true) attachElements( motor, vehicles) setElementParent( motor, vehicles ) end end end end addEventHandler( "onClientRender", root, HarleyDavidsonSound)
-
I MAKE SO setElementData(source, "countCheckpoitBusRoad", 0) -- somewhere in the code local countCheckpoint = getElementData(player, "countCheckpoitBusRoad") + 1 -- callback hit marker -- AND HERE ERROR setElementData(player, "countCheckpoitBusRoad", countCheckpoint) AND HAVE "ERROR: attempt to perform arithmetic on a boolean value 'countCheckpoint '" WHY??? MY SYSTEM-BUS WORK, BUT IN CONSOLE MORE ERROR
-
Olá, eu estava querendo colocar o nick do jogador na hud que estou fazendo, porém quando eu coloco ele aparece por exemplo: "Meu#929292Nick", ou seja, com o código da cor, alguém sabe como retira isso? function SousaHud ( ... ) if (not isPlayerMapVisible()) then local dinheiro = getPlayerMoney(localPlayer) local banco = getElementData(localPlayer, "bank.money") or "0" local muniarma = getPedAmmoInClip (localPlayer) local munitotal = getPedTotalAmmo (localPlayer) local vida = math.floor(getElementHealth(getLocalPlayer())) local colete = math.floor(getPedArmor(getLocalPlayer())) local fome = getElementData(getLocalPlayer(), "fome") or 100 local sede = getElementData(getLocalPlayer(), "sede") or 100 local nome = getPlayerName (localPlayer) dxDrawRectangle(screenW * 0.7897, screenH * 0.0495, screenW * 0.2103, screenH * 0.2487, tocolor(0, 0, 0, 215), false) dxDrawRectangle(screenW * 0.7978, screenH * 0.0651, screenW * 0.1949, screenH * 0.0352, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.7978, screenH * 0.1133, screenW * 0.0941, screenH * 0.0326, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.8993, screenH * 0.1133, screenW * 0.0941, screenH * 0.0326, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.7978, screenH * 0.1589, screenW * 0.0941, screenH * 0.0326, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.8985, screenH * 0.1589, screenW * 0.0941, screenH * 0.0326, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.8985, screenH * 0.2044, screenW * 0.0941, screenH * 0.0326, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.7971, screenH * 0.2044, screenW * 0.0941, screenH * 0.0326, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.7978, screenH * 0.2500, screenW * 0.1949, screenH * 0.0352, tocolor(255, 255, 255, 255), false) dxDrawText(""..nome.. "", screenW * 0.7971, screenH * 0.0651, screenW * 0.9926, screenH * 0.1003, tocolor(0, 0, 0, 254), 1.20, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("R$"..dinheiro , screenW * 0.7971, screenH * 0.1120, screenW * 0.8912, screenH * 0.1458, tocolor(0, 0, 0, 254), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("R$"..banco , screenW * 0.8985, screenH * 0.1120, screenW * 0.9926, screenH * 0.1458, tocolor(0, 0, 0, 254), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Fome " ..fome.. "%", screenW * 0.7971, screenH * 0.1576, screenW * 0.8912, screenH * 0.1914, tocolor(0, 0, 0, 254), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Sede " ..sede.. "%", screenW * 0.8985, screenH * 0.1576, screenW * 0.9926, screenH * 0.1914, tocolor(0, 0, 0, 254), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Vida " ..vida.. "%", screenW * 0.7971, screenH * 0.2031, screenW * 0.8912, screenH * 0.2370, tocolor(0, 0, 0, 254), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Colete " ..colete.. "%", screenW * 0.8985, screenH * 0.2031, screenW * 0.9926, screenH * 0.2370, tocolor(0, 0, 0, 254), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Rawer Roleplay", 1084, 191, 1350, 219, tocolor(0, 0, 0, 254), 1.50, "default-bold", "center", "center", false, false, false, false, false) end