Jump to content

Addlibs

Members
  • Posts

    1,060
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Addlibs

  1. You can't set control state of a vehicle. There's one possible solution, placing a ped inside the vehicle while no one's there and making him apply the handbrake constantly, but then it'd be impossible to re-enter the car (can't jack peds, can't enter while they're inside). The only way to fix that second problem would be deleting the ped when the player enters, but the player won't enter at that instance therefore one will need to press F/Enter twice to re-enter a car.
  2. DayZ doesn't care about other players' weapons — It replaces the weapon model on your client, every weapon model. This means if you look at another player, he might be wielding a Makarov PM while, on his end, it is actually a flashlight — this is because you may be wielding a Makarov PM as well. https://github.com/mtadayz/MTADayZ/blob ... switch.lua
  3. Oh, I see. So you're using the American version so that you look dumb, which you obviously are.Jokes aside, I actually used the British version not to look smart, but because I am a British resident.
  4. Freezing a vehicle is not the same as having a handbrake applied. He's aiming for realism rather than mechanics, hence
  5. Actually, in international English standards, you use (modern) British English (–ise), not American English (–ize). Besides, I only expressed my view but you called me an idiot which I find quite offensive.
  6. Good idea. (being sarcastic here if you don't realise) Completely remove the possibility to decrypt the code and hope it will magically load up. MTA needs to decrypt the code in order to load it into memory.
  7. You can use coroutines to pause the thread while waiting for results (I don't really know how to make a code like that but I saw a few resources that employ this method)
  8. I believe your primary problem might be caused by the fact you can't (I think) pass MTA elements into PHP, whilst you're trying to send the player element and return it back on callback.
  9. No, it's not possible. Unless they had changed all weapon models' textures to full transparency and then attached MTA objects through bone_attach. Default MTA weapons aren't elements, and therefore you cannot target them with dxSetShaderTexture (however, you can target all weapons of a particular weapon, or rather, a specific texture from all models)
  10. In that case your PHP might be erroneous
  11. callRemote("http://*****/login.php", function (...) outputDebugString( toJSON({...}) ) end ) What does the PHP return to the debugstring, in JSON? (use the code above temporarily)
  12. In that case you can try to ask the developers of that server or wait for someone else with a better suggestion as I really don't know what would be a good way.
  13. I'm not sure if that is possible, I'm afraid. You could try to mess around with the vehicle handling, though I never got any decent successes.
  14. You can replace the x, y, and z arguments with one vector argument, i.e. setElementPosition( player, Vector3( 1, 2, 3 ) ) -- or local pos = Vector3( 1, 2, 3 ) setElementPosition( player, pos ) -- or (only in OOP) player.position = Vector3( 1, 2, 3 )
  15. Matrices are useful for finding the front of an object, for example. localPlayer.vehicle.matrix.forwards * 5 = 5 units forwards Vectors are for positioning or velocities Vector3(0,0,1) -- could mean position X:0, Y:0: Z:1 or could mean Z:+1 velocity (m/s maybe?) depending on how you use it (setElementPosition or setElementVelocity)
  16. f = function() end -- this is accessible across the whole resource-side (i.e. all server/client-side files of a resource) local f f = function() end -- this is accessible to the whole file local f = function() end -- this is accessible to the whole file if true then local f = function() end -- this is accessible to the scope it's on only (the if-then-end scope). end
  17. getAccountName(user) on the HTTP interface.
  18. On line 13, you break the loop just after first if-else. This means it will stop looping after the first seat without an occupant. Remove 'break' from that line (or the whole line as it's unnecessary)
  19. You're attempting to getElementData of a nil value (that is, a variable that is set to nil, or even more simply, the variable is set to nothing or not set at all)
  20. Where did you add hex? Am I blind or what? I don't see it. However, I do see that you can't even script in Lua if you don't see string formatting/syntax mistakes in your code when they're syntax-highlighted (on this forum).
  21. 'safe' is not defined anywhere within 'safecheck' function
  22. string.format("%X%X%X%X", a, r, g, b) -- a = alpha, -- r = red, -- g = green, -- b = blue (duh) Edit: string.format("%.2X%.2X%.2X%.2X", a, r, g, b) -- a = alpha, -- r = red, -- g = green, -- b = blue (duh)
  23. function helloWorld() print("Hello World") end -- is the same as helloWorld = function() print("Hello World") end -- Therefore, local function helloWorld() print("Hello World") end -- is the same as local helloWorld = function() print("Hello World") end A local function is just a function but assigned to a local variable.
×
×
  • Create New...