Wysłany: 2018-05-18, 18:01
adisonboss
Wiek: 23 Na forum: 3331 dni Posty: 237
Piwa : 6
Witam ! Mam taki oto skrypt ale mam w nim dwa b??dy. Jeden to panel wy?wietlaj?cy si? ka?demu graczowi a dwa to nie usuwaj?ce si? wszystkie barierki i pacho?ki. Kto? co?? Daje i
CLIENT
-- [ Autor skryptu venzikk ]
-- [ Edytowany przez Maszek i adizygzak ]
GUIEditor = {
button = {},
window = {}
}
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
GUIEditor . window [ 1 ] = guiCreateWindow ( 47 , 199 , 198 , 139 , "Schowek" , false )
guiWindowSetSizable ( GUIEditor . window [ 1 ], false )
GUIEditor . button [ 1 ] = guiCreateButton ( 9 , 28 , 83 , 30 , "Pacho?ek" , false , GUIEditor . window [ 1 ])
GUIEditor . button [ 2 ] = guiCreateButton ( 102 , 28 , 83 , 30 , "Barierka" , false , GUIEditor . window [ 1 ])
GUIEditor . button [ 3 ] = guiCreateButton ( 9 , 72 , 83 , 30 , "Rat.techniczne" , false , GUIEditor . window [ 1 ])
GUIEditor . button [ 4 ] = guiCreateButton ( 102 , 72 , 83 , 30 , "AODO" , false , GUIEditor . window [ 1 ])
GUIEditor . button [ 5 ] = guiCreateButton ( 9 , 106 , 181 , 30 , "Schowaj wszystko" , false , GUIEditor . window [ 1 ])
end
)
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
guiSetVisible ( GUIEditor . window [ 1 ], false )
end
)
bindKey ( "l" , "down" ,function()
local veh = getPedOccupiedVehicle ( localPlayer )
if ( getElementModel ( veh ) == 407 ) then
local x , y , z = getElementPosition ( localPlayer )
local marker = createMarker ( x , y , z , "cylinder" , 1 , 255 , 0 , 0 , 255 )
attachElements ( marker , veh , 1.6 ,- 0.9 ,- 1.4 )
function baga ()
guiSetVisible ( GUIEditor . window [ 1 ], true )
showCursor ( true )
end
addEventHandler ( "onClientMarkerHit" , marker , baga )
bindKey ( ";" , "down" ,function()
destroyElement ( marker )
end )
end
end )
function zamykamy ()
if source ~= GUIEditor . button [ 5 ] then return end
guiSetVisible ( GUIEditor . window [ 1 ], false )
showCursor ( false )
destroyElement ( barierkaa , localPlayer )
destroyElement ( pacholekk , localPlayer )
triggerServerEvent ( "oddaj" , localPlayer )
triggerServerEvent ( "oddaj" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , root , zamykamy )
function desert ()
if source ~= GUIEditor . button [ 3 ] then return end
guiSetVisible ( GUIEditor . window [ 1 ], false )
showCursor ( false )
triggerServerEvent ( "daj" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , root , desert )
function kamizelka ()
if source ~= GUIEditor . button [ 4 ] then return end
guiSetVisible ( GUIEditor . window [ 1 ], false )
showCursor ( false )
triggerServerEvent ( "daj2" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , root , kamizelka )
function barierka ()
if source ~= GUIEditor . button [ 2 ] then return end
guiSetVisible ( GUIEditor . window [ 1 ], false )
showCursor ( false )
barierkaa = createObject ( 1228 , 0 , 0 , 0 , 0 , 0 , 0 )
attachElements ( barierkaa , localPlayer , 0 , 0.5 , - 0.5 , 0 , 0 , - 90 )
end
addEventHandler ( "onClientGUIClick" , root , barierka )
bindKey ( "m" , "down" ,function()
detachElements ( barierkaa , localPlayer )
end )
bindKey ( "m" , "down" ,function()
setElementCollisionsEnabled ( barierkaa , true )
setObjectBreakable ( 1228 , true )
detachElements ( barierkaa , localPlayer )
end )
function pacholek ()
if source ~= GUIEditor . button [ 1 ] then return end
guiSetVisible ( GUIEditor . window [ 1 ], false )
showCursor ( false )
pacholekk = createObject ( 1238 , 0 , 0 , 0 , 0 , 0 , 0 )
attachElements ( pacholekk , localPlayer , 0 , 0.5 , - 0.5 , 0 , 0 , - 90 )
end
addEventHandler ( "onClientGUIClick" , root , pacholek )
bindKey ( "m" , "down" ,function()
detachElements ( pacholekk , localPlayer )
end )
SERVER
addEvent ( "daj" , true )
addEventHandler ( "daj" , root , function()
giveWeapon ( root , 8 , 700 )
end
)
addEvent ( "daj2" , true )
addEventHandler ( "daj2" , root , function()
setPlayerSkin ( root , 277 )
end
)
addEvent ( "barierkaaa" , true )
addEventHandler ( "barierkaaa" , root , function()
local x , y , z = getElementPosition ( root )
local barie = createObject ( 1228 , x , y , z )
attachElements ( barie , root , 0 , 0 , 0 )
end
)
addEvent ( "oddaj" , true )
addEventHandler ( "oddaj" , root , function()
setPlayerSkin ( root , 279 )
setWeaponAmmo ( root , 42 , 0 )
end
)
Wysłany: 2018-05-18, 18:58
Ciastuuś
Truck soon...
Wiek: 26 Na forum: 3071 dni Posty: 799
Nick w MP: Ciastuuś
Piwa : 4297
Dodaj warunek,
if element == localPlayer then
Kt?ry sprawdza, czy dany gracz w??cza dla Siebie GUI
Wysłany: 2018-05-18, 19:57
adisonboss
Wiek: 23 Na forum: 3331 dni Posty: 237
Piwa : 6
I mam rozumie? ?e ten warunek mam doda? w linijce
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
guiSetVisible ( GUIEditor . window [ 1 ], false )
end
)
[ Dodano : 2018-05-18, 20:59 ]
Dobra mam ale znalaz?em drugi problem.
Jak kto? postawi barierke lub pacholek to go nie widze i nie mo?na usn?? kilku pacholkow i barierek
[ Dodano : 2018-05-18, 21:06 ]
Dobra ca?y skrypt jest do du** do zamkniecia
Wysłany: 2018-05-18, 21:53
Hades.
Łiiiiiiiiii
Wiek: 22 Na forum: 4699 dni Posty: 372
Nick w MP: Hades
Piwa : 3214
Nie do dupy, poprostu ztriggeruj tworzenie obiektu do strony servera, bo je?li zrobisz to po stronie CLIENTA to gracz wykonywuj?cy t? funkcj? b?dzie to widzia?.
Tagi: schowek :: dla :: psp
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: