Advertisement
Noneatme

Untitled

Jan 3rd, 2013
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.98 KB | None | 0 0
  1. --[[
  2.     ##########################################################################
  3.     ##                                                                      ##
  4.     ## Project: 'MT-RPG' - Gamemode for MTA: San Andreas PROJECT X          ##
  5.     ##                      Developer: Noneatme                             ##
  6.     ##                                                                      ##
  7.     ##########################################################################
  8. ]]
  9.  
  10.  
  11. local cFunc = {}
  12. local cSetting = {}
  13. cSetting["debug"] = false
  14. cSetting["starttick"] = nil
  15. cSetting["frames"] = 0
  16. cSetting["ticks"] = 0
  17.  
  18. local sx, sy = guiGetScreenSize()
  19. local aesx, aesy = 1600, 900
  20.  
  21. -- FUNCTIONS --
  22.  
  23. cFunc["toggle_debug"] = function()
  24.     cSetting["debug"] = not cSetting["debug"]
  25.  
  26.     setDevelopmentMode(cSetting["debug"])
  27. end
  28.  
  29. cFunc["render_debug"] = function()
  30.     if(cSetting["debug"] or isDebugViewActive ()) then
  31.         if not(cSetting["starttick"]) then
  32.             cSetting["starttick"] = getTickCount()
  33.         end
  34.         if(getTickCount()-cSetting["starttick"] > 1000) then
  35.             cSetting["frames"] = cSetting["ticks"]
  36.             cSetting["ticks"] = 0
  37.             cSetting["starttick"] = nil
  38.         else
  39.             cSetting["ticks"] = cSetting["ticks"]+1
  40.         end
  41.    
  42.         dxDrawText("FPS: #00FFFF"..cSetting["frames"].."#FFFFFF, Tickcount: #00FFFF"..getTickCount(), 5/aesx*sx, sy-(15/aesy*sy), 70/aesx*sx, 50/aesy*sy, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, false, true)
  43.         dxDrawText("Collected Garbage: #00FFFF"..collectgarbage("count"), 5/aesx*sx, sy-(30/aesy*sy), 100/aesx*sx, 50/aesy*sy, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, false, true)
  44.        
  45.         dxDrawText("Peds: #00FFFF"..#getElementsByType("ped", getRootElement(), true).."#FFFFFF, Players: #00FFFF"..#getElementsByType("player", getRootElement(), true).."#FFFFFF, Vehicles: #00FFFF"..#getElementsByType("vehicle", getRootElement(), true).."#FFFFFF, Objects: #00FFFF"..#getElementsByType("object", getRootElement(), true), 5/aesx*sx, sy-(45/aesy*sy), 100/aesx*sx, 50/aesy*sy, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, false, true)
  46.         dxDrawText("Blips: #00FFFF"..#getElementsByType("blip", getRootElement(), true).."#FFFFFF, Colshapes: #00FFFF"..#getElementsByType("colshape", getRootElement(), true), 5/aesx*sx, sy-(60/aesy*sy), 100/aesx*sx, 50/aesy*sy, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, false, true)
  47.         local x, y, z = getElementPosition(localPlayer)
  48.         dxDrawText("X: #00FFFF"..math.round(x, 2, "round").."#FFFFFF, Y: #00FFFF"..math.round(y, 2, "round").."#FFFFFF, Z: #00FFFF"..math.round(z, 2, "round").."#FFFFFF, Interior: #00FFFF"..getElementInterior(localPlayer).."#FFFFFF, Dimension: #00FFFF"..getElementDimension(localPlayer), 5/aesx*sx, sy-(75/aesy*sy), 100/aesx*sx, 50/aesy*sy, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, false, true)
  49.        
  50.         local hour, min = getTime()
  51.         dxDrawText("Skin ID: #00FFFF"..getElementModel(localPlayer).."#FFFFFF, Ingame-Time: #00FFFF"..hour..":"..min.."#FFFFFF, Location: #00FFFF"..getZoneName(x, y, z, false).."#FFFFFF, #00FFFF"..getZoneName(x, y, z, true), 2050/aesx*sx, sy-(15/aesy*sy), 70/aesx*sx, 50/aesy*sy, tocolor(255, 255, 255, 255), 1, "default-bold", "center", "top", false, false, false, true)
  52.        
  53.         local hit, x, y, z, elementHit, normalX, normalY, normalZ, material, lighting, piece, worldModelID, wx, wy, wz, wLOD = processLineOfSight ( x, y, z, x, y, z-30, true, true, false)
  54.         dxDrawText("Lighting Level: #00FFFF"..(lighting or "-").."#FFFFFF, Material: #00FFFF"..(material or "-").."#FFFFFF, World Model ID: #00FFFF"..(worldModelID or "-").."#FFFFFF, World Model LOD: #00FFFF"..(wLOD or "-"), 2050/aesx*sx, sy-(30/aesy*sy), 70/aesx*sx, 50/aesy*sy, tocolor(255, 255, 255, 255), 1, "default-bold", "center", "top", false, false, false, true)
  55.        
  56.     end
  57. end
  58.  
  59. -- EVENT HANDLERS --
  60.  
  61. --addCommandHandler("debug", cFunc["toggle_debug"])
  62. addEventHandler("onClientRender", getRootElement(), cFunc["render_debug"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement