-- server side:
function onEndMission ( vehicle )
if ( getElementDimension ( source ) == 10 ) and ( getElementInterior ( source ) == 0 ) and ( getElementModel ( vehicle ) == 410 ) then
destroyElement ( vehicle )
showPlayerHudComponent ( source, "ammo", true )
showPlayerHudComponent ( source, "area_name", true )
showPlayerHudComponent ( source, "armour", true )
showPlayerHudComponent ( source, "breath", true )
showPlayerHudComponent ( source, "clock", true )
showPlayerHudComponent ( source, "health", true )
showPlayerHudComponent ( source, "money", true )
showPlayerHudComponent ( source, "radar", true )
showPlayerHudComponent ( source, "vehicle_name", true )
showPlayerHudComponent ( source, "weapon", true )
setElementDimension ( source, 0 )
setTimer ( setElementInterior, 500, 1, source, 0 )
setTimer ( setElementPosition, 1500, 1, source, -2489.859, 2510.48, 18.091 )
setPedRotation ( source, 0 )
outputChatBox ( "La prueba ha terminado", source, 255, 0, 0, false )
end
end
addEvent ( "pasar", true )
addEventHandler ( "pasar", getRootElement(), onEndMission )
-- client side:
Marker15 = createMarker ( -1140.79, 1110.79, 38.20, "checkpoint", 3.2, 255, 0, 0 )
function Marker999 ( hitPlayer, matchingDimension )
if ( source == Marker15 ) then
if ( hitElement == localPlayer ) then
outputChatBox ( "Has pasado la prueba.", 255, 0, 0, false )
destroyElement ( Marker15 )
triggerServerEvent ( "pasar", localPlayer, getPedOccupiedVehicle ( hitPlayer ) )
end
end
end
addEventHandler ( "onClientMarkerHit", getRootElement(), Marker999 )