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

Wysłany: 2016-11-09, 20:30


macieq.

Grafik






Wiek: 28
Na forum: 3654 dni
Posty: 42
Nick w MP: 1Macieq



Respekt: 50

Cze??, tak sobie skryptuje w luta, i nie moge doda? nicku do Hudu,

Kod:


W, sH = guiGetScreenSize()
x = 1363
y = 1100

function hud()
if isPlayerHudComponentVisible("radar") == true then
showPlayerHudComponent("ammo", false)
showPlayerHudComponent("armour", false)
showPlayerHudComponent("breath", false)
showPlayerHudComponent("clock", false)
showPlayerHudComponent("health", false)
showPlayerHudComponent("money", false)
showPlayerHudComponent("weapon", false)
showPlayerHudComponent("wanted", false)

local name = getPlayerName
local realtime = getRealTime() d
local hour = realtime.hour
local minute = realtime.minute

dxDrawRectangle((1210/x)*sW, (46/y)*sH, (140/x)*sW, (27/y)*sH, tocolor(0, 0, 0, 208), true)

dxDrawText("Zycie: "..math.floor(getElementHealth(localPlayer)).. "%", (1190/x)*sW, (100/y)*sH, (1381/x)*sW, (68/y)*sH, tocolor(255, 255, 255, 255), 1.20, "default", "left", "top", false, false, true, false, false)



dxDrawRectangle((1069/x)*sW, (4/y)*sH, (286/x)*sW, (184/y)*sH, tocolor(0, 0, 0, 255), false)

dxDrawRectangle((1075/x)*sW, (163/y)*sH, (275/x)*sW, (20/y)*sH, tocolor(0, 0, 0, 217), true)

dxDrawText(" "..hour..":"..minute.."", (1280/x)*sW, (10/y)*sH, (1320/x)*sW, (120/y)*sH, tocolor(255, 255, 255, 255), 1.40, "default", "left", "top", false, false, true, false, false)

end
end

addEventHandler ("onClientRender", root, hud)

addEventHandler("onClientRender", root, function()
if isPlayerMapVisible() then return end
showPlayerHudComponent("money", false)
local move=math.sin(getTickCount()/500)*15
local pieniadze = string.format("%.08d", getPlayerMoney(getLocalPlayer()))
dxDrawText("€ "..pieniadze.."", (1080/x)*sW, (145/y)*sH, (1470/x)*sW, (190/y)*sH, tocolor(10, 83, 0, 255), 1.80, "default", "left", "top", false, false, true, false, false)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-09, 20:36


amited







Wiek: 26
Na forum: 3855 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466


local name = getPlayerName

Tak piszesz taki skrypt a nie widzisz takiego czego?... szkoda gada?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-09, 20:43


macieq.

Grafik






Wiek: 28
Na forum: 3654 dni
Posty: 42
Nick w MP: 1Macieq



Respekt: 50

Dobra, bez tego jak wszystko dodam mam pinknie i jak go w??czam to nie pokazuje mi sie calkiem skrypt..

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-09, 20:53


amited







Wiek: 26
Na forum: 3855 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

macieq., Mo?e ?askawie poka?esz b??dy? debugscript 3 w consoli i reset skryptu.

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-09, 21:31


macieq.

Grafik






Wiek: 28
Na forum: 3654 dni
Posty: 42
Nick w MP: 1Macieq



Respekt: 50

Tutaj wzi??em z innego skryptu 2 linijki w klei?em je do EventHandler

Kod:

dxDrawText(string.gsub(name, "#%x%x%x%x%x%x", "") .. status, sW*1191/1440, sH*112/900, sW*1404/1440, sH*141/900, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false)

local name = getPlayerName


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-09, 22:12


Loop

Inspektor






Wiek: 28
Na forum: 4431 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130


local name = getPlayerName(localPlayer)
dxDrawText(name, "", .. status, sW*1191/1440, sH*112/900, sW*1404/1440, sH*141/900, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false)


Sprawdz

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-10, 15:18


macieq.

Grafik






Wiek: 28
Na forum: 3654 dni
Posty: 42
Nick w MP: 1Macieq



Respekt: 50

Dalej nie dzia?a...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-10, 16:00


Kalizman







Wiek: 24
Na forum: 3793 dni
Posty: 1394

Piwa: 4624

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

Podaj tylko wymiary i b?dzie dobrze:

dxDrawText("..name..", sW*1191/1440, sH*112/900, sW*1404/1440, sH*141/900, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-10, 16:07


macieq.

Grafik






Wiek: 28
Na forum: 3654 dni
Posty: 42
Nick w MP: 1Macieq



Respekt: 50

to te? doda? ?
local name = getPlayerName(localPlayer) 


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-10, 16:08


Kalizman







Wiek: 24
Na forum: 3793 dni
Posty: 1394

Piwa: 4624

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

macieq., Najpierw sprawd? to co ci wys?a?em, jezeli nie bedzie dzialac dodaj to co napisales

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-10, 16:30


amited







Wiek: 26
Na forum: 3855 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

Kalizman, Heh tam gdzie masz "..name.." to to b?dzie wy?wietlone bo jest to w cudzys?owie.

macieq., To ma by? tak:

local name = getPlayerName(localPlayer)
dxDrawText(name, sW*1191/1440, sH*112/900, sW*1404/1440, sH*141/900, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false)


Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-10, 16:49


macieq.

Grafik






Wiek: 28
Na forum: 3654 dni
Posty: 42
Nick w MP: 1Macieq



Respekt: 50

Dobra dzi?ki ch?opaki dzia?a, i jeszcze mam problem z licznikiem dodanie przebiegu pomoze ?
local rowery={[509]=true,[481]=true,[510]=true}

addEventHandler("onClientRender", root, function()

    local veh=getPedOccupiedVehicle(localPlayer) 

    
    if not veh then return end
    if rowery[getElementModel(veh)] then return end  
    if getVehicleController(veh) ~= localPlayer then return end 
    
    local vx,vy,vz=getElementVelocity(veh)
    predkosc=(vx^2+vy^2+vz^2)^0.45*1.55*100  
    
    local paliwo = string.format ( "%01.100f", getElementData(veh, "paliwo") or 0) -- je?eli paliwa nie ma daje 0
    
    if predkosc < 0 then return end 
    
    
    local screenW, screenH = guiGetScreenSize()
    
        dxDrawLine((screenW * 0.8125) - 1, (screenH * 0.6706) - 1, (screenW * 0.8125) - 1, screenH * 1.0000, tocolor(0, 0, 0, 102), 1, false)
        dxDrawLine(screenW * 0.9742, (screenH * 0.6706) - 1, (screenW * 0.8125) - 1, (screenH * 0.6706) - 1, tocolor(0, 0, 0, 102), 1, false)
        dxDrawLine((screenW * 0.8125) - 1, screenH * 1.0000, screenW * 0.9742, screenH * 1.0000, tocolor(0, 0, 0, 102), 1, false)
        dxDrawLine(screenW * 0.9742, screenH * 1.0000, screenW * 0.9742, (screenH * 0.6706) - 1, tocolor(0, 0, 0, 102), 1, false)
        dxDrawRectangle(screenW * 0.8125, screenH * 0.6706, screenW * 0.1617, screenH * 0.3294, tocolor(254, 254, 254, 102), false)
        dxDrawText(string.format("%.0f",predkosc).." KM/H", screenW * 0.8313, screenH * 0.7578, screenW * 0.9539, screenH * 0.8424, tocolor(0, 0, 0, 254), 2.00, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("Paliwo : "..paliwo.." L", screenW * 0.8313, screenH * 0.8685, screenW * 0.9539, screenH * 0.9531, tocolor(0, 0, 0, 254), 2.00, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawRectangle(screenW * 0.8125, screenH * 0.7018, screenW * 0.1617, screenH * 0.0339, tocolor(0, 0, 0, 165), false)
        dxDrawText("Life", screenW * 0.8086, screenH * 0.7018, screenW * 0.9742, screenH * 0.7357, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)

end
)

local time = getTickCount()
function zabiera_paliwo(auto)

    if getTickCount() - time > 100 then
    time = getTickCount()
    local vx,vy,vz = getElementVelocity(auto)
    local predkosc = ((vx^2+vy^2+vz^2)^(0.5)/100)
    local paliwo = getElementData(auto, "paliwo") or 0
    if predkosc > 0 then -- je?eli samoch?d stoi w miejscu paliwa nie bedzie zabierac
    paliwo = paliwo-predkosc*2
    setElementData(auto, "paliwo", paliwo)
    
end
end
end

addEventHandler("onClientRender", root, function()

    local auto = getPedOccupiedVehicle(localPlayer)
    if not auto then return end
    if not getVehicleEngineState(auto) then return end
    if getVehicleController(auto) ~= localPlayer then return end
    zabiera_paliwo(auto)
    
end
 


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-10, 17:09


amited







Wiek: 26
Na forum: 3855 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

macieq., Przebieg bierzesz z u?ywanego przez siebie systemu aut ale co? takiego:

local przebieg = getElementData(veh,"przebieg")
dxDrawText("Przebieg: "..przebieg.." KM", screenW , screenH , screenW , screenH , ...)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-10, 17:47


macieq.

Grafik






Wiek: 28
Na forum: 3654 dni
Posty: 42
Nick w MP: 1Macieq



Respekt: 50

Tutaj, wszystko doda?em pincus glancus, ale w grze mam czarne tlo tylko bez km/h itd


addEventHandler("onClientRender", root, function()

    local veh=getPedOccupiedVehicle(localPlayer) 
    
    if not veh then return end
    if rowery[getElementModel(veh)] then return end -- rowery nie ma ja gownolicznika
    if getVehicleController(veh) ~= localPlayer then return end -- sterownosc gownolicznika tzn. auta..
    
    local przebieg = getElementData(veh,"przebieg")
    local vx,vy,vz=getElementVelocity(veh)
    predkosc=(vx^2+vy^2+vz^2)^0.45*1.55*100  
    
    local paliwo = string.format ( "%01.0f", getElementData(veh, "paliwo") or 0) -- tutaj gownopaliwo, jak masz 0 to ci nie odpali czy jak to tam
    if predkosc < 0 then return end 
    
    local screenW, screenH = guiGetScreenSize()
    
        dxDrawText("Cos tu napewno bedzie", screenW * 0.9031, screenH * 0.9740, screenW * 1.0531, screenH * 1.0716, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)
        dxDrawLine((screenW * 0.8125) - 1, (screenH * 0.6706) - 1, (screenW * 0.8125) - 1, screenH * 1.0000, tocolor(255, 255,0, 255), 1, false)
        dxDrawLine(screenW * 0.9742, (screenH * 0.6706) - 1, (screenW * 0.8125) - 1, (screenH * 0.6706) - 1, tocolor(255, 255,0, 255), 1, false)
        dxDrawLine((screenW * 0.8125) - 1, screenH * 1.0000, screenW * 0.9742, screenH * 1.0000, tocolor(255, 255,0, 255), 1, false)
        dxDrawLine(screenW * 0.9742, screenH * 1.0000, screenW * 0.9742, (screenH * 0.6706) - 1, tocolor(255, 255,0, 255), 1, false)
        dxDrawRectangle(screenW * 0.8125, screenH * 0.7606, screenW * 0.1617, screenH * 0.3294, tocolor(0, 0, 0, 255), false) --Czarne gowno
        dxDrawText("Przebieg: "..przebieg.." KM", screenW * 0.8086, screenH * 0.7018, screenW * 0.9742, screenH * 0.7357, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText(string.format("%.0f",predkosc).." KM/H", screenW * 0.8313, screenH * 0.7578, screenW * 0.9539, screenH * 0.8424, tocolor(0, 0, 0, 254), 2.00, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("Paliwo : "..paliwo.." L", screenW * 0.8313, screenH * 0.8685, screenW * 0.9539, screenH * 0.9531, tocolor(0, 0, 0, 254), 2.00, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawRectangle(screenW * 0.8125, screenH * 0.7018, screenW * 0.1617, screenH * 0.0339, tocolor(0, 0, 0, 165), false)
       

end
)



 
local time = getTickCount()
function zabiera_paliwo(auto)

    if getTickCount() - time > 100 then
    time = getTickCount()
    local vx,vy,vz = getElementVelocity(auto)
    local predkosc = ((vx^2+vy^2+vz^2)^(0.5)/100)
    local paliwo = getElementData(auto, "paliwo") or 0
    if predkosc > 0 then -- je?eli samoch?d stoi w miejscu paliwa nie bedzie zabierac
    paliwo = paliwo-predkosc*2
    setElementData(auto, "paliwo", paliwo)
    
end
end
end

addEventHandler("onClientRender", root, function()

    local auto = getPedOccupiedVehicle(localPlayer)
    if not auto then return end
    if not getVehicleEngineState(auto) then return end
    if getVehicleController(auto) ~= localPlayer then return end
    zabiera_paliwo(auto)
    
end
) 


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-10, 17:59


amited







Wiek: 26
Na forum: 3855 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

macieq., W consoli, w grze wpisz "debugscript 3" i zresetuj skrypt oraz podaj tutaj b??dy.

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Tagi: mam :: pr0blem :: dodanie :: nicku :: hudu
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