Jump to content

Addlibs

Members
  • Posts

    1,060
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Addlibs

  1. getPlayerName(getAccountPlayer(getAccount("accountname"))) This will only work if the player is logged in onto that account.
  2. bool createSWATRope ( float fx, float fy, float fZ, int duration ) SWAT ropes aren't elements - the return value (which you store as loc) is just a boolean value (true/false) representing whether the rope was created successfully or not.
  3. -- the problem: r, g, b = getTeamColor ( Admins ) -- the correction: r, g, b = getTeamColor ( getTeamFromName("Admins") )
  4. Have you tried https://community.multitheftauto.com/index.php?p=resources&s=details&id=10163?
  5. Pretty sure this function will help (at least with the Z axis rotation) https://wiki.multitheftauto.com/wiki/FindRotation
  6. Ah. Seems like the function requires a vector in the form of a table as well, not a Vector proper. You can change the function to the following and it should work with proper vectors, that is, those introduced with OOP. function getOffsetFromXYZ( mat, vec ) -- make sure our matrix is setup correctly 'cos MTA used to set all of these to 1. mat[1][4] = 0 mat[2][4] = 0 mat[3][4] = 0 mat[4][4] = 1 mat = matrix.invert( mat ) local offX = vec.x * mat[1][1] + vec.y * mat[2][1] + vec.z * mat[3][1] + mat[4][1] -- } local offY = vec.x * mat[1][2] + vec.y * mat[2][2] + vec.z * mat[3][2] + mat[4][2] -- } changed vec[1] to vec.x, vec[2] to vec.y, vec[3] to vec.z local offZ = vec.x * mat[1][3] + vec.y * mat[2][3] + vec.z * mat[3][3] + mat[4][3] -- } return {offX, offY, offZ} end
  7. I'm pretty sure that that function takes in a different kind of matrix. Specifically, it expects a normal table of matrix data, retrievable via getElementMatrix, different from element:getMatrix(). The latter uses the new matrices class introduced with OOP. Other than that, I would also like to state the fact that the calculation you're doing through this function will find coordinates pretty far away from the original coordinates. More specifically, the resultant position will be more or less twice as far from the centre of the map as hx, hy, hz.
  8. MTA hardcoded account system is in internal.db, not registry.db (table accounts). The internal one stores account names, their corresponding hashed password, IP and the serial (idk whether that's the ones used when registering, or last login) (columns name, password, ip, serial). The passwords are hashed into a uniform-length 97-character long hex code, composed on a SHA256 of the password, the version of the hash and the salt. What @DanTDM posted is not the MTA hardcoded account system but his own login system based on executeSQLQuery, and stores passwords in plaintext (not a good idea imo).
  9. I am by no means a modder and I do not know how to edit cars but I do know that the server from the last screenshot on the initial post, devGaming, did have to mod their vehicles' DFFs to get UVs unwrapped. The scripted part is simply drawing an image on a 2D map as you can see on on the red image on the right of the screenshot.
  10. Pretty sure the vehicles need to have modded UV wraps to have no overlapping parts.
  11. You simply cannot move the default HUD as it is part of GTA, not MTA. You can instead hide the original one and make a replacement in dxDraw* and move that replica around however you want.
  12. What you can do, which will be very unpopular with your players and generally a very big liability, is store the plaintext password the user entered when registering (for example, in setAccountData). This is very insecure, as whenever you'll get hacked, passwords will leak out in plaintext. This would also cause privacy concern for those who use the same password for a range of servers, forums or other services. I urge you not to do what I outlined above.
  13. function loadMods() for brandIndex, brandCars in pairs(vehicleTable) do -- loop through brands for index, mod in pairs(brandCars) do -- loop through cars of the brand you're looping through right now -- either txd = engineLoadTXD ( vehicleTable[brandIndex][index].fileName .. ".txd" ) -- or txd = engineLoadTXD ( brandCars[index].fileName .. ".txd" ) -- or txd = engineLoadTXD ( mod.fileName .. ".txd" ) engineImportTXD ( txd, vehicleTable[index].modelID ) dff = engineLoadDFF ( vehicleTable[index].fileName .. ".dff", vehicleTable[index].modelID ) engineReplaceModel ( dff, vehicleTable[index].modelID ) end end end If you have a table named vehicles, and every value inside is a table brand containing every car of that brand, then you can simply loop through vehicles, and for every brand in that table, loop through its cars. That is, loop through the table and then loop through every of the values of that table.
  14. What's wrong with it?
  15. setElementPosition(source, tonumber(interiors[intTypeID][2]),tonumber(interiors[intTypeID][3]),tonumber(interiors[intTypeID][4])) setElementInterior(source, interiors[intTypeID][1]) You're attempting to index the table interiors which is undefined, that is, a 'nil' value. You should define the table first, through something like this interiors = { [1] = {interiorWorldID, posX, posY, posZ}, -- of couse, substitute interiorWoldID, posX, posY, posZ with actual values [2] = {interiorWorldID, posX, posY, posZ}, [3] = {interiorWorldID, posX, posY, posZ}, }
  16. The code seems to be alright and should work. I don't know but maybe you just can't send functions over exports. Try adding the following debug line on line 18: outputDebugString("onAccept: "..tostring(onAccept).." | onReject: "..tostring(onReject)) and see whether it outputs "function: ..." or "nil." Can't think of anything else to try.
  17. Line 9, you're not using the valid syntax for addEventHandler. It should be something like addEventHandler("onResourceStart", resourceRoot, addNotification) but the parameters of the event onResourceStart don't match up with the parameters addNotification is expecting. It also seems like the event is completely unnecessary. I've also got a question - is the resource named "notices"? If so, you're entering an infinite loop by calling addNotification inside addNotification. I have a feeling that client side might have been stolen off somewhere since you definitely didn't write it up considering your server-side Lua skill.
  18. ^^ maximap resource is a custom F11 map, if you don't want to make your own one.
  19. Show us the part of the code that includes guiGridListSetItemText, the source of the error.
  20. Can't you just use getColorFromString?
  21. There error is self-explanatory. Argument #1 ("data") is nil where it should be a table. Line 26 in serverside filters (breaks function via return) only in the following circumstances: If type of return is a table... ...and that table is empty The return is a nil value. This means that a value of true/false will succeed past line 26 and get sent over to the client, and the client will then attempt to sort that boolean value as if it were a table, causing the error. Try using the following code instead of what you have on line 26. if (type(db) ~= "table" or (type(db)=="table" and #db==0) or not db) then return end This should: Reject any non-table values If the value is a table, reject it if it is empty Reject nil values
  22. A shader should be able to do the job.
  23. I'm afraid we cannot understand your problem. Please try your language's scripting section as KariiiM suggested.
  24. This seems like the function timerUnjailPlayer receives a nil instead of the player on parameter jailedPlayer (hence error at line 822) and that results in no element data being collected, creating an arithmetic error on line 823 when trying to compare no data to a number.
×
×
  • Create New...