sckatchof Posted December 15, 2011 Share Posted December 15, 2011 hi all i need same , i want just vehicle entry to the marker ! local Carlbara = createMarker( 117.30000305176, 1885, 17, 'cylinder', 2.5, 255, 255, 255, 150 ) local Carlde5el = createMarker( 86.800003051758, 1771.3000488281, -29.39999961853, 'cylinder', 2.5, 255, 255, 255, 150 ) function Entrer( hitPlayer, matchingDimension ) local team = getPlayerTeam(hitPlayer) if (not team) then return end if (getTeamName(team) == "Army") then setElementPosition ( hitPlayer, 90, 1771.3000488281, -28.39999961853 ) else outputChatBox ( "You cannot enter. You need to be a Army.",hitPlayer ) end end addEventHandler( "onMarkerHit", Carlbara, Entrer ) function Sortie( hitPlayer, matchingDimension ) local team = getPlayerTeam(hitPlayer) if (not team) then return end if (getTeamName(team) == "Army") then setElementPosition ( hitPlayer, 117.69999694824, 1893.4000244141, 18.39999961853 ) end end addEventHandler( "onMarkerHit", Carlde5el, Sortie ) Link to comment
Castillo Posted December 15, 2011 Share Posted December 15, 2011 What do you mean? you want vehicles to be able to enter too? doesn't work already? Link to comment
TAPL Posted December 15, 2011 Share Posted December 15, 2011 you mean this maybe? if getElementType(hitPlayer) == "vehicle" then Link to comment
sckatchof Posted December 15, 2011 Author Share Posted December 15, 2011 What do you mean? you want vehicles to be able to enter too? doesn't work already? it work but i mean just vehicles can enter. Link to comment
Xeno Posted December 15, 2011 Share Posted December 15, 2011 What do you mean? you want vehicles to be able to enter too? doesn't work already? i work but i mean just vehicles can enter. Then as TAPL said, use this, if getElementType(hitPlayer) == "vehicle" then Link to comment
sckatchof Posted December 15, 2011 Author Share Posted December 15, 2011 What do you mean? you want vehicles to be able to enter too? doesn't work already? i work but i mean just vehicles can enter. Then as TAPL said, use this, if getElementType(hitPlayer) == "vehicle" then Ok thnxx i will try Link to comment
sckatchof Posted December 15, 2011 Author Share Posted December 15, 2011 if getElementType(hitPlayer) == "vehicle" then i try many but does not work Like this ?! local Carlbara = createMarker( 117.30000305176, 1885, 17, 'cylinder', 2.5, 255, 255, 255, 150 ) local Carlde5el = createMarker( 86.800003051758, 1771.3000488281, -29.39999961853, 'cylinder', 2.5, 255, 255, 255, 150 ) function Entrer( hitPlayer, matchingDimension ) local team = getPlayerTeam(hitPlayer) if (not team) then return end if getElementType(hitPlayer) == "vehicle" then if (getTeamName(team) == "Army") then setElementPosition ( hitPlayer, 90, 1771.3000488281, -28.39999961853 ) else outputChatBox ( "You cannot enter. You need to be a Army.",hitPlayer ) end end addEventHandler( "onMarkerHit", Carlbara, Entrer ) function Sortie( hitPlayer, matchingDimension ) local team = getPlayerTeam(hitPlayer) if (not team) then return end if getElementType(hitPlayer) == "vehicle" then if (getTeamName(team) == "Army") then setElementPosition ( hitPlayer, 117.69999694824, 1893.4000244141, 18.39999961853 ) end end addEventHandler( "onMarkerHit", Carlde5el, Sortie ) Link to comment
Castillo Posted December 15, 2011 Share Posted December 15, 2011 Try this: local Carlbara = createMarker( 117.30000305176, 1885, 17, 'cylinder', 2.5, 255, 255, 255, 150 ) local Carlde5el = createMarker( 86.800003051758, 1771.3000488281, -29.39999961853, 'cylinder', 2.5, 255, 255, 255, 150 ) function Entrer( hitPlayer, matchingDimension ) if (getElementType(hitPlayer) ~= "vehicle") then return end local hitPlayer = getVehicleOccupant(hitPlayer) local team = getPlayerTeam(hitPlayer) if (not team) then return end if (getTeamName(team) == "Army") then setElementPosition ( hitPlayer, 90, 1771.3000488281, -28.39999961853 ) else outputChatBox ( "You cannot enter. You need to be a Army.",hitPlayer ) end end addEventHandler( "onMarkerHit", Carlbara, Entrer ) function Sortie( hitPlayer, matchingDimension ) if (getElementType(hitPlayer) ~= "vehicle") then return end local hitPlayer = getVehicleOccupant(hitPlayer) local team = getPlayerTeam(hitPlayer) if (not team) then return end if (getTeamName(team) == "Army") then setElementPosition ( hitPlayer, 117.69999694824, 1893.4000244141, 18.39999961853 ) end end addEventHandler( "onMarkerHit", Carlde5el, Sortie ) Link to comment
sckatchof Posted December 15, 2011 Author Share Posted December 15, 2011 Try this: local Carlbara = createMarker( 117.30000305176, 1885, 17, 'cylinder', 2.5, 255, 255, 255, 150 ) local Carlde5el = createMarker( 86.800003051758, 1771.3000488281, -29.39999961853, 'cylinder', 2.5, 255, 255, 255, 150 ) function Entrer( hitPlayer, matchingDimension ) if (getElementType(hitPlayer) ~= "vehicle") then return end local hitPlayer = getVehicleOccupant(hitPlayer) local team = getPlayerTeam(hitPlayer) if (not team) then return end if (getTeamName(team) == "Army") then setElementPosition ( hitPlayer, 90, 1771.3000488281, -28.39999961853 ) else outputChatBox ( "You cannot enter. You need to be a Army.",hitPlayer ) end end addEventHandler( "onMarkerHit", Carlbara, Entrer ) function Sortie( hitPlayer, matchingDimension ) if (getElementType(hitPlayer) ~= "vehicle") then return end local hitPlayer = getVehicleOccupant(hitPlayer) local team = getPlayerTeam(hitPlayer) if (not team) then return end if (getTeamName(team) == "Army") then setElementPosition ( hitPlayer, 117.69999694824, 1893.4000244141, 18.39999961853 ) end end addEventHandler( "onMarkerHit", Carlde5el, Sortie ) does not work Link to comment
Castillo Posted December 15, 2011 Share Posted December 15, 2011 What exactly doesn't work? any errors shown in debugscript? Link to comment
sckatchof Posted December 15, 2011 Author Share Posted December 15, 2011 What exactly doesn't work? any errors shown in debugscript? I cannot enter to marker not vehicles or on the legs (sorry for english). any errors shown in debugscript? There are no errors Link to comment
Castillo Posted December 15, 2011 Share Posted December 15, 2011 local Carlbara = createMarker( 117.30000305176, 1885, 17, 'cylinder', 2.5, 255, 255, 255, 150 ) local Carlde5el = createMarker( 86.800003051758, 1771.3000488281, -29.39999961853, 'cylinder', 2.5, 255, 255, 255, 150 ) function Entrer( hitPlayer, matchingDimension ) if (getElementType(hitPlayer) == "vehicle") then local hitPlayer = getVehicleController(hitPlayer) local team = getPlayerTeam(hitPlayer) if (not team) then return end local vehicle = getPedOccupiedVehicle(hitPlayer) if (getTeamName(team) == "Army") then setElementVelocity(vehicle, 0, 0, 0) setElementPosition ( vehicle, 90, 1771.3000488281, -28.39999961853 ) else outputChatBox ( "You cannot enter. You need to be a Army.",hitPlayer ) end end end addEventHandler( "onMarkerHit", Carlbara, Entrer ) function Sortie( hitPlayer, matchingDimension ) if (getElementType(hitPlayer) == "vehicle") then local hitPlayer = getVehicleController(hitPlayer) local team = getPlayerTeam(hitPlayer) if (not team) then return end local vehicle = getPedOccupiedVehicle(hitPlayer) if (not team) then return end if (getTeamName(team) == "Army") then setElementVelocity(vehicle, 0, 0, 0) setElementPosition ( vehicle, 117.69999694824, 1893.4000244141, 18.39999961853 ) end end end addEventHandler( "onMarkerHit", Carlde5el, Sortie ) Link to comment
sckatchof Posted December 15, 2011 Author Share Posted December 15, 2011 local Carlbara = createMarker( 117.30000305176, 1885, 17, 'cylinder', 2.5, 255, 255, 255, 150 ) local Carlde5el = createMarker( 86.800003051758, 1771.3000488281, -29.39999961853, 'cylinder', 2.5, 255, 255, 255, 150 ) function Entrer( hitPlayer, matchingDimension ) if (getElementType(hitPlayer) == "vehicle") then local hitPlayer = getVehicleController(hitPlayer) local team = getPlayerTeam(hitPlayer) if (not team) then return end local vehicle = getPedOccupiedVehicle(hitPlayer) if (getTeamName(team) == "Army") then setElementVelocity(vehicle, 0, 0, 0) setElementPosition ( vehicle, 90, 1771.3000488281, -28.39999961853 ) else outputChatBox ( "You cannot enter. You need to be a Army.",hitPlayer ) end end end addEventHandler( "onMarkerHit", Carlbara, Entrer ) function Sortie( hitPlayer, matchingDimension ) if (getElementType(hitPlayer) == "vehicle") then local hitPlayer = getVehicleController(hitPlayer) local team = getPlayerTeam(hitPlayer) if (not team) then return end local vehicle = getPedOccupiedVehicle(hitPlayer) if (not team) then return end if (getTeamName(team) == "Army") then setElementVelocity(vehicle, 0, 0, 0) setElementPosition ( vehicle, 117.69999694824, 1893.4000244141, 18.39999961853 ) end end end addEventHandler( "onMarkerHit", Carlde5el, Sortie ) thnx snake for ur help but when the vehicle enter the cylinder, it comes to another cylinder and it fliped Link to comment
Castillo Posted December 15, 2011 Share Posted December 15, 2011 Yes I know, you must fix that by your own. Link to comment
sckatchof Posted December 15, 2011 Author Share Posted December 15, 2011 Yes I know, you must fix that by your own. Thank you for help it fixed Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now