Blockland Forums > Modification Help
Breaking onActivate
jes00:
I used
--- Code: ---function fxDTSBrick::onActivate(%obj, %player, %client, %pos, %vec)
{
%data = %obj.getDataBlock();
if(%data.getid() == SellBrickData.getId())
{
messageAll('', "\c2" @ %client.name @ " clicked the test brick!");
}
Parent::OnActivate(%obj, %player, %client, %pos, %vec);
}
--- End code ---
and it breaks everything else using the same function. Please help D:
cheese6:
--- Quote from: jes00 on November 08, 2011, 12:41:08 PM ---I used
--- Code: ---package test {
function fxDTSBrick::onActivate(%obj, %player, %client, %pos, %vec)
{
%data = %obj.getDataBlock();
if(%data.getid() == SellBrickData.getId())
{
messageAll('', "\c2" @ %client.name @ " clicked the test brick!");
}
Parent::OnActivate(%obj, %player, %client, %pos, %vec);
}
};activatepackage(test);
--- End code ---
--- End quote ---
cough cough package it cough cough
jes00:
--- Quote from: cheese6 on November 08, 2011, 12:47:31 PM ---cough cough package it cough cough
--- End quote ---
*cough* *cough* It's not in the same .cs as the brick *cough* *cough*
cheese6:
--- Quote from: jes00 on November 08, 2011, 12:48:43 PM ---*cough* *cough* It's not in the same .cs as the brick *cough* *cough*
--- End quote ---
just test it ;_;
jes00:
--- Quote from: cheese6 on November 08, 2011, 12:56:24 PM ---just test it ;_;
--- End quote ---
................... Thank you Cheese.
Though I did need to do this instead
--- Code: ---package JunkTrunk
{
function fxDTSBrick::onActivate(%obj, %player, %client, %pos, %vec)
{
%data = %obj.getDataBlock();
if(%data.getid() == SellBrickData.getId())
{
messageAll('', "\c2" @ %client.name @ " clicked the test brick!");
}
else
{
Parent::OnActivate(%obj, %player, %client, %pos, %vec);
}
}
};
activatePackage(JunkTrunk);
--- End code ---
EDIT: ............ IT STOPPED WORKING D: