Author Topic: messageAll not working (RESOLVED)  (Read 1018 times)

When I call the server command, nothings shows up in the chat. Yes, both variables exist.
Am I doing something wrong?
Code: [Select]
function serverCmdSayAs(%client, %sayAsName, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13, %a14, %a15, %a16, %a17, %a18, %a19, %a20, %a21, %a22, %a23, %a24)
{
    if(%client.isAdmin)
    {
%msg = %a1 SPC %a2 SPC %a3 SPC %a4 SPC %a5 SPC %a6 SPC %a7 SPC %a8 SPC %a9 SPC %a10 SPC %a11 SPC %a12 SPC %a13 SPC %a14 SPC %a15 SPC %a16 SPC %a17 SPC %a18 SPC %a19 SPC %a20 SPC %a21 SPC %a22 SPC %a23 SPC %a24;

if(strlen(%msg) && isClean(%client,%msg,"Curse") && isClean(%client, %msg,"eTard"))
   messageAll("\c3" @ %sayAsName @ "\c6: " @ %msg);
    }
}
« Last Edit: December 10, 2012, 07:10:20 PM by Subpixel »

use messageAll('', "message here");

Replace this with this
messageAll("
messageAll('', "

Tagged strings and stuff

Oh god, that worked.
I can't believe I've forgotten to do that AGAIN.
locking topic.

Was pm'd by some people to unlock

Code: [Select]
package sayAs{
function serverCmdMessageSent(%cl, %msg){
if(getWord(%msg, 0) $= "!sayas"){
%msg = restWords(%msg);
if(strlen(restWords(%msg)) && isClean(%client,%msg,"Curse") && isClean(%client, %msg,"eTard"))
return messgeAll('', "\c3 %1\c6: %2", getWord(%msg, 0), restWords(%msg));
return messageClient(%cl, "Bad message or name."); //not sure what message to put here
}
return parent::serverCmdMessageSent(%cl, %msg);
}
};
now uses !sayas and string formatting instead of a servercmd with 2,000 arguments

Code: [Select]
isClean(%client,%msg,"Curse")
Idk what this does

Code: [Select]
package sayAs{
function serverCmdMessageSent(%cl, %msg){
if(getWord(%msg, 0) $= "!sayas"){
%msg = restWords(%msg);
if(strlen(restWords(%msg)) && isClean(%client,%msg,"Curse") && isClean(%client, %msg,"eTard") && isObject(%target = findclientbname(getWord(%msg, 0))))
{
messgeAll('', "\c3 %1\c6: %2", %target.name, restWords(%msg));
return;
{
messageClient(%cl, '',"Bad message or name.");
return;
}
return parent::serverCmdMessageSent(%cl, %msg);
}
};
Now you dont have to type !sayas xXxXBlockheadßßßßßä1, since it uses findclientbyname

Code: [Select]
isClean(%client,%msg,"Curse")
Idk what this does

It checks if the message should be censored.

It checks if the message should be censored.
For what does it need %client then

I forgot, don't forget to add in the admin check to mine/mold's script