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

Wysłany: 2017-03-05, 16:38


Kalizman







Wiek: 23
Na forum: 3652 dni
Posty: 1394

Piwa: 4619

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

Witam, mam problem:

WARNING: test/server.lua:41: Bad argument @ 'isPedInVehicle' [Expected ped at argument 1, got vehicle] - taki b??d wyskakuje bo wjechaniu w marker, a kod;

server:



addEvent('GuiMech',true)

local MarkerMech createMarker(0010-0.9"cylinder"425525525530)
local MarkerMech2 createMarker(0010-0.9,"cylinder"425525525530)

addEventHandler('onMarkerHit',MarkerMech,function(Player)
if not isPedInVehicle (Playerthen
return
end
if isElementWithinMarker(Player,MarkerMechthen
triggerClientEvent(Player,"PokazGuiNaprawa",root)
triggerClientEvent(Player,"PokazButony",root)
showCursor(Player,true)
end
end)

function NaprawaPojazdu(source)
if isElementWithinMarker(source,MarkerMechthen
local Pojazd getPedOccupiedVehicle(source)
local Nazwa getVehicleName(Pojazd)
local Kasa getPlayerMoney(source)
  if (Kasa 51then
  takePlayerMoney(source50)
  fixVehicle(Pojazdtrue)
end
end
end
addEventHandler('GuiMech',root,NaprawaPojazdu)

addEventHandler('onMarkerHit',MarkerMech2,function(Player)
if not isPedInVehicle (Playerthen
return
end
if isElementWithinMarker(Player,MarkerMech2then
triggerClientEvent(Player,"PokazGuiNaprawa",root)
triggerClientEvent(Player,"PokazButony",root)
showCursor(Player,true)
end
end)

function NaprawaPojazdu2(source)
if isElementWithinMarker(source,MarkerMech2then
local Pojazd getPedOccupiedVehicle(source)
local Nazwa getVehicleName(Pojazd)
local Kasa getPlayerMoney(source)
  if (Kasa 51then
  takePlayerMoney(source50)
  fixVehicle(Pojazdtrue)
end
end
end
addEventHandler('GuiMech',root,NaprawaPojazdu2)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-05, 17:11


_Haze

Peace Yo!






Wiek: 24
Na forum: 4185 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

Kalizman, argument 1 to nie player tylko element. Je?li wejdziesz w marker samochodem to samoch?d b?dzie elementem a nie gracz. Mo?esz zrobi? takiego ifa:
if getElementType(el) == "player" then


Postaw piwo autorowi tego posta
 

 
Tagi: ispedinvehicle
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » isPedInVehicle 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