The server is up again.
Added NewJeep
Banned Jeep
Added Sail Boat
Enabled RowBoat
(Finally) Enabled Keypad Events
Added DoorCheck events
Wand no longer bounces people up above street level.
Fixed /deductmoney.
Fixed gameconnection::arrest bug found by Deneb
Fixed pickpocketing bug found by Fate
Pickpocketing now requires that you be crouched.
Pickpocketing no longer gives rewards if you fail.
Pickpocketing now properly detects your target's line of sight.
Drugs now obey economics, and will sell for lower prices while the market is flooded.
08/24/2018 - ~8:45
The NewDuplicator has been modified to work with this CityRPG.
Thank you, Queuenard.
There may eventually be a better solution, but this is my solution:
This automatically loads a module we define later.
Place it at the end of server.cs:
if($AddOn__Tool_NewDuplicator)
{
ForceRequiredAddOn("Tool_NewDuplicator");//no harm done if it doesn't load, but it MUST be loaded so this next part can overwrite it.
exec("./modules/newduplicator.cs");
}
This is a modified version of serverCmdPlantBrick() found in Gamemode_CityRPG/package.cs.
It does various checks to determine whether a brick should be planted or not.
Place this code somewhere in common.cs:
function GameConnection::CRPGPlantCheck(%this, %brick, %silent)
{
if(%this.isAdmin)
return 1;
%brickData = %brick.getDatablock();
if(%brickData.CityRPGBrickAdmin && !%this.isAdmin)
return 0;
if(mFloor(getWord(%brick.rotation, 3)) == 90)
%boxSize = getWord(%brick.getDatablock().brickSizeY, 1) / 2.5 SPC getWord(%brick.getDatablock().brickSizeX, 0) / 2.5 SPC getWord(%brick.getDatablock().brickSizeZ, 2) / 2.5;
else
%boxSize = getWord(%brick.getDatablock().brickSizeX, 1) / 2.5 SPC getWord(%brick.getDatablock().brickSizeY, 0) / 2.5 SPC getWord(%brick.getDatablock().brickSizeZ, 2) / 2.5;
initContainerBoxSearch(%brick.getWorldBoxCenter(), %boxSize, $typeMasks::triggerObjectType);
while(isObject(%trigger = containerSearchNext()))
{
if(%trigger.getDatablock() == CityRPGLotTriggerData.getID())
{
%lotTrigger = %trigger;
break;
}
}
if(!%lotTrigger && %brickData.CityRPGBrickType != 1)
return 0;
if(CityRPGData.getData(%this.bl_id).valueMoney < mFloor(%brick.getDatablock().initialPrice))
return 0;
if(!%lotTrigger && %brickData.CityRPGBrickType == 1 && %this.brickGroup.lotsOwned >= $CityRPG::pref::realestate::maxLots)
return 0;
if(%lotTrigger && %brick.getDatablock().CityRPGBrickType != 1)
{
%lotTriggerMinX = getWord(%lotTrigger.getWorldBox(), 0);
%lotTriggerMinY = getWord(%lotTrigger.getWorldBox(), 1);
%lotTriggerMinZ = getWord(%lotTrigger.getWorldBox(), 2);
%lotTriggerMaxX = getWord(%lotTrigger.getWorldBox(), 3);
%lotTriggerMaxY = getWord(%lotTrigger.getWorldBox(), 4);
%lotTriggerMaxZ = getWord(%lotTrigger.getWorldBox(), 5);
%brickMinX = getWord(%brick.getWorldBox(), 0) + 0.0016;
%brickMinY = getWord(%brick.getWorldBox(), 1) + 0.0013;
%brickMinZ = getWord(%brick.getWorldBox(), 2) + 0.00126;
%brickMaxX = getWord(%brick.getWorldBox(), 3) - 0.0016;
%brickMaxY = getWord(%brick.getWorldBox(), 4) - 0.0013;
%brickMaxZ = getWord(%brick.getWorldBox(), 5) - 0.00126;
if(%brickMinX < %lotTriggerMinX || %brickMinY < %lotTriggerMinY || %brickMinZ < %lotTriggerMinZ || %brickMaxX > %lotTriggerMaxX || %brickMaxY > %lotTriggerMaxY || %brickMaxZ > %lotTriggerMaxZ)
return 0;
}
if(%lotTrigger && %brickData.CityRPGBrickType == 1)
return 0;
//it is necessary to disable this for apartment bricks to work.
//if(%lotTrigger && getTrustLevel(%lotTrigger.parent, %this.player) < 1)
//{
// commandToClient(%this, 'centerPrint', (getBrickGroupFromObject(%lotTrigger.parent).name $= "") ? "\c1BL_ID:" SPC getBrickGroupFromObject(%lotTrigger.parent).bl_id : getBrickGroupFromObject(%lotTrigger.parent).name SPC "\c0does not trust you enough to do that.", 1);
// return;
//}
if(%lotTrigger && %brickData.getID() == brickVehicleSpawnData.getID() && CityRPGData.getData(%this.bl_id).valueMoney < mFloor($CityRPG::prices::vehicleSpawn))
return 0;
if(%lotTrigger && %brickData.CityRPGBrickType == 420)
{
for(%a = 0; %a < %this.brickGroup.getCount(); %a++)
if(%this.brickGroup.getObject(%a).getDatablock().CityRPGBrickType == 420)
%drugsOwned += 1;
if(%drugsOwned >= $CityRPG::Drugs::DrugLimit)
return 0;
}
return 1;
}
Attached to this post is the code for Gamemode_CityRPG/modules/newduplicator.cs.
It is a copy of a function from Tool_NewDuplicator/classes/server/selection.cs | verison 1.6.2
The extra lines can be seen on lines 16-19 and lines 211 to 217.
08/25/2018
A new event has been added: spawnPinball
This event has a timeout on it per brickgroup, to help prevent spam.
The setapartment event has been modified:
Set the owner to -1 to allow anyone to build on your brick.
If that setapartment event is disabled, the brick does not allow random people to build on it.
This can be used to automate the renting of a particular room.