Wysłany: 2016-08-03, 20:56
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
Prosz? je?eli kto? mo?e niech poprawi mi kod .
B?de bardzo wdzi?czny .
s-side
function marker ()
triggerClientEvent ( "gui" , source , source )
outputChatBox ( "Chcesz rozpocz?? prac? kliknij rozpocznij !" , player )
end
addEventHandler ( "onMarkerHit" , m1 , marker )
addEventHandler ( "onClientGUIClick" , b1 , function( el , md )
if getElementData ( el , "zrespilGracz" ) then
outputChatBox ( "praca w trakcie poprawek" , el )
return
end
if not md or getElementType ( el ) ~= "player" or getPedOccupiedVehicle ( el ) then return end
local x , y , z = getElementPosition ( el )
local bus = createVehicle ( 437 , x , y - 8 , z , 0.0 , 0.0 , 180.0 )
setElementData ( bus , "zrespilGracz" , el )
setElementData ( bus , "pojazd_paliwo" , 50 )
setElementData ( bus , "pojazd_przebieg" , 100 )
warpPedIntoVehicle ( el , bus )
removePreviousVehicles ( el )
triggerClientEvent ( el , "STARTJobBus" , resourceRoot , bus )
vehs [ el ] = bus
end )
c-side
okno = guiCreateWindow ( 314 , 167 , 217 , 297 , "" , false )
guiWindowSetSizable ( okno , false )
memo = guiCreateMemo ( 10 , 27 , 197 , 205 , " " , false , okno )
b1 = guiCreateButton ( 10 , 241 , 93 , 46 , "Rozpocznij" , false , okno )
b2 = guiCreateButton ( 111 , 241 , 96 , 46 , "Zamknij" , false , okno )
addEventHandler ( "onClientMarkerHit" , m1 ,
function ()
if source == m1 then
guiSetVisible ( okno , true )
showCursor ( true )
end
end )
function zamknij ()
if source == b2 then
guiSetVisible ( okno , false )
showCursor ( false )
end
end
addEventHandler ( "onClientGUIClick" , b2 , zamknij )
Chc? aby po wcisni?ciu rozpocznij rozpoczyna?o prac?
EDIT
Zrobi?em tak jak w moim poprzednim poscie by?o czyli wed?ug wzoru i wy?wietla?o si? po starcie skryptu.
Wysłany: 2016-08-03, 21:39
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
okno = guiCreateWindow ( 314 , 167 , 217 , 297 , "" , false )
guiWindowSetSizable ( okno , false )
memo = guiCreateMemo ( 10 , 27 , 197 , 205 , " " , false , okno )
b1 = guiCreateButton ( 10 , 241 , 93 , 46 , "Rozpocznij" , false , okno )
b2 = guiCreateButton ( 111 , 241 , 96 , 46 , "Zamknij" , false , okno )
addEventHandler ( "onClientMarkerHit" , m1 ,
function ()
if source == m1 then
guiSetVisible ( okno , true )
showCursor ( true )
end
end )
function rozp ()
if source == b1 then
outputChatBox ( "Rozpoczales prace" , localPlayer )
end
end
addEventHandler ( "onClientGUIClick" )
function zamknij ()
if source == b2 then
guiSetVisible ( okno , false )
showCursor ( false )
end
end
addEventHandler ( "onClientGUIClick" , b2 , zamknij )
Tagi: ponownie :: tigger.
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: