Cheetah.dff Posted September 4, 2012 Posted September 4, 2012 Only the last is listed in the update record, but I just want to save the wheels. Can you help me in this regard. -I'm sorry If this is not understood to have used Google translation function save () local vehicle = getPedOccupiedVehicle(source) local adam = getPlayerAccount (source) local upgrades = getVehicleUpgrades ( vehicle ) for upgradeKey, upgradeValue in ipairs ( upgrades ) do setAccountData (adam, "teker", upgradeValue) outputChatBox ( getVehicleUpgradeSlotName ( upgradeValue ) .. ": " .. upgradeValue ) end end addEvent( "save", true ) addEventHandler( "save", getRootElement(), save ) saving database value
Fury Posted September 4, 2012 Posted September 4, 2012 why did you do it with this way? you can save the wheel while you choose the wheel. it will be much more easy.
Cheetah.dff Posted September 5, 2012 Author Posted September 5, 2012 Where is the Client Side client side function show_window () local IsWindowVisible = guiGetVisible(pecere) if (IsWindowVisible == true) then guiSetVisible(pecere, false) showCursor(false) triggerServerEvent("save",getLocalPlayer()) end if (IsWindowVisible == false) then guiSetVisible(pecere, true) showCursor(true) end end why did you do it with this way? you can save the wheel while you choose the wheel. it will be much more easy. How do I do it? --for upgradeKey, upgradeValue in ipairs ( upgrades ) do result: [2012-09-03 17:02:40] WARNING: [script]\wpanel\server.lua:285: Bad argument @ 'getVehicleUpgradeSlotName' [2012-09-03 17:02:40] ERROR: [script]\wpanel\server.lua:285: attempt to concatenate global 'upgradeValue' (a nil value)
TAPL Posted September 5, 2012 Posted September 5, 2012 function save() local vehicle = getPedOccupiedVehicle(source) if vehicle then local adam = getPlayerAccount(source) local upgrade = getVehicleUpgradeOnSlot(vehicle, 12) setAccountData(adam, "teker", upgrade) outputChatBox(upgrade) end end addEvent("save", true) addEventHandler("save", root, save)
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