Author Topic: not work %1 in script.  (Read 1128 times)

Code: [Select]
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.
%1 not work, how I am going make it work?

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: [Select]
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
}

I doubt you're gonna get much help if you have all that obfuscation

Something like bottomprint and centerprint same chatmgs. They are worked with %1, but in my script not work.

I doubt you're gonna get much help if you have all that obfuscation
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: [Select]
$pref::server::WelcomeMessage = 'Welcome to Blockland, %1.'
In order to fill in the "tags", such as %1, you specify them after the tagged string when messaging a client.
Code: [Select]
messageClient(%client, 'ChatMessage', 'Welcome to Blockland, %1.', %client.name);
However, you can do the same thing in a different way like this:
Code: [Select]
messageClient(%client, 'ChatMessage', "Welcome to Blockland, " @ %client.name @ ".");
If you just want the client's name, though:
Code: [Select]
%name = %client.name;

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: [Select]
$pref::server::WelcomeMessage = 'Welcome to Blockland, %1.'
In order to fill in the "tags", such as %1, you specify them after the tagged string when messaging a client.
Code: [Select]
messageClient(%client, 'ChatMessage', 'Welcome to Blockland, %1.', %client.name);
However, you can do the same thing in a different way like this:
Code: [Select]
messageClient(%client, 'ChatMessage', "Welcome to Blockland, " @ %client.name @ ".");
If you just want the client's name, though:
Code: [Select]
%name = %client.name;
Same thing vce script?
%name same as %cient.name simliar %1 code?


I will get home and I ll pm you of my scripts.
I thought headcrab zombie nice guy? But he not...

I thought headcrab zombie nice guy? But he not...

All he was saying is you can't create a topic with really hard to understand code like "blah::blah" that gives no hints to what you mean and expect everyone to understand.

« Last Edit: October 07, 2011, 11:12:24 PM by Cubelands »

You speak like a foreigner, where are you from?

Or you are young...

You speak like a foreigner, where are you from?

Or you are young...
He's deaf, american sign language seems to have dramatically different sentence construction than english.

He's deaf, american sign language seems to have dramatically different sentence construction than english.

Didn't know that, weird. How do you know he is deaf though, did he say it in a thread or something?

Didn't know that, weird. How do you know he is deaf though, did he say it in a thread or something?
common knowledge type thing.

Hey amade. I posted code here. you can read it. there something wrong what I did?