Blockland Forums > Modification Help

clientsided stuff

Pages: (1/2) > >>

cucumberdude:

I'm curious as to how clientside stuff works.

Let's say I create a function

--- Code: ---function saywords(%words)
{
     echo('Words: ' @ %words);
}

--- End code ---
How does TS know that I want this executed clientside? Is there a different function syntax clientside?

Also, do variables work exactly the same way clientside? Or are there differences?

Thanks.

Kalphiter:

If you execute that stuff on a pure client, it will be client-sided.

If you execute stuff on a pure server, it will be server-sided.

If you execute it on a hybrid (hosting from the client), it will be both.

When you start a server, code that makes it able to be a server is loaded.
When you load a client, code that makes it a client and not a server is loaded.

thaky:

function saywords(%words)
{
     echo('Words: ' @ %words);
}

//===================
//You would have to make /(whatever you want)
//===================

//so...

function clientcmd[whatever](%client, %words)
{
      saywords("Hello");
}

//That would make it say:
//
//Words: Hello
//
//It would say that in the client's console.

cucumberdude:


--- Quote from: Kalphiter on March 15, 2011, 10:01:22 PM ---If you execute that stuff on a pure client, it will be client-sided.

If you execute stuff on a pure server, it will be server-sided.

If you execute it on a hybrid (hosting from the client), it will be both.

When you start a server, code that makes it able to be a server is loaded.
When you load a client, code that makes it a client and not a server is loaded.

--- End quote ---
So if I put that code in a server.cs, upon joining a server I can use the function?

Can you be a tad more specific? I'm new to all this clientside business.

DrenDran:


--- Quote from: thaky on March 15, 2011, 10:26:11 PM ---function saywords(%words)
{
     echo('Words: ' @ %words);
}

//===================
//You would have to make /(whatever you want)
//===================

//so...

function clientcmd[whatever](%client, %words)
{
      saywords("Hello");
}

//That would make it say:
//
//Words: Hello
//
//It would say that in the client's console.

--- End quote ---
I'm not sure what you're trying to do, so I can't be sure, but it looks like you don't know what you're talking about.

Serverside refers to a task that should be carried out on a server, and as such, clientside refers to a task that should be carried out on a client, serverside scripting is put in a server.cs file or a file that is executed by one, and likewise, clientside material in a client.cs or it's executions.

Pages: (1/2) > >>

Go to full version