function markerb1()
if CurrentMarker >= 2 then
destroyElement(marker)
destroyElement(blip)
end
if CurrentMarker == 2 then --42 = ultima
outputChatBox("Você terminou, entre na auto-escola para ver sua avaliação.", getRootElement(), 0, 255, 0)
health = getElementHealth(car)
fnh = createMarker(-2026.83, -114.85, 1034, "cylinder", 1.0, _,_,_,_, getRootElement())
setElementInterior(fnh, 3)
destroyElement(car)
addEventHandler("onMarkerHit", fnh, finish)
else
marker = createMarker(markersb[CurrentMarker][1], markersb[CurrentMarker][2], markersb[CurrentMarker][3], "checkpoint", 5.0, 255, 0, 0, 90, getRootElement())
blip = createBlipAttachedTo(marker, _, _, _, _, _, _, _, _, getRootElement())
CurrentMarker = CurrentMarker + 1
end
end
function finish(hitElement, matchingDimension)
if health >= 900 then
outputChatBox("Você aprovado, agora você possui habilitação tipo B.", getRootElement(), 0, 255, 0)
if ( getElementType ( hitElement ) == 'player' ) then
account = getPlayerAccount(hitElement)
elseif ( getElementType ( hitElement ) == 'vehicle' ) then
account = getPlayerAccount(getVehicleOccupant ( hitElement ))
end
setAccountData(account, "habilitacao.tipob", true)
else
outputChatBox("Você foi reprovado, tente novamente.", getRootElement(), 255, 0, 0)
end
started = false
end
and you need check from player not in guest account