Jumper_Mych Posted January 18, 2011 Author Share Posted January 18, 2011 1. omfg! you are doing random code as i said, this makes no sense o_o, you want to setPlayerName in a vehicle?? I try change to setPlayerFromNick is doesn't work i change next setPlayerType but doesn't work it all doesn't work, unless my code are error 2.simply ask you, i want Vehicle is owned Jumper_Mych Link to comment
Jumper_Mych Posted January 18, 2011 Author Share Posted January 18, 2011 Which will work 1.setPlayerName 2.getPlayerName 3.getPlayerFromNick 4.getElementType 5.other (add me function) Link to comment
Castillo Posted January 18, 2011 Share Posted January 18, 2011 what are you trying to do? i would recommend doing something like this: vehicle = createVehicle ( 496, 2425, -55, 27, 0, 0, 0 ) setElementData(vehicle,"vehicle","car") setElementData(vehicle, "owner", "Jumper_Mych") function enterVehicle ( player, seat, jacked ) if (getElementData(source, "vehicle" ) == "car") and ( not getElementData(source, "owner" ) == getPlayerName(player) ) then outputChatBox ( "Vehicle owner: Jumper_Mych", player ) cancelEvent() end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) Link to comment
Jumper_Mych Posted January 18, 2011 Author Share Posted January 18, 2011 what are you trying to do? i would recommend doing something like this: vehicle = createVehicle ( 496, 2425, -55, 27, 0, 0, 0 ) setElementData(vehicle,"vehicle","car") setElementData(vehicle, "owner", "Jumper_Mych") function enterVehicle ( player, seat, jacked ) if (getElementData(source, "vehicle" ) == "car") and ( not getElementData(source, "owner" ) == getPlayerName(player) ) then outputChatBox ( "Vehicle owner: Jumper_Mych", player ) cancelEvent() end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) Weak code and doesn't work Topic to scrap But thanks you Solidsnake14 was first code work Link to comment
Castillo Posted January 18, 2011 Share Posted January 18, 2011 vehicle = createVehicle ( 496, 2425, -55, 27, 0, 0, 0 ) setElementData(vehicle,"vehicle","car") setElementData(vehicle, "owner", "Jumper_Mych") function enterVehicle ( player, seat, jacked ) if (getElementData(source, "vehicle" ) == "car") and ( getElementData(source, "owner" ) ~= getPlayerName(player) ) then outputChatBox ( "Vehicle owner: Jumper_Mych", player ) cancelEvent() end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) you only had to remove "not" and change "==" to "~=" Link to comment
Jumper_Mych Posted January 18, 2011 Author Share Posted January 18, 2011 Thanks you! 1/2 and 2/2 Close Topic No deleted, A beginner might be useful Link to comment
Castillo Posted January 18, 2011 Share Posted January 18, 2011 OMG! ur seriusly? finally! Link to comment
Jumper_Mych Posted January 18, 2011 Author Share Posted January 18, 2011 maybe finally, but next my work on code target doesn't work i New Topic 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