Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-08-09, 21:28


KoxikiPvP







Wiek: 29
Na forum: 3223 dni
Posty: 28
Nick w MP: WojBody110lv

Piwa: 2

Respekt: 50

Witam, 1 osoba mi podes?a?a skrypt na mechanika dla frakcji PD, Lecz on mi nie dzia?a, gdy wchodz? w marker nic si? nie dzieje. w DB3 nic nie ma te?.

skrypt:

Kod:

local cuboid=createColSphere(2014.97717, -1737.49304, 13.55468, 5) -- cuboid
local marker=createMarker(2015.02808, -1733.09021, 14.23438-0.5,'cylinder',1.5,200,255,0,125) -- marker

function naprawaPojazdow (plr, driver) -- funkcja
if not getElementData("player:duty") == "PD" then return end
if #getElementsWithinColShape(cuboid,"vehicle") < 1 then -- sprawdzamy czy na stano jest pojazd
outputChatBox("* Brak pojazdu na stanowisku...",plr)
return -- odrzucamy
end
local vehicles = getElementsWithinColShape ( cuboid, "vehicle" ) -- sprawdzamy nazwe pojazdu itp
isVehicles = vehicles[1]
local cena = getElementHealth(isVehicles) / 0.5 -- cena naprawy ( DOSTOSUJ DO SWOICH ZAROBKOW )
outputChatBox("* Aby naprawi? ten pojazd wpisz /napraw",plr,0,255,0)
local driver=getVehicleController(cuboid)
if driver then
outputChatBox("* Cena naprawy: "..cena.." PLN",plr,0,255,0)
end
addEventHandler('onMarkerHit', marker, naprawaPojazdow)

function napraw (plr, driver)
if #getElementsWithinColShape(cuboid,"vehicle") < 1 then -- sprawdzamy czy na stano jest pojazd
return -- odrzucamy
end
if getPedOccupiedVehicle(plr) then
outputChatBox("* Wysi?d? z pojazdu!!",plr,255,0,0)
return
end
local cena = getElementHealth(isVehicles) / 0.5 ---- ( TU MA BYC TA SAMA WARTOSC JAK CENA WYZEJ! )
if getPlayerMoney(plr) > cena-1 then
if not getElementData("player:duty") == "PD" then return end
fixVehicle(isVehicles)
outputChatBox("* Pojazd naprawiony, z twojego konta pobrano "..cena.." PLN!",driver,0,255,0)
takePlayerMoney(driver,cena)
else
outputChatBox("* Nie sta? ci? na naprawe pojazdu!",driver,255,0,0)
end
end
end
addCommandHandler('napraw',napraw)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-09, 21:30


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

zamie?
if not getElementData("player:duty") == "PD" then return end 

na
if getElementData(plr"player:duty") ~= "PD" then return end 


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-09, 21:58


KoxikiPvP







Wiek: 29
Na forum: 3223 dni
Posty: 28
Nick w MP: WojBody110lv

Piwa: 2

Respekt: 50

Zamieni?em i nadal nie dzia?a, a mi chodzi ?eby ta naprawa by?a dla PD, ?eby frakcja PD mog?a naprawia? graczom.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-09, 22:17


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

dziwisz si? ?e nie dzia?a?
pewnie nie masz element-daty "player:duty" o WARTO?CI "PD" to Ci nie dzia?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-09, 22:21


KoxikiPvP







Wiek: 29
Na forum: 3223 dni
Posty: 28
Nick w MP: WojBody110lv

Piwa: 2

Respekt: 50

Da?em player:faction bo mam pys 3.0, wgl nie wy?wietla si? outputchatbox

Postaw piwo autorowi tego posta
 

 
Tagi: mechanik
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » mechanik Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku