3B00DG4MER Posted March 11, 2015 Share Posted March 11, 2015 Hi guys, today I was working on Vehicle and Peds I tried to warp a ped into a Vehicle than I tried to enter the vehicle, I was unable to do it here's a code it's basic, I think it's MTA:SA Bug x,y,z = getElementPosition(getRandomPlayer()) -- i'm alone at the server , so it's should get me veh = createVehicle(411,x,y,z) -- creating the vehicle ped = createPed(211,x,y,z) -- creating the ped warpPedIntoVehicle(ped,veh) -- Warping Ped into the Vehicle addEventHandler("onVehicleStartEnter",root,function() outputChatBox("You are trying to enter a vehicle !") end) -- This event won't get called ! Note : when I kill the Ped I can enter to the vehicle and the event called Link to comment
MIKI785 Posted March 11, 2015 Share Posted March 11, 2015 That's not bug, it won't get called, because he never "started" to enter the vehicle, you warped him right in. onVehicleEnter should be called. Link to comment
3B00DG4MER Posted March 11, 2015 Author Share Posted March 11, 2015 No, you didn't understand When I TRY to enter and the ped is in the vehicle I can't enter to it Link to comment
darhal Posted March 11, 2015 Share Posted March 11, 2015 Its your bug you should use seat (thirs function argument) x,y,z = getElementPosition(getRandomPlayer()) -- i'm alone at the server , so it's should get me veh = createVehicle(411,x,y,z) -- creating the vehicle ped = createPed(211,x,y,z) -- creating the ped warpPedIntoVehicle(ped,veh, 1) -- Warping Ped into the Vehicle addEventHandler("onVehicleStartEnter",root,function() outputChatBox("You are trying to enter a vehicle !") end) -- This event won't get called ! Link to comment
3B00DG4MER Posted March 11, 2015 Author Share Posted March 11, 2015 (edited) OMG,Why do I've to set the seat while by default it's 0 and the problem is not when Warping the ped the problem when trying to enter to a vehicle it's has got already a ped( Jacking) Edited March 11, 2015 by Guest Link to comment
3B00DG4MER Posted March 11, 2015 Author Share Posted March 11, 2015 Okay look, if a ped is in vehicle i can't enter to it (i can't steal it, like in GTA) Link to comment
iMr.TZ[W]ER Posted March 11, 2015 Share Posted March 11, 2015 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. You have to read all of the function page And be sure that you can't mix server and client functions in one file Link to comment
darhal Posted March 11, 2015 Share Posted March 11, 2015 This server side script and not client check your meta Link to comment
xeon17 Posted March 11, 2015 Share Posted March 11, 2015 It's a bug and end. No need for more discussion I saw it on other servers too. Link to comment
3B00DG4MER Posted March 11, 2015 Author Share Posted March 11, 2015 https://bugs.multitheftauto.com/view.php?id=8792 Help me guys with some solutions Link to comment
darhal Posted March 11, 2015 Share Posted March 11, 2015 Warp the player to vehicle too ! Link to comment
3B00DG4MER Posted March 11, 2015 Author Share Posted March 11, 2015 OMG, you don't know anything what we're talking about Link to comment
darhal Posted March 11, 2015 Share Posted March 11, 2015 You talk about the event afaik !! Link to comment
Moderators IIYAMA Posted March 11, 2015 Moderators Share Posted March 11, 2015 If the event never gets called, you don't know when you have to warp him in to it. (and yes I tested it) So no way around it, lets sit back and relax. Link to comment
3B00DG4MER Posted March 11, 2015 Author Share Posted March 11, 2015 So you say wait until MTA:SA Team fix it ? Link to comment
Mr_Moose Posted March 11, 2015 Share Posted March 11, 2015 The only think I could think of is this this, setElementPosition: Attention: Do not use this function to spawn a ped/player. It will cause problems with other functions like warpPedIntoVehicle. Use spawnPlayer and createPed instead. Now, I know it sounds farfetched but it actually makes sense, you said it worked again after killing the player. (Something that probably will spawn the player the correct way). You may have a look at the function setElementPosition and ho that one is used in your resources. Link to comment
Moderators IIYAMA Posted March 11, 2015 Moderators Share Posted March 11, 2015 So you say wait until MTA:SA Team fix it ? Correct. 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