• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua /reward question :)

domelxp

Member
Joined
Mar 1, 2010
Messages
243
Reaction score
5
Code:
  function onSay(cid, words, param, channel)  
        local t = string.explode(param, ",")
        local gm = getCreatureName(cid)
        for _, cid in ipairs(getPlayersOnline()) do
                local accId = getPlayerAccount(cid)
                if(getNotationsCount(accId) < 1) then
                    doPlayerAddItem(cid, t[1], 1)
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Everyone have been rewarded a "..getItemNameById(t[1]).." by "..gm.." for the reason: "..tostring(t[2])..".")
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)               
                end
        end
        return TRUE
end

how to make reward take only players >50 lvl ??
thx for help
 
LUA:
  function onSay(cid, words, param, channel)  
        local t = string.explode(param, ",")
        local gm = getCreatureName(cid)
        for _, cid in ipairs(getPlayersOnline()) do
                local accId = getPlayerAccount(cid)
                if(getNotationsCount(accId) < 1) then
                   if getPlayerLevel(cid) >= 50 then
                      doPlayerAddItem(cid, t[1], 1)
                      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Everyone have been rewarded a "..getItemNameById(t[1]).." by "..gm.." for the reason: "..tostring(t[2])..".")
                      doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)               
                   end
                end
        end
        return TRUE
end
 

Similar threads

Back
Top