1
Modification Help / Re: getDatablock returning Nil
« on: July 10, 2009, 11:40:02 AM »
Thanks, I fixed it.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
How would I revert the ID back to a name? Could I just remove nametoID? When I remove it though, it doesn't seem to work.Code: [Select]%data = TreeBrickData.getID();
$StrName[%data] = "TreeBrickData";
$StrMat[%data] = "Root";
$StrCost[%data] = 1;
$StrConfirm[%data] = "You planted a tree!";
You have defined $StrNameTreeBrickData as a variable by the array. Your echoes are looking for $StrName1032.
For one, I think it's fxDtsBrick::onPlant(%data,%brick) not just %brick.Anyway, when I place the brick it recognizes it as the datablock as an ID but all of the other fields do not compute.
$StrName["TreeBrickData"] = "TreeBrickData";
$StrMat["TreeBrickData"] = "Root";
$StrCost["TreeBrickData"] = 1;
$StrConfirm["TreeBrickData"] = "You planted a tree!";
package Lolplant
{
function fxDtsBrick::onPlant(%brick)
{
%client = getBrickGroupFromObject(%brick).client;
%brickdatablock = %brick.getDataBlock();
%type = %brick.getDataBlock();
if(%brickdatablock $= nameToID($StrName[%type]) && %client.quantity[$StrMat[%type]] >= $StrCost[%type])
{
echo(%type);
echo($StrConfirm[%type]);
echo($StrCost[%type]);
echo($StrMat[%type]);
%client.Leftprint("\c1" @ $StrConfirm[%type] @ "");
%client.quantity[$StrMat[%type]] -= $StrCost[%type];
%client.quantity["Weight"] -= $StrCost[%type];
parent::onPlant(%brick);
return;
}
}
};
activatepackage(Lolplant);
getDatablock()*Yep, I found a way around it though which is more efficient. Thanks to you both.
if you didn't fix that.
Disregard this.Ok....?
Hello, my name is bob.All of the other args I didn't not set have Myname then a zero after it.
function serverCmdL(%client,%m,%m2,%m3,%m4,%m5,%m6,%m7,%m8,%m9,%m10,%m11,%m12,%m13,%m14,%m15,%m16,%m17,%m18,%m19,%m20)
{
%position=%client.player.position;
InitContainerRadiusSearch(%position,15,$TypeMasks::PlayerObjectType);
$LocalMsgString='\c7%1 says:\c6 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %16 %16 %17 %18 %19 %20';
while((%targetObject=containerSearchNext()) !$= 0)
{
%c = %targetObject.client;
messageClient(%c,'',$LocalMsgString,%client.name,%m,%m2,%m3,%m4,%m5,%m6,%m7,%m8,%m9,%m10,%m11,%m12,%m13,%m14,%m15,%m16,%m17,%m18,%m19,%m20);
}
}