| Blockland Forums > Modification Help |
| clientsided stuff |
| << < (2/2) |
| cucumberdude:
--- Quote from: DrenDran on March 15, 2011, 11:03:46 PM ---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. --- End quote --- That's essentially what I wanted to know. So anything I put in a client.cs is clientsided - I don't want the functions of client.cs getting mixed with the same named functions of the server.cs, which is packaged with it. That should be okay right? As far as thaky's code goes, I think he was trying to show me how to do a clientside slash command. Which I don't need, but thanks anyways. |
| Iban:
why why WHY WHY WHY WHY WHY WHY WHY WHY WHY WHY WHY WHY are you naming the stuff for both client and server sided functions the same? There is no reason to do that, EVER. |
| cucumberdude:
:/ 'Nother question then, if I make a clientside variable ($dontshowtheserver) in client.cs, then connect to a server, can the server get $dontshowtheserver? Or is the variable only accessible clientside? |
| Iban:
--- Quote from: cucumberdude on March 16, 2011, 01:27:33 AM ---:/ 'Nother question then, if I make a clientside variable ($dontshowtheserver) in client.cs, then connect to a server, can the server get $dontshowtheserver? Or is the variable only accessible clientside? --- End quote --- the latter. here's how ZAPT communicates a value in a meaningful way. GameMode_ZAPT/scripts/package.cs --- Code: ---function GameConnection::autoAdminCheck(%client) { %client.hasZAPT = false; %client.zaptVersion = 0; %client.zombieHudCells = -1; commandToClient(%client, 'ZAPT_MOD_Resgister', $ZAPT::Version, ZombieMutations.getMutationList()); return parent::autoAdminCheck(%client); } --- End code --- GameMode_ZAPT/client.cs --- Code: ---function clientCmdZAPT_MOD_Resgister(%version, %mutations) { echo("\c5ZAPT has been registered with this server."); if(%version > $ZAPT_Client::Version) { echo("\c2 +- Warning: You are running an outdated version of ZAPT."); } else if(%version < $ZAPT_Client::Version) { echo("\c2 +- Warning: The server is running an outdated version of ZAPT."); } %x = getWord(getRes(), 0); %x -= 275; %i = mFloor(%x / 205); commandToServer('ZAPT_Register', $ZAPT_Client::Version); commandToServer('ZAPT_CellCount', %i); ZAPTC_addMinigamePanels(); ZAPTC_addMutations(%mutations); } --- End code --- GameMode_ZAPT/scripts/functions.cs --- Code: ---function serverCmdZAPT_Register(%client, %version) { %client.hasZAPT = true; %client.zaptVersion = %version; } --- End code --- |
| cucumberdude:
Great, thanks. |
| Navigation |
| Message Index |
| Previous page |