Jump to content

Controlled

Members
  • Posts

    167
  • Joined

  • Last visited

Everything posted by Controlled

  1. Use lua tags so it's easier for us to read. What does debug output for the values of screenx and screeny?
  2. Where does account data? Are there any disadvantages to using it long term?
  3. Is there a function to check if a ped is in the water? Thanks
  4. I made it quickly based on what is put on the MTA Wiki. You can change it however you wish. I'm just showing you a example you could use to build your own.
  5. Just make the screen turn red when you're on low health function addRednessOnDamage ( ) local playerHealth = getElementHealth ( source ) local theVehicle = getPedOccupiedVehicle(source) if playerHealth<=20 then fadeCamera ( source, false, 2.5, 255, 0, 0 ) -- fade the player's camera to red over a period of 1 second setTimer ( fadeCamera2, 900, 1, source ) -- don't let it go to opaque red, interrupt it after half a second and fade back to normal else fadeCamera ( source, false, 2.5, 255, 0, 0 ) -- fade the player's camera to red over a period of 1 second setTimer ( fadeCameraDelayed, 500, 1, source ) -- don't let it go to opaque red, interrupt it after half a second and fade back to normal end end addEventHandler ( "onPlayerDamage", getRootElement(), addRednessOnDamage ) function fadeCameraDelayed(player) -- This function prevents debug warnings when the player disconnects while the timer is running. if (isElement(player)) then fadeCamera(player, true, 1.0) end end function fadeCamera2(player) if (isElement(player)) then fadeCamera(player, true, 20.0) end end
  6. function DimensionP (player, dimension) if isPedInVehicle (player) then local veh = getPedOccupiedVehicle (player) setElementDimension ( player, dimension ) setElementDimension ( veh, dimension ) else setElementDimension ( player, dimension ) end return true end function checkAFKPlayers() for index, thePlayer in ipairs(getElementsByType("player"))do -- Loop all online players if (getPlayerIdleTime(thePlayer) > 300000) then -- Player hasn't moved for 300,000ms (5 minutes) DimensionP ( thePlayer, 1 ) outputChatBox("AFk Check") elseif ( getElementDimension ( thePlayer) == 1 ) and (getPlayerIdleTime(thePlayer) < 300000) then setElementDimension ( thePlayer, 0) end end end setTimer(checkAFKPlayers, 30000, 0)
  7. This is wrong. [2014-03-10 16:57:06] WARNING: roleplay-banking\s_banking.lua:212: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got nil] You are not choosing a SQL Connection at the first argument - I see the same errors over multiple systems so I'm guessing thats a issue with more than 1 resource
  8. Had a line if (speed=>1) then Instead of if (speed>=1) then That was the issue, thanks
  9. I'm trying to compile a Lua file at https://luac.multitheftauto.com/ and whenever I try it says "Error Cannot Compile File" Is their some kind of character I have in it causing this issue? Or whats going on? lol
  10. Did not work. I could still tap it quickly to run
  11. I don't see a addEvent in your script
  12. What's the error? Did you make a event for onPlayerLevelUP?
  13. How can I disable spamming your sprint key to run faster? Thanks
  14. How could I use a Table to write a new Number Value but have it readable across resources?
  15. Using SQL queries would be waaaay worst. Much more laggy
  16. Would it be laggy to setElementData every second? I need a way for a number to be updated every second and carried over to another resource, but be bound to a single person if that makes sense.
  17. One more thing. Can you make it possible so you can't be shot/punched?
  18. Thanks man. Exactly what I was looking for, just wasn't sure what it was called
  19. Is there a way to allow other players to walk through you? I was thinking of making something like /afk for players that need to step away from the computer.
  20. Alright, Thanks Bonsai and Citizen. I will see what I can do, I know this was a unusual question/problem
  21. I have been doing it like that in my scripts before without issue
  22. The thing is, I'm not using a script. I'm just doing what I showed you above with the Meta file..
×
×
  • Create New...