@imkingran
Try this:
Try this:
Code:
local STORAGE = 23305
function onSay(cid, words, param, type)
local player = Player(cid)
local party = player:getParty()
if not party then
player:sendCancelMessage("You're not in a party.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end
if party:getLeader() ~= player then
player:sendCancelMessage("You're not the leader of your party.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end
player:setStorageValue(STORAGE, player:getStorageValue(STORAGE) == -1 and 1 or -1)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Party Item share has been " .. (player:getStorageValue(STORAGE) == -1 and "disabled" or "enabled") .. ".")
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
return false
end