Zango

Members
  • Content Count

    628
  • Joined

  • Last visited

  • Days Won

    3

Zango last won the day on November 2

Zango had the most liked content!

Community Reputation

6 Neutral

About Zango

  • Rank
    Pimp
  • Birthday 19/09/1993

Details

  • Location
    Denmark

Recent Profile Visitors

1,251 profile views
  1. 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/"..name.."/"..name..".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/"..name.."/"..name..".txd") engineImportTXD ( txd, id ) local dff = engineLoadDFF ( "Cars/"..name.."/"..name..".dff") engineReplaceModel ( dff, id ) outputDebugString("name = "..name.." | id = "..id..".") vehiclesData[name] = {} vehiclesData[name].txd = txd vehiclesData[name].dff = dff end end addEventHandler("onClientResourceStart", resourceRoot, loadVehicleFiles)
  2. 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
  3. Change this local vehicles = results[1] local vehicle = results[1]
  4. You need to do SELECT * FROM vehicles To select everything
  5. 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
  6. You need to give your object a name obj = createObject(id, px, py, pz) and then you can destroy it later destroyElement(obj)
  7. 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.
  8. 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
  9. 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")
  10. 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)
  11. 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?
  12. I remember having issues with the player as source element, try using resourceRoot triggerClientEvent(source,"showCharacters",resourceRoot,source,charCount)
  13. 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
  14. Zango

    help

    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
  15. You haven't showed us the "Query" function in your resource MySQL so we can't tell for sure what's going on. Is "result" a table or a number? If it's a table you need to do #result to get the number of rows. Normally the results from queries are returned in a 2-dimensional table, with the rows being numerically indexed in order and each containing a table of key=value pairs corresponding to the columns in your SQL table. As you are selecting a user account, there should only be 1 row returned, or 0 if the user/password combination doesn't exist. So the length of "result" table should be 1, and the user you want is result[1]. The field you want is "skin", which is accessed like result[1].skin. You should post the code for mysql:Query or clarify what the variables are in this snippet.