Author Topic: Rule Script Not working?  (Read 875 times)

/title
I've done this before, but this time it isn't working.
Any help would be appreciated.

Here is the code:
Code: [Select]
//Name: Rules
//Author: Carbon Zypher


function serverCmdRules(%client)
{
messageClient(%client,'','/c4------------------------RULES------------------------');
messageClient(%client,'','/c6Messages in/c5 VIOLET/c6 will get you perma'd');
messageClient(%client,'','/c6Messages in/c0 RED/c6 will get you banned.');
messageClient(%client,'','/c6Messages in/c3 YELLOW/c6will get you kicked.');
messageClient(%client,'','/c6Messages in/c2 GREEN/c6 will get you a warning.');
messageClient(%client,'','/c2Dont spam. EVENTS OR BRICKS');
messageClient(%client,'','/c2Be nice to other players.');
messageClient(%client,'','/c3Spamming after 1st warning.');
messageClient(%client,'','/c0Spamming after 2nd warning');
messageClient(%client,'','/c5Admin abusal.');
messageClient(%client,'','/c2Being a downright idiot. THIS MEANS YOU DAMEON');
messageClient(%client,'','/c3Idiocity after 1st warning');
messageClient(%client,'','/c0Idiocity after 2nd warning');
messageClient(%client,'','/c2Asking for admin.');
messageClient(%client,'','/c3Asking for admin a 2nd time');
messageClient(%client,'','/c0Asking for admin a 3rd time');
messageClient(%client,'','/c4------------------------RULES------------------------');
}

what isn't working?


also your \c color codes are backwards.


you have : /c#
it should be : \c#

You need to put your msg in actual quotation marks. "Msg"

Elm is right. In Torque, apostrophies are not the same as quotes. Apostrophies create tagged strings, they're useful for data that gets sent many times to a client because it will assign a number to that text value and transmit the number instead, which is much faster.

I use single quotes for my messageAll/Client calls all the time, it works fine

The problem (one of them at least, there may be more) is here:
messageClient(%client,'','/c6Messages in/c5 VIOLET/c6 will get you perma'd');
the ' in perma'd is ending the string, it sees a random d, and then it's starting another string ); and stuff after it
Replace it with this:
messageClient(%client,'','/c6Messages in/c5 VIOLET/c6 will get you perma\'d');

I use single quotes for my messageAll/Client calls all the time, it works fine
You probably shouldn't, it tags it as I posted above which is absolutely useless for 99% of situations, it just fills the buffer with useless tags.

It's what I've been doing since I started with Torque 5-6 years ago, and this is the first time I've seen someone suggest otherwise.
Sure it may be better to do otherwise, but I haven't seen any issues arise from it or seen anyone suggest differently.

But the point I was making earlier is that it's not preventing the script from working.

Well, it's faster, yes. But if you plan to use color codes, you should never use tagged strings; the color codes don't cause them to be assigned a different number: it just doesn't update.

If I recall correctly, which almost never happens, tagged strings are a short value, meaning there's a maximum of 65536 spaces. Thus, we probably shouldn't just abuse them for simple messages because as Trinick said, it'll just waste spaces that other add-ons could have used.

It's what I've been doing since I started with Torque 5-6 years ago, and this is the first time I've seen someone suggest otherwise.
Sure it may be better to do otherwise, but I haven't seen any issues arise from it or seen anyone suggest differently.
Wouldn't advise it. No benefit to using it for strings you aren't gonna transmit multiple times, you're just telling the client to keep them in memory for no reason, and you might risk stumbling onto that tagged string capitalization bug.