Author Topic: fxDtsBrick::onPlant porblems  (Read 2272 times)

It dose not work.
Code: [Select]
package atmbrickPackage
{
function fxDtsBrick::onPlant(%brick)
{
if(%brick.getDatablock().brickType == PitroRPATMBrickData)
{
if(PitroRPData.getData(%client.bl_id).valueMoney < mFloor($PitroRP::prices::ATM))
{
messageClient(%client, '', "\c6You need at least \c3$" @ mFloor($PitroRP::prices::ATM) SPC "\c6in order to plant ATM!");

%brick.schedule(0, "delete");

return;
}

messageClient(%client, '', "\c6You have paid \c3$" @ mFloor($PitroRP::prices::ATM) @ "\c6 to plant this ATM.");

PitroRPData.getData(%client.bl_id).valueMoney -= mFloor($PitroRP::prices::ATM);
}
}
};
activatePackage(atmbrickPackage);
« Last Edit: May 25, 2010, 11:27:36 PM by pitfall »

Tom

Try
Code: [Select]
if(%brick.getDatablock().getName() $= "PitroRPATMBrickData")

Try
Code: [Select]
if(%brick.getDatablock().getName() $= "PitroRPATMBrickData")
No.


Beggars can't be choosers
No i mean it dose not work. It deletes the brick when i place it.

Show the brick code.

Code: [Select]
datablock fxDTSBrickData(PitroRPATMBrickData : brick2x4FData)
{
category = "PitroRP";
subCategory = "PitroRPG Infoblocks";

uiName = "ATM Brick";

PitroRPBrickType = 2;
PitroRPBrickAdmin = false;

triggerDatablock = PitroRPInputTriggerData;
triggerSize = "2 4 1";
trigger = 0;
};

Code: [Select]
if(%brick.getDatablock().PitroRPBrickType == 2)Or since Iban's CityRPG mod has other bricktypes that = 2, maybe add in
Code: [Select]
PitroRPATMBrickType = 2;and
Code: [Select]
if(%brick.getDatablock().PitroRPATMBrickType == 2)
« Last Edit: May 25, 2010, 10:56:51 PM by Wicked »

Great thanks, it dose not delete its self on plant, but now the bank functions don't work. It still dose not take money when its planted.
Edit:
Code: [Select]
$PitroRP::prices::ATM = 5000;So don't call me stupid.
Also i did NOT in any way mess with the original bank functions.

hey
hey
where did this %client variable come from, I don't see that being defined anywhere

First, add a parent to it so it wont break anything else.
Code: [Select]
Parent::onPlant(%brick);Then, get the client that owns the brick. (Not sure if it works if it really isn't planted yet. May be fixed with a scheduled check.)
Code: [Select]
%client = getBrickGroupFromObject(%brick).client;