Wysłany: 2018-03-25, 01:05
PenkY
Mapper
Wiek: 23 Na forum: 3465 dni Posty: 223
Nick w MP: penky
Piwa : 2210
Witam!
Ot?? chcia?bym zrobi? tylko tak aby tylko pojazdy frakcyjne mog?y sobie naprawi? pojazd, m?g?by mi kto? pom?c? Ni?ej kod! Za pomoc stawiam
local mech = createMarker (- 1606.07 , 733.54 , - 5.23 - 1 , "cylinder" , 3.5 , 255 , 255 , 255 , 60 )
local txd2 = createElement ( "text" )
setElementData ( txd2 , "name" , "Mechanik Frakcyjny" )
setElementPosition ( txd2 ,- 1606.07 , 733.54 , - 5.23 + 1 )
addEventHandler ( "onClientMarkerHit" , mech , function( el , md )
local Pojazd = getPedOccupiedVehicle ( el )
if not md or getElementType ( el ) ~= "player" then return end
if el ~= localPlayer then return end
if not getPedOccupiedVehicle ( el ) then return end
if not getElementData ( el , "player:faction" ) then exports [ "lr_noti" ]: addNotification ( "* Mechanik jest tylko i wy??cznie dla frakcji!" , 255 , 0 , 0 ) return end
exports [ "lr_noti" ]: addNotification ( "* Pojazd frakcyjny zosta? naprawiony." , 0 , 185 , 18 )
fixVehicle ( Pojazd , true )
end )
Wysłany: 2018-03-25, 08:22
Avenged
Młodszy Szkrypter
Wiek: 23 Na forum: 3510 dni Posty: 654
Nick w MP: Avenged
Piwa : 1570
Nadajesz na pojazd frakcyjny elementdate czy co tam chcesz i potem w tym markerze pobierasz pojazd w kt?rym siedzi "el" i sprawdzasz czy ma dat? pojazdu frakcyjnego
Podpis
LUA, JS, PHP
Zapraszam do skorzystania z moich usług: Klik
Wysłany: 2018-03-25, 10:10
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
Spos?b na sprawdzanie ID/model pojazdu w kt?rym si? znajdujemy:
addEventHandler ( "onClientMarkerHit" , mech , function( el , md )
local Pojazd = getPedOccupiedVehicle ( el )
if not md or getElementType ( el ) ~= "player" then return end
if el ~= localPlayer then return end
if not getPedOccupiedVehicle ( el ) then return end
if not getElementData ( el , "player:faction" ) then exports [ "lr_noti" ]: addNotification ( "* Mechanik jest tylko i wy??cznie dla frakcji!" , 255 , 0 , 0 ) return end
-- Teraz bede sprawdzal czy pojazd to dany model / ID pojazdu
local model = getElementModel ( Pojazd )
if model == 596 or model == 597 or model == 598 or model == 416 or model == 407 then
exports [ "lr_noti" ]: addNotification ( "* Pojazd frakcyjny zosta? naprawiony." , 0 , 185 , 18 )
fixVehicle ( Pojazd , true )
end
end )
Więcej szczegółów
Wystawiono 1 piw(a):PenkY
Wysłany: 2018-03-25, 13:49
PenkY
Mapper
Wiek: 23 Na forum: 3465 dni Posty: 223
Nick w MP: penky
Piwa : 2210
Kalizman , Dzi?ki za pomoc! Do zamkni?cia
Tagi: mechanik :: frakcyjny
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: