Blockland Forums > Modification Help
Need help fixing Iban's Lockpick.
<< < (3/4) > >>
otto-san:

--- Quote from: Nexus on April 17, 2011, 09:29:16 PM ---I haven't really looked at the code, but I assume that you could just force a contentstart event on a door?  That would take like five minutes to script.

--- End quote ---
No, this doesn't work, I've tried it.
Nexus:

--- Quote from: otto-san on April 17, 2011, 11:04:35 PM ---No, this doesn't work, I've tried it.

--- End quote ---

Why wouldn't it work?  ContentStart needs no special permissions to run.  I think it would work fine.  Lemme write it up.


--- Code: ---function CityRPGPicklockImage::onHitObject(%this, %obj, %slot, %col, %pos, %normal)
{
%client = %obj.client;

if(%col.getType() & $TypeMasks::FxBrickObjectType)
{
if($CityRPG::pref::canpicklockadmindoors != 1)
{
if(getrandom(0,3) == 2)
{
%col.processInputEvent("onContentStarted",%client);

commandToClient(%client, 'centerPrint', "\c6You have commited a crime. [\c3Breaking and Entering\c6]", 3);
CityRPG_AddDemerits(%client.bl_id, $CityRPG::demerits::breakingAndEntering);
return;
}
else
{
commandToclient(%client, 'centerprint', "\c6Picking Lock...", 3);
}
}
else
{
commandToclient(%client, 'centerprint', "\c6Lock Is unpickable", 3);
}
}
else if(%col.getType() & $TypeMasks::VehicleObjectType)
{
if(%col.locked)
{
%col.locked = false;
CityRPG_AddDemerits(%obj.client.bl_id, $CityRPG::demerits::grandTheftAuto);
commandToClient(%client, 'centerPrint', "\c6You have committed a crime. [\c3Grand Theft Auto\c6]", 5);
}
}

parent::onHitObject(%this, %obj, %slot, %col, %pos, %normal);
}

--- End code ---
lilboarder32:
I'm not sure that would work Nexus. They might remove the onContentStarted event from the brick. Is there not a function you can just call like %col.startContent(%args); ? I will take a look at the code.

Edit:
function fxDTSBrick::contentStart(%obj, %startType, %startDirection, %text, %client)
Bloxxed:
So I'd need to put that function in there to get the door to open?

Great :/
Nexus:

--- Quote from: lilboarder32 on April 18, 2011, 01:39:11 AM ---I'm not sure that would work Nexus. They might remove the onContentStarted event from the brick. Is there not a function you can just call like %col.startContent(%args); ? I will take a look at the code.

Edit:
function fxDTSBrick::contentStart(%obj, %startType, %startDirection, %text, %client)

--- End quote ---

The point is, if there is no event on the door, why should it open for any reason?  The way mine would work, I think, is if any events that would be triggered by the door opening would also be triggered.  That way, the lockpick could also be used for windows and buttons and odther jvs things.
Navigation
Message Index
Next page
Previous page

Go to full version