diff --git a/Client/mods/deathmatch/logic/lua/CLuaMain.cpp b/Client/mods/deathmatch/logic/lua/CLuaMain.cpp index 6b794be016..1cd8f86d31 100644 --- a/Client/mods/deathmatch/logic/lua/CLuaMain.cpp +++ b/Client/mods/deathmatch/logic/lua/CLuaMain.cpp @@ -27,6 +27,14 @@ SString CLuaMain::ms_strExpectedUndumpHash; #include "luascripts/exports.lua.h" #include "luascripts/inspect.lua.h" +#include "luascripts/constants_main.lua.h" +#include "luascripts/constants_elements.lua.h" +#include "luascripts/constants_vehicles.lua.h" +#include "luascripts/constants_weapons.lua.h" +#include "luascripts/constants_peds.lua.h" +#include "luascripts/constants_ui.lua.h" +#include "luascripts/constants_other.lua.h" + CLuaMain::CLuaMain(CLuaManager* pLuaManager, CResource* pResourceOwner, bool bEnableOOP) { // Initialise everything to be setup in the Start function @@ -187,6 +195,20 @@ void CLuaMain::LoadEmbeddedScripts() LoadScript(EmbeddedLuaCode::exports); LoadScript(EmbeddedLuaCode::coroutine_debug); LoadScript(EmbeddedLuaCode::inspect); + + LoadScript(EmbeddedLuaCode::constantsMain); + LoadScript(EmbeddedLuaCode::constantsElements); + LoadScript(EmbeddedLuaCode::constantsVehicles); + LoadScript(EmbeddedLuaCode::constantsWeapons); + LoadScript(EmbeddedLuaCode::constantsPeds); + LoadScript(EmbeddedLuaCode::constantsUI); + LoadScript(EmbeddedLuaCode::constantsOther); + + // To make `constants` table read-only + LoadScript(R"~LUA~( + setmetatable(constants, __readonly_table_meta__) + __readonly_table_meta__ = nil + )~LUA~"); DECLARE_PROFILER_SECTION(OnPostLoadScript) } diff --git a/Server/mods/deathmatch/logic/lua/CLuaMain.cpp b/Server/mods/deathmatch/logic/lua/CLuaMain.cpp index 189d204c57..c020e84d86 100644 --- a/Server/mods/deathmatch/logic/lua/CLuaMain.cpp +++ b/Server/mods/deathmatch/logic/lua/CLuaMain.cpp @@ -61,6 +61,14 @@ extern CNetServer* g_pRealNetServer; #include "luascripts/exports.lua.h" #include "luascripts/inspect.lua.h" +#include "luascripts/constants_main.lua.h" +#include "luascripts/constants_elements.lua.h" +#include "luascripts/constants_vehicles.lua.h" +#include "luascripts/constants_weapons.lua.h" +#include "luascripts/constants_peds.lua.h" +#include "luascripts/constants_ui.lua.h" +#include "luascripts/constants_other.lua.h" + CLuaMain::CLuaMain(CLuaManager* pLuaManager, CObjectManager* pObjectManager, CPlayerManager* pPlayerManager, CVehicleManager* pVehicleManager, CBlipManager* pBlipManager, CRadarAreaManager* pRadarAreaManager, CMapManager* pMapManager, CResource* pResourceOwner, bool bEnableOOP) { @@ -244,6 +252,20 @@ void CLuaMain::LoadEmbeddedScripts() LoadScript(EmbeddedLuaCode::exports); LoadScript(EmbeddedLuaCode::coroutine_debug); LoadScript(EmbeddedLuaCode::inspect); + + LoadScript(EmbeddedLuaCode::constantsMain); + LoadScript(EmbeddedLuaCode::constantsElements); + LoadScript(EmbeddedLuaCode::constantsVehicles); + LoadScript(EmbeddedLuaCode::constantsWeapons); + LoadScript(EmbeddedLuaCode::constantsPeds); + LoadScript(EmbeddedLuaCode::constantsUI); + LoadScript(EmbeddedLuaCode::constantsOther); + + // To make `constants` table read-only; + LoadScript(R"~LUA~( + setmetatable(constants, __readonly_table_meta__) + __readonly_table_meta__ = nil + )~LUA~"); } void CLuaMain::RegisterModuleFunctions() diff --git a/Shared/mods/deathmatch/logic/luascripts/constants_elements.lua.h b/Shared/mods/deathmatch/logic/luascripts/constants_elements.lua.h new file mode 100644 index 0000000000..b16960e100 --- /dev/null +++ b/Shared/mods/deathmatch/logic/luascripts/constants_elements.lua.h @@ -0,0 +1,33 @@ +namespace EmbeddedLuaCode +{ + const char* const constantsElements = R"~LUA~( +--[[ + SERVER AND CLIENT. + Defines a constant variables available for server and client. +--]] + +constants.ElementType = setmetatable({ + Player = 'player', + Ped = 'ped', + Water = 'water', + Sound = 'sound', + Vehicle = 'vehicle', + Object = 'object', + Pickup = 'pickup', + Marker = 'marker', + Colshape = 'colshape', + Blip = 'blip', + RadarArea = 'radararea', + Team = 'team', + SpawnPoint = 'spawnpoint', + Console = 'console', + Projectile = 'projectile', + Effect = 'effect', + Light = 'light', + Searchlight = 'searchlight', + Shader = 'shader', + Texture = 'texture', +}, __readonly_table_meta__) + + )~LUA~"; +} \ No newline at end of file diff --git a/Shared/mods/deathmatch/logic/luascripts/constants_main.lua.h b/Shared/mods/deathmatch/logic/luascripts/constants_main.lua.h new file mode 100644 index 0000000000..2fa28260a8 --- /dev/null +++ b/Shared/mods/deathmatch/logic/luascripts/constants_main.lua.h @@ -0,0 +1,37 @@ +namespace EmbeddedLuaCode +{ + const char* const constantsMain = R"~LUA~( +--[[ + SERVER AND CLIENT. + Defines a constant variables available for server and client. +--]] + +__readonly_table_meta__ = { + __index = function(tbl, key) + local val = rawget(tbl, key) + if val then + return val + end + for k,v in pairs(tbl) do + if tostring(k):lower() == tostring(key):lower() then + return v + end + end + end, + __newindex = function(tbl, key) + return error('Table is read only!') + end, + __call = function(tbl, key) + if not key then return end + for k,v in pairs(tbl) do + if tostring(v):lower() == tostring(key):lower() then + return k + end + end + end +} + +constants = {} + + )~LUA~"; +} \ No newline at end of file diff --git a/Shared/mods/deathmatch/logic/luascripts/constants_other.lua.h b/Shared/mods/deathmatch/logic/luascripts/constants_other.lua.h new file mode 100644 index 0000000000..29f1d5fbb4 --- /dev/null +++ b/Shared/mods/deathmatch/logic/luascripts/constants_other.lua.h @@ -0,0 +1,376 @@ +namespace EmbeddedLuaCode +{ + const char* const constantsOther = R"~LUA~( +--[[ + SERVER AND CLIENT. + + Defines a constant variables available for server and client. +--]] + +constants.TriggerPriority = setmetatable({ + High = 'high', + Normal = 'normal', + Low = 'low' +}, __readonly_table_meta__) + +constants.DebugMessageLevel = setmetatable({ + Custom = 0, + Error = 1, + Warning = 2, + Information = 3, + CustomNoPath = 4 +}, __readonly_table_meta__) + +constants.KeyState = setmetatable({ + Up = 'up', + Down = 'down', + Both = 'both' +}, __readonly_table_meta__) + +constants.KeyName = setmetatable({ + LeftClick = 'mouse1', + RightClick = 'mouse2', + MiddleClick = 'mouse3', + Mouse4 = 'mouse4', + Mouse5 = 'mouse5', + MouseWheelUp = 'mouse_wheel_up', + MouseWheelDown = 'mouse_wheel_down', + ArrowLeft = 'arrow_l', + ArrowUp = 'arrow_u', + ArrowRight = 'arrow_r', + ArrowDown = 'arrow_d', + Zero = '0', + One = '1', + Two = '2', + Three = '3', + Four = '4', + Five = '5', + Six = '6', + Seven = '7', + Eight = '8', + Nine = '9', + A = 'a', + B = 'b', + C = 'c', + D = 'd', + E = 'e', + F = 'f', + G = 'g', + H = 'h', + I = 'i', + J = 'j', + K = 'k', + L = 'l', + M = 'm', + N = 'n', + O = 'o', + P = 'p', + Q = 'q', + R = 'r', + S = 's', + T = 't', + U = 'u', + V = 'v', + W = 'w', + X = 'x', + Y = 'y', + Z = 'z', + Num0 = 'num_0', + Num1 = 'num_1', + Num2 = 'num_2', + Num3 = 'num_3', + Num4 = 'num_4', + Num5 = 'num_5', + Num6 = 'num_6', + Num7 = 'num_7', + Num8 = 'num_8', + Num9 = 'num_9', + NumMul = 'num_mul', + NumAdd = 'num_add', + NumSep = 'num_sep', + NumSub = 'num_sub', + NumDiv = 'num_div', + NumDec = 'num_dec', + NumEnter = 'num_enter', + F1 = 'F1', + F2 = 'F2', + F3 = 'F3', + F4 = 'F4', + F5 = 'F5', + F6 = 'F6', + F7 = 'F7', + F8 = 'F8', + F9 = 'F9', + F10 = 'F10', + F11 = 'F11', + F12 = 'F12', + Escape = 'escape', + Backspace = 'backspace', + Tab = 'tab', + LeftAlt = 'lalt', + RightAlt = 'ralt', + Enter = 'enter', + Space = 'space', + PageUp = 'pgup', + PageDown = 'pgdn', + End = 'end', + Home = 'home', + Insert = 'insert', + Delete = 'delete', + LeftShift = 'lshift', + RightShift = 'rshift', + LeftCtrl = 'lctrl', + RightCtrl = 'rctrl', + LeftSquareBracket = '[', + RightSquareBracket = ']', + Pause = 'pause', + Capslock = 'capslock', + Scroll = 'scroll', + Semicolon = ';', + Comma = ',', + Dash = '-', + Dot = '.', + Slash = '/', + Hash = '#', + BackSlash = '\\', + Equals = '=' +}, __readonly_table_meta__) + +constants.ControlName = setmetatable({ + Fire = 'fire', + AimWeapon = 'aim_weapon', + NextWeapon = 'next_weapon', + PreviousWeapon = 'previous_weapon', + Forwards = 'forwards', + Backwards = 'backwards', + Left = 'left', + Right = 'right', + ZoomIn = 'zoom_in', + ZoomOut = 'zoom_out', + ChangeCamera = 'change_camera', + Jump = 'jump', + Sprint = 'sprint', + LookBehind = 'look_behind', + Crouch = 'crouch', + Action = 'action', + Walk = 'walk', + ConversationYes = 'conversation_yes', + ConversationNo = 'conversation_no', + GroupControlForwards = 'group_control_forwards', + GroupControlBack = 'group_control_back', + EnterExit = 'enter_exit', + VehicleFire = 'vehicle_fire', + VehicleSecondaryFire = 'vehicle_secondary_fire', + VehicleLeft = 'vehicle_left', + VehicleRight = 'vehicle_right', + SteerForward = 'steer_forward', + SteerBack = 'steer_back', + Accelerate = 'accelerate', + BrakeReverse = 'brake_reverse', + RadioNext = 'radio_next', + RadioPrevious = 'radio_previous', + RadioUserTrackSkip = 'radio_user_track_skip', + Horn = 'horn', + SubMission = 'sub_mission', + Handbrake = 'handbrake', + VehicleLookLeft = 'vehicle_look_left', + VehicleLookRight = 'vehicle_look_right', + VehicleLookBehind = 'vehicle_look_behind', + VehicleMouseLook = 'vehicle_mouse_look', + SpecialControlLeft = 'special_control_left', + SpecialControlRight = 'special_control_right', + SpecialControlDown = 'special_control_down', + SpecialControlUp = 'special_control_up', + EnterExit = 'enter_exit', +}, __readonly_table_meta__) + +constants.AnimationBlock = setmetatable({ + airport = 'airport', + attractors = 'attractors', + bar = 'bar', + baseball = 'baseball', + bd_fire = 'bd_fire', + beach = 'beach', + benchpress = 'benchpress', + bf_injection = 'bf_injection', + biked = 'biked', + bikeh = 'bikeh', + bikeleap = 'bikeleap', + bikes = 'bikes', + bikev = 'bikev', + bike_dbz = 'bike_dbz', + bmx = 'bmx', + bomber = 'bomber', + box = 'box', + bsktball = 'bsktball', + buddy = 'buddy', + bus = 'bus', + camera = 'camera', + car = 'car', + carry = 'carry', + car_chat = 'car_chat', + casino = 'casino', + chainsaw = 'chainsaw', + choppa = 'choppa', + clothes = 'clothes', + coach = 'coach', + colt45 = 'colt45', + cop_ambient = 'cop_ambient', + cop_dvbyz = 'cop_dvbyz', + crack = 'crack', + crib = 'crib', + dam_jump = 'dam_jump', + dancing = 'dancing', + dealer = 'dealer', + dildo = 'dildo', + dodge = 'dodge', + dozer = 'dozer', + drivebys = 'drivebys', + fat = 'fat', + fight_b = 'fight_b', + fight_c = 'fight_c', + fight_d = 'fight_d', + fight_e = 'fight_e', + finale = 'finale', + finale2 = 'finale2', + flame = 'flame', + flowers = 'flowers', + food = 'food', + freeweights = 'freeweights', + gangs = 'gangs', + ghands = 'ghands', + ghetto_db = 'ghetto_db', + goggles = 'goggles', + graffiti = 'graffiti', + graveyard = 'graveyard', + grenade = 'grenade', + gymnasium = 'gymnasium', + haircuts = 'haircuts', + heist9 = 'heist9', + int_house = 'int_house', + int_office = 'int_office', + int_shop = 'int_shop', + jst_buisness = 'jst_buisness', + kart = 'kart', + kissing = 'kissing', + knife = 'knife', + lapdan1 = 'lapdan1', + lapdan2 = 'lapdan2', + lapdan3 = 'lapdan3', + lowrider = 'lowrider', + md_chase = 'md_chase', + md_end = 'md_end', + medic = 'medic', + misc = 'misc', + mtb = 'mtb', + muscular = 'muscular', + nevada = 'nevada', + on_lookers = 'on_lookers', + otb = 'otb', + parachute = 'parachute', + park = 'park', + paulnmac = 'paulnmac', + ped = 'ped', + player_dvbys = 'player_dvbys', + playidles = 'playidles', + police = 'police', + pool = 'pool', + poor = 'poor', + python = 'python', + quad = 'quad', + quad_dbz = 'quad_dbz', + rapping = 'rapping', + rifle = 'rifle', + riot = 'riot', + rob_bank = 'rob_bank', + rocket = 'rocket', + rustler = 'rustler', + ryder = 'ryder', + scratching = 'scratching', + shamal = 'shamal', + shop = 'shop', + shotgun = 'shotgun', + silenced = 'silenced', + skate = 'skate', + smoking = 'smoking', + sniper = 'sniper', + spraycan = 'spraycan', + strip = 'strip', + sunbathe = 'sunbathe', + swat = 'swat', + sweet = 'sweet', + swim = 'swim', + sword = 'sword', + tank = 'tank', + tattoos = 'tattoos', + tec = 'tec', + train = 'train', + truck = 'truck', + uzi = 'uzi', + van = 'van', + vending = 'vending', + vortex = 'vortex', + wayfarer = 'wayfarer', + weapons = 'weapons', + wuzi = 'wuzi', +}, __readonly_table_meta__) + +constants.BodyPart = setmetatable({ + Torso = 3, + Ass = 4, + LeftArm = 5, + RightArm = 6, + LeftLeg = 7, + RightLeg = 8, + Head = 9, +}, __readonly_table_meta__) + +constants.ClothesType = setmetatable({ + Shirt = 0, + Head = 1, + Trousers = 2, + Shoes = 3, + TattoosLeftUpperArm = 4, + TattoosLeftLowerArm = 5, + TattoosRightUpperArm = 6, + TattoosRightLowerArm = 7, + TattoosBack = 8, + TattoosLeftChest = 9, + TattoosRightChest = 10, + TattoosStomach = 11, + TattoosLower_back = 12, + Necklace = 13, + Watch = 14, + Glasses = 15, + Hat = 16, + Extra = 17, +}, __readonly_table_meta__) + +constants.Weather = setmetatable({ + ExtraSunnyLS = 0, + SunnyLS = 1, + ExtraSunnySmogLS = 2, + SunnySmogLS = 3, + CloudyLS = 4, + SunnySF = 5, + ExtraSunnySF = 6, + CloudySF = 7, + RainySF = 8, + FoggySF = 9, + SunnyLV = 10, + ExtraSunnyLV = 11, + CloudyLV = 12, + ExtraSunnyCountry = 13, + SunnyCountry = 14, + CloudyCountry = 15, + RainyCountry = 16, + ExtrasunnyDesert = 17, + SunnyDesert = 18, + SandstormDesert = 19, + Underwater = 20, + ExtraColours1 = 21, + ExtraColours2 = 22, +}, __readonly_table_meta__) + + )~LUA~"; +} \ No newline at end of file diff --git a/Shared/mods/deathmatch/logic/luascripts/constants_peds.lua.h b/Shared/mods/deathmatch/logic/luascripts/constants_peds.lua.h new file mode 100644 index 0000000000..652fb7c6bc --- /dev/null +++ b/Shared/mods/deathmatch/logic/luascripts/constants_peds.lua.h @@ -0,0 +1,226 @@ +namespace EmbeddedLuaCode +{ + const char* const constantsPeds = R"~LUA~( +--[[ + SERVER AND CLIENT. + Defines a constant variables available for server and client. +--]] + +constants.PedStats = setmetatable({ + ProgressMade = 0, + TotalProgress = 1, + LongestBasketball = 2, + -- Distances + DistanceFoot = 3, + DistanceCar = 4, + DistanceBike = 5, + DistanceBoat = 6, + DistanceGolfCart = 7, + DistanceHelicopter = 8, + DistancePlane = 9, + LongestWheelieDistance = 10, + LongestStoppieDistance = 11, + Longest2WheelDistance = 12, + DistanceSwimming = 26, + DistanceCycle = 27, + DistanceTreadmill = 28, + DistanceExcersiseBike = 29, + MaxJumpDistance = 139, + -- Cash + WeaponBudget = 13, + FashionBudget = 14, + PropertyBudget = 15, + SprayingBudget = 16, + FoodBudget = 20, + TattooBudget = 30, + HairdressingBudget = 31, + ProstituteBudget = 33, + StripClubBudget = 54, + CarModBudget = 55, + TotalShoppingBudget = 62, + -- Times + LongestWheelieTime = 17, + LongestStoppieTime = 18, + Longest2WheelTime = 19, + LongestTreadmillTime = 44, + LongestExcersiseBikeTime = 45, + BestTimeHotring = 48, + BestTimeBmx = 49, + LongestChaseTime = 51, + LastChaseTime = 52, + TimeSpentShopping = 56, + TimeSpentUnderwater = 63, + FlightTime = 169, + FlightTimeJetpack = 173, + -- Body + Fat = 21, + Stamina = 22, + Muscle = 23, + MaxHealth = 24, + SexAppeal = 25, + -- Gambling + MoneySpentGambling = 35, + MoneyMadePimping = 36, + MoneyWonGambling = 37, + BiggestGamblingWin = 38, + BiggestGamblingLoss = 39, + Gambling = 81, + -- Respect + RespectTotal = 64, + RespectGirlFriend= 65, + RespectClothed = 66, + RespectFitness = 67, + Respect = 68, + -- Weapon + WeaponPistolSkill = 69, + WeaponPistolSilencedSkill = 70, + WeaponDeagleSkill = 71, + WeaponShotgunSkill = 72, + WeaponSawnoffSkill = 73, + WeaponSpas12Skill = 74, + WeaponUZISkill = 75, + WeaponMP5Skill = 76, + WeaponAK47Skill = 77, + WeaponM4Skill = 78, + WeaponSniperSkill = 79, + -- Other + LargestBurglarySwag = 40, + MoneyMadeBurglary = 41, + HeaviestWeightBenchPress = 46, + HeaviestWeightDumbells = 47, + WageBill = 53, + SexAppealClothes = 80, + PeopleKilledByOthers = 120, + PeopleKilledByPlayer = 121, + CarsDestroyed = 122, + BoatsDestroyed = 123, + HelicoptersDestroyed = 124, + PropertyDestroyed = 125, + RoundsFired = 126, + ExplosivesUsed = 127, + BulletsHit = 128, + TyresPopped = 129, + HeadsPopped = 130, + WantedStarsAttained = 131, + WantedStarsEvaded = 132, + TimesArrested = 133, + DaysPassed = 134, + TimesDied = 135, + TimesSaved = 136, + TimesCheated = 137, + Sprayings = 138, + MaxJumpHeight = 140, + MaxJumpFlips = 141, + MaxJumpSpins = 142, + BestStunt = 143, + UniqueJumpsFound = 144, + UniqueJumpsDone = 145, + MissionsAttempted = 146, + MissionsPassed = 147, + TotalMissions = 148, + TaxiMoneyMade = 149, + PassengersDeliveredInTaxi = 150, + LivesSaved = 151, + CriminalsCaught = 152, + FiresExtinguished = 153, + PizzasDelivered = 154, + Assassinations = 155, + LatestDanceScore = 156, + VigilanteLevel = 157, + AmbulanceLevel = 158, + FirefighterLevel = 159, + DrivingSkill = 160, + TruckMissionsPassed = 161, + TruckMoneyMade = 162, + RecruitedGangMembersKilled = 163, + Armour = 164, + Energy = 165, + PhotosTaken = 166, + KillFrenziesAttempted = 167, + KillFrenziesPassed = 168, + TimesDrowned = 170, + GirlsPimped = 171, + BestPositionHotring = 172, + ShootingRangeScore = 174, + ValetCarsParked = 175, + KillsSinceLastCheckpoint = 176, + TotalLegitimateKills = 177, + BloodringKills = 178, + BloodringTime = 179, + NoMoreHurricanes = 180, + CitiesPassed = 181, + PoliceBribes = 182, + CarsStolen = 183, + CurrentGirlfriends = 184, + BadDates = 185, + GirlsDated = 186, + TimesScoredWithGirl = 187, + Dates = 188, + GirlsDumped = 189, + TimesVisitedProstitute = 190, + HousesBurgled = 191, + SafesCracked = 192, + StolenItemsSold = 194, + EightballsInPool = 195, + WinsInPool = 196, + LossesInPool = 197, + VisitsToGym = 198, + MealsEaten = 200, + UnderwaterStamina = 225, + BikeSkill = 229, + CycleSkill = 230, +}, __readonly_table_meta__) + +constants.PedWalkingStyle = setmetatable({ + Default = 0, + Player = 54, + PlayerFat = 55, + PlayerMuscular = 56, + RocketLauncher = 57, + RocketLauncherFat = 58, + RocketLauncherMuscular = 59, + Armed = 60, + ArmedFat = 61, + ArmedMuscular = 62, + BaseballBat = 63, + BaseballBatFat = 64, + BaseballBatMuscular = 65, + Chainsaw = 66, + ChainsawFat = 67, + ChainsawMuscular = 68, + Sneak = 69, + Jetpack = 70, + Man = 118, + Shuffle = 119, + OldMan = 120, + Gang1 = 121, + Gang2 = 122, + OldFatMan = 123, + FatMan = 124, + Jogger = 125, + DrunkMan = 126, + BlindMan = 127, + Swat = 128, + Woman = 129, + Shopping = 130, + BusyWoman = 131, + SexyWoman = 132, + Pro = 133, + OldWoman = 134, + FatWoman = 135, + JogWoman = 136, + OldFatWoman = 137, + Skate = 138, +}, __readonly_table_meta__) + +constants.PedFightingStyle = setmetatable({ + Standard = 4, + Boxing = 5, + KungFu = 6, + KneeHead = 7, + GrabKick = 15, + Elbows = 16, +}, __readonly_table_meta__) + + )~LUA~"; +} \ No newline at end of file diff --git a/Shared/mods/deathmatch/logic/luascripts/constants_ui.lua.h b/Shared/mods/deathmatch/logic/luascripts/constants_ui.lua.h new file mode 100644 index 0000000000..14c025ed62 --- /dev/null +++ b/Shared/mods/deathmatch/logic/luascripts/constants_ui.lua.h @@ -0,0 +1,134 @@ +namespace EmbeddedLuaCode +{ + const char* const constantsUI = R"~LUA~( +--[[ + SERVER AND CLIENT. + Defines a constant variables available for server and client. +--]] + +constants.HudComponents = setmetatable({ + All = 'all', + Ammo = 'ammo', + Area_name = 'area_name', + Armour = 'armour', + Breath = 'breath', + Clock = 'clock', + Health = 'health', + Money = 'money', + Radar = 'radar', + Vehicle_name = 'vehicle_name', + Weapon = 'weapon', + Radio = 'radio', + Wanted = 'wanted', + Crosshair = 'crosshair', +}, __readonly_table_meta__) + +constants.BlipIcons = setmetatable({ + Marker = 0, + WhiteSquare = 1, + Centre = 2, + MapHere = 3, + North = 4, + Airyard = 5, + Gun = 6, + Barbers = 7, + BigSmoke = 8, + Boatyard = 9, + Burgershot = 10, + Bulldozer = 11, + CatPink = 12, + Cesar = 13, + Chicken = 14, + CJ = 15, + Crash1 = 16, + Diner = 17, + EmmetGun = 18, + EnemyAttack = 19, + Fire = 20, + Girlfriend = 21, + Hospital = 22, + Loco = 23, + MaddDogg = 24, + Mafia = 25, + McStrap = 26, + ModGarage = 27, + OgLoc = 28, + Pizza = 29, + Police = 30, + PropertyGreen = 31, + PropertyRed = 32, + Race = 33, + Ryder = 34, + Savehouse = 35, + School = 36, + Mystery = 37, + Sweet = 38, + Tattoo = 39, + Truth = 40, + Waypoint = 41, + TorenoRanch = 42, + Triads = 43, + TriadsCasino = 44, + TShirt = 45, + Woozie = 46, + Zero = 47, + DateDisco = 48, + DateDrink = 49, + DateFood = 50, + Truck = 51, + Cash = 52, + Flag = 53, + Gym = 54, + Impound = 55, + RunwayLight = 56, + Runway = 57, + GangLosAztecas = 58, + GangBallas = 59, + GangVagos = 60, + GangRifa = 61, + GangFamilies = 62, + Spray = 63, +}, __readonly_table_meta__) + +constants.MarkerTypes = setmetatable({ + Checkpoint = 'checkpoint', + Ring = 'ring', + Cylinder = 'cylinder', + Arrow = 'arrow', + Corona = 'corona', +}, __readonly_table_meta__) + +constants.PickupTypes = setmetatable({ + Health = 0, + Armour = 1, + Weapon = 2, + Custom = 3 +}, __readonly_table_meta__) + +constants.ModelPickupTypes = setmetatable({ + Jetpack = 370, + Money = 1212, + InfoIcon = 1239, + Health = 1240, + Adrenaline = 1241, + Armour = 1242, + Bribe = 1247, + GTA3Bomb = 1252, + Photo = 1253, + Skull = 1254, + GTA3Sign = 1248, + HouseBlue = 1272, + HouseGreen = 1273, + MoneyIcon = 1274, + BlueTShirt = 1275, + TikiStatue = 1276, + SaveDisk = 1277, + DrugBundle = 1279, + Parachute = 1310, + Skulls = 1313, + PlayersIcon = 1314, + DownArrow = 1318, +}, __readonly_table_meta__) + + )~LUA~"; +} \ No newline at end of file diff --git a/Shared/mods/deathmatch/logic/luascripts/constants_vehicles.lua.h b/Shared/mods/deathmatch/logic/luascripts/constants_vehicles.lua.h new file mode 100644 index 0000000000..5201b81a53 --- /dev/null +++ b/Shared/mods/deathmatch/logic/luascripts/constants_vehicles.lua.h @@ -0,0 +1,94 @@ +namespace EmbeddedLuaCode +{ + const char* const constantsVehicles = R"~LUA~( +--[[ + SERVER AND CLIENT. + Defines a constant variables available for server and client. +--]] + +constants.VehicleLights = setmetatable({ + FrontLeft = 0, + FrontRight = 1, + RearRight = 2, + RearLeft = 3 +}, __readonly_table_meta__) + +constants.VehicleLightState = setmetatable({ + Normal = 0, + Broken = 1 +}, __readonly_table_meta__) + +constants.VehicleDoorType = setmetatable({ + Hood = 0, + Trunk = 1, + FrontLeft = 2, + FrontRight = 3, + RearLeft = 4, + RearRight = 5 +}, __readonly_table_meta__) + +constants.VehicleDoorState = setmetatable({ + ClosedUndamaged = 0, + OpenUndamaged = 1, + ClosedDamaged = 2, + OpenDamaged = 3, + Missing = 4 +}, __readonly_table_meta__) + +constants.VehicleLightOverride = setmetatable({ + Disable = 0, + Off = 1, + On = 2 +}, __readonly_table_meta__) + +constants.CarPanel = setmetatable({ + FrontLeft = 0, + FrontRight = 1, + RearLeft = 2, + RearRight = 3, + Windscreen = 4, + FrontBumper = 5, + RearBumper = 6 +}, __readonly_table_meta__) + +constants.PlanePanels = setmetatable({ + LeftEngine = 0, + RightEngine = 1, + Rudder = 2, + Elevators = 3, + Ailerons = 4, + --Unknown = 5, + --Unknown = 6 +}, __readonly_table_meta__) + +constants.VehiclePanelState = setmetatable({ + Undamaged = 0, + SlightlyDamaged = 1, + Damaged = 2, + HeavilyDamaged = 3 +}, __readonly_table_meta__) + +constants.vehicleWheelState = setmetatable({ + Inflated = 0, + Flat = 1, + FallenOff = 2, + Collisionless = 3 +}, __readonly_table_meta__) + +constants.VehicleSeat = setmetatable({ + FrontLeft = 0, + FrontRight = 1, + RearLeft = 2, + RearRight = 3 +}, __readonly_table_meta__) + +constants.TrafficLightState = setmetatable({ + Auto = 'auto', + Disabled = 'disabled', + Red = 'red', + Yellow = 'yellow', + Green = 'green' +}, __readonly_table_meta__) + + )~LUA~"; +} \ No newline at end of file diff --git a/Shared/mods/deathmatch/logic/luascripts/constants_weapons.lua.h b/Shared/mods/deathmatch/logic/luascripts/constants_weapons.lua.h new file mode 100644 index 0000000000..6f1cda9d0b --- /dev/null +++ b/Shared/mods/deathmatch/logic/luascripts/constants_weapons.lua.h @@ -0,0 +1,88 @@ +namespace EmbeddedLuaCode +{ + const char* const constantsWeapons = R"~LUA~( +--[[ + SERVER AND CLIENT. + Defines a constant variables available for server and client. +--]] + +constants.WeaponSlot = setmetatable({ + Unarmed = 0, + Melee = 1, + Handgun = 2, + Shotgun = 3, + SMG = 4, + Rifle = 5, + Sniper = 6, + Heavy = 7, + Thrown = 8, + Special = 9, + Gift = 10, + Parachute = 11, + Detonator = 12, +}, __readonly_table_meta__) + +constants.WeaponSkillLevel = setmetatable({ + Poor = 0, + Gangster = 1, + Hitman = 2 +}, __readonly_table_meta__) + +constants.WeaponSkillName = setmetatable({ + Pro = 'pro', + Gangster = 'std', + Poor = 'poor' +}, __readonly_table_meta__) + +constants.WeaponProperties = setmetatable({ + WeaponRange = 'weapon_range', + TargetRange = 'target_range', + Accuracy = 'accuracy', + Damage = 'damage', + MaximumClipAmmo = 'maximum_clip_ammo', + MoveSpeed = 'move_speed', + Flags = 'flags', + FlagAimNoAuto = 'flag_aim_no_auto', + FlagAimArm = 'flag_aim_arm', + FlagAim1stPerson = 'flag_aim_1st_person', + FlagAimFree = 'flag_aim_free', + FlagMoveAndAim = 'flag_move_and_aim', + FlagMoveAndShoot = 'flag_move_and_shoot', + FlagTypeThrow = 'flag_type_throw', + FlagTypeHeavy = 'flag_type_heavy', + FlagTypeConstant = 'flag_type_constant', + FlagTypeDual = 'flag_type_dual', + FlagAnimReload = 'flag_anim_reload', + FlagAnimCrouch = 'flag_anim_crouch', + FlagAnimReloadLoop = 'flag_anim_reload_loop', + FlagAnimReloadLong = 'flag_anim_reload_long', + FlagShotSlows = 'flag_shot_slows', + FlagShotRandSpeed = 'flag_shot_rand_speed', + FlagShotAnimAbrupt = 'flag_shot_anim_abrupt', + FlagShotExpands = 'flag_shot_expands', + AnimLoopStart = 'anim_loop_start', + AnimLoopStop = 'anim_loop_stop', + AnimLoopBulletFire = 'anim_loop_bullet_fire', + Anim2LoopStart = 'anim2_loop_start', + Anim2LoopStop = 'anim2_loop_stop', + Anim2LoopBulletFire = 'anim2_loop_bullet_fire', + AnimBreakoutTime = 'anim_breakout_time', + FireType = 'fire_type', + Model = 'model', + Model2 = 'model2', + WeaponSlot = 'weapon_slot', + AnimGroup = 'anim_group', + SkillLevel = 'skill_level', + RequiredSkillLevel = 'required_skill_level', + FiringSpeed = 'firing_speed', + Radius = 'radius', + LifeSpan = 'life_span', + Spread = 'spread', + FireOffset = 'fire_offset', + AimOffset = 'aim_offset', + DefaultCombo = 'default_combo', + CombosAvailable = 'combos_available', +}, __readonly_table_meta__) + + )~LUA~"; +} \ No newline at end of file