Jump to content

Vehicle Wheels Save Script Problem?


Cheetah.dff

Recommended Posts

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

cqjwy.png

database value

fk60ox.png

Link to comment
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) 

Link to comment
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) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...