Wysłany: 2018-09-02, 20:29
JakisPolak199
wieczny student
Wiek: 20 Na forum: 3510 dni Posty: 131
Nick w MP: bover.
Piwa : 905
Witam mam taki problem, ?e gui pokazuje si? dla wszystkich. kod jest po stronie clienta kod:
teoriaAPokaz = false
teoriaBPokaz = false
teoriaCPokaz = false
local screenW , screenH = guiGetScreenSize ()
local teoriaA = createMarker ( 2489.12 , - 1686.21 , 51.95 - 1 , "cylinder" , 1.5 , 255 , 255 , 255 , 150 )
setElementInterior ( teoriaA , 1 )
local textA = createElement ( "text" )
setElementData ( textA , "name" , "Cz??? teoretyczna prawa jazdy kat.A" )
setElementPosition ( textA , 2489.12 , - 1686.21 , 51.95 )
setElementInterior ( textA , 1 )
local teoriaB = createMarker ( 2471.55 , - 1676.93 , 51.95 - 1 , "cylinder" , 1.5 , 255 , 255 , 255 , 150 )
setElementInterior ( teoriaB , 1 )
local textB = createElement ( "text" )
setElementData ( textB , "name" , "Cz??? teoretyczna prawa jazdy kat.B" )
setElementPosition ( textB , 2471.55 , - 1676.93 , 51.95 )
setElementInterior ( textB , 1 )
local teoriaC = createMarker ( 2499.44 , - 1672.87 , 51.95 - 1 , "cylinder" , 1.5 , 255 , 255 , 255 , 150 )
setElementInterior ( teoriaC , 1 )
local textC = createElement ( "text" )
setElementData ( textC , "name" , "Cz??? teoretyczna prawa jazdy kat.C" )
setElementPosition ( textC , 2499.44 , - 1672.87 , 51.95 )
setElementInterior ( textC , 1 )
addEventHandler ( "onClientMarkerLeave" , teoriaA , function( plr )
if teoriaAPokaz == true then
teoriaAPokaz = false
removeEventHandler ( "onClientRender" , root , teoriaAGui )
end
end )
addEventHandler ( "onClientMarkerHit" , teoriaA , function( plr )
if teoriaAPokaz == false then
teoriaAPokaz = true
addEventHandler ( "onClientRender" , root , teoriaAGui )
end
end )
function teoriaAGui ( plr )
if teoriaAPokaz then
dxDrawRectangle ( screenW * 0.3661 , screenH * 0.0004 , screenW * 0.2690 , screenH * 0.9999 , tocolor ( 0 , 0 , 0 , 168 ), false )
end
end
Wysłany: 2018-09-02, 20:39
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
do ka?dego addEventHandleru (onClientMarkerHit etc.) dodaj warunek
if plr ~= localPlayer then return end
Powinno dzia?a?.
Wysłany: 2018-09-03, 13:35
nanKy
Wiek: 22 Na forum: 3865 dni Posty: 498
Nick w MP: nanky
Piwa : 1773
"Kalizman" napisał/a :do ka?dego addEventHandleru (onClientMarkerHit etc.) dodaj warunek
if plr ~= localPlayer then return end
Powinno dzia?a?.
To raczej za trudne dla ludzi kt?rzy podmieniaj? tylko nazw? serwerka w paczkach ogrpg.
Masz tu gotowy kod:
addEventHandler ( "onClientMarkerLeave" , teoriaA , function( plr , dim )
if plr ~= localPlayer or not dim then return end
if teoriaAPokaz == true then
teoriaAPokaz = false
removeEventHandler ( "onClientRender" , root , teoriaAGui )
end
end )
addEventHandler ( "onClientMarkerHit" , teoriaA , function( plr , dim )
if plr ~= localPlayer or not dim then return end
if teoriaAPokaz == false then
teoriaAPokaz = true
addEventHandler ( "onClientRender" , root , teoriaAGui )
end
end )
Więcej szczegółów
Wystawiono 1 piw(a):Kalizman
Tagi: gui :: pokazuje :: sie :: dla :: wszystkich
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: