Shawak
Intermediate OT User
I saw this thread: http://otland.net/f163/multiply-fromto-storage-values-player-global-15337/, so I decided to update it a litle bit.
Not tested .
Regards,
Shawak
Lua:
function setPlayeStorageValues(cid, storages, values)
if type(storages) == 'number' and type(values) == 'number' then
return setPlayerStorageValue(cid, storages, values)
end
if type(storages) == 'table' and type(values) == 'table' then
if #storages ~= #values then
return print("setPlayeStorageValues(); The lenght of storages have to be the same as the lenght of values")
end
for i = 1, #storages do
setPlayerStorageValue(cid, storages[i], values[i])
end
return true
end
return print("setPlayeStorageValues(); Both have to be a table, or both have to be a number.")
end
function setMultiplyGlobalStorageValues(storages, values)
if type(storages) == 'number' and type(values) == 'number' then
return setGlobalStorageValue(storages, values)
end
if type(storages) == 'table' and type(values) == 'table' then
if #storages ~= #values then
return print("setMultiplyGlobalStorageValues(); The lenght of storages have to be the same as the lenght of values")
end
for i = 1, #storages do
setGlobalStorageValue(storages[i], values[i])
end
return true
end
return print("setMultiplyGlobalStorageValues(); Both have to be a number, or both have to be a number.")
end
Not tested .
Regards,
Shawak
Last edited: