Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getPlayerAccountStorageValue(name, key)
- local result, ret = db.getResult("SELECT `value` FROM `account_storage` WHERE `acc_id` = '".. getAccountIdByName(name) .."' AND `key` = ".. key ..";")
- if result:getID() == -1 then
- return nil
- end
- ret = result:getDataInt("value")
- result:free()
- return ret
- end
- function setPlayerAccountStorageValue(name, key, value)
- local result = db.getResult("SELECT * FROM `account_storage` WHERE `acc_id` = ".. getAccountIdByName(name) .." AND `key` = ".. key ..";")
- if result:getID() == -1 then
- return db.executeQuery("INSERT INTO `account_storage` (`acc_id`, `key`, `value`) VALUES (".. getAccountIdByName(name) ..", ".. key ..", ".. value ..");")
- else
- result:free()
- return db.executeQuery("UPDATE `account_storage` SET `value` = ".. value .." WHERE `acc_id` = ".. getAccountIdByName(name) .." AND `key` = ".. key ..";")
- end
- end
- function getWarnings(name)
- return getPlayerAccountStorageValue(name, 21798)
- end
- function setWarnings(name, count)
- return setPlayerAccountStorageValue(name, 21798, count)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement