JuniorMelo Posted June 12, 2013 Share Posted June 12, 2013 (edited) Can you help me with this problem (When I go to sell the vehicle it happens) (sorry my english) Edited June 12, 2013 by Guest Link to comment
Castillo Posted June 12, 2013 Share Posted June 12, 2013 You must check if the hit element is a player. function vender ( hitElement ) if ( isElement ( hitElement ) and getElementType ( hitElement ) == "player" ) then if isPedInVehicle ( hitElement ) then local amount = math.random ( 20000, 60000 ) local playercar = getPedOccupiedVehicle ( hitElement ) if ( getElementModel ( playercar ) == 520 or getElementModel ( playercar ) == 425 ) then givePlayerMoney ( hitElement, amount ) outputChatBox ( "*Voce vendeu seu carro por #ff0000R$ ".. amount .." #00ff00Reais.", hitElement, 0, 255, 0, true ) removePedFromVehicle ( playercar ) destroyElement ( playercar ) end else outputChatBox ("[ERRO]: é necessario voce esta em um carro para vender.",hitElement, 255,100,100 ) end end end addEventHandler ( "onMarkerHit", markertransfeder, vender ) Link to comment
JuniorMelo Posted June 12, 2013 Author Share Posted June 12, 2013 thank you you are very good 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