BorderLine Posted May 9, 2013 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 Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
Castillo Posted May 9, 2013 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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
BorderLine Posted May 9, 2013 Author 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 Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
Castillo Posted May 10, 2013 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 San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
BorderLine Posted May 10, 2013 Author Posted May 10, 2013 EDIT: i found another way. So now is working.. Thanks for your help solid Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
Castillo Posted May 10, 2013 Posted May 10, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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