Blockland Forums > Modification Help
not work %1 in script.
Cubelands:
--- Code: ---function blah::blah(%blah, %blah)
{
//%blah.player.%name,%1
}
I create script. I want know if this player name as %name correct? I put in event empty box as %1.
--- End code ---
%1 not work, how I am going make it work?
otto-san:
Wait.
What are you trying to do exactly?
First off, the entire inside of your function is commented out, and moreover, what's commented out makes no real sense at all.
Second, I don't know what would be using the class 'blah', but the 'blah' method for it has to be called.
Third, you have two different variables with the exact same name. That won't work.
--- Code: ---function blah::blah(%this, %blah)
{
%1 = %blah.name; //I have no idea what you're actually trying to do. :(
//do some stuff with %1 since that variable has been set to the client's name
}
--- End code ---
Headcrab Zombie:
--- Quote from: Kalphiter on October 06, 2011, 11:13:23 PM ---I doubt you're gonna get much help if you have all that obfuscation
--- End quote ---
Cubelands:
Something like bottomprint and centerprint same chatmgs. They are worked with %1, but in my script not work.
Amade:
--- Quote from: Headcrab Zombie on October 07, 2011, 04:08:45 PM ---
--- Quote from: Kalphiter on October 06, 2011, 11:13:23 PM ---I doubt you're gonna get much help if you have all that obfuscation
--- End quote ---
--- End quote ---
It's not like he's doing it on purpose.
What I think you're trying to do is use "tagged strings". A tagged string looks like this:
--- Code: ---$pref::server::WelcomeMessage = 'Welcome to Blockland, %1.'
--- End code ---
In order to fill in the "tags", such as %1, you specify them after the tagged string when messaging a client.
--- Code: ---messageClient(%client, 'ChatMessage', 'Welcome to Blockland, %1.', %client.name);
--- End code ---
However, you can do the same thing in a different way like this:
--- Code: ---messageClient(%client, 'ChatMessage', "Welcome to Blockland, " @ %client.name @ ".");
--- End code ---
If you just want the client's name, though:
--- Code: ---%name = %client.name;
--- End code ---