3B00DG4MER Posted March 11, 2015 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 SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
MIKI785 Posted March 11, 2015 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. Lua Scripter Owner of mshost.cz MTA portal.
3B00DG4MER Posted March 11, 2015 Author 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 SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
darhal Posted March 11, 2015 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 ! #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
3B00DG4MER Posted March 11, 2015 Author 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 SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
darhal Posted March 11, 2015 Posted March 11, 2015 0 is the driver #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
3B00DG4MER Posted March 11, 2015 Author Posted March 11, 2015 Yep SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
darhal Posted March 11, 2015 Posted March 11, 2015 So ... Just try it please #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
3B00DG4MER Posted March 11, 2015 Author 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) SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
darhal Posted March 11, 2015 Posted March 11, 2015 Evean the seat is 1 ?? #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
iMr.TZ[W]ER Posted March 11, 2015 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
darhal Posted March 11, 2015 Posted March 11, 2015 This server side script and not client check your meta #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
3B00DG4MER Posted March 11, 2015 Author Posted March 11, 2015 I know that SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
xeon17 Posted March 11, 2015 Posted March 11, 2015 It's a bug and end. No need for more discussion I saw it on other servers too. A unique GangWar gamemode waiting for you!Click here for more information.
3B00DG4MER Posted March 11, 2015 Author Posted March 11, 2015 https://bugs.multitheftauto.com/view.php?id=8792 Help me guys with some solutions SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
darhal Posted March 11, 2015 Posted March 11, 2015 Warp the player to vehicle too ! #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
3B00DG4MER Posted March 11, 2015 Author Posted March 11, 2015 OMG, you don't know anything what we're talking about SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
darhal Posted March 11, 2015 Posted March 11, 2015 You talk about the event afaik !! #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
Moderators IIYAMA Posted March 11, 2015 Moderators 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. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
3B00DG4MER Posted March 11, 2015 Author Posted March 11, 2015 So you say wait until MTA:SA Team fix it ? SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
Mr_Moose Posted March 11, 2015 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. MTA Community | GitHub | 99Stack Forum
Moderators IIYAMA Posted March 11, 2015 Moderators Posted March 11, 2015 So you say wait until MTA:SA Team fix it ? Correct. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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