jeremaniak Posted November 11, 2014 Share 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? Link to comment
The Don Posted November 11, 2014 Share 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 Link to comment
jeremaniak Posted November 11, 2014 Author Share Posted November 11, 2014 is there also a way to make it that you check for vehicle type? Link to comment
Moderators IIYAMA Posted November 11, 2014 Moderators Share Posted November 11, 2014 https://wiki.multitheftauto.com/wiki/GetVehicleType Link to comment
Bilal135 Posted November 11, 2014 Share 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 Link to comment
Anubhav Posted November 11, 2014 Share 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! Link to comment
Bilal135 Posted November 11, 2014 Share Posted November 11, 2014 Oh sorry, I fixed it. Link to comment
Anubhav Posted November 11, 2014 Share Posted November 11, 2014 Oh sorry, I fixed it. I fixed it in quote. 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