BorderLine Posted May 9, 2013 Share Posted May 9, 2013 Hi again. Well i have another problem. I have this function upgrade() local cuVehicle = getPedOccupiedVehicle(source) local account = getPlayerAccount ( source ) if not isGuestAccount(account) and getAccountName(account) == "x" then setTimer(addVehicleUpgrade, 1000, 1, cuVehicle, 1080 ) end end addEventHandler("onMapStarting", getRootElement(), upgrade) addEventHandler("onPlayerVehicleEnter", getRootElement(), upgrade) addEventHandler("onElementModelChange", getRootElement(), upgrade) The problem is. in Race gamemode, when i change vehicle, my wheels change to default. I want have ever my wheels. But idk how fix it. Thanks for your time Link to comment
Castillo Posted May 9, 2013 Share Posted May 9, 2013 You are using three different events for one single function, and all these events have different arguments. onMapStarting: It has no player argument as source. onElementModelChange: 'source' is the element that got his model changed. So you would need to use: onVehicleEnter onElementModelChange and use 'source' as vehicle element. Also, onMapStarting is not required because when you spawn, 'onVehicleEnter' will be triggered. Link to comment
BorderLine Posted May 9, 2013 Author Share Posted May 9, 2013 Thanks. Now i got this. But isnt work function upgrade(player) local account = getPlayerAccount ( player ) if not isGuestAccount(account) and getAccountName(account) == "yakuza" then addVehicleUpgrade( source , 1080) end end addEventHandler("onVehicleEnter", resourceRoot, upgrade) addEventHandler("onElementModelChange", resourceRoot, upgrade) Same error, when i change model dont keep the wheels Link to comment
Castillo Posted May 10, 2013 Share Posted May 10, 2013 Well, the first argument of "onElementModelChange" is the old model, is not a player element. Get the vehicle driver with: getVehicleController Link to comment
BorderLine Posted May 10, 2013 Author Share Posted May 10, 2013 EDIT: i found another way. So now is working.. Thanks for your help solid 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