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

Wysłany: 2015-11-14, 12:55


Gerano

Mleko,Kakao,LUA






Wiek: 38
Na forum: 4407 dni
Posty: 187
Nick w MP: Gerano

Piwa: 1460

Respekt: 146,3
Respekt: 146,3

Ostrzeżeń: 100%
Witam mam ot?? problem poniewa? robi? hud do nowego swojego projektu RPG i mam taki problem mam wszystko opr?cz reputacji.Mam napisany kod ale nie pokazuje reputacji.
--[[

  Autor: Gerano
  Wersja: 2.0 Finish
  Zakaz kopiowania bez pozwolenia autora skryptu
  
--]]
showPlayerHudComponent ( "all", false )
showPlayerHudComponent ( "radar", true)
showPlayerHudComponent ( "wanted", true)

--- Kod na realny czas
local realtime = getRealTime()
    local hour = realtime.hour
    local minute = realtime.minute
    
local pgpval = getElementData(localPlayer,"player:reputation")



local screenW, screenH = guiGetScreenSize()

addEventHandler("onClientRender", root,
    function()
        dxDrawRectangle(screenW * 0.7324, screenH * 0.0000, screenW * 0.2676, screenH * 0.2409, tocolor(51, 51, 51, 227), false)
        dxDrawRectangle(screenW * 0.7275, screenH * 0.0000, screenW * 0.0049, screenH * 0.2409, tocolor(10, 103, 218, 227), false)
        dxDrawRectangle(screenW * 0.7275, screenH * 0.2409, screenW * 0.2725, screenH * 0.0052, tocolor(10, 103, 218, 227), false)
        dxDrawRectangle(screenW * 0.8838, screenH * 0.0508, screenW * 0.0996, screenH * 0.0156, tocolor(227, 0, 0, 227), false)
        dxDrawText("?ycie:"..math.floor(getElementHealth(localPlayer)).. "%", screenW * 0.8838, screenH * 0.0508, screenW * 0.9834, screenH * 0.0664, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "center", false, false, false, false, false)
        dxDrawRectangle(screenW * 0.8838, screenH * 0.0820, screenW * 0.0996, screenH * 0.0156, tocolor(11, 12, 12, 251), false)
        dxDrawRectangle(screenW * 0.8838, screenH * 0.1107, screenW * 0.0996, screenH * 0.0156, tocolor(13, 160, 229, 227), false)
        dxDrawText("Pancerz:"..math.floor(getPedArmor(localPlayer)).. "%", screenW * 0.8838, screenH * 0.0794, screenW * 0.9834, screenH * 0.0951, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "center", false, false, false, false, false)
        dxDrawText("Tlen:"..math.floor(getPedOxygenLevel(localPlayer) / 10).. "%", screenW * 0.8838, screenH * 0.1107, screenW * 0.9834, screenH * 0.1263, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "center", false, false, false, false, false)
        dxDrawText("Pieni?dze:"..getPlayerMoney(localPlayer).."PLN", screenW * 0.7324, screenH * 0.1979, screenW * 1.0000, screenH * 0.2331, tocolor(47, 172, 8, 251), 1.50, "sans", "left", "center", false, false, false, false, false)
        dxDrawText("PG:   %01d",getElementData(localPlayer,"player:reputation"), screenW * 0.8828, screenH * 0.1354, screenW * 0.9932, screenH * 0.1771, tocolor(47, 172, 8, 251), 1.50, "sans", "left", "center", false, false, false, false, false)
        dxDrawImage(screenW * 0.7422, screenH * 0.0117, screenW * 0.1309, screenH * 0.1523, "i/ikona.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    end
)
    



Podpis
BUDOWA SERWERA: XXX

Prace: XXX%
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-14, 14:06


AteX







Wiek: 27
Na forum: 4156 dni
Posty: 925
Nick w MP: #AteX

Piwa: 8366

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

dxDrawText("PG:   %01d",getElementData(localPlayer,"player:reputation"), screenW * 0.8828, screenH * 0.1354, screenW * 0.9932, screenH * 0.1771, tocolor(47, 172, 8, 251), 1.50, "sans", "left", "center", false, false, false, false, false)

Przed getElementData jest przecinek ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-14, 14:18


Fanciak

BOT






Wiek: 26
Na forum: 4587 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

--[[

  Autor: Gerano
  Wersja: 2.0 Finish
  Zakaz kopiowania bez pozwolenia autora skryptu
  
--]]
showPlayerHudComponent ( "all", false )
showPlayerHudComponent ( "radar", true)
showPlayerHudComponent ( "wanted", true)

--- Kod na realny czas
local realtime = getRealTime()
    local hour = realtime.hour
    local minute = realtime.minute
    
local pgpval = getElementData(localPlayer,"player:reputation")



local screenW, screenH = guiGetScreenSize()

addEventHandler("onClientRender", root,
    function()
        dxDrawRectangle(screenW * 0.7324, screenH * 0.0000, screenW * 0.2676, screenH * 0.2409, tocolor(51, 51, 51, 227), false)
        dxDrawRectangle(screenW * 0.7275, screenH * 0.0000, screenW * 0.0049, screenH * 0.2409, tocolor(10, 103, 218, 227), false)
        dxDrawRectangle(screenW * 0.7275, screenH * 0.2409, screenW * 0.2725, screenH * 0.0052, tocolor(10, 103, 218, 227), false)
        dxDrawRectangle(screenW * 0.8838, screenH * 0.0508, screenW * 0.0996, screenH * 0.0156, tocolor(227, 0, 0, 227), false)
        dxDrawText("?ycie:"..math.floor(getElementHealth(localPlayer)).. "%", screenW * 0.8838, screenH * 0.0508, screenW * 0.9834, screenH * 0.0664, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "center", false, false, false, false, false)
        dxDrawRectangle(screenW * 0.8838, screenH * 0.0820, screenW * 0.0996, screenH * 0.0156, tocolor(11, 12, 12, 251), false)
        dxDrawRectangle(screenW * 0.8838, screenH * 0.1107, screenW * 0.0996, screenH * 0.0156, tocolor(13, 160, 229, 227), false)
        dxDrawText("Pancerz:"..math.floor(getPedArmor(localPlayer)).. "%", screenW * 0.8838, screenH * 0.0794, screenW * 0.9834, screenH * 0.0951, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "center", false, false, false, false, false)
        dxDrawText( TLEN:"..math.floor(getPedOxygenLevel(localPlayer) / 10).. "%", screenW * 0.8838, screenH * 0.1107, screenW * 0.9834, screenH * 0.1263, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "center", false, false, false, false, false)
        dxDrawText("Pieni?dze:"..getPlayerMoney(localPlayer).."PLN", screenW * 0.7324, screenH * 0.1979, screenW * 1.0000, screenH * 0.2331, tocolor(47, 172, 8, 251), 1.50, "sans", "left", "center", false, false, false, false, false)
        dxDrawText("PG:   %01d",pgpval, screenW * 0.8828, screenH * 0.1354, screenW * 0.9932, screenH * 0.1771, tocolor(47, 172, 8, 251), 1.50, "sans", "left", "center", false, false, false, false, false)
        dxDrawImage(screenW * 0.7422, screenH * 0.0117, screenW * 0.1309, screenH * 0.1523, "i/ikona.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    end
)
    


Tak powinno by? dobrze.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-14, 15:58


Gerano

Mleko,Kakao,LUA






Wiek: 38
Na forum: 4407 dni
Posty: 187
Nick w MP: Gerano

Piwa: 1460

Respekt: 146,3
Respekt: 146,3

Ostrzeżeń: 100%
Nadal nic

Podpis
BUDOWA SERWERA: XXX

Prace: XXX%
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-14, 18:59


monio







Wiek: 30
Na forum: 5028 dni
Posty: 319
Nick w MP: Monio99

Piwa: 3565

Respekt: 120,5
Respekt: 120,5


--[[

  Autor: Gerano
  Wersja: 2.0 Finish
  Zakaz kopiowania bez pozwolenia autora skryptu
  
--]]
showPlayerHudComponent ( "all", false )
showPlayerHudComponent ( "radar", true)
showPlayerHudComponent ( "wanted", true)

--- Kod na realny czas
local realtime = getRealTime()
    local hour = realtime.hour
    local minute = realtime.minute
    
local pgpval = getElementData(localPlayer,"player:reputation")



local screenW, screenH = guiGetScreenSize()

addEventHandler("onClientRender", root,
    function()
        dxDrawRectangle(screenW * 0.7324, screenH * 0.0000, screenW * 0.2676, screenH * 0.2409, tocolor(51, 51, 51, 227), false)
        dxDrawRectangle(screenW * 0.7275, screenH * 0.0000, screenW * 0.0049, screenH * 0.2409, tocolor(10, 103, 218, 227), false)
        dxDrawRectangle(screenW * 0.7275, screenH * 0.2409, screenW * 0.2725, screenH * 0.0052, tocolor(10, 103, 218, 227), false)
        dxDrawRectangle(screenW * 0.8838, screenH * 0.0508, screenW * 0.0996, screenH * 0.0156, tocolor(227, 0, 0, 227), false)
        dxDrawText("?ycie:"..math.floor(getElementHealth(localPlayer)).. "%", screenW * 0.8838, screenH * 0.0508, screenW * 0.9834, screenH * 0.0664, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "center", false, false, false, false, false)
        dxDrawRectangle(screenW * 0.8838, screenH * 0.0820, screenW * 0.0996, screenH * 0.0156, tocolor(11, 12, 12, 251), false)
        dxDrawRectangle(screenW * 0.8838, screenH * 0.1107, screenW * 0.0996, screenH * 0.0156, tocolor(13, 160, 229, 227), false)
        dxDrawText("Pancerz:"..math.floor(getPedArmor(localPlayer)).. "%", screenW * 0.8838, screenH * 0.0794, screenW * 0.9834, screenH * 0.0951, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "center", false, false, false, false, false)
        dxDrawText("Tlen:"..math.floor(getPedOxygenLevel(localPlayer) / 10).. "%", screenW * 0.8838, screenH * 0.1107, screenW * 0.9834, screenH * 0.1263, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "center", false, false, false, false, false)
        dxDrawText("Pieni?dze:"..getPlayerMoney(localPlayer).."PLN", screenW * 0.7324, screenH * 0.1979, screenW * 1.0000, screenH * 0.2331, tocolor(47, 172, 8, 251), 1.50, "sans", "left", "center", false, false, false, false, false)
        dxDrawText("PG:  "..pgpval ,screenW * 0.8828, screenH * 0.1354, screenW * 0.9932, screenH * 0.1771, tocolor(47, 172, 8, 251), 1.50, "sans", "left", "center", false, false, false, false, false)
        dxDrawImage(screenW * 0.7422, screenH * 0.0117, screenW * 0.1309, screenH * 0.1523, "i/ikona.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    end
)


Ludzie co wy podajecie?...
Do czego ma Ci zwr?ci? "pgpval"?

dxDrawText("PG:  ",pgpval ,screenW * 0.8828, screenH * 0.1354, screenW * 0.9932, screenH * 0.1771, tocolor(47, 172, 8, 251), 1.50, "sans", "left", "center", false, false, false, false, false)



dxDrawText("PG:  "..pgpval ,screenW * 0.8828, screenH * 0.1354, screenW * 0.9932, screenH * 0.1771, tocolor(47, 172, 8, 251), 1.50, "sans", "left", "center", false, false, false, false, false)


Teraz powinno dzia?a? ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-15, 15:49


Gerano

Mleko,Kakao,LUA






Wiek: 38
Na forum: 4407 dni
Posty: 187
Nick w MP: Gerano

Piwa: 1460

Respekt: 146,3
Respekt: 146,3

Ostrzeżeń: 100%
nadal nic

[ Dodano: 2015-11-15, 15:58 ]
chcia?em u?y? tej funkcji
local ogpval = getElementData(localPlayer,"player:reputation")
string2=string.format("R:   %01d",getElementData(localPlayer,"player:reputation"))

i jak da?em zamiast PG normalnie string2 to nic znika wtedy PG i tyle

[ Dodano: 2015-11-15, 16:10 ]
Pomo?e kto??

Podpis
BUDOWA SERWERA: XXX

Prace: XXX%
Postaw piwo autorowi tego posta
 

 
Tagi: reputacja
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