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.
// 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.
$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?