Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ============================================================
- // Project : CityRPG
- // Author : VelocityLP
- // Description : Record Erase Brick
- // ============================================================
- // Table of Contents
- // 1. Brick Data
- // 2. Trigger Data
- // ============================================================
- // ============================================================
- // Section 1 : Brick Data
- // ============================================================
- datablock fxDTSBrickData(CityRPGRecordShredBrickData : brick2x4FData)
- {
- category = "CityRPG";
- subCategory = "CityRPG Infoblock";
- uiName = "Erase Record Brick";
- CityRPGBrickType = 2;
- CityRPGBrickAdmin = true;
- triggerDatablock = CityRPGInputTriggerData;
- triggerSize = "2 4 1";
- trigger = 0;
- hackable = 1;
- };
- // ============================================================
- // Section 2 : Trigger Data
- // ============================================================
- function CityRPGRecordShredBrickData::parseData(%this, %brick, %client, %triggerStatus, %text)
- {
- if(%triggerStatus !$= "")
- {
- if(%triggerStatus == true && %client.stage $= "")
- {
- messageClient(%client, '', "\c6How can I be of service?");
- messageClient(%client, '', "\c31 \c6- Erase Record");
- %input = strLwr(%text);
- if(strReplace(%input, "1", "") !$= %input || strReplace(%input, "one", "") !$= %input)
- {
- if(getWord(CityRPGData.getData(%client.bl_id).valueJailData, 0))
- {
- %cost = $CityRPG::pref::demerits::recordShredCost;
- if(CityRPGData.getData(%client.bl_id).valueMoney >= %cost || %client.isAdmin)
- {
- CityRPGData.getData(%client.bl_id).valueJailData = "0" SPC getWord(CityRPGData.getData(%client.bl_id).valueJailData, 1);
- messageClient(%client, '', "\c6I'll take care of it. Consider your record fresh, without a scratch on it.");
- if(!%client.isHost)
- {
- CityRPGData.getData(%client.bl_id).valueMoney -= %cost;
- }
- %client.setInfo();
- }
- else
- {
- messageClient(%client, '', "\c6It's gonna cost you \c3$" @ %cost SPC "\c6for me to erase your record.");
- }
- }
- else
- {
- messageClient(%client, '', "\c6Uh, your record's already perfectly clean.");
- }
- }
- messageClient(%client, '', "\c3" @ %text SPC "\c6is not a valid option!");
- return;
- }
- }
- if(%triggerStatus == false && %client.stage !$= "")
- {
- messageClient(%client, '', "\c6See ya.");
- %client.stage = "";
- }
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement