kito2
www.masteria.net
Disabling a spell to team members for a certain time? <- Could this be possible, via a command?
local t = {
['exevo gran mas vis'] = 1239, --spell name or spell words and empty storage
['exevo gran mas frigo'] = 3213, --spell name or spell words and empty storage
['exura'] = 1234 --spell name or spell words and empty storage
}
function onSay(cid, words, param, channel)
local k = string.explode(param, ',')
local v = t[k[2]]
local i = {}
if param == '' then
return doPlayerSendTextMessage(cid, 27, 'Command param required') and false
end
if not k[2] then
return doPlayerSendTextMessage(cid, 27, 'Second command param required') and false
end
if not k[3] then
return doPlayerSendTextMessage(cid, 27, 'Third command param required') and false
end
if not tonumber(k[3]) then
return doPlayerSendTextMessage(cid, 27, 'Third command param must be a number') and false
end
if not v then
return doPlayerSendTextMessage(cid, 27, 'This spell is not in the list') and false
end
for _, pid in ipairs(getPlayersOnline()) do
if getPlayerGuildName(pid) == k[1] then
table.insert(i, getPlayerName(pid))
end
end
if #i > 0 then
for _, pid in ipairs(getPlayerOnline()) do
if isInArray(i, getPlayerName(pid)) then
exhaust.set(pid, v, k[3]*1000)
end
end
else
doPlayerSendTextMessage(cid, 27, k[1]..'\'s guild members not foud')
end
i = {}
return TRUE
end
if exhaustion.get(cid, 1239) then
return doPlayerSendCancel(cid, 'You are exhausted') and doSendMagicEffect(getPlayerPosition(cid), 2) and false
end