GhostXoP Posted December 10, 2012 Share Posted December 10, 2012 I have tried to use warpPedIntoVehicle(source, VEHICLE) and this does not seem to be working How can i spawn the player into a vehicle otherwise?(This is server side within an event handler triggered by the player) Link to comment
Castillo Posted December 10, 2012 Share Posted December 10, 2012 Well, if 'source' is defined and 'VEHICLE' as well, then it should work. Link to comment
GhostXoP Posted December 10, 2012 Author Share Posted December 10, 2012 That is the odd part, and its odd only because i get no errors via debugscript 3 or in the console Link to comment
Castillo Posted December 10, 2012 Share Posted December 10, 2012 Mind posting your script? Link to comment
GhostXoP Posted December 10, 2012 Author Share Posted December 10, 2012 function SpawnPlayerInCar(Vehicle) warpPedIntoVehicle(source,Vehicle) end addEvent("Server,PutMeInMyCar", true) addEventHandler("Server.PutMeInMyCar", getRootElement(), SpawnPlayerInCar) SERVERSIDE --spawn the vehicle where player is but spawn player within it local x,y,z = getElementPosition(getLocalPlayer()) local spawnedVehicle = createVehicle(Item.ID, x,y,z, 0, 0, 0, Item.LIC) triggerServerEvent("Server.PutMeInMyCar", getLocalPlayer(), spawnedVehicle) CLIENTSIDE Link to comment
Castillo Posted December 11, 2012 Share Posted December 11, 2012 You can't warp him because the vehicle is created client side, so the server doesn't know about it. Create the vehicle server side. Link to comment
GhostXoP Posted December 11, 2012 Author Share Posted December 11, 2012 I assume vehicle is a pointer to memory on the host its created on, that's what is causing this limit Link to comment
DiSaMe Posted December 11, 2012 Share Posted December 11, 2012 The vehicle doesn't exist on the server. It was created by the client and only exists on the client. You can't pass elements or other userdata if they do not exist on the other side. Link to comment
TAPL Posted December 11, 2012 Share Posted December 11, 2012 https://wiki.multitheftauto.com/wiki/CreateVehicle Note: Vehicles (and other elements) created client-side are only seen by the client that created them, aren't synced and players cannot enter them. They are essentially for display only. Link to comment
GhostXoP Posted December 12, 2012 Author Share Posted December 12, 2012 Alright kids, the question was already answered. Find something else to do Link to comment
TAPL Posted December 12, 2012 Share Posted December 12, 2012 Alright kids, the question was already answered. Find something else to do Thank you very much. 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