• 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 fined, but using magic

di12345di

New Member
Joined
Aug 1, 2012
Messages
105
Reaction score
0
hello someone could modify the script and grant access to use spells, getting more mutated unable to write anything just using magic.

<talkaction log="yes" words="/mute;/desmute" access="2" event="script" value="muteplayer.lua"/>
talkactions/script
muteplayer.lua
Code:
local v = {}

for k = 1, 100 do

table.insert(v, createConditionObject(CONDITION_MUTED))

setConditionParam(v[k], CONDITION_PARAM_TICKS, k*60*1000)

end

function onSay(cid, words, param)

if (words == "/mute") then

local t = string.explode(param, ",") 

if param == '' then  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")  return true end 

local player,time,pid = getPlayerByName(t[1]),t[2],getPlayerByNameWildcard(t[1]) 

if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then 

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")  return TRUE  end

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você mutou o jogador "..t[1].." por "..time.." minutos.")

doAddCondition(player, v[tonumber(time)])

setPlayerStorageValue(player, 90000, os.time()+time*60)

doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você foi mutado por "..time.." minutos.")

elseif (words == "/desmute") then

if param == '' then  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")  return true end 

local player = getPlayerByNameWildcard(param)

if(not player)then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") return true end

if getCreatureCondition(player, CONDITION_MUTED) == false then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "este jogador não está mutado.") return true end

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você desmutou o jogador "..param..".")

doRemoveCondition(player, CONDITION_MUTED)

setPlayerStorageValue(player, 90000, -1)

doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você foi desmutado.")

end

return true 

end

<event type="login" name="MutePlayer" event="script" value="mute_check.lua"/>

creaturescript/script
mute_check.lua
Code:
local v = {}

for k = 1, 100000 do

table.insert(v, createConditionObject(CONDITION_MUTED))

setConditionParam(v[k], CONDITION_PARAM_TICKS, k*1000)

end

function onLogin(cid)

if getPlayerStorageValue(cid, 90000) >= os.time() then

doAddCondition(cid, v[tonumber(getPlayerStorageValue(cid, 90000) - os.time())])

end

return TRUE

end
 
here is what i come up after trying really hard, this isnt perfect but must do more less what you want.
First open CHAT.CPP and search for :
PHP:
        if(channel->getConditionId() >= 0 && player->hasCondition(CONDITION_MUTED, channel->getConditionId()))
        {
            player->sendCancel(channel->getConditionMessage().c_str());
            return true;
        }
now replace all that with
PHP:
    std::string tmpStrValue = asLowerCaseString(text);
    const char* strs[] = { "exura", "exori vis", "Help", NULL };

    bool isSpell = false ;
    for (int i=0; strs[i] != NULL  i++) {
        const char *str = strs[i];
        if(tmpStrValue == asLowerCaseString(*str) ){    isSpell = true;    }
    }

    if(!isSpell && channel->getConditionId() >= 0 && player->hasCondition(CONDITION_MUTED, channel->getConditionId()))
    {
        player->sendCancel(channel->getConditionMessage().c_str());
        return true;
    }

you can change the list of allowed word while being muted here.
the last element must be NULL
const char* strs[] = { "exura", "exori vis", "Help", NULL };

please if some one know a better way to improve it or do it help us.
 
sailorv5
error

http://prntscr.com/bnp9fh

In member function 'bool Chat::talk(Player*, MessageClasses, const std::string&, uint16_t, uint32_t, bool)':

expected ';' before 'i'

invalid conversion from 'const char' to 'const char*'

initializing argument 1 of 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]'
 
Back
Top