Wysłany: 2016-08-08, 17:22
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
Tak jak w temacie . Dlaczego ten kod nie dzia?a i czy mo?ecie wyt?umaczy? krok po kroku dlaczego ? Zadnych b?ed?w w db . Marker jest ale panel si? nie pojawia.
Kod :
c-side
okno = guiCreateWindow ( 256 , 136 , 286 , 318 , "Panel Pogotowia" , false )
guiWindowSetSizable ( okno , false )
guiSetVisible ( okno , false )
o1 = guiCreateButton ( 12 , 39 , 96 , 45 , "Skin 1" , false , okno )
o2 = guiCreateButton ( 12 , 93 , 96 , 48 , "Skin 2" , false , okno )
o3 = guiCreateButton ( 12 , 147 , 96 , 45 , "Skin 3" , false , okno )
o5 = guiCreateButton ( 169 , 93 , 103 , 48 , "Spray" , false , okno )
o6 = guiCreateButton ( 27 , 221 , 231 , 69 , "ZAMKNIJ PANEL" , false , okno )
marker = createMarker ( 115.2108 , - 95.9072 , 2.1553 - 1 , "cylinder" , 1 )
blip = createBlip ( 115.2108 , - 95.9072 , 2.1553 , 22 )
-- image = guiCreateStaticImage ( 112 , 27 , 96 , 119 , ":policja.png" , false , okno )
addEventHandler ( "onClientGUIClick" , o1 ,
function()
setElementModel ( localPlayer , 274 )
outputChatBox ( "* Tw?j skin zosta? zmieniony na ID " .. getElementModel ( localPlayer ).. "." )
end )
addEventHandler ( "onClientGUIClick" , o2 ,
function()
setElementModel ( localPlayer , 275 )
outputChatBox ( "* Tw?j skin zosta? zmieniony na ID " .. getElementModel ( localPlayer ).. "." )
end )
addEventHandler ( "onClientGUIClick" , o3 ,
function()
setElementModel ( localPlayer , 276 )
outputChatBox ( "* Tw?j skin zosta? zmieniony na ID " .. getElementModel ( localPlayer ).. "." )
end )
addEventHandler ( "onClientGUIClick" , o5 ,
function()
triggerServerEvent ( "dajSpray" , root , localPlayer )
end )
addEvent ( "pokaz" , true )
addEventHandler ( "pokaz" , root ,
function()
if source == marker then
if source == localPlayer then
if guiGetVisible ( okno )== false then
guiSetVisible ( okno , true )
showCursor ( true )
end
end
end
end
)
function zamknij ()
if source == o6 then
if guiGetVisible ( okno ) == true then
guiSetVisible ( okno , false )
showCursor ( false )
end
end
end
addEventHandler ( "onClientGUIClick" , o6 , zamknij )
s-side
addEvent ( "dajSpray" , true )
addEventHandler ( "dajSpray" , root ,
function( plr )
giveWeapon ( plr , 41 , 9999 , true )
giveWeapon ( plr , 41 , 9999 , true )
outputChatBox ( "* Otrzyma?e? spray do leczenia ." , plr )
end )
addEvent ( "pokaz" , true )
addEventHandler ( "onClientMarkerHit" , root ,
function( hitElement )
if source == marker then
if getElementType ( hitElement ) == "player" then
local accountName = getAccountName ( getPlayerAccount ( hitElement ))
if isObjectInACLGroup ( "user." .. accountName , aclGetGroup ( "SAMC" ) ) then
triggerClientEvent ( hitElement , "pokaz" , hitElement )
end
end
end
end
)
Za pomoc i
Wysłany: 2016-08-08, 18:36
Brzysiek
Skrypter pralek
Wiek: 27 Na forum: 5199 dni Posty: 488
Nick w MP: Brzysiek
Piwa : 1034
Robisz marker po stronie clienta, a odwo?ujesz si? do niego po stronie serwera.
Event onClientMarkerHit nie istnieje po stronie serwera. Trzeba u?y? onMarkerHit.
Event pokaz jest r?wnie? b??dny, bo ?r?d?em (source) w evencie jest gracz, a jest warunek czy ?r?d?em jest marker.
Wysłany: 2016-08-08, 18:39
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
M?g?by? poprawi??
Podpis
Uczeń LUA . Mapper MTA.
Wysłany: 2016-08-08, 19:10
AteX
Wiek: 26 Na forum: 4015 dni Posty: 927
Nick w MP: #AteX
Piwa : 8360
"sasik12" napisał/a :M?g?by? poprawi??
Brzysiek poda? ci pope?nione b??dy... m?g?by? je sobie poprawi?? Tutaj pomagamy, a nie piszemy gotowce.
Wysłany: 2016-08-09, 20:49
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
Dobrze poprawi?em ? (testowa?em ale nie dzia?a )
addEvent ( "pokaz" , true )
addEventHandler ( "onMarkerHit" , root ,
function( source )
if getElementType ( source ) == "player" then
local accountName = getAccountName ( getPlayerAccount ( source ))
if isObjectInACLGroup ( "user." .. accountName , aclGetGroup ( "SAMC" ) ) then
triggerClientEvent ( "pokaz" , source , source )
end
end
end
)
Podpis
Uczeń LUA . Mapper MTA.
Tagi: dlaczego :: nie :: działa :: możecie :: krok :: kroku :: wytłumaczyć
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: