Wysłany: 2017-06-24, 19:52
admiral123
Wiek: 29 Na forum: 3276 dni Posty: 16
Piwa : 1
Witam mam problem z dxDrawText. Po wej?ciu do auta, kt?re ma w sobie po stronie servera w pracy: setElementData(source, "pojazd") nie pokazuje si? nic. Jak to naprawi? za pomoc piwko!
kod:
local screenW , screenH = guiGetScreenSize ()
if getElementData ( localPlayer , "pojazd" ) then
exports [ "nm-blur" ]: dxDrawBluredRectangle ( screenW * 0.7438 , screenH * 0.1289 , screenW * 0.2379 , screenH * 0.0599 , tocolor ( 150 , 150 , 150 , 255 ))
dxDrawRectangle ( screenW * 0.7387 , screenH * 0.1289 , screenW * 0.0051 , screenH * 0.0599 , tocolor ( 25 , 75 , 125 , 155 ), false )
local poziom = getElementData ( localPlayer , "mlvl" )
local exp = getElementData ( localPlayer , "mexp" )
dxDrawText ( "Tw?j poziom: " .. poziom , ( screenW * 0.7511 ) + 1 , ( screenH * 0.1289 ) + 1 , ( screenW * 0.8631 ) + 1 , ( screenH * 0.1888 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.00 , wFont2 , "left" , "center" , false , false , false , false , false )
dxDrawText ( "Tw?j poziom: " .. poziom , screenW * 0.7511 , screenH * 0.1289 , screenW * 0.8631 , screenH * 0.1888 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , wFont2 , "left" , "center" , false , false , false , false , false )
dxDrawText ( "Tw?j exp: " .. exp , ( screenW * 0.8697 ) + 1 , ( screenH * 0.1289 ) + 1 , ( screenW * 0.9817 ) + 1 , ( screenH * 0.1888 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.00 , wFont2 , "left" , "center" , false , false , false , false , false )
dxDrawText ( "Tw?j exp: " .. exp , screenW * 0.8697 , screenH * 0.1289 , screenW * 0.9817 , screenH * 0.1888 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , wFont2 , "left" , "center" , false , false , false , false , false )
end
Wysłany: 2017-06-24, 19:54
Makay
Tryb .lua
Wiek: 26 Na forum: 3288 dni Posty: 38
Nick w MP: Makay
Piwa : 774
admiral123 , To jest chyba tylko do pracy magazyniera.
Podpis
Początkowy Programista LUA
[lua]if getElementData(source, "gracz:Makay") then
setPlayerName(source, "Makauś")
else
setPlayerName(source, ".lua")
end[/lua]
Wysłany: 2017-06-24, 20:02
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
na pewno localPlayer?
getElementData ( localPlayer , "pojazd" )
Podpis
"amited" napisał/a :
Wysłany: 2017-06-24, 21:10
admiral123
Wiek: 29 Na forum: 3276 dni Posty: 16
Piwa : 1
amited , Tak, to jest po stronie klienta w gui.
Wysłany: 2017-06-24, 22:00
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
admiral123 , m?wisz ?e pojazd ma elementDat? "pojazd" a nie gracz, chyba ?e ?le zrozumia?em
Podpis
"amited" napisał/a :
Wysłany: 2017-06-25, 10:35
NeX.
Calm Story
Wiek: 26 Na forum: 3643 dni Posty: 56
Nick w MP: NeX
Piwa : 36
Skoro jest to po stronie clienta w 'gui', to gui pojawia si? w tym przypadku tylko na jedn? setn? sekundy i nagle znika.
local screenW , screenH = guiGetScreenSize ()
function render ()
if getElementData ( localPlayer , "pojazd" ) then
exports [ "nm-blur" ]: dxDrawBluredRectangle ( screenW * 0.7438 , screenH * 0.1289 , screenW * 0.2379 , screenH * 0.0599 , tocolor ( 150 , 150 , 150 , 255 ))
dxDrawRectangle ( screenW * 0.7387 , screenH * 0.1289 , screenW * 0.0051 , screenH * 0.0599 , tocolor ( 25 , 75 , 125 , 155 ), false )
local poziom = getElementData ( localPlayer , "mlvl" )
local exp = getElementData ( localPlayer , "mexp" )
dxDrawText ( "Tw?j poziom: " .. poziom , ( screenW * 0.7511 ) + 1 , ( screenH * 0.1289 ) + 1 , ( screenW * 0.8631 ) + 1 , ( screenH * 0.1888 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.00 , wFont2 , "left" , "center" , false , false , false , false , false )
dxDrawText ( "Tw?j poziom: " .. poziom , screenW * 0.7511 , screenH * 0.1289 , screenW * 0.8631 , screenH * 0.1888 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , wFont2 , "left" , "center" , false , false , false , false , false )
dxDrawText ( "Tw?j exp: " .. exp , ( screenW * 0.8697 ) + 1 , ( screenH * 0.1289 ) + 1 , ( screenW * 0.9817 ) + 1 , ( screenH * 0.1888 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.00 , wFont2 , "left" , "center" , false , false , false , false , false )
dxDrawText ( "Tw?j exp: " .. exp , screenW * 0.8697 , screenH * 0.1289 , screenW * 0.9817 , screenH * 0.1888 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , wFont2 , "left" , "center" , false , false , false , false , false )
end
end
addEventHandler ( "onClientRender" , getRootElement (), render )
Podpis
Wykonuję zasoby programistyczne w języku lua. Osoby zainteresowane proszone są o kontakt.
[email protected]
Wysłany: 2017-06-25, 22:20
Jacob
Głupiomądry
Wiek: 28 Na forum: 5502 dni Posty: 967
Nick w MP: Jacob
Piwa : 786
Koledze chodzi?o o to, ?e w pierwszym po?cie napisa?e?, ?e t? date posiada pojazd, a nie bezpo?rednio grasz. Wi?c wnioskuj?c po tym:
function render ()
if isPedInVehicle ( localPlayer ) then
if getElementData ( getPedOccupiedVehicle ( localPlayer ), "pojazd" ) then
exports [ "nm-blur" ]: dxDrawBluredRectangle ( screenW * 0.7438 , screenH * 0.1289 , screenW * 0.2379 , screenH * 0.0599 , tocolor ( 150 , 150 , 150 , 255 ))
dxDrawRectangle ( screenW * 0.7387 , screenH * 0.1289 , screenW * 0.0051 , screenH * 0.0599 , tocolor ( 25 , 75 , 125 , 155 ), false )
local poziom = getElementData ( localPlayer , "mlvl" )
local exp = getElementData ( localPlayer , "mexp" )
dxDrawText ( "Tw?j poziom: " .. poziom , ( screenW * 0.7511 ) + 1 , ( screenH * 0.1289 ) + 1 , ( screenW * 0.8631 ) + 1 , ( screenH * 0.1888 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.00 , wFont2 , "left" , "center" , false , false , false , false , false )
dxDrawText ( "Tw?j poziom: " .. poziom , screenW * 0.7511 , screenH * 0.1289 , screenW * 0.8631 , screenH * 0.1888 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , wFont2 , "left" , "center" , false , false , false , false , false )
dxDrawText ( "Tw?j exp: " .. exp , ( screenW * 0.8697 ) + 1 , ( screenH * 0.1289 ) + 1 , ( screenW * 0.9817 ) + 1 , ( screenH * 0.1888 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.00 , wFont2 , "left" , "center" , false , false , false , false , false )
dxDrawText ( "Tw?j exp: " .. exp , screenW * 0.8697 , screenH * 0.1289 , screenW * 0.9817 , screenH * 0.1888 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , wFont2 , "left" , "center" , false , false , false , false , false )
end
end
end
addEventHandler ( "onClientRender" , getRootElement (), render )
Tagi: dxdrawtext
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: