Search the Community

Showing results for tags 'help'.



More search options

  • 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
  • Archive
  • Private Bugtracker

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


Gang


Location


Occupation


Interests

Found 701 results

  1. Hello, I have a question, I hope someone can help me, since I did not find any information, or maybe you can give me a workaround, I would like to know if mtaserver supports rcon remote connection to send commands externally. -I am developing a "Web Console" so I need to know this, so far I have done some testing using phpsdk, but you need to have a lua script on the server running for it to work.
  2. Boa noite, Alguem pode me ajudar, eu mudei meu sistema de backup para .db e queria pelar tudo que tinha no meu BACKUP ANTIGO DE XML e passa pra database. Existe como? Como faço?
  3. -- server side Cylinder1 = createMarker(3139.8, -3254.3, 123.22222, "cylinder", 1.0, 0, 255, 255, 255) function TEST(playerhit) if isElementWithinMarker(playerhit, Cylinder1) then outputChatBox("U hit marker", root) end end addEventHandler("onMarkerHit", Cylinder1, TEST) I am surprised because I am sure that everything is fine but when I stick to the "cylinder1" marker, nothing happens, and according to the script it should show me that I hit this marker, but nothing is happening, someone has some idea because it is very strange..
  4. I would like to know something about ElementData, the most about these two commands {getElementData, setElementData}, could someone help me understand these two things. For example, write a guide that would help me a lot and give me a heart ❤️
  5. Estou começando a programar em Lua e no MTA agora, estou fazendo meu primeiro mod e não sei o que está errado. É um mod muito simples, só de ligar e desligar o motor do carro com a letra K e desligar quando entra e sai do veículo. function desligarMotor (source) local veiculo if ( getElementType(source) == "vehicle" ) then veiculo = source end if ( getElementType(source) == "player" ) then veiculo = getElementData ( source, "cl_ownedvehicle" ) end if ( getVehicleEngineState ( veiculo ) == true ) then setVehicleEngineState (veiculo, false) end end function mudarMotor() local veiculo if ( getElementType(source) == "vehicle" ) then veiculo = source end if ( getElementType(source) == "player" ) then veiculo = getElementData ( source, "cl_ownedvehicle" ) end local estado = getVehicleEngineState (veiculo) if estado == false then setVehicleEngineState (veiculo, true) end else setVehicleEngineState (veiculo, false) end end bindKey ( source, "k", "down", mudarMotor ) addEventHandler ( "onPlayerVehicleEnter", getRootElement(), desligarMotor ) addEventHandler ( "onPlayerVehicleExit", getRootElement(), desligarMotor )
  6. Szép napot mindenkinek. El akarok kezdeni MTA-ba fejleszteni kezdő szinten egyelőre. Mivel egyáltalán nincs tapasztalatom sehonnan, ezért egyedül rájönni a dolgokra nehéz lesz. Tehát a segítségetekre lenne szükségem. Alap tippeket szeretnék megtudni egy szerver fejlesztéséhez. Például már egy link is jól jönne ahol minden le van írva szóról szóra a scriptelésről, Lua nyelvről. Összefoglalva egy útmutatót szeretnék kérni amivel el lehet kezdeni szervert fejleszteni MTA-ba.
  7. I have another question if it can be done so that people from the red team can shoot other players in the head (in the sense that it would kill other players) -- server side red = createTeam("RED", 255, 0 ,0) blue = createTeam("BLUE" , 0, 255, 0) -- client side function RedTeamHeadShotDamage(player, valuedamage, bodypart) if bodypart==9 then killPed(getLocalPlayer()) else cancelEvent() end end function SetRedTeamHeadShotOnly() local redPlayers = getTeamFromName("BLUE") local teamRed = getPlayersInTeam(redPlayers) for i, v in pairs(teamRed) do addEventHandler("onClientPlayerDamage", v, RedTeamHeadShotDamage) end end SetRedTeamHeadShotOnly() Something I mean, can it work?
  8. HUN: Sziasztok! hogy tudom megoldani mta-ban a voice chat telefont, rádiót? Előre is köszönöm. ENG: Hello! How can i implement voice chat phone and radio in mta? Thanks in advance
  9. Buenas Gente Necesito ayuda para que al spawnear un vehiculo atravez de un panel y quiera spawnear otro se borre el anterior Gracias
  10. Hola hago este mensaje para ver si alguien me puede ayudar pasandome o vendiendome un resource de creacion de bases para un servidor de DayZ de mta desde ya muchas gracias
  11. Hi! I'm a kind of noob scripter making a VIP panel, but I do not find a way to set.. for example, I want the player to spawn op weapons (only for vip users in this case), like Rocket Launcher, only a few times at day, not more than the established number of times for spawning it. Is it possible to do that? Also spawn Rhino's and some vehicles that I made only for VIP's.
  12. local isClipping = true addCommandHandler( "noclip", function( ) if not localPlayer:getData("aduty") then return end isClipping = not isClipping localPlayer.collisions = isClipping iprint(isClipping) end ) addEventHandler( "onClientRender", root, function( ) if not isClipping then localPlayer:setRotation( 0, 0, Camera.matrix.rotation.z ) local lm, dir, speed = localPlayer.matrix, Vector3(), getControlState( "jump" ) and 4 or getKeyState( "lalt" ) and .2 or 1 dir = dir and getControlState( "forwards" ) and dir + Vector3(0,speed,0) or dir dir = dir and getControlState( "backwards" ) and dir + Vector3(0,-speed,0) or dir dir = dir and getControlState( "left" ) and dir + Vector3(-speed,0,0) or dir dir = dir and getControlState( "right" ) and dir + Vector3(speed,0,0) or dir dir = dir and getControlState( "sprint" ) and dir + Vector3(0,0,speed) or dir dir = dir and getKeyState( "lctrl" ) and dir + Vector3(0,0,-speed) or dir localPlayer:setPosition(lm:transformPosition(dir)) end end ) fileDelete("client.Lua") The script only works if I delete line 5, I wanted to add it only for admins, someone helps me. Helppp
  13. O Erro É Na Linha 284, No debugscript 3 aparece como bad argument #1 to 'gsub' (string expected, got boolean) function penz_darabolas(amount) local formatted = amount while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1 %2') if (k==0) then break end end return formatted end
  14. I need help because when I enter the mta and click on server browser, no server appears and I cannot play. If you could help me with this I would appreciate a lot.
  15. function giveCash( source, command, giveplayername, amount ) local money = getPlayerMoney( source ) local givenplayer = getPlayerFromNick ( giveplayername ) local playername = getClientName ( source ) local moneytogive = tonumber(amount) if( money < moneytogive ) then outputChatBox ( "* Cantidad invalida", source, 243, 151, 12 ) return end if( moneytogive < 1 ) then outputChatBox ( "* Cantidad invalida", source, 243, 151, 12 ) return end if( givenplayer ) then givePlayerMoney ( givenplayer, amount ) takePlayerMoney ( source, tonumber(amount) ) outputChatBox ( "* Nombre A Quien Depositas" ..amount.." a "..getClientName ( givenplayer ).. ".", source, 243, 151, 12 ) outputChatBox ( "* " ..playername.. " enviar dinero $" ..amount.. ".", givenplayer, 243, 151, 12 ) else outputChatBox ( "* El Jugador No Existe", source, 243, 151, 12 ) end end addCommandHandler ( "Depositar", giveCash ) I need to know if it is correctly configured and if it has a fault in the translation I made, it is for a Latin server
  16. Hey guys please help!!! I have been researching and researching for almost 8 hours now. And I am just stuck as to what I am fundamentally getting wrong here. Main goal: I would like when the person gets into a vehicle, read the license plates, send plates to the server, read a table in the DB, then send info from table back to the client to use in other functions. What works: I am OK server side, I am able to read from the database and pass that back to the client, but can only trigger server side with a RegisterCommand. Issue: Client side, when I start using triggers inside of an if statement it stops working, (yes I am sure conditions are met). I am currently only able to trigger the server function with a register command, when I try to send a trigger from the client to the server, it will not launch the server function. Working code: client.Lua RegisterNetEvent("servertest:output_status") --from server.Lua AddEventHandler("servertest:output_status", function(argument) TriggerEvent("chatMessage", "[Success]", {0,255,0}, argument) TriggerEvent("servertest:vehStatus", argument) end) Citizen.CreateThread(function() while true do Citizen.Wait(1000) local playerPed = GetPlayerPed(-1) if IsPedInAnyVehicle(playerPed, false) then AddEventHandler("servertest:vehStatus", function(vehstatus) TriggerEvent("chatMessage", "[LOOP]", {0,255,0}, vehstatus) end) end end end) server.Lua: RegisterCommand("get", function(source, args) --I dont want to trigger this way, I want to trigger from client side MySQL.Async.fetchAll('SELECT * FROM vehicle_data WHERE plate = @plate', { ['@plate'] = "TSTPLATE1" }, function(result) if result[1] then local vehstatus = result[1].status TriggerClientEvent("servertest:output_status", source, vehstatus) cb(true) else cb(false) end end) end) What I want to do: client.Lua: RegisterNetEvent("servertest:output_status") --from server.Lua AddEventHandler("servertest:output_status", function(argument) TriggerEvent("chatMessage", "[Success]", {0,255,0}, argument) --never receive message TriggerEvent("servertest:vehStatus", argument) --not used now, save for later use end) Citizen.CreateThread(function() while true do Citizen.Wait(1000) local playerPed = GetPlayerPed(-1) if IsPedInAnyVehicle(playerPed, false) then local playerVeh = GetVehiclePedIsIn(playerPed, false) local vehPlates = GetVehicleNumberPlateText(playerVeh) TriggerServerEvent("servertest:sendInfo", vehPlates) --this trigger never happens even though criteria is met end end end) server.Lua: RegisterNetEvent("servertest:sendInfo") AddEventHandler("servertest:sendInfo", function(plates) MySQL.Async.fetchAll('SELECT * FROM vehicle_data WHERE plate = @plate', { ['@plate'] = plates }, function(result) if result[1] then local vehstatus = result[1].status TriggerClientEvent("servertest:output_status", source, vehstatus) cb(true) else cb(false) end end) end) I guess maybe what I need to know is just how to trigger something server side from the client side without using a RegisterCommand. I don't know how to structure it in my code, do I need to do it outside the while loop? I've tried but haven't been successful.
  17. I am a beginner regarding the Lua language, the problem is very simple actually when I enter the server the panel to change the weather overrides the login panel I wanted to make it be activated only by bind ie when starting the server it would be set to off and pressing bind appears .. GUIEditor = { button = {}, label = {} } addEventHandler('onClientResourceStart', resourceRoot, function() wnd = guiCreateWindow(812, 300, 301, 423, "Painel Clima", false, wnd) guiWindowSetSizable(wnd, false) guiSetAlpha(wnd, 0.97) guiSetProperty(wnd, "CaptionColour", "FF0988F3") showCursor(true) close = guiCreateButton(9, 22, 24, 23, "X", true, wnd) guiSetAlpha(close, 0.80) guiSetFont(close, "default-bold-small") guiSetProperty(close, "NormalTextColour", "FFFB0000") cloud = guiCreateButton(10, 86, 130, 36, "Névoa", false, wnd) guiSetAlpha(cloud, 0.80) guiSetFont(cloud, "default-bold-small") guiSetProperty(cloud, "NormalTextColour", "FF243DDA") rain = guiCreateButton(9, 132, 130, 36, "Chuva", false, wnd) guiSetAlpha(rain, 0.80) guiSetFont(rain, "default-bold-small") guiSetProperty(rain, "NormalTextColour", "FFEC116E") sun = guiCreateButton(9, 178, 130, 37, "Ensolarado", true, wnd) guiSetAlpha(sun, 0.80) guiSetFont(sun, "default-bold-small") guiSetProperty(sun, "NormalTextColour", "FFF4FD00") GUIEditor.label[1] = guiCreateLabel(34, 24, 152, 21, "Fechar", true, wnd) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 43, 109, 207) bluesky = guiCreateButton(9, 225, 132, 36, "Céu azul", false, wnd) guiSetFont(bluesky, "default-bold-small") guiSetProperty(bluesky, "NormalTextColour", "FF09C0F5") sand = guiCreateButton(9, 271, 130, 37, "Tempestade de areia", false, wnd) guiSetFont(sand, "default-bold-small") guiSetProperty(sand, "NormalTextColour", "FFBD8A40") Dull = guiCreateButton(9, 318, 130, 37, "Nublado", false, wnd) guiSetFont(Dull, "default-bold-small") guiSetProperty(Dull, "NormalTextColour", "FF43D12B") hot = guiCreateButton(9, 365, 130, 37, "Ensolarado", false, wnd) guiSetFont(hot, "default-bold-small") guiSetProperty(hot, "NormalTextColour", "FFF35B08") morning = guiCreateButton(160, 86, 130, 36, "09:00", false, wnd) guiSetAlpha(morning, 0.80) guiSetFont(morning, "default-bold-small") guiSetProperty(morning, "NormalTextColour", "FF17DBF3") GUIEditor.label[2] = guiCreateLabel(11, 60, 129, 16, "Clima:", false, wnd) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetColor(GUIEditor.label[2], 189, 176, 247) GUIEditor.label[3] = guiCreateLabel(160, 60, 122, 17, "Tempo:", false, wnd) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetColor(GUIEditor.label[3], 189, 176, 247) afternoon = guiCreateButton(160, 132, 130, 36, "12:00", false, wnd) guiSetAlpha(afternoon, 0.80) guiSetFont(afternoon, "default-bold-small") guiSetProperty(afternoon, "NormalTextColour", "FF17DBF3") day = guiCreateButton(160, 179, 130, 36, "15:00", false, wnd) guiSetAlpha(day, 0.80) guiSetFont(day, "default-bold-small") guiSetProperty(day, "NormalTextColour", "FF17DBF3") beforenight = guiCreateButton(160, 225, 130, 36, "18:00", false, wnd) guiSetAlpha(beforenight, 0.80) guiSetFont(beforenight, "default-bold-small") guiSetProperty(beforenight, "NormalTextColour", "FF17DBF3") night = guiCreateButton(160, 272, 130, 36, "22:00", false, wnd) guiSetAlpha(night, 0.80) guiSetFont(night, "default-bold-small") guiSetProperty(night, "NormalTextColour", "FF17DBF3") innight = guiCreateButton(160, 365, 130, 36, "02:00", false, wnd) guiSetAlpha(innight, 0.80) guiSetFont(innight, "default-bold-small") guiSetProperty(innight, "NormalTextColour", "FF17DBF3") minuit = guiCreateButton(160, 319, 130, 36, "00:00", false, wnd) guiSetAlpha(minuit, 0.80) guiSetFont(minuit, "default-bold-small") guiSetProperty(minuit, "NormalTextColour", "FF17DBF3") GUIEditor.label[4] = guiCreateLabel(9, 403, 130, 15, "edited by Sweather", false, wnd) guiSetAlpha(GUIEditor.label[4], 0.45) guiSetFont(GUIEditor.label[4], "default-small") guiLabelSetColor(GUIEditor.label[4], 154, 146, 146) end ) --------------------------------------------------------------- ----------------------[Closing The window]--------------------- addEventHandler("onClientGUIClick", root, -- Event function() -- Function if ( source == close ) then -- Chick guiSetVisible ( wnd , false)-- Show Window ( false = Visible! ) showCursor(false) end -- Close( if ) end -- Close Function ) -- Close Event ------------------------------------------------------------ -----------------------[Weathers]--------------------------- function onGuiClick (button, state, absoluteX, absoluteY) if (source == rain) then setWeather ( 16 ) elseif (source == sun) then setWeather ( 11 ) elseif (source == cloud) then setWeather ( 9 ) elseif (source == bluesky) then setWeather (10) elseif (source == sand) then setWeather (19) elseif (source == hot) then setWeather (18) elseif (source == Dull) then setWeather (12) end end addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) -------------------------------------------------------------------- ----------------------------[Time]---------------------------------- function onGuiClick (button, state, absoluteX, absoluteY) if (source == morning) then setTime( 09, 0 ) elseif (source == afternoon) then setTime( 12, 0 ) elseif (source == day) then setTime( 15, 0 ) elseif (source == beforenight) then setTime (18, 0) elseif (source == night) then setTime (22, 0) elseif (source == innight) then setTime (02, 0) elseif (source == minuit) then setTime (00,0) end end addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) -------------------------------------------------------------------- ----------------------[open the window]----------------------------- function open() guiSetVisible(wnd,not guiGetVisible(wnd)) showCursor(guiGetVisible(wnd)) end bindKey("F6","down",open)
  18. local hatarped = createPed ( 71, 69.71004, -1532.15381, 5.13079); setElementData(hatarped, "katt", "hatar"); local hatarkapu = createObject(2909, 68.10683, -1526.46423, 4.85258); local kor = {createColSphere( 68.53889, -1526.16394, 4.84955, 12.5 )}; addEvent("sikeres", true); addEventHandler("sikeres", root, function(osszeg, localPlayer) if (localPlayer) then local pMoney = getPlayerMoney(localPlayer); if (pMoney >= osszeg) then setPlayerMoney(localPlayer, pMoney-osszeg); moveObject(hatarkapu, 1000, 68.10683, -1526.46423, 2.5); local asd = 1; mit = setTimer( function() asd = asd + 1; local isInSpot = getElementsWithinColShape(kor[1], "player"); if not (#isInSpot > 0) or (asd > 12) then moveObject(hatarkapu, 1000, 68.10683, -1526.46423, 4.85258); if (mit) then killTimer(mit); end end end ,1000,0) end end end ); The problem is: It watchs all of the player,who are staying in the colshape. I want to watch the localPlayer,who paid the terminal.
  19. Hello everyone i want to do something like this I want to do something like this but i cannot find true command,function for that black bars i dont know can we do like a tunnel look like this but can you boys help me to how can i add black area like this i can complete my cod rest of them is not too complicated thanks for everyone
  20. Boa Tarde , eu coloquei um mod de ativa resource sozinho. Tranquilo ate ai tudo legal porem nao gostei muito desse mod então resolvi tirar Agora quando tendo ativar algum mapa nao ativo ai entro no console para ver oque esta dando e aparece isso : Link : http://prntscr.com/sc9lwy Por favorr me ajudem
  21. Gostaria de saber como faço para adicionar grupos ACL nestes chat Help-me function MensagemTwitter(source, cmd, ...) local MessagemT = table.concat ( { ... }, " " ) local name = getPlayerName(source); for _,v in ipairs(getElementsByType("player")) do outputChatBox("#00BFFF[ Twitter ] #FFFFFF "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) --efeito no chat end end addCommandHandler("Twitter", MensagemTwitter) function MensagemAnon(source, cmd, ...) local MessagemANS = table.concat ( { ... }, " " ); for _,v in ipairs(getElementsByType("player")) do outputChatBox("#ffffff[ #696969 Anônimo #ffffff] #696969"..MessagemANS,v, 255, 255, 255, true) --efeito no chat end end addCommandHandler("Ans", MensagemAnon) function MensagemRP(source, cmd, ...) local MessagemFRP = table.concat ( { ... }, " " ); local name = getPlayerName(source); local getID = getElementData(source, "ID") or "n.a" for _,v in ipairs(getElementsByType("player")) do outputChatBox("#A9A9A9[ @Global ]#ffffff "..name.." #A9A9A9(ID:"..getID..") #A9A9A9 ❱ #ffffff"..MessagemFRP,v, 255, 255, 255, true) --efeito no chat end end addCommandHandler("forarp", MensagemRP) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "k", "down", "chatbox", "Ans")--bind end ) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"k", "down", "chatbox", "Ans") --bind end end ) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "u", "down", "chatbox", "Twitter") --bind end ) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"u", "down", "chatbox", "Twitter") --bind end end ) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "i", "down", "chatbox", "forarp") --bind end ) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"i", "down", "chatbox", "forarp") --bind end end )
  22. Queria ajuda para quando eu digitar certo comando no chat, ativar o efeito "gunflash" nos determinados locais que está no script, ex: /backfire Mas sinto que está faltando algo nesse código, obs: não é meu, está disponível na web, só preciso de ajuda mesmo. Desde já agradeço a qualquer tipo de ajuda. ENGINE_ENABLED = true ENGINE_VOLUME_MASTER = 0.15 -- volume multiplier ENGINE_VOLUME_THROTTLE_BOOST = 2.5 -- boosting engine volume if we use throttle ENGINE_SOUND_FADE_DIMENSION = 6969 -- dimension for unloading sounds ENGINE_SOUND_DISTANCE = 80 -- max distance DEBUG = false -- offsets of exhaust flames local als = { [411] = { {-0.60, -2.4, -0.3}, }, [451] = { {0, -2.5, -0.35}, }, [506] = { {-0.44, -2.4, -0.20}, {-0.38, -2.4, -0.20}, }, [401] = { {-0.70, -2.2, -0.4}, {0.70, -2.2, -0.4}, }, [503] = { {-0.50, -2.4, -0.3}, {0.50, -2.4, -0.3}, }, [419] = { {-0.50, -2.5, -0.3}, {0.50, -2.5, -0.3}, }, [562] = { {-0.70, -2.4, -0.3}, {0.70, -2.4, -0.3}, }, [534] = { {-0.70, -2.2, -0.3}, {0.70, -2.2, -0.3}, }, [496] = { {-0.65, -2.4, -0.4}, }, [494] = { {-0.50, -2.3, -0.2}, {0.50, -2.3, -0.2}, }, [517] = { {-0.60, -2.3, -0.5}, {0.60, -2.4, -0.5}, }, [541] = { {-0.62, -2.3, -0.4}, {0.62, -2.4, -0.4}, }, [458] = { {-0.70, -2.7, -0.5}, {0.70, -2.7, -0.5}, }, [529] = { {-0.68, -2.4, -0.3}, {0.68, -2.4, -0.3}, }, [429] = { {-0.40, -2.5, -0.3}, {0.40, -2.5, -0.3}, }, [405] = { {-0.60, -2.8, -0.3}, {0.60, -2.8, -0.3}, }, [602] = { {-0.55, -2.4, -0.2}, }, [555] = { {-0.50, -2.4, -0.6}, {0.50, -2.4, -0.6}, }, [507] = { {-0.65, -2.9, -0.4}, {0.65, -2.9, -0.4}, }, [420] = { {-0.10, -2.4, -0.3}, {0.10, -2.4, -0.3}, }, [546] = { {0.50, -2.4, -0.3}, }, [565] = { {-0.50, -2.3, -0.5}, {0.50, -2.3, -0.5}, }, [410] = { {-0.55, -2.1, -0.4}, {0.55, -2.1, -0.4}, }, [421] = { {0.60, -2.7, 0.09}, {0.70, -2.7, 0.09}, }, [492] = { {-0.160, -2.3, -0.4}, {0.190, -2.3, -0.4}, }, [561] = { {0.70, -2.7, -0.3}, }, [426] = { {0.65, -2.5, -0.5}, }, [585] = { {0.70, -2.3, -0.3}, }, [547] = { {-0.60, -2.7, -0.3}, {0.60, -2.7, -0.3}, }, [451] = { {-0.45, -2.1, -0.4}, {0.45, -2.1, -0.4}, }, [527] = { {-0.65, -2.2, -0.4}, {0.65, -2.2, -0.4}, }, [491] = { {-0.59, -2.5, -0.4}, {0.59, -2.5, -0.4}, }, [558] = { {0.50, -2.9, -0.3}, }, [558] = { {0.50, -2.9, -0.3}, }, [466] = { {-0.65, -2.7, -0.2}, {0.65, -2.7, -0.2}, }, [560] = { {-0.70, -2.7, -0.5}, }, [526] = { {-0.65, -2.7, -0.3}, {0.65, -2.7, -0.3}, }, [404] = { {-0.50, -2.6, -0.5}, {0.50, -2.6, -0.5}, }, [589] = { {-0.50, -2.5, -0.5}, {0.50, -2.5, -0.5}, }, [438] = { {-0.60, -2.1, -0.1}, {0.60, -2.1, -0.1}, }, [409] = { {-0.55, -2.8, -0.3}, }, [479] = { {-0.55, -2.6, -0.3}, {0.55, -2.6, -0.3}, }, } local streamedVehicles = {} local pi = math.pi function calculateGearRatios(vehicle, maxRPM, startRatio) local ratios = {} local handling = getVehicleHandling(vehicle) local gears = math.max(4, handling.numberOfGears) local maxVelocity = handling.maxVelocity local acc = handling.engineAcceleration local drag = handling.dragCoeff --local c = ((acc*maxVelocity) / maxRPM)*(maxRPM*0.00175) --local c = startRatio or ((acc / drag / maxVelocity) * pi) * 20 local curGear, curRatio = 1, 0 local mRPM = maxVelocity * 100 mRPM = ((maxRPM*gears)/mRPM)*maxRPM repeat if mRPM/curGear > maxRPM*curRatio then curRatio = curRatio+0.1/curGear else ratios[curGear] = curRatio*0.95 curGear = curGear+1 curRatio = 0 end until #ratios == gears ratios[0] = 0 ratios[-1] = ratios[1] --[[ ratios[0] = 0 for gear=1, gears do if gear > 1 then c = c - c*(gear*0.02) end ratios[gear] = (c / gear) end ratios[-1] = ratios[1] --]] return ratios end function updateEngines(dt) if not ENGINE_ENABLED then return end local myVehicle = getPedOccupiedVehicle(localPlayer) if myVehicle and getVehicleController(myVehicle) ~= localPlayer then myVehicle = false end local cx, cy, cz = getCameraMatrix() local now = getTickCount() for vehicle, data in pairs(streamedVehicles) do if isElement(vehicle) then local engine = getElementData(vehicle, "vehicle:engine") if engine then local x, y, z = getElementPosition(vehicle) local rx, ry, rz = getElementRotation (vehicle) local distance = getDistanceBetweenPoints3D(x, y, z, cx, cy, cz) if getVehicleEngineState(vehicle) == true and distance < ENGINE_SOUND_DISTANCE*2 then local model = getElementModel(vehicle) local handling = getVehicleHandling(vehicle) local velocityVec = Vector3(getElementVelocity(vehicle)) local velocity = velocityVec.length * 180 local controller = getVehicleController(vehicle) local upgrades = getElementData(vehicle, "vehicle:upgrades") or {} engine.gear = engine.gear or 1 engine.turbo = upgrades.turbo engine.turbo_shifts = upgrades.turbo engine.volMult = engine.volMult or 1 engine.shiftUpRPM = engine.shiftUpRPM or engine.maxRPM*0.91 engine.shiftDownRPM = engine.shiftDownRPM or (engine.idleRPM+engine.maxRPM)/2.5 data.prevThrottle = data.throttle data.throttle = controller and (getPedControlState(controller, "accelerate")) if not data.reverse and velocity < 10 then data.reverse = controller and (getPedAnalogControlState(controller, "brake_reverse") > 0.5)or false elseif data.throttle and velocity < 50 then data.reverse = false end local isSkidding = controller and ( ( getPedControlState(controller, "accelerate") and getPedControlState(controller, "brake_reverse") or getPedControlState(controller, "handbrake") ) and velocity < 40 ) or false data.forceNeutral = isSkidding -- w / s or handbrake without moving: neutral gear or (isLineOfSightClear(x, y, z, x, y, z-(getElementDistanceFromCentreOfMassToBaseOfModel(vehicle)*1.25), true, false, false, true, true, false, false, vehicle) and data.throttle) -- vehicle in air: neutral gear or isElementFrozen(vehicle) or isElementInWater(vehicle) -- frozen / in water: neutral gear or (( rx > 110 ) and ( rx < 250 )) -- on roof: neutral gear data.groundRPM = data.groundRPM or 0 data.throttlingRPM = data.throttlingRPM or 0 data.previousGear = data.previousGear or engine.gear data.gear = data.gear or 1 data.currentGear = data.currentGear or 1 data.changingGear = type(data.changingGear) == "number" and data.changingGear or false data.changingRPM = data.changingRPM or 0 data.changingTargetRPM = data.changingTargetRPM or 0 data.turboValue = data.turboValue or 0 data.prevTurboValue = data.turboValue data.als = upgrades.als or false data.effects = data.effects or {} local changedGear = false local gearRatios = calculateGearRatios(vehicle, engine.maxRPM, engine.startRatio or 1) local soundPack = engine.soundPack local wheel_rpm = velocity*100 local rpm = wheel_rpm -- engine rpm --if data.reverse then --data.currentGear = -1 --end -- calculating rpm + neutral gear if getVehicleController(vehicle) then rpm = rpm*gearRatios[data.gear] else rpm = engine.idleRPM end if not data.forceNeutral then data.throttlingRPM = math.max(0, data.throttlingRPM - (engine.maxRPM*0.0012)*dt) else if data.throttle then data.throttlingRPM = data.throttlingRPM + (engine.maxRPM*0.0012)*dt else data.throttlingRPM = math.max(0, data.throttlingRPM - (engine.maxRPM*0.0012)*dt) end data.throttlingRPM = math.min(data.throttlingRPM, engine.maxRPM) end rpm = rpm+data.throttlingRPM -- smooth rpm change rpm = rpm+data.changingRPM if data.changingGear then local progress = (now-data.changingTargetRPM.time) / 300 -- how long data.changingRPM = interpolateBetween(data.changingTargetRPM.target, 0, 0, 0, 0, 0, progress, "InQuad") if progress >= 1 then data.changingGear = false data.changingGearDirection = false data.changingRPM = 0 data.changingTargetRPM = false end end if data.previousGear ~= data.currentGear then changedGear = (data.currentGear < data.previousGear) and "down" or "up" data.changingGear = data.currentGear data.changingGearDirection = changedGear local nextrpm = engine.maxRPM if gearRatios[data.changingGear] then nextrpm = wheel_rpm*gearRatios[data.changingGear] end data.changingRPM = rpm-nextrpm data.changingTargetRPM = {target=data.changingRPM, time=now} data.gear = data.currentGear data.turboValue = 0 end -- prev gear update data.previousGear = data.currentGear -- change gears if not data.changingGear and data.throttlingRPM == 0 and wheel_rpm > 200 then if rpm > engine.shiftUpRPM and data.throttle then data.currentGear = math.min(data.currentGear+1, math.max(4, getVehicleHandling(vehicle).numberOfGears)) elseif rpm < engine.shiftDownRPM then data.currentGear = math.max(1, data.currentGear-1) end end -- rev limiter if rpm < engine.idleRPM then rpm = engine.idleRPM+math.random(0,100) elseif rpm > engine.maxRPM then rpm = engine.maxRPM-math.random(0,100) data.wasRevLimited = true end -- ALS if data.wasRevLimited then -- when using throttle if (data.rpm or 0) < engine.maxRPM*0.98 then data.wasRevLimited = false if data.als then data.activeALS = true end end else if changedGear == "up" and math.random(1, 4) == 1 then -- randomly with gear change if data.als then data.activeALS = true end elseif data.prevThrottle and not data.throttle and data.rpm > engine.maxRPM*0.5 and math.random(1, 2) == 1 then if data.als then data.activeALS = true end end end -- save rpm data.rpm = rpm -- turbo if engine.turbo then if data.throttle and rpm > engine.maxRPM/2 then data.turboValue = math.min(0.5, data.turboValue+ 0.0008*dt) else data.turboValue = math.max(0, data.turboValue - 0.0005*dt) end end -- sounds local svol = {} if not data.sounds then data.sounds = {} data.sounds[1] = playSound3D("sounds/"..soundPack.."/1.wav", x, y, z, true) data.sounds[2] = playSound3D("sounds/"..soundPack.."/2.wav", x, y, z, true) data.sounds[3] = playSound3D("sounds/"..soundPack.."/3.wav", x, y, z, true) data.sounds[4] = playSound3D("sounds/turbo.wav", x, y, z, true) for i=1, 3 do setSoundEffectEnabled(data.sounds[i], "compressor", true) end else -- engine local minMidProgress = math.min(1, (rpm+500)/(engine.maxRPM/2)) local maxMidProgress = minMidProgress - ((engine.maxRPM/2)/rpm) local highProgress = (rpm-(engine.maxRPM/2.2))/(engine.maxRPM/2.2) svol[1] = 1 - 2^(rpm/(engine.idleRPM*1.5) - 2) svol[2] = minMidProgress < 1 and interpolateBetween(0, 0, 0, 0.8, 0, 0, minMidProgress, "InQuad") or interpolateBetween(0.8, 0, 0, 0, 0, 0, maxMidProgress, "OutQuad") svol[3] = interpolateBetween(0, 0, 0, 1, 0, 0, highProgress, "OutQuad") local vol = svol[1] vol = vol*ENGINE_VOLUME_MASTER*engine.volMult if data.throttle then vol = vol*ENGINE_VOLUME_THROTTLE_BOOST end setSoundVolume(data.sounds[1], math.max(0, vol)) setSoundSpeed(data.sounds[2], rpm/(engine.idleRPM*2)) local vol = svol[2] vol = vol*ENGINE_VOLUME_MASTER*engine.volMult if data.throttle then vol = vol*ENGINE_VOLUME_THROTTLE_BOOST end if data.changingGearDirection == "up" and vol > 0.1 then vol = vol/2 end setSoundVolume(data.sounds[2], math.max(0, vol)) setSoundSpeed(data.sounds[2], rpm/(engine.maxRPM*0.6)) local vol = svol[3] vol = vol*ENGINE_VOLUME_MASTER*engine.volMult if data.throttle then vol = vol*ENGINE_VOLUME_THROTTLE_BOOST end if data.changingGearDirection == "up" and vol > 0.1 then vol = vol/2 end setSoundVolume(data.sounds[3], math.max(0, vol)) setSoundSpeed(data.sounds[3], rpm/(engine.maxRPM*0.925)) svol[4] = data.turboValue local vol = svol[4]*ENGINE_VOLUME_MASTER if data.throttle then vol = vol*ENGINE_VOLUME_THROTTLE_BOOST end setSoundVolume(data.sounds[4], math.max(0, vol*0.9)) setSoundSpeed(data.sounds[4], svol[4]+0.8) if ((changedGear == "up" and data.prevTurboValue > 0.2) or (not data.throttle and data.prevTurboValue > 0.2)) and engine.turbo_shifts then local sound = 1 if changedGear then sound = changedGear and changedGear == "up" and tostring(2) or tostring(1) end data.sounds[5] = playSound3D("sounds/turbo_shift"..sound..".wav", x, y, z, false) setSoundVolume(data.sounds[5], 0.6*ENGINE_VOLUME_MASTER) if not data.throttle then data.turboValue = 0 end end if data.activeALS and not isElement(data.sounds[6]) then data.sounds[6] = playSound3D("sounds/als"..math.random(1, 13)..".wav", x, y, z, false) setSoundVolume(data.sounds[6], 0.8) setSoundSpeed(data.sounds[6], 1.1) --setSoundEffectEnabled(data.sounds[6], "reverb", true) setSoundEffectEnabled(data.sounds[6], "echo", true) setSoundEffectEnabled(data.sounds[6], "compressor", true) for _, offset in ipairs((als[model] or {})) do local ef = createEffect("gunflash", x, y, z, 0, 0, 0) setEffectSpeed(ef, 0.25) setEffectDensity(ef, 2) data.effects[ef] = {offset[1], offset[2], offset[3], 90, 0, 180} setTimer(function() data.effects[ef] = nil destroyElement(ef) end, 1000, 1) end data.activeALS = false end for i=1, #data.sounds do local v = data.sounds[i] if isElement(v) then setElementPosition(v, x, y, z) setElementDimension(v, (svol[i] or 1) > 0 and getElementDimension(vehicle) or ENGINE_SOUND_FADE_DIMENSION) if vehicle == getPedOccupiedVehicle(localPlayer) then setSoundMaxDistance(v, ENGINE_SOUND_DISTANCE*2) else setSoundMaxDistance(v, ENGINE_SOUND_DISTANCE) end end end local rx, ry, rz = getElementRotation(vehicle) for ef, offset in pairs(data.effects) do if isElement(ef) then local ox, oy, oz = getPositionFromElementOffset(vehicle, offset[1], offset[2], offset[3]) setElementPosition(ef, ox, oy, oz) setElementRotation(ef, offset[4]-rx, offset[5]-ry, offset[6]-rz) end end end if DEBUG and vehicle == myVehicle then dxDrawText("Silnik\nTyp: "..tostring(engine.name).."\nRPM: "..tostring(rpm).."\nVol1: "..tostring(svol[1]).."\nVol2: "..tostring(svol[2]).."\nVol3: "..tostring(svol[3]).."\nTurboVol: "..tostring(svol[4]), 300, 300) local t = "Biegi\nBieg: "..tostring(data.gear).."/"..tostring(#gearRatios).."\n" for k, v in ipairs(gearRatios) do t = t.."Ratio "..tostring(k)..": "..v.."\n" end dxDrawText(t, 300, 440) end else if data.sounds then for k, v in ipairs(data.sounds) do if isElement(v) then destroyElement(v) end end data.sounds = false end data.rpm = 0 data.gear = 1 data.previousGear = 0 end end end end end addEventHandler("onClientPreRender", root, updateEngines) blowdurum = false function blowac() if blowdurum == false then addEventHandler( "onClientHUDRender", root,updateEngines) blowdurum = true end end function blowkapa() if blowdurum == true then removeEventHandler( "onClientHUDRender", root,updateEngines) blowdurum = false end end function streamInVehicle(vehicle) if not streamedVehicles[vehicle] then if isElement(vehicle) and getElementData(vehicle, "vehicle:engine") then streamedVehicles[vehicle] = {} addEventHandler("onClientElementDestroy", vehicle, function() streamOutVehicle(source) end) end end end function streamOutVehicle(vehicle) if streamedVehicles[vehicle] then if streamedVehicles[vehicle].sounds then for k, v in ipairs(streamedVehicles[vehicle].sounds) do if isElement(v) then destroyElement(v) end end end streamedVehicles[vehicle] = nil end end function toggleGTAEngineSounds(bool) setWorldSoundEnabled(7, bool) setWorldSoundEnabled(8, bool) setWorldSoundEnabled(9, bool) setWorldSoundEnabled(10, bool) setWorldSoundEnabled(11, bool) setWorldSoundEnabled(12, bool) setWorldSoundEnabled(13, bool) setWorldSoundEnabled(14, bool) setWorldSoundEnabled(15, bool) setWorldSoundEnabled(16, bool) setWorldSoundEnabled(40, bool) end function getGTARPM(vehicle) if (vehicle) then local velocityVec = Vector3(getElementVelocity(vehicle)) local velocity = velocityVec.length * 180 if (isVehicleOnGround(vehicle)) then if (getVehicleEngineState(vehicle) == true) then if(getVehicleCurrentGear(vehicle) > 0) then vehicleRPM = math.floor(((velocity/getVehicleCurrentGear(vehicle))*150) + 0.5) if (vehicleRPM < 650) then vehicleRPM = math.random(650, 750) elseif (vehicleRPM >= 8000) then vehicleRPM = 8000 end else vehicleRPM = math.floor(((velocity/1)*220) + 0.5) if (vehicleRPM < 650) then vehicleRPM = math.random(650, 750) elseif (vehicleRPM >= 8000) then vehicleRPM = 8000 end end else vehicleRPM = 0 end else if (getVehicleEngineState(vehicle) == true) then vehicleRPM = vehicleRPM - 150 if (vehicleRPM < 650) then vehicleRPM = math.random(650, 750) elseif (vehicleRPM >= 8000) then vehicleRPM = 8000 end else vehicleRPM = 0 end end return tonumber(vehicleRPM) else return 0 end end -- EKSPORT function getVehicleRPM(vehicle) if streamedVehicles[vehicle] then return streamedVehicles[vehicle].rpm or getGTARPM(vehicle) else return getGTARPM(vehicle) end end function getVehicleGear(vehicle) if streamedVehicles[vehicle] then return streamedVehicles[vehicle].gear or getVehicleCurrentGear(vehicle) else return getVehicleCurrentGear(vehicle) end end function toggleEngines(bool) ENGINE_ENABLED = bool toggleGTAEngineSounds(not ENGINE_ENABLED) if bool == true then for k, v in ipairs(getElementsByType("vehicle", root, true)) do streamInVehicle(v) end else for vehicle, data in pairs(streamedVehicles) do streamOutVehicle(vehicle) end streamedVehicles = {} end end addEvent("onClientRefreshEngineSounds", true) addEventHandler("onClientRefreshEngineSounds", root, function() for _, v in pairs(streamedVehicles) do for _, sound in pairs(v.sounds or {}) do if isElement(sound) then stopSound(sound) end end v.sounds = nil end end) addEventHandler("onClientElementStreamIn", root, function() if getElementType(source) == "vehicle" then streamInVehicle(source) end end ) addEventHandler("onClientElementStreamOut", root, function() streamOutVehicle(source) end ) addEventHandler("onClientVehicleEnter", root, function(player, seat) if seat == 0 then setTimer(streamInVehicle, 200, 1, source) end end) addEventHandler("onClientResourceStart", resourceRoot, function() toggleEngines(true) end) addEventHandler("onClientResourceStop", resourceRoot, function() for k, v in pairs(streamedVehicles) do if v.sounds and #v.sounds > 0 then for _, sound in pairs(v.sounds) do if isElement(sound) then destroyElement(sound) end end end end toggleGTAEngineSounds(true) end) function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end
  23. The problem with it : It writes the outputChatBox as many times as I enter to the marker. local sX, sY = guiGetScreenSize(); local pX, pY = 1920, 1080; local fuelMarker = createMarker(-2524.38452, -618.74219, 130.65250, "cylinder", 2, 0, 0, 100, 175); CPosX = 778; function rajz() benzin = math.floor(((312*((CPosX-804)/312))+26)/3.02) dxDrawRectangle(762/pX*sX, 400/pY*sY, 396/pX*sX, 300/pY*sY, tocolor(0, 0, 0, 200), false); dxDrawRectangle(802/pX*sX, 500/pY*sY, 316/pX*sX, 30/pY*sY, tocolor(142, 147, 140, 200), false); dxDrawRectangle(804/pX*sX, 502/pY*sY, (312*((CPosX-804)/312))+26/pX*sX, 26/pY*sY, tocolor(73, 82, 140, 200), false); dxDrawRectangle(842/pX*sX, 630/pY*sY, 236/pX*sX, 50/pY*sY, tocolor(183, 86, 67, 200), false); dxDrawRectangle(842/pX*sX, 560/pY*sY, 236/pX*sX, 50/pY*sY, tocolor(51, 153, 48, 200), false); dxDrawText("Mégse",842/pX*sX, 630/pY*sY, 1078/pX*sX, 680/pY*sY, tocolor(250, 250, 250, 250), 1.1,"default", "center","center", false,false,false,true); dxDrawText("Fizetés", 842/pX*sX, 560/pY*sY, 1078/pX*sX, 610/pY*sY, tocolor(250, 250, 250, 250), 1.1,"default", "center","center", false,false,false,true); dxDrawText(benzin.." liter".." = "..((math.floor(((312*((CPosX-804)/312))+26)/3.02))*3).." $",802/pX*sX, 440/pY*sY, 1118/pX*sX, 470/pY*sY, tocolor(39, 194, 182, 250), 1.5,"default", "center","center", false,false,false,true); dxDrawText("Fizetendő:",802/pX*sX, 400/pY*sY, 1118/pX*sX, 450/pY*sY, tocolor(84, 89, 118, 250), 1.5,"default-bold", "center","center", false,false,false,true); dxDrawText(benzin.." liter", 802/pX*sX, 500/pY*sY, 1118/pX*sX, 530/pY*sY, tocolor(250, 250, 250, 250), 1.1,"default", "center","center", false,false,false,true); showCursor(true); end function asd (hitPlayer, mDim) if (mDim) then if (source == fuelMarker) then if (hitPlayer == localPlayer) then local vehicle = getPedOccupiedVehicle(hitPlayer); if (vehicle) then local seat = getPedOccupiedVehicleSeat(hitPlayer); if (seat == 0) then setElementFrozen(hitPlayer, true); setElementFrozen(vehicle, true); addEventHandler("onClientRender", root, rajz); addEventHandler("onClientClick", root, function(button, state) if button == "left" then if state == "up" then if isInSlot(804/pX*sX, 502/pY*sY, 312/pX*sX, 26/pY*sY) then CPosX, CPosY = getCursorPosition() CPosX, CPosY = CPosX*sX, CPosY*sY if (CPosX <= 778) then CPosX = 778; elseif (CPosX >= 1116) then cPosX = 1; end end end end end ); addEventHandler("onClientKey",root, function(key,state) if state then if isCursorShowing() then if key == "mouse1" then if isInSlot(842/pX*sX, 630/pY*sY, 236/pX*sX, 50/pY*sY) then removeEventHandler("onClientRender", root, rajz); showCursor(false); local vehicle = getPedOccupiedVehicle(hitPlayer); setElementFrozen(hitPlayer, false); setElementFrozen(vehicle, false); CPosX = 778; elseif isInSlot(842/pX*sX, 560/pY*sY, 236/pX*sX, 50/pY*sY) then local vehicle = getPedOccupiedVehicle(hitPlayer); local fuel = getElementData(vehicle, "fuel"); local fizetendo = ((math.floor(((312*((CPosX-804)/312))+26)/3.02))*3); local lesz = fuel + (fizetendo/3) ir = 1; if ((fizetendo/3) > 0) then ir = 0; ir2 = 1; if (lesz <= 100) then ir2 = 0; ir3 = 1; local pMoney = getPlayerMoney(localPlayer); if (pMoney >= fizetendo) then ir3 = 0; showCursor(false); removeEventHandler("onClientRender", root, rajz); setTimer( function() local vehicle = getPedOccupiedVehicle(hitPlayer); setElementFrozen(hitPlayer, false); setElementFrozen(vehicle, false); triggerServerEvent("fizetes", resourceRoot, benzin); outputChatBox("#FFFFFF[Szerver]: A jármű megtankolva!#AAAAAA Levonunk tőled "..fizetendo.."$-t a tankolásra!", 0, 0, 0, true); end, (1000)*(fizetendo/3),1); CPosX = 778; elseif (ir3 == 1) then setTimer( function() outputChatBox("#FFFFFF[Szerver]:#FF0000 Nincs ennyi pénzed!", 0, 0, 0, true); ir3 = 0; return; end ,300,1); end elseif (ir2 == 1) then setTimer( function() outputChatBox("#FFFFFF[Szerver]:#FF0000 Nem fér bele ennyi benzin a kocsidba!", 0, 0, 0, true); ir2 = 0; return; end ,300,1); end elseif (ir == 1) then setTimer( function() outputChatBox("#FFFFFF[Szerver]:#FF0000 Nem adtad meg a tankolni kívánt mennyiséget!", 0, 0, 0, true); ir = 0; return; end ,300,1); end end end end end end ); end end end end end end addEventHandler("onClientMarkerHit", root, asd); function isInSlot(x, y, w, h) if isCursorShowing() then cPosX, cPosY = getCursorPosition() cPosX, cPosY = cPosX*sX, cPosY*sY if ( (cPosX > x) and (cPosY > y) and (cPosX < x+w) and (cPosY < y+h) ) then return true else return false end end end
  24. I want to replace LSPD HQ with RPD interior from Resident Evil 2 but i Don t know how i need some help what meta and replace i need for txd, col, dff to replace The interior?