Jump to content

arezu

Members
  • Content Count

    446
  • Joined

  • Last visited

Community Reputation

4 Neutral

About arezu

  • Rank
    Hustler

Details

  • Gang
    TG

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I'm not noticing anything like that in your script, or do you mean it's slow when you are turning? I think that is because your gravity is too strong. Btw, you should use onClientPreRender instead of onClientRender for the gravity and then multiply the gravity power with the 'timeSlice' parameter you get from onClientPreRender. If you dont multiply by the time slice, then the gravity will be very different depending on your fps.
  2. I used setVehicleGravity(vehicle, 0, 0, 0) and then used setElementVelocity on the vehicle in that script instead to simulate gravity, since setElementVelocity doesn't affect the camera in the same way as setVehicleGravity.
  3. Your pcre syntax does not match anything in php or javascript either. Test it here and you will see: https://regex101.com/#pcre Remove the first anchor and it will work: [^local ]function (.*?)\( (Im completely newbie at using regular expressions so don't ask me more about it)
  4. If there a runtime error in the code you load with loadstring, for example trying to call a function that doesn't exist; then when you call the function returned by loadstring, the script you are running will stop execution (but mta will still call your code functions in the script, like events, binds etc). That means if you have code like this: local func = loadstring("outputChatBoxZ('hello, world!')") func() outputChatBox("After calling loadstring func") then the second outputChatBox will not be called. But if you are using pcall: local func = loadstring("outputChatBoxZ('hello,
  5. The best way to do it is probably to create a command that saves data (maybe stopping work and afk resource first?) and then closes the server. Something like this: local resourcesToWaitFor = { "work", "afk" } local waitingForResources = {} local doShutdown = false addCommandHandler("safeshutdown", function(player) outputChatBox("Safely shutting down the server...") for k, resourceName in ipairs(resourcesToWaitFor) do local resource = getResourceFromName(resourceName) if(resource)then waitingForResources[resource] = true end
  6. You also have to change the velocity setElementVelocity
  7. How are you animating? show your code
  8. Something like this if you just want to get started and might want to learn about vectors more later: -- "ball" is the ball element -- "vehicle" is the vehicle element that collided with the ball local x, y, z = getElementPosition(ball) local x2, y2, z2 = getElementPosition(vehicle) local velX, velY, velZ = getElementVelocity(vehicle) local vel = math.sqrt(velX*velX + velY*velY + velZ*velZ) -- equal to getDistanceBetweenPoints3D(0, 0, 0, velX, velY, velZ) local dirX, dirY, dirZ = x - x2, y - y2, z - z2 local dist = math.sqrt(dirX*dirX + dirY*dirY + dirZ*dirZ) -- equal to getDist
  9. You can fix it by drawing your dx stuff into a render target and changing the depth that you render the texture (also enabling depth checking), the same way I believe Ren's shader does it.
  10. Change this on line 16: dxSetRenderTarget(login.background) to: dxSetRenderTarget(login.background, true)
  11. arezu

    Prevent File

    From downloadFile wiki page: In other words: downloadFile will only download the file if the file doesn't exist, or if the file exists and the content of the file does not match the content of the file you want to download.
  12. You have to check that the file exists and that you have permission to read from it.
  13. onClientClick executes twice because it executes when you press down a mouse button and when release it. The button state is the second parameter value for the callback function. https://wiki.multitheftauto.com/wiki/OnClientClick You just have to check if button == "left" and state == "down" to make your function only detect a click when your left mouse button is pressed down.
  14. That runs on server's performance sadly, there's no client part. Tick the box "include clients" and select a player and it will tell you performance information from the player (client-side performance).
  15. Try creating a custom font of several sizes and switch between the fonts depending on the size.
×
×
  • Create New...