K well anyway now I got it to work but when I hammer the tree and try to spawn it will not give any material.
//MaterialBuild
package buildstuff
{
function hammerProjectile::oncollision(%this,%obj,%col,%fade,%pos,%normal)
{
if(%col.getDatablock() $= "brickPineTreeData")
{
%obj.client.material++;
messageClient(%obj.client,'Material : %1',%obj.client.material);
}
Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}
function serverCmdPlantBrick(%client)
{
if(%client.material <= 0)
{
messageClient(%client,'','Not enough material! Material : %1',%client.material);
return;
}
if(%client.ghostbrick.getDatablock() $= "brickPineTreeData")
%client.material-=100;
else
%client.material--;
messageClient(%obj.client,'Material : %1',%obj.client.material);
Parent::serverCmdPlantBrick(%client);
}
};
ActivatePackage(buildstuff);
function serverCmdGiveMaterial(%client,%victim,%amount)
{
if(!%client.isSuperAdmin)
return;
%victim = findClientByBL_ID(%victim);
%victim.material+=%amount;
messageClient(%victim,'Given %1 by %2',%client.name,%amount);
}
P.S. Stop's you from getting material?