Blockland Forums > Modification Help
OnClientEnter message not showing up!
Lugnut:
--- Quote from: Jasa0 on April 01, 2012, 01:48:43 PM ---
--- Code: ---package NoBaseplates
{
function GameConnection::onClientEnterGame(%client)
{
Parent::onClientEnterGame(%client);
messageClient(%client,'',"\c4This server is running the No Baseplates for Non Admins script. This means non-admins cannot build any brick in the baseplate section.");
}
function fxDTSBrick::OnPlant(%this)
{
parent::OnPlant(%this);
%client = %this.getGroup().client;
if(%this.getDataBlock().category $= "Baseplates" && !%client.isAdmin && %this.isPlanted)
{
MessageClient(%client, '', "\c6Non-admins aren't allowed to plant any bricks in the baseplate section.");
return %this.delete();
}
}
};
ActivatePackage(NoBaseplates);
--- End code ---
Rewrote the code. Not sure if this works.
--- End quote ---
i think there's a %obj variable in onPlant..?
otto-san:
--- Quote from: Lugnut1206 on April 01, 2012, 02:25:42 PM ---i think there's a %obj variable in onPlant..?
--- End quote ---
only on the fxDTSBrickData version
Port:
Here's a more efficient version that doesn't create a new object and delete it every time a non-admin tries to plant a baseplate:
--- Code: ---package noBasePlates
{
function gameConnection::onClientEnterGame(%this)
{
parent::onClientEnterGame(%this);
messageClient(%this, '', "\c4This server is running the No Baseplates for Non Admins script. This means non-admins cannot build any brick in the baseplate section.");
}
function serverCmdPlantBrick(%cl)
{
if(!isObject(%tb = %cl.player.tempBrick))
{
parent::serverCmdPlantBrick(%cl);
return;
}
if(%tb.getDataBlock().category $= "Baseplates" && !%cl.isAdmin)
{
%cl.centerPrint("\c6Non-admins are not allowed to plant any bricks in the baseplate section.", 2);
return;
}
parent::serverCmdPlantBrick(%cl);
}
};
activatePackage("noBasePlates");
--- End code ---
Treynolds416:
Enough with the loving polls goddamn