Wysłany: 2019-09-20, 16:59
MartinPanZycia
Zielony w LUA
Wiek: 27 Na forum: 3729 dni Posty: 476
Nick w MP: Rodzaje
Piwa : 878
jak zrobi? sprawdzanie firmu client
c - side
addEventHandler ( "onClientMarkerHit" , marker ,function( el , dim )
if el ~= localPlayer and dim then return end
if getElementType ( el ) ~= "player" then return end
if getPedOccupiedVehicle ( el ) then
enablegui = false
else
if getElementData ( el , "bezrobotny" ) then
enablegui = false
exports [ "wc-noti" ]: showBox ( "info" , "Nie Posiadasz ?adnej pracy." )
else
theTeam = getPlayerTeam ( el ) -- z tym mam problem
factionType = getElementData ( el , "type" )
if ( factionType == 2 ) or ( factionType == 3 ) then
showCursor ( true )
triggerServerEvent ( "DM:lock" , el )
enablegui = true
addEventHandler ( "onClientRender" , root , start_job )
else
exports [ "wc-noti" ]: showBox ( "info" , "Nie Posiadasz ?adnej pracy." )
enablegui = false
end
end
end
end )
polecacie jaka? elementData po stronie servera z sprawdzaniem ? Nie mam pomys?u jak to wykona?
Podpis
Cześć w MTA jestem jako Rodzaje.
Wszystko jest po staremu nie zamierzam stawiać RPG.
Wysłany: 2019-09-20, 17:15
Pawel5321
Szkrypter
Wiek: 36 Na forum: 3809 dni Posty: 237
Nick w MP: Pawell
Piwa : 2315
mo?esz zamieni? el na localPlayer
Wysłany: 2019-09-20, 17:55
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
Podmie? kod:
addEventHandler ( "onClientMarkerHit" , marker ,function( el , dim )
if el ~= localPlayer and not dim then return end
if getElementType ( el ) ~= "player" then return end
if getPedOccupiedVehicle ( el ) then
enablegui = false
else
if getElementData ( el , "bezrobotny" ) then
enablegui = false
exports [ "wc-noti" ]: showBox ( "info" , "Nie Posiadasz ?adnej pracy." )
else
local theTeam = getPlayerTeam ( el ) -- z tym mam problem
local nazwa_teamu = getTeamName ( theTeam )
local factionType = getElementData ( el , "type" )
if ( factionType == 2 ) or ( factionType == 3 ) then
showCursor ( true )
triggerServerEvent ( "DM:lock" , el )
enablegui = true
addEventHandler ( "onClientRender" , root , start_job )
else
exports [ "wc-noti" ]: showBox ( "info" , "Nie Posiadasz ?adnej pracy." )
enablegui = false
end
end
end
end )
Teraz pod zmienn? 'nazwa_teamu' masz nazw? teamu, do kt?rego gracz nale?y.
Je?li chcesz sprawdzi?, czy gracz nale?y do danego teamu do najpierw sprawdzasz czy 'getPlayerTeam' zwraca Ci co? innego ni? false i czy 'nazwa_teamu' r?wna si? Twojej nazwie teamu, kt?r? chcesz sprawdza?.
Przyk?ad:
Więcej szczegółów
Wystawiono 1 piw(a):MartinPanZycia
Wysłany: 2019-09-20, 21:15
MartinPanZycia
Zielony w LUA
Wiek: 27 Na forum: 3729 dni Posty: 476
Nick w MP: Rodzaje
Piwa : 878
dzi?ki za pomoc, dzia?a bez zarzutu
Tagi: sprawdzanie :: teamu :: client
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: