Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("infobar loaded")
- --dofile(infobarcfg.cfg)
- cfg_font_name = "Comic Sans MS"
- cfg_flags = 5
- cfg_text_color = 0xFFFFCC00
- cfg_back_color = 0xBF000000
- cfg_border_color = 0xFFFFCC00
- istate = 1
- ifont = renderCreateFont(cfg_font_name, 8, cfg_flags)
- function command()
- if istate == 1 then
- istate = 0
- sampfuncsLog("infobar disabled")
- else
- istate = 1
- sampfuncsLog("infobar enabled")
- end
- end
- function main()
- while not isSampAvailable() do
- wait(1000)
- end
- sampAddMessageToChat("infobar loaded", 0xFF0000)
- sampRegisterChatCommand("ibar", command)
- while true do
- wait(0)
- if isPlayerPlaying(playerChar) and isSampAvailable() and istate then
- posX, posY = getScreenResolution()
- posX2 = posX + 2
- posY2 = posY - 17
- renderDrawBoxWithBorder(-1, posY2, posX2, 18, cfg_back_color, 1, cfg_border_color)
- if not isCharInAnyCar(playerChar) then
- playerID = sampGetPlayerIdByCharHandle(playerPed)
- playerName = sampGetPlayerNickname(playerID)
- playerPing = sampGetPlayerPing(playerID)
- playerHP = getCharHealth(playerPed)
- playerAP = getCharArmour(playerPed)
- playerLvl = sampGetPlayerScore(playerID)
- playerMoney = storeScore(playerchar)
- playerMoney = playerMoney / 1000000.0
- playerposX, playerposY, playerposZ = getCharCoordinates(playerPed)
- playerWeapon = getCurrentCharWeapon(playerPed)
- playerAmmo = getAmmoInCharWeapon(playerPed, playerAmmo)
- playerInterior = getCharAreaVisible(playerPed)
- posX3, posY3 = getScreenResolution()
- 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))
- posX4 = posX3 / 2
- posX4 = posX4 - fontleng
- posY4 = posY3 - 17
- 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)
- else
- end
- --playerID = sampGetPlayerIdByCharHandle(playerPed)
- --playerColor = sampGetPlayerColor(playerID)
- --renderDrawBoxWithBorder(posX2, 5, 15, 15, playerColor, 1, 0x66000000)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement