jeremaniak Posted November 11, 2014 Posted November 11, 2014 Hi, Is there any way you can make it where you can check if the player is in a plane or that he is in a car or that he is in a boat?
The Don Posted November 11, 2014 Posted November 11, 2014 -- Wiki Example and some edit from me function addHelmetOnEnter ( thePlayer, seat, jacked ) if ( getElementModel ( source ) == 522 ) then -- if its a nrg outputChatBox("You entered the NRG-500 Vehicle",thePlayer,255,255,0) end end addEventHandler ( "onVehicleEnter", getRootElement(), addHelmetOnEnter ) Vehicles ID https://wiki.multitheftauto.com/wiki/Vehicle_IDs آن يكون فكر المرء مختلآ , خيرآ من آن يكون فكره محتلآ ! my nick name in the game : =x=|DoN|=x= or 7eJAzZy- ( ͡° ͜ʖ ͡°) http://community.multitheftauto.com/ind ... &id=337164 my profile
jeremaniak Posted November 11, 2014 Author Posted November 11, 2014 is there also a way to make it that you check for vehicle type?
Moderators IIYAMA Posted November 11, 2014 Moderators Posted November 11, 2014 https://wiki.multitheftauto.com/wiki/GetVehicleType 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
Bilal135 Posted November 11, 2014 Posted November 11, 2014 (edited) function myVehicleType(theVehicle, seat, jacked) outputChatBox("Your vehicle type is:" ..getVehicleType(theVehicle)..".", source, 255, 0, 0) end addEventHandler("onVehicleEnter", root, myVehicleType) Edited November 11, 2014 by Guest "Get busy living or get busy dying"
Anubhav Posted November 11, 2014 Posted November 11, 2014 function myVehicleType(player, seat, jacked) outputChatBox("Your vehicle type is:" ..getVehicleType(source)..".", player, 255, 0, 0) end addEventHandler("onVehicleEnter", root, myVehicleType) Are you dreaming boss? thePlayer: A player element representing the player who is entering the vehicle Is the first parameter? Idk what's wrong and Player not defined! See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Bilal135 Posted November 11, 2014 Posted November 11, 2014 Oh sorry, I fixed it. "Get busy living or get busy dying"
Anubhav Posted November 11, 2014 Posted November 11, 2014 Oh sorry, I fixed it. I fixed it in quote. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
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