Jump to content

Search the Community

Showing results for tags 'help'.

  • 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. Hello, I have a problem when logging in. I try to see if the hashed password in the database is the same as the one entered by the player for the password, so I check if the password is correct. But even if you enter a good password and the two passwords are the same, the system always says that the password is incorrect. Can you help? addEvent("login", true) addEventHandler("login", root, function (user, pass) local serial = getPlayerSerial(client) local dq = dbQuery(db, "SELECT * FROM accounts WHERE serial=?", serial) local result = dbPoll(dq, 250) if (#result > 0) then outputChatBox(pass) local Pass = hash("sha512", pass) outputChatBox(Pass) if user == result[1]["username"] then if Pass == result[1]["password"] then print("Sikeres bejelentkezés!") else print("Hibás jelszó!") end else print("Felhasználónév nem található!") end else print("Sikertelen bejelentkezés!") end end )
  2. English - Ingles: Greetings, I am new to MTA and I started playing MTA thanks to some friends who invited me to play, we played a first server and when I tried to create my account it told me that there was already an account created in this series, I didn't give it importance, I talked to the server administrators and they changed the gmail of the account they had for one of mine, after a few days we played on another server and it happened and they gave me the same message "there is already an account created in this series or something like that" so I talked to the server administrators were more strict and said that I couldn't do anything, that I needed to buy another storage for my PC and that my PC is new, it seemed strange to me and we went to another server and the same message came out 'there is already a account created in this serial'' so I came here to MTA technical support I created an account and here we are, I want you to help me here I leave my serial number that appears in F8: 3AB7D7403109925463BAF0536D7B96A1 Español - Spanish: Saludos, soy nuevo en MTA y empeze a jugar MTA gracias a unos amigos que me invitaron a jugar, jugamos un primer server y al intentar crear mi cuenta me decia que ya habia una cuenta creada en esta serial, no le di importancia hable con los adminsitradores del servidor y cambiaron el gmail de la cuenta que habia por una mia, luego de unos dias jugamos a otro server y sucedio y me dio el mismo mensaje ''ya hay una cuenta creada en esta serial o algo asi'' entonces hable con los administradores del server y eran mas estrictos y dijieron que no podria hacer nada, que necesitaba comprar otro almacenamiento para mi PC y eso que mi PC es nueva, me parecio raro y fuimos a otro server y salio el mismo mensaje ''ya hay una cuenta creada en esta serial'' asi que vine aca a soporte tecnico de MTA me cree una cuenta y aca estamos, quiero que me ayuden aca les dejo mi serial que aparece en F8: 3AB7D7403109925463BAF0536D7B96A1
  3. Hello! I have this code: client.lua: function clicksFunction(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) .... if isCursorInBox(x, y, 20, 20) then triggerServerEvent("serverEventName", resourceRoot, data) end .... end addEventHandler("onClientClick", getRootElement(), clickInTheFarms) server.lua: local inUseData = {} addEvent("serverEventName", true) addEventHandler("serverEventName", resourceRoot, function(data) if not inUseData[data[1]] then inUseData[data[1]] = {} end if inUseData[data[1]] and inUseData[data[1]][data[2]] == true then return end inUseData[data[1]][data[2]] = true --some more code here to do things end) My problem is when two player clicks on client side, and triggering server event in the exact same time, then the if inUseData[data[1]] and inUseData[data[1]][data[2]] == true then return end not blocking the code execution under this line. So they can run the "--some more code here to do things" in the same time, and I don't want to allow this. How can I solve this problem?
  4. Hello everyone, i was wondering if there's a way to make some models exceptions on this code, that is supposed to delete all GTA default models but i need the ints to not be deleted so i want to know how can i make exceptions for some interior models.. addEventHandler("onResourceStart", resourceRoot, function() for i=550, 20000 do removeWorldModel(i, 10000, 0, 0, 0) setOcclusionsEnabled(false) end end)
  5. i want a code if i drive Pizzaboy bike the bike will start automatically idk how to do it appreciated it if you help me
  6. Hello! I've been working with MTA team on implementing the ability to play custom IFP animations in MTA since a couple of months. Today, I want to notify you all that it's done after a lot work, this means you can create your own IFP animations in 3ds Max using Kam's script, play them in MTA:SA (not released yet) using Lua scripting functions. I've created my pull request on github which you can find here. Everything's pretty much done, but there's one problem, the pull request cannot be merged into the master branch because there's a lot of code to go through, this will make fixing bugs very difficult, so we'll need to test everything in every way possible before releasing. MTA used to have a lot of developers back in the days who designed the core of the software that we have today, I appreciate their work, and I'm forever grateful for their contribution. There are still a few developers from the MTA team and other old contributors who spends hours upon hours on making MTA better, and get literally nothing out of MTA for their work, but they still do it . My point is, MTA has potential, and together, we can make it better, not having enough time to test everything out is on the main reason why we still don't have this feature implemented into MTA's main branch, so I'm here to ask the community for help in testing this feature. There are so many gamemodes that can take advantage of this feature. We still have plenty of RP servers here, and they still keep increasing till this day. RP servers have almost everything they need, server developers keep trying their best to push the limits in order to have more realism, I honestly believe this will fix that problem, or at least improve it. Here are two video: What is IFP? IFP is the animation file format for GTA III, SA, and VC. Adding support for this file format will allow us to play any custom animation which are made for GTA:SA and GTA:VC. You can load as many IFP files you wish to, you can have hundreds of thousands of animations. Note: GTA III animations are not supported for now. How you can help: As much as everyone wants to have custom animations in MTA, I would love to see them as well. You can help by testing different IFP files, and report bugs on this thread. Download the new MTA:SA from here: https://ci.appveyor.com/api/buildjobs/67st54i25p8ge8is/artifacts/InstallFiles.zip Right-click on InstallFiles.zip, extract the files to some location on your computer, I usually extract them to my desktop. Download the resources from here: https://drive.google.com/file/d/1TIK0-M3CNFR_1Yjn6pjImrS7184SS8jS/view?usp=sharing Create a folder with name "resources" in InstallFiles\server\mods\deathmatch, and extract resources.zip to InstallFiles\server\mods\deathmatch\resources. Start your MTA:SA server from location: InstallFiles\server\MTA Server.exe, and then start the ifp test resource from console "start ifptest" Now launch MTA from InstallFiles\Multi Theft Auto.exe, join your server. Use keys 1, 2, 3, 4, or 5 to play the custom parkour animation from parkour.ifp in ifptest. How to report bugs? When you are playing custom animations, if something's not working the way it should be, or if MTA crashes then please fill this form and reply to this thread: IFP download link: (put the download link here for IFP, so I can download and test it myself) Description: (Explain what the bug is) Steps To Reproduce: (write the steps on how I can reproduce the bug myself) Example: IFP download link: https://www.website.com/gta4.ifp Description: When I play this animation named "CartWheel," I can't move for a while, and MTA crashes. Steps To Reproduce: 1. Load "gta4.ifp". 2. play animation named "CartWheel" using setPedAnimation. 3. MTA crashes. If you want to submit the bug report by PM on forum then feel free to do so. I've added the resource "ifptest" to show you how to play custom animations. You can check how I did it by checking InstallFiles\server\mods\deathmatch\resources\ifptest\client.lua. About the new Lua functions, quoting myself: "There are three new Lua functions added: // loads IFP with a custom block name ifp engineLoadIFP ( string ifp_file_path, string custom_block_name ) // this will replace an internal GTA animation with custom one, it's a light-weight operation, // don't worry too much about performance. Different peds can have different running, walking, // crouching, shooting, etc. animations all running simultaneously because we are not actually // replacing animation hierarchies, we are merely storing everything in std::map which is in // CClientPed. When an animation triggers, we get the ped by clump, and play the animation // we wish to play. setPedAnimation works a little different than this, but the idea is same. bool engineReplaceAnimation ( ped thePed, string block_name, string anim_name, string custom_block_name, string custom_anim_name ) // This will restore animation replaced using engineReplaceAnimation, if only 1 parameter // is provided which is ped, then it will restore all animations, if block name is also provided, // then it will restore animations of that block only, if animation name is provided as well, // it will restore that specific animation only. bool engineRestoreAnimation ( ped thePed [, string block_name, string anim_name ] ) " To add your own ifp file, just add this to meta.xml: <file src="YourIFPFileNameHere.ifp" /> then in client-side Lua script, you can do: local customIfp = engineLoadIFP ("YourIfpNameHere.ifp", "YourCustomBlockNameHere") setPedAnimation ( localPlayer, "YourCustomBlockNameHere", "YourCustomAnimationNameHere" ) If you have any questions, write them here.
  7. Hello everyone, I got a problem, i have a monitor with size 1920 x 1080. So when i change the resolution (in game), then i have Blackbars.... I got a Nvidia Graphics card, i tried to change it in the Control Panel. But i still get Blackbars, In other games it works, its the first game where i get in every resolution except (1920: 1080) Blackbars. Thanks for the Help! Best regards, NaiiCe
  8. Hello there! thanks for visiting my post. Some of you helped me a lot a few months ago with a skin save list using database. Today, this post is to ask you if its possible to add skins to that list from another script, for example using a command from another external script. This is the code i'm using; Server side function myskins(thePlayer,commandName) if thePlayer then local acc = getPlayerAccount( thePlayer ) local acc_name = getAccountName( acc ) local q = dbQuery(connection,"SELECT username,skin FROM skins WHERE username=?",tostring(acc_name)) local rezult = dbPoll(q,-1) if #rezult > 0 then triggerClientEvent(thePlayer,"skin_inventory",thePlayer,rezult) end end end addCommandHandler("myskins",myskins,false,false) addEvent("ChangeSkin",true) change_skin = function(Player,skin) if source == Player and client == source then setElementModel(Player,skin) end end addEventHandler("ChangeSkin",getRootElement(),change_skin) Client side function centerWindow (center_window) local screenW, screenH = guiGetScreenSize() local windowW, windowH = guiGetSize(center_window, false) local x, y = (screenW - windowW) /2,(screenH - windowH) /2 return guiSetPosition(center_window, x, y, false) end addEvent("skin_inventory",true) function skin_inventory_gui(rezult) skin_list = guiCreateWindow(329, 246, 465, 381, "MY SKINS", false) centerWindow(skin_list) guiWindowSetMovable(skin_list, false) guiWindowSetSizable(skin_list, false) skins = guiCreateGridList(9, 20, 376, 351, false, skin_list) guiGridListAddColumn(skins, "Description", 0.5) guiGridListAddColumn(skins, "Model/Skin Owned", 0.5) close = guiCreateButton(389, 20, 66, 21, "X", false, skin_list) set_skin = guiCreateButton(389, 40, 66, 21, "SET SKIN", false, skin_list) guiSetProperty(close, "NormalTextColour", "FFAAAAAA") showCursor(true) for key, value in ipairs(rezult) do local row = guiGridListAddRow(skins) guiGridListSetItemText (skins, row, 1, "Skin Model ->", false, true) guiGridListSetItemText (skins, row, 2, value.skin, false, true) end addEventHandler ( "onClientGUIClick", close, closeinventory,false) addEventHandler ( "onClientGUIClick", set_skin, closeinventory,false) end addEventHandler("skin_inventory",root,skin_inventory_gui) closeinventory = function(button,state) if (button == "left") and (state == "up") then if source == set_skin then if (guiGridListGetSelectedItem (skins)) then local skin_to_change = guiGridListGetItemText (skins, guiGridListGetSelectedItem (skins), 2) triggerServerEvent("ChangeSkin",localPlayer,localPlayer,skin_to_change) outputChatBox("[SKIN SYSTEM] You have changed your skin",160,255,160) end end showCursor (false) guiSetVisible(skin_list,false) end end
  9. I can't connect to a server I've never been to. Disconnected CD48, "humor" I have fully reinstalled GTA, and MTA. https://imgur.com/RAm4VDc Thanks for help in advance!
  10. Hello everyone, I need help with something, I'm creating missions for my server, I want the missions to only be done daily, I mean, the marker and ped once the mission is done disappears and appears the next day. The problem is, when I destroy the ped and the marker (destroyElement) and I quit or reconnect into the server, the ped and the marker appears again. How can I save destroyElements and make it appears daily once it's destroyed?
  11. Hi I have a problem whit starting the linux server i use ubunu 19.XX the ssh says: root@server:~/mta# ./mta-server64 libncursesw.so.5: cannot open shared object file: No such file or directory ERROR: Could not load ./x64/core.so * Check installed data files. Press enter to continue... q root@server:~/mta# ldd /x64/core.so ldd: /x64/core.so: No such file or directory root@server:~/mta# ldd root/mta/x64/core.so ldd: root/mta/x64/core.so: No such file or directory root@server:~/mta# ldd x64/core.so linux-vdso.so.1 (0x00007fff41da0000) libncursesw.so.5 => not found libtinfo.so.5 => not found librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f43d12c7000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f43d1179000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f43d1158000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f43d0f6d000) /lib64/ld-linux-x86-64.so.2 (0x00007f43d164b000) #root@server:~/mta# ./mta-server64 libncursesw.so.5: cannot open shared object file: No such file or directory ERROR: Could not load ./x64/core.so * Check installed data files. Press enter to continue... root@server:~/mta# I have core.so i also try apt-get install lib32readline5
  12. Hello, I want to know how can I put on the same bar normal health and extra health, normal health is 100 but extra health increase constantly by levels, how can i adapt a bar for both health? that looks full and adapts to the extra health
  13. I made a script that has to do with fire and createFire() function, it worked perfectly for the client, but of course the fire wouldn't appear for other players on the server, what's the best approach to sync the fire in server-side? while making sure the fire is fully functional (burns and damages peds and vehicles)
  14. Hello, my name is Nicolas Henrique, I'm 15 years old, I'm Brazilian and I want to join the MTA Sa staff. I have maturity and commitment. My main reason for wanting to join the staff team is to help look for bugs in the codes and help members who don't understand much. I know how to work with .lua, I'm intermediate/medium in that part and I know I'll be able to discover bugs that exist on the Mta platform. I don't know how to work with hosts/3D Modeling/Animation, I want to take a course in the future to understand more about animations. I intend to open a youtube channel to teach people how to solve Mta problems/errors. And I think that's it! Sincerely Nicolas Henrique! My discord: nego_mta
  15. How can I make the player sound louder? i want create megaphone police like fivem I just don't know how to make the player sound louder https://media.discordapp.net/attachments/1099800823724253215/1137128273743192247/2023-07-03_09-48-58_ukkn.mp4 kike this video
  16. hi guys How can I move a car without a player in that car?
  17. hi guys i want create gui like this to show the car inside How should I do this? image link https://ibb.co/87hYNKF
  18. Hello guys! Can you please explain me how create weapon glowing like this? Video
  19. Hello! I can't seem to find a solution for this message: 1 or less players are required to start 'race-fuzimu321312312123' if not using ghostmode Even if map has enabled ghostmode, race resource also has enabled "ghostmode" and I have one-spawn and autoghostmode - it still doesn't work. Do you know what I can change in RACE gamemode to prevent that from happening? I remember on older builds i only needed one-spawn to execute maps properly, and now it doesn't work... Map has only 1 spawnpoint but I don't want to add new ones. Help is appreciated, thx.
  20. Search in hours and hours to see if we can find the pyramid to make a map, but I could not. Download a file to confirm if it is called '' pyramid '' and if, as it is called, however, you can not find the pyramid for my map. I need help? Could it be that the pyramid is not in the MTA Map Editor catalog?
  21. Before the multi-theft allowed the use of ReShade was blocked more recently, the Rehade and nothing else wants an ENB series for weak PCs like mine I hope you do
  22. hi guys i want call marker from another function like this code local hidemark = createMarker(10,50,5,"cylinder",1,0,255,0) function mark(theplayer) markerveh =createMarker(0,0,5,"cylinder",1,0,255,0) end addEventHandler("onMarkerHit",marker1,mark) function job1(theplayer) setElementVisibleTo(markerveh,root,false)-- for here end addCommandHandler("hidemark",job1)
  23. https://prnt.sc/fK0_6Cc-0Bud ja tentei desisntalar o game e ate deletar os mods, nao funcionou
  24. how can i change the damage of rocket explosion? when I tried it before, when I fired with a rocket, I was taking damage when any player took damage, I don't want this and I want their cars to take extra damage. please help me
  25. oad-- *** THESE ARE THE SETTINGS. MODIFY IN META.XML *** reloadTime = 6000 -- for Rhino reloadTimeHydra = 4000 -- for Hydra reloadTimeHunter = 3000 -- for Hunter range = 2 -- To increase range, set this value to 1. To decrease range, use 3. My code is optimized for 2. --*** BETTER NOT TOUCH BELOW *** event = nil fired = false drawHandler = nil armedVehicles = {[425]=true, [520]=true, [432]=true} w, h = guiGetScreenSize() height = nil endY = nil r, g = 255, 0 time = 0 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] 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 end function onStart() height = math.ceil(h / 50) if height < 19 then height = 19 end endY = math.ceil((h/100)*6) corona = createMarker (0, 0, -10, "corona", 1.0, 200, 100, 0, 150) bindKey ( "mouse1", "down", toggleRhino ) bindKey("vehicle_fire", "down", toggleHunter) bindKey("vehicle_secondary_fire", "down", toggleHunter) color = tocolor(255, 255, 255, 200) end addEventHandler("onClientResourceStart", resourceRoot, onStart) function entering( thePlayer, seat ) if thePlayer == localPlayer then toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) local model = getElementModel ( source ) if model == 432 or model == 425 or model == 520 then drawHandler = addEventHandler("onClientRender", root, reloadFinished) end if model == 432 then toggleControl ( "vehicle_fire", false ) toggleControl ( "vehicle_secondary_fire", false ) addEventHandler("onClientRender", root, marker) event = true end end end addEventHandler("onClientVehicleEnter", getRootElement(), entering) function exit( thePlayer, seat ) if thePlayer == localPlayer then local model = getElementModel ( source ) if model == 432 then if event ~= nil then removeEventHandler("onClientRender", root, marker) event = nil end toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) end end end addEventHandler("onClientVehicleExit", getRootElement(), exit) addEventHandler("onClientElementDestroy", getRootElement(), function () if (getElementModel(source) == 432 and getVehicleController(source) == localPlayer) then if event ~= nil then removeEventHandler("onClientRender", root, marker) event = nil end toggleControl ( "vehicle_secondary_fire", true ) end end) function wasted() if source == localPlayer then if event ~= nil then removeEventHandler("onClientRender", root, marker) event = nil end toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) end end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), wasted ) function clientResourceStop() toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) end addEventHandler( "onClientResourceStop", getResourceRootElement(getThisResource()), clientResourceStop ) function toggleRhino() if fired == false then if isPedInVehicle ( localPlayer ) and not isCursorShowing() then local veh = getPedOccupiedVehicle ( localPlayer ) if (veh) then if ( getElementModel ( veh ) == 432 ) then fired = true local turX, turY, turZ = getElementPosition(veh) local cx,cy,cz = getVehicleComponentPosition( veh, "misc_a" ) local x, y, z = getVehicleComponentPosition( veh, "misc_c" ) local barrelX, barrelY, barrelZ = getPositionFromElementOffset(veh,cx,cy,cz) local muzzleX, muzzleY, muzzleZ = getPositionFromElementOffset(veh,x,y,z) local velX = (muzzleX - barrelX) /range local velY = (muzzleY - barrelY) /range local velZ = (muzzleZ - barrelZ) /range local vx, vy, vz = getElementVelocity(veh) setElementVelocity (veh, vx+(((velX/3)*(-1))/50), vy+(((velY/3)*(-1))/50), vz+(((velZ/3)*(-1))/50) ) bullet = createProjectile(veh, 21, muzzleX, muzzleY, muzzleZ, 1, nil, 0, 0, 0, velX, velY, velZ) createExplosion(turX, turY, turZ-10, 8, false, 0.5, false) removeEventHandler("onClientRender", root, reloadFinished) drawHandler = nil start = getTickCount() drawHandler = addEventHandler("onClientRender", root, reload) time = 6000 soundTimer = setTimer(function() local sound = playSound("reload.mp3") setSoundVolume(sound, 0.1) end, (reloadTime-1000), 1) end end end end end function toggleHunter(control) if isPedInVehicle(localPlayer) then local model = getElementModel(getPedOccupiedVehicle(localPlayer)) if model == 425 and fired == false and control == "vehicle_fire" then fired = true setTimer(function() toggleControl ( "vehicle_fire", false ) end, 100, 1) setTimer(function() toggleControl ( "vehicle_fire", true ) fired = false end, reloadTimeHunter, 1) removeEventHandler("onClientRender", root, reloadFinished) drawHandler = nil start = getTickCount() drawHandler = addEventHandler("onClientRender", root, reload) time = 3000 elseif model == 520 and fired == false and control == "vehicle_secondary_fire" then fired = true setTimer(function() toggleControl ( "vehicle_secondary_fire", false ) end, 100, 1) setTimer(function() toggleControl ( "vehicle_secondary_fire", true ) fired = false end, reloadTimeHydra, 1) removeEventHandler("onClientRender", root, reloadFinished) drawHandler = nil start = getTickCount() drawHandler = addEventHandler("onClientRender", root, reload) time = 4000 end end end function reload() if not isPedInVehicle(localPlayer) then removeEventHandler("onClientRender", root, reload) drawHandler = nil end setMarkerColor ( corona, 255, 0, 0, 100 ) local getTime = (getTickCount()) - start local height = math.ceil(h / 50) if height < 19 then height = 19 end dxDrawRectangle (0, h-endY-height-6, height+6, endY, tocolor(0,0,0,150), false) local endY = math.ceil((h/100)*6) endY = endY - 4 if getTime <= time then endY = (getTime/time)*endY else removeEventHandler("onClientRender", root, reload) drawHandler = nil drawHandler = addEventHandler("onClientRender", root, reloadFinished) if getElementModel(getPedOccupiedVehicle(localPlayer)) ~= 432 then local sfx = playSFX ( "genrl", 136, 72 ) setSoundVolume (sfx, 1) end setMarkerColor ( corona, r, g, 0, 150 ) start = nil fired = false end dxDrawRectangle (2, h-endY-height-8, height+2, endY, tocolor(220,0,0,150), false) end function reloadFinished() if not isPedInVehicle(localPlayer) then removeEventHandler("onClientRender", root, reloadFinished) drawHandler = nil else dxDrawRectangle (0, h-endY-height-6, height+6, endY, tocolor(0,0,0,150), false) dxDrawRectangle (2, h-endY-height-4, height+2, endY-4, tocolor(220,0,0,150), false) end end function marker() if not isPedInVehicle(localPlayer) then removeEventHandler("onClientRender", getRootElement(), marker) if isTimer(soundTimer) then killTimer(soundTimer) end fired = false drawHandler = nil setElementPosition (corona, 0, 0, -10) else local vx, vy, vz = nil, nil, nil local cx, cy, cz = nil, nil, nil local veh = getPedOccupiedVehicle ( localPlayer ) if veh then local x, y, z = getVehicleComponentPosition( veh, "misc_a" ) cx, cy, cz = getPositionFromElementOffset( veh, x, y, z ) x, y, z = getVehicleComponentPosition( veh, "misc_c" ) vx, vy, vz = getPositionFromElementOffset( veh, x, y, z ) if vx ~= nil then local velX = (vx - cx) /range local velY = (vy - cy) /range local velZ = (vz - cz) /range local vx1, vy1 = cx + (velX * 50 * 0.1), cy + (velY * 50 * 0.1) local vx2, vy2 = cx + (velX * 50 * 0.2), cy + (velY * 50 * 0.2) local vx3, vy3 = cx + (velX * 50 * 0.3), cy + (velY * 50 * 0.3) local vx4, vy4 = cx + (velX * 50 * 0.5), cy + (velY * 50 * 0.5) local vx5, vy5 = cx + (velX * 50 * 0.6), cy + (velY * 50 * 0.6) local vx6, vy6 = cx + (velX * 50 * 0.7), cy + (velY * 50 * 0.7) local vx7, vy7 = cx + (velX * 50 * 0.8), cy + (velY * 50 * 0.8) local m1 = cz + (velZ * 50 * 0.1) - ((getGravity()*2400*0.01)/2) local m2 = cz + (velZ * 50 * 0.2) - ((getGravity()*2400*0.04)/2) local m3 = cz + (velZ * 50 * 0.3) - ((getGravity()*2400*0.09)/2) local m4 = cz + (velZ * 50 * 0.5) - ((getGravity()*2400*0.25)/2) local m5 = cz + (velZ * 50 * 0.6) - ((getGravity()*2400*0.36)/2) local m6 = cz + (velZ * 50 * 0.7) - ((getGravity()*2400*0.49)/2) local m7 = cz + (velZ * 50 * 0.8) - ((getGravity()*2400*0.64)/2) local hit, mx, my, mz, elementHit = processLineOfSight (cx, cy, cz, vx1, vy1, m1, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx1, vy1, m1, vx2, vy2, m2, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx2, vy2, m2, vx3, vy3, m3, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx3, vy3, m3, vx4, vy4, m4, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx4, vy4, m4, vx5, vy5, m5, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx5, vy5, m5, vx6, vy6, m6, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx6, vy6, m6, vx7, vy7, m7, true, true, true, true, true, false, false, false, veh) if hit == false then mx, my, mz = vx7, vy7, m7 end end end end end end end local dist = getDistanceBetweenPoints3D ( vx, vy, vz, mx, my, mz ) if dist < 50 then r = 5.1 * dist g = 255 elseif dist >= 50 then r = 255 g = 255 - ((dist-50) * 5.1) end setElementPosition (corona, mx, my, mz) setMarkerColor ( corona, r, g, 0, 150 ) if not drawHandler then drawHandler = addEventHandler("onClientRender", root, reloadFinished) end end end end end function projectileSound ( creator ) local zeType = getProjectileType( source ) if zeType == 21 then if getElementType(creator) == "vehicle" then if getElementModel(creator) == 432 then local velX, velY, velZ = getElementVelocity(source) local cx, cy, cz = getVehicleComponentPosition( creator, "misc_c" ) cx, cy, cz = getPositionFromElementOffset(creator, cx, cy, cz) fxAddTankFire(cx, cy, cz, velX, velY, velZ) local sound1 = playSFX3D ( "genrl", 45, 2, cx, cy, cz ) local sound2 = playSFX3D ( "genrl", 45, 3, cx, cy, cz ) local sound3 = playSFX3D ( "genrl", 45, 4, cx, cy, cz ) setSoundMaxDistance( sound1, 300 ) setSoundMaxDistance( sound2, 300 ) setSoundMaxDistance( sound3, 200 ) setSoundVolume(sound1, 2) setSoundVolume(sound2, 2) setSoundVolume(sound3, 2) --setElementModel(source, 342) end end end end addEventHandler( "onClientProjectileCreation", getRootElement(), projectileSound ) I'm aiming to make a crosshair that will work fine with this, but I haven't been successful. Can you help me.
×
×
  • Create New...