Wysłany: 2020-06-03, 01:44
Matikmontana
Modern Stories
Wiek: 22 Na forum: 2473 dni Posty: 423
Nick w MP: Mazeusz*
Piwa : 1015
Dobry. Chcia?bym zrobi? aby dxDrawText pokazywa?o si? tylko w vehicle kt?ry posiada zamontowane nitro. Kombinowa?em cos ale nie wysz?o . Dodatkowo jest jaki? bad argument. Wszystko wida? ?adnie tu -> Klik
kod:
local sx , sy = guiGetScreenSize ()
local px , py = 1366 , 768
local x , y = ( sx / px ), ( sy / py )
-- local nitrof = isVehicleNitroRecharging ( veh , theVehicle )
local dxfont1_font = dxCreateFont ( ":czcionka/f.ttf" , 12 )
function Vel ()
local veh = getPedOccupiedVehicle ( getLocalPlayer () )
local veh = getPedOccupiedVehicle ( localPlayer )
local nitro = getVehicleNitroLevel ( veh )
if nitro ~= false and nitro ~= nil and nitro > 0 then
dxDrawRectangle ( x * 995 , y * 754 , x * 211 / 1 * nitro , y * 19 , tocolor ( 170 , 130 , 50 , 255 ), false )
dxDrawText ( "Nitro: " ..( math . floor ( nitro / 1 * 100 )), x * 780 , y * 825 , x * 1351 , y * 699 , tocolor ( 254 , 254 , 254 , 227 ), 1.00 , dxfont1_font , "center" , "center" , false , false , false , false , false )
--else
-- dxDrawText ( "Nitro" , x * 1140 , y * 679 , x * 1351 , y * 699 , tocolor ( 254 , 254 , 254 , 227 ), 1.00 , dxfont1_font , "center" , "center" , false , false , false , false , false )
end
dxDrawImage ( x * 960 , y * 745 , x * 25 , y * 25 , "1.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 170 ), false )
end
addEventHandler ( "onClientRender" , root , Vel )
[ Dodano : 2020-06-03, 01:48 ]
Edit: Zrobi?em ju? pokazywanie, ale nadal jest b??d z db3
Wysłany: 2020-06-03, 10:01
Qwertick
Coming soon...
Wiek: 23 Na forum: 3577 dni Posty: 472
Nick w MP: Qwertick
Piwa : 2726
local sx , sy = guiGetScreenSize ()
local px , py = 1366 , 768
local x , y = ( sx / px ), ( sy / py )
-- local nitrof = isVehicleNitroRecharging ( veh , theVehicle )
local dxfont1_font = dxCreateFont ( ":czcionka/f.ttf" , 12 )
function Vel ()
if isPedInVehicle ( localPlayer )
local veh = getPedOccupiedVehicle ( localPlayer )
local nitro = getVehicleNitroLevel ( veh )
if nitro ~= false and nitro ~= nil and nitro > 0 then
dxDrawRectangle ( x * 995 , y * 754 , x * 211 / 1 * nitro , y * 19 , tocolor ( 170 , 130 , 50 , 255 ), false )
dxDrawText ( "Nitro: " ..( math . floor ( nitro / 1 * 100 )), x * 780 , y * 825 , x * 1351 , y * 699 , tocolor ( 254 , 254 , 254 , 227 ), 1.00 , dxfont1_font , "center" , "center" , false , false , false , false , false )
--else
-- dxDrawText ( "Nitro" , x * 1140 , y * 679 , x * 1351 , y * 699 , tocolor ( 254 , 254 , 254 , 227 ), 1.00 , dxfont1_font , "center" , "center" , false , false , false , false , false )
end
dxDrawImage ( x * 960 , y * 745 , x * 25 , y * 25 , "1.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 170 ), false )
end
end
addEventHandler ( "onClientRender" , root , Vel )
Wysłany: 2020-06-03, 11:28
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Brakuje then. Po kliencie lepiej u?ywa? funkcji getPedOccupiedVehicle do sprawdzenia, czy grasz jest w poje?dzie.
Weryfikacja nitra mo?e by? za pomoc?
function Vel ()
if getPedOccupiedVehicle ( localPlayer ) then
local veh = getPedOccupiedVehicle ( localPlayer )
if getVehicleUpgradeOnSlot ( veh , 8 ) then
local nitro = getVehicleNitroLevel ( veh )
if nitro and nitro > 0 then
dxDrawRectangle ( x * 995 , y * 754 , x * 211 / 1 * nitro , y * 19 , tocolor ( 170 , 130 , 50 , 255 ), false )
dxDrawText ( "Nitro: " ..( math . floor ( nitro / 1 * 100 )), x * 780 , y * 825 , x * 1351 , y * 699 , tocolor ( 254 , 254 , 254 , 227 ), 1.00 , dxfont1_font , "center" , "center" , false , false , false , false , false )
end
--else
-- dxDrawText ( "Nitro" , x * 1140 , y * 679 , x * 1351 , y * 699 , tocolor ( 254 , 254 , 254 , 227 ), 1.00 , dxfont1_font , "center" , "center" , false , false , false , false , false )
end
dxDrawImage ( x * 960 , y * 745 , x * 25 , y * 25 , "1.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 170 ), false )
end
end
Wysłany: 2020-06-04, 22:27
Matikmontana
Modern Stories
Wiek: 22 Na forum: 2473 dni Posty: 423
Nick w MP: Mazeusz*
Piwa : 1015
Tagi: nitro :: aucie
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: