Author Topic: Need help fixing Iban's Lockpick.  (Read 1544 times)

The lockpick is a stupid idea because no matter what course of action you use there is some gimmicky way to stop it.

Code:
%door.contentStart(...);

Events:
onContentStarted -> barrier -> setColliding [true]
onContentStopped -> barrier -> setColliding [false]
onContentStuck -> StuckPlayers -> InstantRespawn


That way, even if you do force the door open, it's still going to keep the intruder out.

The only way around this is to make rules saying "Do not safeguard your doors," which is absolutely outrageous. If your server can be griefed like that, you're not doing a very good job at making a server.

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.
Yours doesn't work, just tested.

The lockpick is a stupid idea because no matter what course of action you use there is some gimmicky way to stop it.

Code:
%door.contentStart(...);

Events:
onContentStarted -> barrier -> setColliding [true]
onContentStopped -> barrier -> setColliding [false]
onContentStuck -> StuckPlayers -> InstantRespawn


That way, even if you do force the door open, it's still going to keep the intruder out.

The only way around this is to make rules saying "Do not safeguard your doors," which is absolutely outrageous. If your server can be griefed like that, you're not doing a very good job at making a server.
Agh, I don't get you, what do you mean 'safegaurd' and all that?

Bump. I still need some help, but with a different problem now.
I've found a work around, by fakekilling the block, the only problem is that.
It fakekills the any brick, but not a JVS door.
It gives demerits if you hit a brick, but not a door.

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

if(%col.getType() & $TypeMasks::FxBrickObjectType)
{
if(getrandom(0,3) == 2)
{
if (!isObject(%col.shape))
{
%col.fakeKillBrick(1, 3);
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 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);
}

Thanks if you can help.


Well, you COULD loop through ContentBricksSO and see if %col is in it, and if it is fakekill it and if not, don't.

Something like this, maybe.

Code: [Select]
for(%i = 0; %i < ContentBricksSO.bricks;%i++)
{
  if(%col == ContentBricksSO.brick[%i])
  {
    %yes = 1;
    break;
  }
}
if(%yes)
  %col.fakeKillbrick(1, 3);

adapt to your code.
« Last Edit: April 23, 2011, 04:46:38 PM by otto-san »

Code: [Select]
for(%i = 0; %i < ContentBricksSO.bricks;%i++)
{
  if(%col == ContentBricksSO.brick[%i])
    %yes = 1;
    break;
}
if(%yes)
  %col.fakeKillbrick(1, 3);
This wont work, torque will read it as
if(%col == ContentBrickSO.brick[%I])
     %yes = 1;
break;
And will break on the first brick.You need to add brackets to it.