Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-12-03, 20:48


adisonboss







Wiek: 23
Na forum: 3331 dni
Posty: 237

Piwa: 6

Respekt: 50

Witam. Jak zrobi? by nie widzie? swojego nametaga nad g?ow?. Za pomoc :piwo: i R*

--[[
    # Resource Name
      Basic HUD
    # Author
      Rage
    # Date created
      12.04.2014
    # Copyright (c)
      If you edit itthen please respect me and keep
      the credits.
--]]

--# Fix on all resolutions
local screenW,screenH guiGetScreenSize()
local resW,resH 1280,720
local sW,sH =  (screenW/resW), (screenH/resH)
        
local validWeaponSlots = 
        {
        [ ] = true,
        [ ] = true,
        [ ] = true,
        [ ] = true,
        [ ] = true,
        [ ] = true,
        [ ] = true, 
        }  

addEventHandler("onClientRender"root,
    function()
        --# Player
        local hourmins getTime ()
        local time hour .. ":" .. (((mins 10) and "0"..mins) or mins)
        local zone getZoneName (getElementPosition(getLocalPlayer()))    
        local money convertNumber(getPlayerMoney(localPlayer))
        local health math.floor (getElementHealth getLocalPlayer() ))    
        local armor math.floor(getPedArmor getLocalPlayer() ))    
            dxDrawText(tostring (time), 1150*sW17*sH1270*sW38*sHtocolor(255255255255), 1.25"default-bold""center""center"falsefalsefalsefalsefalse)        
            dxDrawText(zone1150*sW45*sH1270*sW45*sHtocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)        
            dxDrawText("$ "..money1150*sW50*sH1270*sW70*sHtocolor(255255255255), 1.25"default-bold""left""center"falsefalsetruetruefalse)
            dxDrawText("Health: "..health.." %"1150*sW70*sH1270*sW85*sHtocolor(255255255255), 1.00"default-bold""left""center"falsefalsetruetruefalse)                
            dxDrawText("Armor: "..armor.." %"1150*sW85*sH1270*sW100*sHtocolor(255255255255), 1.00"default-bold""left""center"falsefalsetruetruefalse)        
        local oxygen getPedOxygenLevel (getLocalPlayer())
            if  ( oxygen 1000 or isElementInWater(getLocalPlayer()) ) then    
                dxDrawText("Oxygen: "..math.floor(oxygen/10).."%"1150*sW100*sH1270*sW115*sHtocolor(255255255255), 1.00"default-bold""left""center"falsefalsetruetruefalse)            
            end    
        if getControlState ("aim_weapon") or isPedDoingGangDriveby(getLocalPlayer()) then
            local ammo getPedTotalAmmo (getLocalPlayer())
            local clip getPedAmmoInClip (getLocalPlayer())
            local weaponID getPedWeapon(localPlayer)
            local weapName getWeaponNameFromID(weaponID)
            local weapSlot getPedWeaponSlot(getLocalPlayer())        
            local xBone,yBone,zBone getPedBonePosition(getLocalPlayer(), 8)
            local zBone zBone 0.5
            local xSP,ySP getScreenFromWorldPosition xBone,yBone,zBone )            
                if ( xSP and ySP then    
                    dxDrawText(weapName.." "..clip.." | "..ammoxSP+100,ySP290*sW250*sHtocolor (255255255255), 1.25*sW,1.25*sH,"default-bold","left","top",false,false,false,true) 
                        if ( clip and validWeaponSlots weapSlot ]  ) then
                            dxDrawText("Reloading..."xSP+100,ySP+20290*sW250*sHtocolor (255255255255), 1.25*sW,1.25*sH,"default-bold","left","top",false,false,false,true)        
                        end
                end
        end
        --# Vehicle
        local vehicle getPedOccupiedVehicle(getLocalPlayer())
            if ( vehicle then
                local speedxspeedyspeedz getElementVelocity vehicle  )
                local actualspeed = (speedx^speedy^speedz^2)^(0.5) 
                local kmh math.floor(actualspeed*180)    
                    if getElementHealth(vehicle) >= 999 then
                        vehiclehealth 100
                    else
                        vehiclehealth math.floor(getElementHealth vehicle )/10)
                    end
                        dxDrawText(kmh.." km/h"1160*sW653*sH1190*sW680*sHtocolor(255255255255), 1.25"default-bold""left""center"falsefalsefalsefalsefalse)
                        dxDrawText("Damage: "..vehiclehealth.." %"1150*sW680*sH1270*sW695*sHtocolor(255255255255), 1.00"default-bold""left""center"falsefalsefalsefalsefalse)                        
                    end        
            local vehicle getPedOccupiedVehicle(getLocalPlayer())
                if ( vehicle then            
                    local nitro getVehicleNitroLevel(getPedOccupiedVehicle(getLocalPlayer()))
                    local nitroCount getVehicleNitroCount(getPedOccupiedVehicle(getLocalPlayer()))
                        if getVehicleUpgradeOnSlot(vehicle8then            
                            if  nitro ~= false and nitro ~= nil and nitro 0  then
                                dxDrawText("Nitro: "..nitroCount.." | "..math.floor(nitro/1*100).." %"1150*sW695*sH1270*sW710*sHtocolor(255255255255), 1.00"default-bold""left""center"falsefalsefalsefalsefalse)                
                            else
                                dxDrawText(""1150*sW695*sH1270*sW710*sHtocolor(255255255255), 1.00"default-bold""left""center"falsefalsefalsefalsefalse)            
                            end
                        end
                end
        end)

--# Nametags
addEventHandler"onClientRender",root,
   function( )
      local pxpypztxtytzdist
      pxpypz getCameraMatrix( )
      for _v in ipairsgetElementsByType 'player' ) do
         txtytz getElementPosition)
         dist math.sqrt( ( px tx ) ^ + ( py ty ) ^ + ( pz tz ) ^ )
         if dist 30.0 then
            if isLineOfSightClearpxpypztxtytztruefalsefalsetruefalsefalsefalse,localPlayer then
               local sxsysz getPedBonePositionv)
               local x,getScreenFromWorldPositionsxsysz 0.6 )
               local playerRplayerGplayerB getPlayerNametagColor localPlayer )               
               local Level getElementData(localPlayer,"Level") or 0               
               if x then
                dxDrawTextstring.gsub getPlayerName ), "#%x%x%x%x%x%x""" )..""xyxytocolor(playerRplayerGplayerB), 0.85 + ( 15 dist ) * 0.02"default-bold" )            
               end
            end
         end
      end
   end
)

--# Convert numbers
function convertNumber number )  
    local formatted number  
    while true do      
        formattedstring.gsub(formatted"^(-?%d+)(%d%d%d)"'%1,%2')    
        if ( k==then      
            break  
        end  
    end  
    return formatted
end

addEventHandler"onClientResourceStart"resourceRoot,
    function()
        setPlayerHudComponentVisible "all"false )
        setPlayerHudComponentVisible "radar"true )    
        setPlayerHudComponentVisible "vehicle_name"true )    
        setPlayerHudComponentVisible "radio"true )        
        setPlayerHudComponentVisible "crosshair"true )            
    end);

addEventHandler"onClientResourceStop"resourceRoot,
    function()
        setPlayerHudComponentVisible "all"true )        
    end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-03, 20:50


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Powinno dzia?a?:
--# Nametags
addEventHandler"onClientRender",root,
   function( )
      local pxpypztxtytzdist
      pxpypz getCameraMatrix( )
      for _v in ipairsgetElementsByType 'player' ) do
        if v~=localPlayer then
         txtytz getElementPosition)
         dist math.sqrt( ( px tx ) ^ + ( py ty ) ^ + ( pz tz ) ^ )
         if dist 30.0 then
            if isLineOfSightClearpxpypztxtytztruefalsefalsetruefalsefalsefalse,localPlayer then
               local sxsysz getPedBonePositionv)
               local x,getScreenFromWorldPositionsxsysz 0.6 )
               local playerRplayerGplayerB getPlayerNametagColor localPlayer )               
               local Level getElementData(localPlayer,"Level") or 0               
               if x then
                dxDrawTextstring.gsub getPlayerName ), "#%x%x%x%x%x%x""" )..""xyxytocolor(playerRplayerGplayerB), 0.85 + ( 15 dist ) * 0.02"default-bold" )            
               end
            end
         end
         end
      end
   end
)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
adisonboss
Wysłany: 2018-12-04, 17:43


adisonboss







Wiek: 23
Na forum: 3331 dni
Posty: 237

Piwa: 6

Respekt: 50

Dziena do zamkniecia

Postaw piwo autorowi tego posta
 

 
Tagi: swoje :: nametagi
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku