Blockland Forums > Modification Help

Syntax Error [EDIT: CONSOLE ERROR]

Pages: << < (2/3) > >>

Triple Nickels:

serverCmdPlantBrick only has one variable, client. If you want to get info about the planted brick, I suggest doing something like this:


--- Code: ---package BrickPlant {
function serverCmdPlantBrick(%this)
{
$CodeNextBrick=1;
parent::serverCmdPlantBrick(%this);
}
function fxDTSbrick::onPlant(%brick)
{
%ret = parent::onPlant(%brick);
%client = %brick.client;
if(!$codeNextBrick)
return %ret;
$CodeNextBrick=0;
if(%brick.getDownBrick(0).getDatablock().getName() $= "Admin32x32x1Data" && !%client.isAdmin)
{
%brick.delete();
messageClient(%client,'',"You must be an admin to build there!");
return;
}
return %ret;
      }
  };

--- End code ---

I just kinda pasta'd your code onto the end there, so I'm assuming that works.


EDIT: I finally figured out what you were trying to do, and updated my code so that it would work.

MegaScientifical:

You should put the brick check in plantbrick and look up what his ghostbrick is.

Miles Barlow:

UPDATED CODE IN OP

Thanks for the help all you guys, I believe the %downbrick problem was fixed, but this still appears in the console every time I plant a brick; there seems to be a problem with getDataBlock.

--- Quote ---Add-Ons/Brick_AdminPlates/server.cs (73): Unable to find object: '' attempting to call function 'getDataBlock'
BackTrace: ->[PlatePlant]ServerCmdPlantBrick->[BrickPlant]ServerCmdPlantBrick->[DeletionBricks]ServerCmdPlantBrick->[JVS_Content]ServerCmdPlantBrick->[duplicator]ServerCmdPlantBrick->[SAG_MoveMode]ServerCmdPlantBrick->ServerCmdPlantBrick->[VCE_Main]fxDTSBrick::onPlant->[PlatePlant]fxDTSBrick::onPlant


Add-Ons/Brick_AdminPlates/server.cs (24): Unable to find object: '' attempting to call function 'getDataBlock'
BackTrace: ->[PlatePlant]ServerCmdPlantBrick->[BrickPlant]ServerCmdPlantBrick->[DeletionBricks]ServerCmdPlantBrick->[JVS_Content]ServerCmdPlantBrick->[duplicator]ServerCmdPlantBrick->[SAG_MoveMode]ServerCmdPlantBrick->ServerCmdPlantBrick->[VCE_Main]fxDTSBrick::onPlant->[PlatePlant]fxDTSBrick::onPlant->[BrickPlant]fxDTSBrick::onPlant
--- End quote ---


herb:

restart blockland

SpreadsPlague:


--- Quote from: herb on July 22, 2010, 05:37:06 AM ---restart blockland

--- End quote ---

leave coding help and never come back please

Pages: << < (2/3) > >>

Go to full version