Author Topic: Fixing the Lockpick  (Read 1884 times)

Trying to fix the City RPG lockpick, I'm not sure what is up with it, but I'm assuming that because from the JVS change, it's broke the lockpick
Here's the part of the code I think which is going wrong.
Code: [Select]
// Section 2.1 : Visual Functionality
function CityRPGPicklockImage::onPreFire(%this, %obj, %slot)
{
%obj.playThread(2, "armAttack");
}

function CityRPGPicklockImage::onStopFire(%this, %obj, %slot)
{
%obj.playThread(2, "root");
}

function CityRPGPicklockImage::onHitObject(%this, %obj, %slot, %col, %pos, %normal)
{
if(%col.getType() & $TypeMasks::FxBrickObjectType)
{
%client = %obj.client;
%brickData = %col.getDatablock();
if(isObject(%col.door) && %col.door.closed)
{
if(getRandom(0, 3) > 2)
{
for(%i = 0; %col.eventInput[%i] !$= "" && !%doorPath; %i++)
{
if(%col.eventOutput[%i] $= "doorOpen")
%doorPath = %col.eventOutputParameter[%i, 2];
}

switch(%doorPath)
{
case 0: %doorResult = %col.doorOpenCW();
case 1: %doorResult = %col.doorOpenCCW();
default: %doorResult = %col.doorOpen();
}

%col.schedule(3000, "doorClose");  //Is this the problem?

if(%doorResult == 1)
{
%col.schedule(3000, "doorClose"); //Is this the problem?

commandToClient(%client, 'centerPrint', "\c6You have commited a crime. [\c3Breaking and Entering\c6]", 3);
CityRPG_AddDemerits(%client.bl_id, $CityRPG::demerits::breakingAndEntering);
}
else
{
commandToClient(%client, 'centerPrint', "\c6You have commited a crime. [\c3Attempted Breaking and Entering\c6]", 3);
CityRPG_AddDemerits(%client.bl_id, $CityRPG::demerits::attemptedBnE);
}
}
else
commandToClient(%client, 'centerPrint', "\c6Picklocking attempt failed", 1);
}
}
else if(%col.getType() & $TypeMasks::VehicleObjectType)
{
if(%col.locked)
{
%col.locked = false;
CityRPG_AddDemerits(%obj.client.bl_id, $CityRPG::demerits::grandTheftAuto);
commandToClient(%obj.client, 'centerPrint', "\c6You have committed a crime. [\c3Grand Theft Auto\c6]", 5);
}
}

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

Second part is the variables.
Code: [Select]
$JVS::Types::doorAnimationLengthClose = 833;
$JVS::Types::doorAnimationLengthOpen = 833;
$JVS::Types::doorAnimationNameCloseCW = "closeCW";
$JVS::Types::doorAnimationNameCloseCCW = "closeCCW";
$JVS::Types::doorAnimationNameOpenCW = "openCW";
$JVS::Types::doorAnimationNameOpenCCW = "openCCW";
$JVS::Types::doorDatablockBrick = "doorBrickUnbreakable";
$JVS::Types::doorDatablockDebris = "doorDebrisSecurity";
$JVS::Types::doorDatablockExplosion = "doorExplosionSecurity";
$JVS::Types::doorDatablockProjectile = "doorProjectileSecurity";
$JVS::Types::doorDatablockShape = "doorShapeSecurity";
$JVS::Types::doorDatablockSoundClose = "doorSoundCloseSecurity";
$JVS::Types::doorDatablockSoundOpen = "doorSoundOpenSecurity";
$JVS::Types::doorGroups = 4;
$JVS::Types::doorGroupColor0 = "color1";
$JVS::Types::doorGroupColor1 = "color2";
$JVS::Types::doorGroupColor2 = "color1";
$JVS::Types::doorGroupColor3 = "color1";
$JVS::Types::doorGroupName0 = "door";
$JVS::Types::doorGroupName1 = "panels";
$JVS::Types::doorGroupName2 = "knobs";
$JVS::Types::doorGroupName3 = "bars";
$JVS::Types::doorName = "Unbreakable Door";
$JVS::Types::doorSearches = 1;
$JVS::Types::doorSearchBox0 = 1.9 SPC 1.9 SPC 2.80;
$JVS::Types::doorSearchPositionCCW0 = 0 SPC -1.2 SPC 0;
$JVS::Types::doorSearchPositionCW0 = 0 SPC 1.2 SPC 0;
$JVS::Types::doorSize = 1 TAB 4 TAB 15;
$JVS::Types::doorSoundDelayClose = 650;
$JVS::Types::doorSoundDelayOpen = 0;
$JVS::Types::doorSubCategory = "CityRPG Doors";
I think it's the second part with the $JVS::Types::doorAnimationNameCloseCW = "closeCW";
Can anyone help me?

Shouldn't the parts that have "DoorClose" be changed to "ContentStop", or am I just being crazy?

Shouldn't the parts that have "DoorClose" be changed to "ContentStop", or am I just being crazy?
Tried, doesn't work.


Re-Bump

Though I dont think you should try and "fix" CityRPG content. Its a bad mod anyways.

DO NOT FIX THE LOCKPICK!

I've been in a server where someone 'fixed' it, and so many noobs were busting down locked doors and stuff that you really want locked that i just left. This would bring a whole new level of noobdom.

DO NOT FIX THE LOCKPICK!

I've been in a server where someone 'fixed' it, and so many noobs were busting down locked doors and stuff that you really want locked that i just left. This would bring a whole new level of noobdom.

You are dumb

The new way JVS works is with content, so you need to change the dooropen/close with the proper content commands.
These are the new events used.
Code: [Select]
registerOutputEvent("fxDTSBrick", "contentStop", %string TAB "string 200 72", 1);
registerOutputEvent("fxDTSBrick", "contentStart", %string TAB "list CW 0 CCW 1" TAB "string 200 72", 1);

Another way to do this would be to simply fakekill the door, similar to how the baton does.  I believe the baton still works.

Also: Does your version of CityRPG have issues with selling items?  If so, I know what version you have and some bugs to fix.

You are dumb

The new way JVS works is with content, so you need to change the dooropen/close with the proper content commands.
These are the new events used.
Code: [Select]
registerOutputEvent("fxDTSBrick", "contentStop", %string TAB "string 200 72", 1);
registerOutputEvent("fxDTSBrick", "contentStart", %string TAB "list CW 0 CCW 1" TAB "string 200 72", 1);

Another way to do this would be to simply fakekill the door, similar to how the baton does.  I believe the baton still works.

Also: Does your version of CityRPG have issues with selling items?  If so, I know what version you have and some bugs to fix.
No, my version of City RPG doesn't, I've fixed them bugs, so basically, I could fake kill the door?
What is the command for fake killing the door?

its just fakeKillBrick(%c, #, #);

Need a little bit of help here, I'm curios where should I put it
Can someone help me?

function CityRPGBatonItem::onHitObject(%this, %player, %slot, %col, %pos, %normal)
{
   parent::OnHitObject(%this, %player, %slot, %col, %pos, %normal);
   if(%col.getClassName() $= "fxDTSBrick")
   {
      if(%col.getDatablock().FindSomeIndicatorOfAJvsDoor)
         %col.fakeKillBrick(#, #);
   }
}

actually, just replace where it says DoorOpen in the script you currently have with the fakeKillBrick thing.  Thats the easiest way.

DO NOT FIX THE LOCKPICK!

I've been in a server where someone 'fixed' it, and so many noobs were busting down locked doors and stuff that you really want locked that i just left. This would bring a whole new level of noobdom.
.....