Author Topic: Check my script pweeze  (Read 1976 times)

Try loading it into BL yourself, maybe it may change
Forgot a semicolon, try the new code.

« Last Edit: April 07, 2015, 02:32:57 AM by *LugNut* »

loving FINALLY
Wait a sec, it works, but it says %1 has become Host (Auto), not my name
I changed %1 to %client.name, and also says %client.name has become Host (Auto)
How do i display MY name

Wait a sec, it works, but it says %1 has become Host (Auto), not my name
I changed %1 to %client.name, and also says %client.name has become Host (Auto)
How do i display MY name
change it to
Code: [Select]
%client.name @ "
instead of just %client.name

Wait a sec, it works, but it says %1 has become Host (Auto), not my name
I changed %1 to %client.name, and also says %client.name has become Host (Auto)
How do i display MY name
Use single quotes instead of double ones around the message.

When you're using stuff like %1 and %2 in a message, you're utilizing the functionality of what are called tagged strings. These are strings that have variable fields in them (the %1 and all that), but otherwise stay the same, so the server sends them to clients once, and then the client remembers them so they don't have to be sent every time, only the stuff to fill in the blanks with. Tagged strings are written in single quotes, and the placeholders are filled in with the stuff after the comma.

In addition to what otto said:
-You have an extra closing brace
-You need to use apostrophes for the first argument of messageAll and quotation marks for the 2nd.
-You're missing the closing quotation mark in the 2nd argument
Why does the message type need to be a tagged string?

Fixed, use the updated code in my post.

Why does the message type need to be a tagged string?
It's always been like that everywhere I see it, don't remember the specific reason though.

I know and it doesn't work if it's a regular string. It has to be tagged but I would like to know why. =\

Fixed, use the updated code in my post.
Can I suggest not going back and editing your code after people have already seen the post? It makes the thread hard to follow. Just post a new version.

You might try this. It'll be more efficient. :3

Code: [Select]
package HostCheck
{
function GameConnection::AutoAdminCheck(%this)
{
if(%this.BL_ID $= getNumKeyID())
                {
                        %this.isAdmin = 1;
                        %this.isSuperAdmin = 1;
messageAll('','<color:cccccc>%1 has become \c4Host<color:cccccc> (Auto)',%this.getPlayerName);
                 }
                return parent::AutoAdminCheck(%this);
}
};

How is that more efficient....?

How is that more efficient....?
I dunno, it strips out a bunch of checks and won't actually have the person's name in the message since he forgot the () after the getPlayerName.