ThePope Posted January 14, 2010 Posted January 14, 2010 Hello all, I feel like I'm spamming a little bit here, or I wan't so many unusual things I am looking for a way to spawn a player into or inside a vehicle that he/she just spawned. Is this possible? 'Cause I can't find anything about this on the wiki nor the forum. thanks in advance!
ThePope Posted January 14, 2010 Author Posted January 14, 2010 Hello all, I feel like I'm spamming a little bit here, or I wan't so many unusual things I am looking for a way to spawn a player into or inside a vehicle that he/she just spawned. Is this possible? 'Cause I can't find anything about this on the wiki nor the forum. thanks in advance!
50p Posted January 14, 2010 Posted January 14, 2010 Use this function: https://wiki.multitheftauto.com/wiki/WarpPedIntoVehicle
50p Posted January 14, 2010 Posted January 14, 2010 Use this function: https://wiki.multitheftauto.com/wiki/WarpPedIntoVehicle
ThePope Posted January 14, 2010 Author Posted January 14, 2010 and this can also be done like this? oPlayerVehicle = createVehicle( 12, -2137, 656, 13 ) warpPedIntoVehicle( getLocalPlayer(), oPlayerVehicle )
ThePope Posted January 14, 2010 Author Posted January 14, 2010 and this can also be done like this? oPlayerVehicle = createVehicle( 12, -2137, 656, 13 ) warpPedIntoVehicle( getLocalPlayer(), oPlayerVehicle )
robhol Posted January 14, 2010 Posted January 14, 2010 No, you can't use client-created vehicles. Think about the sync issues. If you create the vehicle server-side (or do it all there) you'll be fine.
robhol Posted January 14, 2010 Posted January 14, 2010 No, you can't use client-created vehicles. Think about the sync issues. If you create the vehicle server-side (or do it all there) you'll be fine.
madis Posted January 14, 2010 Posted January 14, 2010 warpPedIntoVehicle is server-only function, so you can't simply use getLocalPlayer() (which is client-only function). Server should check if something triggered some event you need to use warping at, and usually the source of the event will be the player who trigger it and you can use that source instead of getLocalPlayer().
madis Posted January 14, 2010 Posted January 14, 2010 warpPedIntoVehicle is server-only function, so you can't simply use getLocalPlayer() (which is client-only function). Server should check if something triggered some event you need to use warping at, and usually the source of the event will be the player who trigger it and you can use that source instead of getLocalPlayer().
ThePope Posted January 14, 2010 Author Posted January 14, 2010 thanks, I'm gonna try some things with this info
ThePope Posted January 14, 2010 Author Posted January 14, 2010 thanks, I'm gonna try some things with this info
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