Author Topic: Coding questions V2  (Read 567 times)

After taking wallet's class, I fell I know alot more about blockland scripting and the torque language, but there are still some things that bug me.

How to i combine two variables into one?
Like if I did
function servercmdCombine(%client, %var1, %var2)

And typed /combine Hi There
How would I make it form a new variable called Hithere?


Another problem I had was servercmds not supporting easy word manipulation. I want to make a command such as /createteam cool club, it would only make the team named cool.

I want it so you do function servercmdCreateteam(%client, %name1, %name2) and it keeps spaces and creates a new string called %name3 by combining name 1 and 2.

%newvariable = %var1 @ %var2;

If I remember correctly.

@ will concatenate without a space
"Hi" @ "There" becomes "HiThere"

SPC will concatenate with a space
"Hi" SPC "There" becomes "Hi There"

Theres a few more, I think, but I don't remember them.

@ will concatenate without a space
"Hi" @ "There" becomes "HiThere"

SPC will concatenate with a space
"Hi" SPC "There" becomes "Hi There"

Theres a few more, I think, but I don't remember them.
There's TAB for a new field and NL for a new line.

After taking wallet's class, I fell I know alot more about blockland scripting and the torque language, but there are still some things that bug me.

How to i combine two variables into one?
Like if I did
function servercmdCombine(%client, %var1, %var2)

And typed /combine Hi There
How would I make it form a new variable called Hithere?


Another problem I had was servercmds not supporting easy word manipulation. I want to make a command such as /createteam cool club, it would only make the team named cool.

I want it so you do function servercmdCreateteam(%client, %name1, %name2) and it keeps spaces and creates a new string called %name3 by combining name 1 and 2.
Dunno,I suck at it myself

Dunno,I suck at it myself
Then why post? Also I'm posting to point out that his post was unneeded.

Another problem I had was servercmds not supporting easy word manipulation. I want to make a command such as /createteam cool club, it would only make the team named cool.

I want it so you do function servercmdCreateteam(%client, %name1, %name2) and it keeps spaces and creates a new string called %name3 by combining name 1 and 2.

your going to want something like this:
Code: [Select]
function serverCmdCreateteam(%client, %name1, %name2, %name3 )
  {
    %teamName = %name1;
    if (%name2 !$= "")
      %teamName = %teamName SPC %name2;
    if (%name3 !$= "")
      %teamName = %teamName SPC %name3;

.... stuff to actually create the team goes here...

   }

your going to want something like this:
Code: [Select]
function serverCmdCreateteam(%client, %name1, %name2, %name3 )
  {
    %teamName = %name1;
    if (%name2 !$= "")
      %teamName = %teamName SPC %name2;
    if (%name3 !$= "")
      %teamName = %teamName SPC %name3;

.... stuff to actually create the team goes here...

   }

:cookieMonster: