Jump to content

wtf?? [ help ]


mars

Recommended Posts

hey all,

i wanted to make missions but its weird, i got the spawn, of the car. u get spawned in it.

a blip is getting created, and a marker too.

but when you hit the other marker, the server + your mta crashed :S

and it doesn't give me a error is something,

this is how far i am atm:

mission = createMarker ( -2642.5, 1375, 6, "cylinder", 1.5, 255, 255, 0, 30 )
 
function mission ( hitPlayer )
	getNickFromPlayer = ( hitPlayer )
	if ( hitPlayer ) then
	myMarker = createMarker ( -1647, 1219, 6, "cylinder" , 4, 255, 255, 0, 30 )
	--setElementVisibleTo ( myMarker, getRootElement ( ), false )
	--setElementVisibleTo ( myMarker, hitPlayer , true )
    	local MissionVehicle = createVehicle ( 401, -2639, 1371, 8 )
        warpPedIntoVehicle ( hitPlayer , MissionVehicle )
	blip = createBlip ( -1647, 1219, 4, 52, 2, 255, 0, 0, 255, 0, 99999.0, getRootElement() )
	--setElementVisibleTo ( blip, hitPlayer, true )
end
end
addEventHandler ("onMarkerHit" , getRootElement(), mission)

Link to comment

haha i know about the get nick, i removed. i mixed 2 scripts, but can you explain abit more? :shock:

i got this right now

marky = createMarker ( -2642.5, 1375, 6, "cylinder", 1.5, 255, 255, 0, 30 )
 
function mission ( hitPlayer )
	my = createMarker ( -1647, 1219, 6, "cylinder" , 4, 255, 255, 0, 30 )
	--setElementVisibleTo ( myMarker, getRootElement ( ), false )
	--setElementVisibleTo ( myMarker, hitPlayer , true )
    	local MissionVehicle = createVehicle ( 401, -2639, 1371, 8 )
        warpPedIntoVehicle ( hitPlayer , MissionVehicle )
	blip = createBlip ( -1647, 1219, 4, 52, 2, 255, 0, 0, 255, 0, 99999.0, getRootElement() )
	--setElementVisibleTo ( blip, hitPlayer, true )
end
addEventHandler ("onMarkerHit" , getRootElement(), mission)

Link to comment

this SHOULD do the trick

marky = createMarker ( -2642.5, 1375, 6, "cylinder", 1.5, 255, 255, 0, 30 )
 
  function mission ( hitPlayer )
  if (source == marky) then
           my = createMarker ( -1647, 1219, 6, "cylinder" , 4, 255, 255, 0, 30 )
           setElementVisibleTo ( my, hitPlayer , true )
               local MissionVehicle = createVehicle ( 401, -2639, 1371, 8 )
                warpPedIntoVehicle ( hitPlayer , MissionVehicle )
           blip = createBlip ( -1647, 1219, 4, 52, 2, 255, 0, 0, 255, 0, 99999.0, getRootElement() )
           setElementVisibleTo ( blip, hitPlayer, true )
 
     end
 end
 
 function Reward( hitPlayer )
 if (source == my) then
 removePedFromVehicle( hitPlayer)
 destroyElement( MissionVehicle )
 destroyElement( blip )
 destroyElement( my )
	givePlayerMoney(hitPlayer, 100) -- change 100 to whatever you would like
end
  end
 
 
     addEventHandler ("onMarkerHit" , getRootElement(), mission)

i right away added a function that destroys every element u created in the mission function so there will be no marker that some other guy may walk in and earn money

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...