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: wjazda
1. Wjazda w marker na ID pojazdu
Witam ot?? chcia?bym, zrobi? co? takiego, ?e aby zaliczy?o nam marker musimy wjecha? pojazdem o danym id np infernusem. Pr?bowa?em z funkcj? [lua]getVehicleModel[/lua] lecz nic.
kod c_side.
[lua]--[[
Praca busa

]]--
local code = "MoveTrans"
local districtsTir = {
{-2490.23, 1387.22, 7.19},
{-2441.33, 1367.34, 7.19},
}

local jobTarget
local jobMarker
local jobVehicle
local maxTarget = #districtsTir
function odleglosc()
local x,y,z = getElementPosition(localPlayer)
local mx,my,mz = getElementPosition(jobMarker)
local distance = getDistanceBetweenPoints3D(x,y,z,mx,my,mz)
if distance > 9000000 then
triggerEvent('onClientAddNotification', localPlayer, 'Odjecha?e? zadaleko od punktu.', 'error')
finishJob()
end
end
function finishJob()
if jobMarker and isElement(jobMarker) then
destroyElement(jobMarker)
jobMarker = nil
end
if jobBlip and isElement(jobBlip) then
destroyElement(jobBlip)
jobBlip = nil
end
if jobTarget and isElement(jobTarget) then
destroyElement(jobTarget)
jobTarget = nil
jobTarget = 0

end
if getElementData(localPlayer,"player:job") == code then
setElementData(localPlayer,"player:job",false)
end
triggerServerEvent("destroyVeh", localPlayer)
removeEventHandler("onClientRender",root,odleglosc)
end
addEventHandler ( "onClientPlayerWasted", getLocalPlayer(),finishJob)
...