Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: ispeddrivingvehicle
1. isPedDrivingVehicle
Mam problem, a mianowicie kiedy wjedziemy pojazdem w marker to wiadomo?? si? pokazuje, ale kod nie wykonuje triggerClientEvent oraz w konsoli wyrzuca b??d: ERROR: t-gm/t-gm.lua:29: Bad argument @ isPedDrivingVehicle [ped/player expected, got userdata: 0x75]. Licz? na pomoc.


Kod:

function isPedDrivingVehicle(ped)
assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ isPedDrivingVehicle [ped/player expected, got " .. tostring(ped) .. "]")
local isDriving = isPedInVehicle(ped) and getVehicleOccupant(getPedOccupiedVehicle(ped)) == ped
return isDriving, isDriving and getPedOccupiedVehicle(ped) or nil
end

addEventHandler ("onMarkerHit", zaladuj, function(plr)
if isPedDrivingVehicle(plr) then

outputChatBox("test", plr)
triggerClientEvent( "zaladujtira", plr )

end
end)