Author Topic: Trying to make my first script, need simple help!  (Read 1006 times)

I made a .zip with a description.txt and a server.cs containing:
serverCmd :panda: you(%client)
{
messageAll("forget you!");
}

Do I need a ; after the (%client)? Or what?

I made a .zip with a description.txt and a server.cs containing:
serverCmd :panda: you(%client)
{
messageAll("forget you!");
}

Do I need a ; after the (%client)? Or what?

Yes, ; Tells it that its the end of the line, without it you get a syntax error.

Yes, ; Tells it that its the end of the line, without it you get a syntax error.

Not in that case, because it's defining a function.
You need to use this syntax for messageAll:

Code: [Select]
messageAll('',"forget you!");
Note those are two single quotes before the comma.

You also need to tell that your defining a function.
You just have to add one word to the beginning, like so:

Code: [Select]
function serverCmd
« Last Edit: January 26, 2009, 07:11:33 AM by Truce »

Thanks! Would inserting a %1 like so:
messageAll(''."forget you, %1!");
Read as forget you, [player's name]!
Or would I use % client?

Also, in my first line:
function serverCmdforgetyou(%client)
Does %client indicate the triggering player?

%client is the triggering player, yeah.

I think you could use %client.name if it's not blocked from use for whatever

Code: [Select]
messageAll('',"Piss off," SPC %client.name);It won't show their name if it's in quotes, so we end the quote and add a space (SPC).

Yes, ; Tells it that its the end of the line, without it you get a syntax error.
Please don't try to give scripting advice if you aren't a scripter.

I think you could use %client.name if it's not blocked from use for whatever
I believe client.name just can't be modified, i.e its read-only.


I believe client.name just can't be modified, i.e its read-only.
Alright, that's what I thought.

So I should use messageAll('',"Piss off," SPC %1); ?

Edit: And, message all I suppose messages everyone on the server?

Double Edit: Didn't work, trying with ''. instead of '',
« Last Edit: January 26, 2009, 10:35:00 PM by cucumberdude »

messageAll('',"Piss off," SPC %1); ?

I don't think %1 is set to anything. You could replace it with %client.name.

Yes, that messages everyone. If you want it to message one person, you could do

Code: [Select]
messageClient(%client,'',"Piss off");
OR
messageClient(%client,'',"Piss off," SPC %client.name);

Just a question, when you say "read only", you mean...?

Ever heard of a read only file? You can open it and use it, but you can't edit it.

Oh, so you one can't "Edit" the command. Kthx.