Jump to content

warpPedIntoVehicle


Lloyd Logan

Recommended Posts

Posted

Hey, I want it so that when the player enters the marker it warps the Created ped into the vehicle?

client

pickPed = createMarker(1790.33105, -1909.81689, 13.03162, "cylinder", 1.5, 255, 0, 0) 
  
function warpit() 
    triggerServerEvent("doIt", source, "pickPed") 
end 
addEventHandler("onClientMarkerHit", root, warpit) 

server

createMarker(1777.95203, -1892.48059, 12.38782, "cylinder", 0.9, 255, 0, 0) 
taxiPed = createPed(252, 1789.95386, -1910.94507, 13.03228) 
taxiVeh = createVehicle(420, 1777.95203, -1892.48059, 12.38782) 
  
function pickPed() 
    warpPedIntoVehicle( taxiPed, taxiVeh, 2) 
end 
addEvent("doIt", true) 
addEventHandler("doIt", root, pickPed) 

If it it possible, could you make it so that the ped is warped in the current vehicle the player is in? Instead of the createVeh?

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted

-- client side:

pickPed = createMarker(1790.33105, -1909.81689, 13.03162, "cylinder", 1.5, 255, 0, 0) 
  
function warpit ( hitElement ) 
    if ( hitElement == localPlayer ) then 
        triggerServerEvent ( "doIt", localPlayer ) 
    end 
end 
addEventHandler ( "onClientMarkerHit", root, warpit ) 

-- server side:

createMarker(1777.95203, -1892.48059, 12.38782, "cylinder", 0.9, 255, 0, 0) 
taxiPed = createPed(252, 1789.95386, -1910.94507, 13.03228) 
taxiVeh = createVehicle(420, 1777.95203, -1892.48059, 12.38782) 
  
function pickPed ( ) 
    local vehicle = getPedOccupiedVehicle ( source ) 
    if ( vehicle ) then 
        warpPedIntoVehicle ( taxiPed, vehicle, 2 ) 
    end 
end 
addEvent ( "doIt", true ) 
addEventHandler ( "doIt", root, pickPed ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Thanks Alot, Castillo!!

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
You're welcome.

Sorry, Castillo, when I hit any marker, the ped is warped into the Veh, how would i make it so that the ped is only warped when it hits that client side marker?

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted

Change:

addEventHandler ( "onClientMarkerHit", root, warpit ) 

To:

addEventHandler ( "onClientMarkerHit", pickPed, warpit ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Change:
addEventHandler ( "onClientMarkerHit", root, warpit ) 

To:

addEventHandler ( "onClientMarkerHit", pickPed, warpit ) 

Thank you!! Sorry about this but as a general question, how can I delete/erase a ped?

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted
destroyElement 

Thanks!!

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

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...