Author Topic: Chat Message Delay  (Read 1926 times)

I made my own little message script, but I don't know how to make it so that
whenever someone sends a message, there is a delay.
Code: [Select]
function serverCmdMsg(%client,%input,%Chat, %Chat2, %Chat3, %Chat4, %Chat5, %Chat6, %Chat7, %Chat8, %Chat9, %Chat10, %Chat11, %Chat12, %Chat13, %Chat14, %Chat15, %Chat16, %Chat17, %Chat18, %Chat19, %Chat20, %Chat21, %Chat22, %Chat23, %Chat24, %Chat25, %Chat26, %Chat27, %Chat28, %Chat29, %Chat30, %Chat31, %Chat32, %Chat33, %Chat34, %Chat35, %Chat36, %Chat37, %Chat38, %Chat39, %Chat40)
{
%message = %chat SPC %chat2 SPC %chat3 SPC %chat4 SPC %chat5 SPC %chat6 SPC %chat7 SPC %chat8 SPC %chat9 SPC %chat10 SPC %chat11 SPC %chat12 SPC %chat13 SPC %chat14 SPC %chat15 SPC %chat16 SPC %Chat17 SPC %Chat18 SPC %Chat19 SPC %Chat20 SPC %Chat21 SPC %Chat22 SPC %Chat23 SPC %Chat24 SPC %Chat25 SPC %Chat26 SPC %Chat27 SPC %Chat28 SPC %Chat29 SPC %Chat30 SPC %Chat31 SPC %Chat32 SPC %Chat33 SPC %Chat34 SPC %Chat35 SPC %Chat36 SPC %Chat37 SPC %Chat38 SPC %Chat39 SPC %Chat40;
%targ = findclientbyname(%input);
if(!isObject(%targ))
{
%client.chatMessage("That player does not exist!");
}
else
{
messageClient(%client,'MsgAdminForce',"\c4Message was sent to \c3"@%targ.name@"\c6: "@%message);
messageClient(%targ,'MsgAdminForce',"\c4Message From \c3"@%client.name@"\c6: "@%message);
}
}

Use the schedule function. Search around

Use the schedule function. Search around

So then would it be something like this?...
Code: [Select]
schedule(0,3000,messageClient,%client,'MsgAdminForce',"\c4Message was sent to \c3"@%targ.name@"\c6: @%message);I think I am doing something horribly wrong

Flip the first two arguments.

Flip the first two arguments.
Oohh, I understand it now.
But is there a way if they say it twice then they can't talk for awhile?

Keep track of the last message and check if the current message is the same as that, then save the current time and don't let them send a message if enough time hasn't passed since that previously saved point.

Keep track of the last message and check if the current message is the same as that, then save the current time and don't let them send a message if enough time hasn't passed since that previously saved point.
Okay, I will try to figure out how to do that.

NAT3, the maximum number of arguments on a function, is 15. So those extra %chat16-40 are useless.

NAT3, the maximum number of arguments on a function, is 15. So those extra %chat16-40 are useless.
Oh, lol. And I got confused with you and Port, because the avatars are so alike...

Oh, lol. And I got confused with you and Port, because the avatars are so alike...
What are you talking about?

What are you talking about?


And BTW, serverCmd's can only support 16 arguments.
« Last Edit: April 15, 2013, 11:12:08 PM by Plexious »



And BTW, serverCmd's can only support 16 arguments.

The eye colors are totally different. Mine has red eyes, his has pink.

I guess I was told wrong, or maybe someone told me fifteen and forgot about client.

NAT3, the maximum number of arguments on a function, is 15.

Where are you getting that from?


A fix to the 15 argument limit would be to package the function serverCmdMessageSent(%client, %msg).
Unless you have a plan to utilize the other way.