Mateuswiesner Posted January 20, 2014 Share Posted January 20, 2014 (edited) How to when the player enter /sellcar. It exit of car automatically? function playerCarSell ( source, cmd) if(isPedInVehicle(source)) then local playercar = getPedOccupiedVehicle ( source ) if(getElementData ( playercar, "owner" ) == getPlayerName ( source )) then setElementData (playercar,"owner","Nobody") givePlayerMoney ( source, getElementData ( playercar, "price" )/100*50 ) outputChatBox ("You sold your car!",source, 243,149,72 ) saveCars() else outputChatBox ("Error: It's not your car!",source, 255,255,127 ) end else outputChatBox ("Error: You're not the car!",source, 255,255,127 ) end end addCommandHandler ("sellcar",playerCarSell) Edited January 20, 2014 by Guest Link to comment
Karuzo Posted January 20, 2014 Share Posted January 20, 2014 We can't help you if you not speak in english... Spanish board: viewforum.php?f=122 Link to comment
Chopper Posted January 20, 2014 Share Posted January 20, 2014 function playerCarSell ( source, cmd) if(isPedInVehicle(source)) then removePedFromVehicle (source) local playercar = getPedOccupiedVehicle ( source ) if(getElementData ( playercar, "owner" ) == getPlayerName ( source )) then setElementData (playercar,"owner","Nobody") givePlayerMoney ( source, getElementData ( playercar, "price" )/100*50 ) outputChatBox ("You sold your car!",source, 243,149,72 ) saveCars() else outputChatBox ("Error: It's not your car!",source, 255,255,127 ) end else outputChatBox ("Error: You're not the car!",source, 255,255,127 ) end end addCommandHandler ("sellcar",playerCarSell) Link to comment
Mateuswiesner Posted January 20, 2014 Author Share Posted January 20, 2014 It did not work. Now he just gets out and does not sell the car! Link to comment
Moderators IIYAMA Posted January 20, 2014 Moderators Share Posted January 20, 2014 It did not work. Now he just gets out and does not sell the car! https://wiki.multitheftauto.com/wiki/OnVehicleEnter https://wiki.multitheftauto.com/wiki/OnVehicleExit https://wiki.multitheftauto.com/wiki/Re ... romVehicle To lazy to search on wiki mta? 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