Wei Posted April 6, 2012 Share Posted April 6, 2012 function bus(thePlayer) if ( theSkin == 171 ) then x,y,z = getElementPosition(thePlayer) veh = createVehicle(431, x,y,z) warpPedIntoVehicle(thePlayer, veh) end end addEventHandler ( "onPickupUse", busdrivepickup, bus ) It doesn't give me bus Link to comment
drk Posted April 6, 2012 Share Posted April 6, 2012 addEventHandler ( 'onPickupUse', root, function ( uPed ) if ( source == busdrivepickup ) then if ( getElementModel ( uPed ) == 171 ) then local nX, nY, nZ = getElementPosition ( uPed ); local eBus = createVehicle ( 431, x + 5, y, z ); warpPedIntoVehicle ( uPed, eBus ); end end end ) Link to comment
Todd Posted April 6, 2012 Share Posted April 6, 2012 (edited) solved/ too late ;p Edited April 6, 2012 by Guest Link to comment
BriGhtx3 Posted April 6, 2012 Share Posted April 6, 2012 function bus(thePlayer) if ( getElementModel(thePlayer) == 171 ) then x,y,z = getElementPosition(thePlayer) veh = createVehicle(431, x,y,z) warpPedIntoVehicle(thePlayer, veh) end end addEventHandler ( "onPickupUse", busdrivepickup, bus Link to comment
drk Posted April 6, 2012 Share Posted April 6, 2012 @@BriGhtx3 -> Your code is wrong and I already posted the correct one. 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