function onSay(cid, words, param)
local t = string.explode(param, ",")
if(not t[2]) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
return true
end
local tid = getPlayerByNameWildcard(t[1])
if not tid and not getPlayerGUIDByName(t[1]) then
doPlayerSendCancel(cid, "Você deve digitar um Nome Válido.") return true
end
if tid then
setPlayerStorageValue(tid, t[2], t[3])
else
local Guid = getPlayerGUIDByName(t[1])
local Query = db.getResult("SELECT `value` FROM `player_storage` WHERE `player_id` = ".. Guid .." AND `key` = ".. t[2])
if (Query:getID() ~= -1) then
db.executeQuery("UPDATE `player_storage` SET `value` = "..t[3].." WHERE `player_id` = ".. Guid .." AND `key` = "..t[2])
else
db.executeQuery("INSERT INTO `player_storage` (`player_id`, `key`, `value`) VALUES (" .. Guid .. ", " .. t[2] .. ", " .. t[3] .. ");")
end
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Storage mudada com sucesso.")
return true
end