PascalCase bitflag keys
This commit is contained in:
@@ -18,9 +18,10 @@ let serverBitFlags = {
|
|||||||
subAccountSettingsFlags: {},
|
subAccountSettingsFlags: {},
|
||||||
accountFlags: {},
|
accountFlags: {},
|
||||||
seenHelpTipsFlags: {},
|
seenHelpTipsFlags: {},
|
||||||
npcTriggerTypeKeys: {},
|
npcTriggerTypeFlags: {},
|
||||||
npcTriggerConditionTypeKeys: {},
|
npcTriggerConditionTypesFlags: {},
|
||||||
npcTriggerResponseTypeKeys: {},
|
npcTriggerResponseTypeFlags: {},
|
||||||
|
serverSettings: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -63,23 +64,23 @@ let serverBitFlagKeys = {
|
|||||||
],
|
],
|
||||||
factionFlagKeys: [
|
factionFlagKeys: [
|
||||||
"None",
|
"None",
|
||||||
"police",
|
"Police",
|
||||||
"medical",
|
"Medical",
|
||||||
"fire",
|
"Fire",
|
||||||
"government",
|
"Government",
|
||||||
"generic",
|
"Generic",
|
||||||
],
|
],
|
||||||
clanTypeFlagKeys: [
|
clanTypeFlagKeys: [
|
||||||
"None",
|
"None",
|
||||||
"illegal",
|
"Illegal",
|
||||||
"legal",
|
"Legal",
|
||||||
"mafia",
|
"Mafia",
|
||||||
"streetGang",
|
"StreetGang",
|
||||||
"weapons",
|
"Weapons",
|
||||||
"drugs",
|
"Drugs",
|
||||||
"humanTrafficking",
|
"HumanTrafficking",
|
||||||
"vigilante",
|
"Vigilante",
|
||||||
"hitContracts"
|
"HitContracts"
|
||||||
],
|
],
|
||||||
clanFlagKeys: [
|
clanFlagKeys: [
|
||||||
"None",
|
"None",
|
||||||
@@ -117,103 +118,123 @@ let serverBitFlagKeys = {
|
|||||||
],
|
],
|
||||||
npcTriggerTypeKeys: [
|
npcTriggerTypeKeys: [
|
||||||
"None",
|
"None",
|
||||||
"farProximity", // Comes within a far distance of NPC
|
"FarProximity", // Comes within a far distance of NPC
|
||||||
"mediumProximity", // Comes within a medium distance of NPC
|
"MediumProximity", // Comes within a medium distance of NPC
|
||||||
"nearProximity", // Comes within a close distance of NPC
|
"NearProximity", // Comes within a close distance of NPC
|
||||||
"enterLineOfSight", // Enters the NPC's line of sight
|
"EnterLineOfSight", // Enters the NPC's line of sight
|
||||||
"exitLineOfSight", // Leaves the NPC's line of sight
|
"ExitLineOfSight", // Leaves the NPC's line of sight
|
||||||
"pedCollision", // Bumps into ped on foot
|
"PedCollision", // Bumps into ped on foot
|
||||||
"vehicleCollision", // Bumps into ped with a vehicle
|
"VehicleCollision", // Bumps into ped with a vehicle
|
||||||
"shootGun", // Shoots a gun (target isn't a factor, it's just about only shooting a gun in general)
|
"ShootGun", // Shoots a gun (target isn't a factor, it's just about only shooting a gun in general)
|
||||||
"swingMelee", // Swings a melee weapon (target doesnt matter, it's just about only swinging a melee weapon in general)
|
"SwingMelee", // Swings a melee weapon (target doesnt matter, it's just about only swinging a melee weapon in general)
|
||||||
"hotwireVehicleStart", // Begin attempt to hotwire a vehicle
|
"HotwireVehicleStart", // Begin attempt to hotwire a vehicle
|
||||||
"hotwireVehicleFail", // Failed to hotwire a vehicle
|
"HotwireVehicleFail", // Failed to hotwire a vehicle
|
||||||
"hotwireVehicleSucceed", // Succeeded at hotwiring a vehicle
|
"HotwireVehicleSucceed", // Succeeded at hotwiring a vehicle
|
||||||
"vehicleAlarmStart", // Vehicle alarm goes off
|
"VehicleAlarmStart", // Vehicle alarm goes off
|
||||||
"vehicleAlarmStop", // Vehicle alarm shuts off (disabled, battery dead, damaged, or just turned off legitly)
|
"VehicleAlarmStop", // Vehicle alarm shuts off (disabled, battery dead, damaged, or just turned off legitly)
|
||||||
"sirenStart", // Any vehicle with a siren that gets activated
|
"SirenStart", // Any vehicle with a siren that gets activated
|
||||||
"sirenStop", // Any vehicle with a siren that gets deactivated
|
"SirenStop", // Any vehicle with a siren that gets deactivated
|
||||||
"vehicleEnter", // Enters any vehicle
|
"VehicleEnter", // Enters any vehicle
|
||||||
"vehicleExit", // Exits any vehicle
|
"VehicleExit", // Exits any vehicle
|
||||||
"propertyEnter", // Enters any interior
|
"PropertyEnter", // Enters any interior
|
||||||
"propertyExit", // Exits any interior
|
"PropertyExit", // Exits any interior
|
||||||
"attackedByMelee", // Any element is attacked by melee weapon
|
"AttackedByMelee", // Any element is attacked by melee weapon
|
||||||
"attackedByGun", // Any element is attacked by gun
|
"AttackedByGun", // Any element is attacked by gun
|
||||||
"attackedByFist", // Any element is attacked by fist
|
"AttackedByFist", // Any element is attacked by fist
|
||||||
],
|
],
|
||||||
npcTriggerConditionTypeKeys: [
|
npcTriggerConditionTypeKeys: [
|
||||||
"None",
|
"None",
|
||||||
"isInLineOfSight",
|
"IsInLineOfSight",
|
||||||
"isFarProximity",
|
"IsFarProximity",
|
||||||
"isMediumProximity",
|
"IsMediumProximity",
|
||||||
"isNearProximity",
|
"IsNearProximity",
|
||||||
"isEnemyClan",
|
"IsEnemyClan",
|
||||||
"isAllyClan",
|
"IsAllyClan",
|
||||||
"isSameClan",
|
"IsSameClan",
|
||||||
"isNotInClan",
|
"IsNotInClan",
|
||||||
"isLawEnforcement",
|
"IsLawEnforcement",
|
||||||
"isFirefighter",
|
"IsFirefighter",
|
||||||
"isParamedic",
|
"IsParamedic",
|
||||||
"isCriminal",
|
"IsCriminal",
|
||||||
"hasWantedLevel",
|
"HasWantedLevel",
|
||||||
"isSelfVehicle",
|
"IsSelfVehicle",
|
||||||
"isPlayerVehicle",
|
"IsPlayerVehicle",
|
||||||
"isOtherVehicle",
|
"IsOtherVehicle",
|
||||||
"isClanVehicle",
|
"IsClanVehicle",
|
||||||
"isEmergencyVehicle",
|
"IsEmergencyVehicle",
|
||||||
"isPoliceVehicle",
|
"IsPoliceVehicle",
|
||||||
"isDriver",
|
"IsDriver",
|
||||||
"isInFrontSeat",
|
"IsInFrontSeat",
|
||||||
"isInSeatId",
|
"IsInSeatId",
|
||||||
"vehicleLocked",
|
"VehicleLocked",
|
||||||
"vehicleHotwired",
|
"VehicleHotwired",
|
||||||
"isPistol",
|
"IsPistol",
|
||||||
"isShotgun",
|
"IsShotgun",
|
||||||
"isAutomatic",
|
"IsAutomatic",
|
||||||
"isRifle",
|
"IsRifle",
|
||||||
"isAssaultRifle",
|
"IsAssaultRifle",
|
||||||
"isSniper",
|
"IsSniper",
|
||||||
"isRPG",
|
"IsRPG",
|
||||||
"isFlameThrower",
|
"IsFlameThrower",
|
||||||
"isTalking",
|
"IsTalking",
|
||||||
"isShouting",
|
"IsShouting",
|
||||||
"isWhispering",
|
"IsWhispering",
|
||||||
],
|
],
|
||||||
npcTriggerResponseTypeKeys: [
|
npcTriggerResponseTypeKeys: [
|
||||||
"None",
|
"None",
|
||||||
"shout",
|
"Shout",
|
||||||
"talk",
|
"Talk",
|
||||||
"whisper",
|
"Whisper",
|
||||||
"switchWeapon",
|
"SwitchWeapon",
|
||||||
"shootWeapon",
|
"ShootWeapon",
|
||||||
"aimWeapon",
|
"AimWeapon",
|
||||||
"fleeSprint",
|
"FleeSprint",
|
||||||
"fleeWalk",
|
"FleeWalk",
|
||||||
"fleeRun",
|
"FleeRun",
|
||||||
"attackMelee",
|
"AttackMelee",
|
||||||
"attackFist",
|
"AttackFist",
|
||||||
"walkToward",
|
"WalkToward",
|
||||||
"runToward",
|
"RunToward",
|
||||||
"sprintToward",
|
"SprintToward",
|
||||||
"crouch",
|
"Crouch",
|
||||||
"phoneCall",
|
"PhoneCall",
|
||||||
"walkieTalkieMessage",
|
"WalkieTalkieMessage",
|
||||||
"switchRadioStation",
|
"SwitchRadioStation",
|
||||||
"toggleSiren",
|
"ToggleSiren",
|
||||||
"fleeTo",
|
"FleeTo",
|
||||||
"driveTo",
|
"DriveTo",
|
||||||
"enterVehicle",
|
"EnterVehicle",
|
||||||
"exitVehicle",
|
"ExitVehicle",
|
||||||
"pullOutOfVehicle",
|
"PullOutOfVehicle",
|
||||||
"enterProperty",
|
"EnterProperty",
|
||||||
"searchArea",
|
"SearchArea",
|
||||||
],
|
],
|
||||||
seenHelpTipsKeys: [
|
seenHelpTipsKeys: [
|
||||||
"None",
|
"None",
|
||||||
"vehicleEngineOffWhenEntering",
|
"VehicleEngineOffWhenEntering",
|
||||||
"vehicleLockedAfterEntryAttempt",
|
"VehicleLockedAfterEntryAttempt",
|
||||||
"showItemsAfterPurchase",
|
"ShowItemsAfterPurchase",
|
||||||
"buyCommandAfterEnterBusiness",
|
"BuyCommandAfterEnterBusiness",
|
||||||
|
],
|
||||||
|
serverSettingsKeys: [
|
||||||
|
"None",
|
||||||
|
"GUI",
|
||||||
|
"ServerLogo",
|
||||||
|
"FallingSnow",
|
||||||
|
"GroundSnow",
|
||||||
|
"Anticheat",
|
||||||
|
"CheckGameScripts",
|
||||||
|
"GameScriptBlackList",
|
||||||
|
"GameScriptWhiteList",
|
||||||
|
"JobBlips",
|
||||||
|
"JobPickups",
|
||||||
|
"BusinessBlips",
|
||||||
|
"BusinessPickups",
|
||||||
|
"HouseBlips",
|
||||||
|
"HousePickups",
|
||||||
|
"DiscordBot",
|
||||||
|
"RealTime",
|
||||||
|
"Testing",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -231,6 +252,7 @@ function initBitFlagScript() {
|
|||||||
serverBitFlags.npcTriggerTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerTypeKeys);
|
serverBitFlags.npcTriggerTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerTypeKeys);
|
||||||
serverBitFlags.npcTriggerConditionTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerConditionTypeKeys);
|
serverBitFlags.npcTriggerConditionTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerConditionTypeKeys);
|
||||||
serverBitFlags.npcTriggerResponseTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerResponseTypeKeys);
|
serverBitFlags.npcTriggerResponseTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerResponseTypeKeys);
|
||||||
|
serverBitFlags.serverSettings = createBitFlagTable(serverBitFlagKeys.serverSettingsKeys);
|
||||||
logToConsole(LOG_INFO, "[VRR.BitFlag]: Bit flag script initialized successfully!");
|
logToConsole(LOG_INFO, "[VRR.BitFlag]: Bit flag script initialized successfully!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -385,6 +407,20 @@ function getModerationFlagValue(flagName) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getServerSettingFlagValue(flagName) {
|
||||||
|
if(flagName == "All") {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(typeof serverBitFlags.serverSettings[flagName] == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return serverBitFlags.serverSettings[flagName];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function givePlayerStaffFlag(client, flagName) {
|
function givePlayerStaffFlag(client, flagName) {
|
||||||
if(!getStaffFlagValue(flagName)) {
|
if(!getStaffFlagValue(flagName)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user