• Content Count

  • Joined

  • Last visited

  • Days Won


Zango last won the day on November 2 2019

Zango had the most liked content!

Community Reputation

7 Neutral

About Zango

  • Rank
  • Birthday 19/09/1993


  • Location

Recent Profile Visitors

1,424 profile views
  1. There is nothing wrong in that, so the error is elsewhere in your script. Post the rest, if it's too big you can use
  2. You can't create a local variables dynamically, those need to be typed. You can however do it with global variables like this, because you can access them in a table _G[name.."dff"] = engineLoadTXD ( "Cars/""/"".txd") Also you need to use pairs for that loop to work. And on line 26, you need to use the function name. I suggest doing it this way in your own table local vehiclesFileNames = { AE86 = 589, ToyotaSupra = 559, ToyotaAltezza = 402, Datsun240Z = 475, Nissan180SX = 602, SilviaS13 = 401, SilviaS14 = 576, SilviaS15 = 474, Skyline2000 = 535, SkylineR32 = 555, SkylineR34 = 562, SkylineGTR = 558, } local vehiclesData = {} function loadVehicleFiles() for name, id in pairs(vehiclesFileNames) do local txd = engineLoadTXD ( "Cars/""/"".txd") engineImportTXD ( txd, id ) local dff = engineLoadDFF ( "Cars/""/"".dff") engineReplaceModel ( dff, id ) outputDebugString("name = "" | id = "".") vehiclesData[name] = {} vehiclesData[name].txd = txd vehiclesData[name].dff = dff end end addEventHandler("onClientResourceStart", resourceRoot, loadVehicleFiles)
  3. Where do you want the line to go? From the player name to the player head position? Try drawing what you want in paint and post it
  4. Change this local vehicles = results[1] local vehicle = results[1]
  5. You need to do SELECT * FROM vehicles To select everything
  6. You can search for better explanations on that than I can give you, read about what a translation matrix is and then a rotation matrix afterwards
  7. You need to give your object a name obj = createObject(id, px, py, pz) and then you can destroy it later destroyElement(obj)
  8. What are you trying to do with this? If you're looking to create a line that is always perpendicular to the vehicle then you can use getElementMatrix local x1, y1, z1 = getElementPosition(theVehicle) local m = getElementMatrix(theVehicle) local x2 = -100 * m[3][1] + m[4][1] local y2 = -100 * m[3][2] + m[4][2] local z2 = -100 * m[3][3] + m[4][3] dxDrawLine3D(x1, y1, z1, x2, y2, z2) -100 is the length of the projected line, you can use processLineOfSight to find whatever it collides with.
  9. It's the angle your gun is tilted upwards in your picture. Like this rx, ry, rz = getElementRotation(gun) rx = math.rad(rx) rz = math.rad(rz) x = x + 0.1 * math.cos(rx) * math.cos(rz) y = y + 0.1 * math.cos(rx) * math.sin(rz) z = z + 0.1 * math.sin(rx) What is your gun, is it an object or a custom weapon? It might be better for you to use a matrix, see the example in getElementMatrix
  10. It's because you're missing the colon exports["resource_Name"]:testExportF("Hello") Basically when you do table:method(arg), Lua passes along "table" as the first parameter, so it's effectively doing table.method(table, arg) If you just do exports.resource.function then it's expecting that first parameter. Even though you can do exports.resource_Name.testExportF(nil, "hello")
  11. You need more than just rotationZ to do that, if you want to find a point from the rotation of the gun. Assuming your weapon has a pitch and yaw, and roll is 0, you would do this to find your point, where yaw is your rotationZ (in radians) x = x + 0.1 * math.cos(pitch) * math.cos(yaw) y = y + 0.1 * math.cos(pitch) * math.sin(yaw) z = z + 0.1 * math.sin(pitch)
  12. Well it looks like you are already selecting the account data in the server code, so you could pass it to the client in the event?
  13. I remember having issues with the player as source element, try using resourceRoot triggerClientEvent(source,"showCharacters",resourceRoot,source,charCount)
  14. DX are not elements like the GUI elements which you create and destroy. Instead you call a function to draw something for 1 frame. 1 frame is not a very long time when you have 60 frames per second, so you use the event onClientRender to call the DX function every frame. In your code, use removeEventHandler to stop calling this function every frame. function HidePanel ( ) removeEventHandler ( "onClientRender", root, Panel ) end
  15. Zango


    Do you want it disabled only for players, not admins? By source do you mean an admin calling this event? If so you can do this if inValidWeapons[tonumber(wep)] and (client ~= plr) then return end It's the same you do for ammo to give 5000 ammo instead of 90