Advertisement
Guest User

Untitled

a guest
May 30th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. print("infobar loaded")
  2. --dofile(infobarcfg.cfg)
  3. cfg_font_name = "Comic Sans MS"
  4. cfg_flags = 5
  5. cfg_text_color = 0xFFFFCC00
  6. cfg_back_color = 0xBF000000
  7. cfg_border_color = 0xFFFFCC00
  8.  
  9. istate = 1
  10. ifont = renderCreateFont(cfg_font_name, 8, cfg_flags)
  11.  
  12. function command()
  13. if istate == 1 then
  14. istate = 0
  15. sampfuncsLog("infobar disabled")
  16. else
  17. istate = 1
  18. sampfuncsLog("infobar enabled")
  19. end
  20. end
  21.  
  22. function main()
  23. while not isSampAvailable() do
  24. wait(1000)
  25. end
  26. sampAddMessageToChat("infobar loaded", 0xFF0000)
  27. sampRegisterChatCommand("ibar", command)
  28. while true do
  29. wait(0)
  30. if isPlayerPlaying(playerChar) and isSampAvailable() and istate then
  31. posX, posY = getScreenResolution()
  32. posX2 = posX + 2
  33. posY2 = posY - 17
  34. renderDrawBoxWithBorder(-1, posY2, posX2, 18, cfg_back_color, 1, cfg_border_color)
  35. if not isCharInAnyCar(playerChar) then
  36. playerID = sampGetPlayerIdByCharHandle(playerPed)
  37. playerName = sampGetPlayerNickname(playerID)
  38. playerPing = sampGetPlayerPing(playerID)
  39. playerHP = getCharHealth(playerPed)
  40. playerAP = getCharArmour(playerPed)
  41. playerLvl = sampGetPlayerScore(playerID)
  42. playerMoney = storeScore(playerchar)
  43. playerMoney = playerMoney / 1000000.0
  44. playerposX, playerposY, playerposZ = getCharCoordinates(playerPed)
  45. playerWeapon = getCurrentCharWeapon(playerPed)
  46. playerAmmo = getAmmoInCharWeapon(playerPed, playerAmmo)
  47. playerInterior = getCharAreaVisible(playerPed)
  48. posX3, posY3 = getScreenResolution()
  49. fontleng = renderGetFontDrawTextLength(ifont, string.format("Name: %s | ID: %d | Ping: %d | Health: %d | Armor: %d | Level: %d | Money: %.2fkk | Weapon: %d | Ammo: %d | Interior: %d | [%.2f][%.2f][%.2f]", playerName, playerID, playerPing, playerHP, playerAP, playerLvl, playerMoney, playerWeapon, playerAmmo, playerInterior, playerposX, playerposY, playerposZ))
  50. posX4 = posX3 / 2
  51. posX4 = posX4 - fontleng
  52. posY4 = posY3 - 17
  53. renderFontDrawText(ifont, string.format("Name: %s | ID: %d | Ping: %d | Health: %d | Armor: %d | Level: %d | Money: %.2fkk | Weapon: %d | Ammo: %d | Interior: %d | [%.2f][%.2f][%.2f]", playerName, playerID, playerPing, playerHP, playerAP, playerLvl, playerMoney, playerWeapon, playerAmmo, playerInterior, playerposX, playerposY, playerposZ), posX4, posY4, cfg_text_color)
  54. else
  55.  
  56. end
  57. --playerID = sampGetPlayerIdByCharHandle(playerPed)
  58. --playerColor = sampGetPlayerColor(playerID)
  59. --renderDrawBoxWithBorder(posX2, 5, 15, 15, playerColor, 1, 0x66000000)
  60. end
  61. end
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement