├── README.md ├── __resource.lua ├── cl.lua └── sv.lua /README.md: -------------------------------------------------------------------------------- 1 | # devProp 2 | JUST FOR DEVELOPERS 3 | 4 | This script is made for esx_property 5 | 6 | You can add new properties in a very easy way. 7 | 8 | HOW-TO: 9 | Go to the point you want to enter a new property 10 | press L and insert the number of which property you wanna add 11 | press enter 12 | 13 | FINISHED 14 | 15 | *its just for adding single properties, no gateways 16 | 17 | Its just for developers, i will not answer any question about it. 18 | If you can´t read the code you are not a developer ;) 19 | 20 | *maybe in the next version: 21 | Add gateways to add more than one property in a building 22 | 23 | 24 | Credits goes to https://github.com/lowheartrate/streetLabel 25 | He allowed me to take the codesnippet with the streetlabels 26 | -------------------------------------------------------------------------------- /__resource.lua: -------------------------------------------------------------------------------- 1 | resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' 2 | 3 | description 'devProp' 4 | 5 | version '1.0.0' 6 | 7 | server_scripts { 8 | '@mysql-async/lib/MySQL.lua', 9 | 'sv.lua' 10 | } 11 | 12 | client_scripts { 13 | 'cl.lua' 14 | } 15 | 16 | dependencies { 17 | 'es_extended' 18 | } -------------------------------------------------------------------------------- /cl.lua: -------------------------------------------------------------------------------- 1 | local Keys = { 2 | ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, 3 | ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, 4 | ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, 5 | ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, 6 | ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, 7 | ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, 8 | ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, 9 | ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, 10 | ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 11 | } 12 | 13 | ESX = nil 14 | 15 | Citizen.CreateThread(function() 16 | while ESX == nil do 17 | TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) 18 | Citizen.Wait(0) 19 | end 20 | end) 21 | 22 | local zones = { 23 | ['AIRP'] = "Los Santos International Airport", 24 | ['ALAMO'] = "Alamo Sea", 25 | ['ALTA'] = "Alta", 26 | ['ARMYB'] = "Fort Zancudo", 27 | ['BANHAMC'] = "Banham Canyon Dr", 28 | ['BANNING'] = "Banning", 29 | ['BEACH'] = "Vespucci Beach", 30 | ['BHAMCA'] = "Banham Canyon", 31 | ['BRADP'] = "Braddock Pass", 32 | ['BRADT'] = "Braddock Tunnel", 33 | ['BURTON'] = "Burton", 34 | ['CALAFB'] = "Calafia Bridge", 35 | ['CANNY'] = "Raton Canyon", 36 | ['CCREAK'] = "Cassidy Creek", 37 | ['CHAMH'] = "Chamberlain Hills", 38 | ['CHIL'] = "Vinewood Hills", 39 | ['CHU'] = "Chumash", 40 | ['CMSW'] = "Chiliad Mountain State Wilderness", 41 | ['CYPRE'] = "Cypress Flats", 42 | ['DAVIS'] = "Davis", 43 | ['DELBE'] = "Del Perro Beach", 44 | ['DELPE'] = "Del Perro", 45 | ['DELSOL'] = "La Puerta", 46 | ['DESRT'] = "Grand Senora Desert", 47 | ['DOWNT'] = "Downtown", 48 | ['DTVINE'] = "Downtown Vinewood", 49 | ['EAST_V'] = "East Vinewood", 50 | ['EBURO'] = "El Burro Heights", 51 | ['ELGORL'] = "El Gordo Lighthouse", 52 | ['ELYSIAN'] = "Elysian Island", 53 | ['GALFISH'] = "Galilee", 54 | ['GOLF'] = "GWC and Golfing Society", 55 | ['GRAPES'] = "Grapeseed", 56 | ['GREATC'] = "Great Chaparral", 57 | ['HARMO'] = "Harmony", 58 | ['HAWICK'] = "Hawick", 59 | ['HORS'] = "Vinewood Racetrack", 60 | ['HUMLAB'] = "Humane Labs and Research", 61 | ['JAIL'] = "Bolingbroke Penitentiary", 62 | ['KOREAT'] = "Little Seoul", 63 | ['LACT'] = "Land Act Reservoir", 64 | ['LAGO'] = "Lago Zancudo", 65 | ['LDAM'] = "Land Act Dam", 66 | ['LEGSQU'] = "Legion Square", 67 | ['LMESA'] = "La Mesa", 68 | ['LOSPUER'] = "La Puerta", 69 | ['MIRR'] = "Mirror Park", 70 | ['MORN'] = "Morningwood", 71 | ['MOVIE'] = "Richards Majestic", 72 | ['MTCHIL'] = "Mount Chiliad", 73 | ['MTGORDO'] = "Mount Gordo", 74 | ['MTJOSE'] = "Mount Josiah", 75 | ['MURRI'] = "Murrieta Heights", 76 | ['NCHU'] = "North Chumash", 77 | ['NOOSE'] = "N.O.O.S.E", 78 | ['OCEANA'] = "Pacific Ocean", 79 | ['PALCOV'] = "Paleto Cove", 80 | ['PALETO'] = "Paleto Bay", 81 | ['PALFOR'] = "Paleto Forest", 82 | ['PALHIGH'] = "Palomino Highlands", 83 | ['PALMPOW'] = "Palmer-Taylor Power Station", 84 | ['PBLUFF'] = "Pacific Bluffs", 85 | ['PBOX'] = "Pillbox Hill", 86 | ['PROCOB'] = "Procopio Beach", 87 | ['RANCHO'] = "Rancho", 88 | ['RGLEN'] = "Richman Glen", 89 | ['RICHM'] = "Richman", 90 | ['ROCKF'] = "Rockford Hills", 91 | ['RTRAK'] = "Redwood Lights Track", 92 | ['SANAND'] = "San Andreas", 93 | ['SANCHIA'] = "San Chianski Mountain Range", 94 | ['SANDY'] = "Sandy Shores", 95 | ['SKID'] = "Mission Row", 96 | ['SLAB'] = "Stab City", 97 | ['STAD'] = "Maze Bank Arena", 98 | ['STRAW'] = "Strawberry", 99 | ['TATAMO'] = "Tataviam Mountains", 100 | ['TERMINA'] = "Terminal", 101 | ['TEXTI'] = "Textile City", 102 | ['TONGVAH'] = "Tongva Hills", 103 | ['TONGVAV'] = "Tongva Valley", 104 | ['VCANA'] = "Vespucci Canals", 105 | ['VESP'] = "Vespucci", 106 | ['VINE'] = "Vinewood", 107 | ['WINDF'] = "Ron Alternates Wind Farm", 108 | ['WVINE'] = "West Vinewood", 109 | ['ZANCUDO'] = "Zancudo River", 110 | ['ZP_ORT'] = "Port of South Los Santos", 111 | ['ZQ_UAR'] = "Davis Quartz" 112 | } 113 | local i = 1 114 | 115 | local price_low1 = 125000 116 | local price_med1 = 560000 117 | local price_high1 = 850000 118 | local price_lux1 = 1300000 119 | local price_lux2 = 1300000 120 | local price_lux3 = 1300000 121 | local price_motel = 43750 122 | 123 | Citizen.CreateThread(function() 124 | while true do 125 | Citizen.Wait(0) 126 | 127 | if IsControlJustReleased(0, Keys['L']) then 128 | local pos = GetEntityCoords(GetPlayerPed(-1)) 129 | local var1, var2 = GetStreetNameAtCoord(pos.x, pos.y, pos.z, Citizen.ResultAsInteger(), Citizen.ResultAsInteger()) 130 | local current_zone = zones[GetNameOfZone(pos.x, pos.y, pos.z)] 131 | local label = GetStreetNameFromHashKey(var1) 132 | local entering = '{\"x\":'..pos.x..',\"y\":'..pos.y..',\"z\":'..pos.z..'}' 133 | local ipl = '[]' 134 | 135 | DisplayOnscreenKeyboard(1, "", "", "", "1=Low 1\n2=Middle 1\n3=High 1\n4=Luxus 1\n5=Luxus 2\n6=Luxus 3\n7=Motel\n", "", "", 600) 136 | while (UpdateOnscreenKeyboard() == 0) do 137 | DisableAllControlActions(0); 138 | Wait(0); 139 | end 140 | if (GetOnscreenKeyboardResult()) then 141 | interieur = GetOnscreenKeyboardResult() 142 | interieur = string.gsub(interieur, '1=Low 1\n2=Middle 1\n3=High 1\n4=Luxus 1\n5=Luxus 2\n6=Luxus 3\n7=Motel\n', '') 143 | interieur = tonumber(interieur) 144 | Citizen.Wait(50) 145 | 146 | if interieur == 1 then 147 | inside = '{"x":265.307,"y":-1002.802,"z":-101.008}' 148 | roommenu = '{"x":265.916,"y":-999.38,"z":-101.008}' 149 | price = math.random(price_low1,price_low1*1.25) 150 | isSingle = 1 151 | isRoom = 0 152 | name = 'LowApartment'..i 153 | elseif interieur == 2 then 154 | inside = '{"x":-612.16,"y":59.06,"z":97.2}' 155 | roommenu = '{"x":-622.173,"y":54.585,"z":95.599}' 156 | price = math.random(price_med1,price_med1*1.35) 157 | isSingle = 1 158 | isRoom = 0 159 | name = 'MedApartment'..i 160 | elseif interieur == 3 then 161 | inside = '{"x":-1459.17,"y":-520.58,"z":54.929}' 162 | roommenu = '{"x":-1457.026,"y":-530.219,"z":54.937}' 163 | price = math.random(price_high1,price_high1*1.55) 164 | isSingle = 1 165 | isRoom = 0 166 | name = 'HigApartment'..i 167 | elseif interieur == 4 then 168 | inside = '{"x":-680.124,"y":590.608,"z":143.392}' 169 | roommenu = '{"x":-680.46,"y":588.6,"z":135.769}' 170 | price = math.random(price_lux1,price_lux1*1.85) 171 | isSingle = 1 172 | isRoom = 0 173 | name = 'LuxApartment'..i 174 | elseif interieur == 5 then 175 | inside = '{"x":118.037,"y":557.032,"z":182.301}' 176 | roommenu = '{"x":118.748,"y":566.573,"z":174.697}' 177 | price = math.random(price_lux2,price_lux2*1.85) 178 | isSingle = 1 179 | isRoom = 0 180 | name = 'LuxApartment'..i 181 | elseif interieur == 6 then 182 | inside = '{"x":-781.64,"y":319.48,"z":185.913}' 183 | roommenu = '{"x":-795.735,"y":326.757,"z":185.313}' 184 | price = math.random(price_lux3,price_lux3*1.85) 185 | isSingle = 1 186 | isRoom = 0 187 | name = 'LuxApartment'..i 188 | ipl = '["apa_v_mp_h_01_c"]' 189 | elseif interieur == 7 then 190 | inside = '{"x":151.45,"y":-1007.57,"z":-101.00}' 191 | roommenu = '' 192 | price = price_motel 193 | isSingle = 1 194 | isRoom = 1 195 | name = 'Motel'..i 196 | ipl = '["hei_hw1_blimp_interior_v_motel_mp_milo_"]' 197 | end 198 | 199 | TriggerServerEvent('putIn',name,label,entering,inside,ipl,isSingle,isRoom,roommenu,price) 200 | i = i + 1 201 | end 202 | end 203 | end 204 | end) 205 | -------------------------------------------------------------------------------- /sv.lua: -------------------------------------------------------------------------------- 1 | RegisterServerEvent('putIn') 2 | AddEventHandler('putIn', function(name,label,entering,inside,ipl,isSingle,isRoom,roommenu,price) 3 | 4 | local _source = source 5 | 6 | MySQL.Async.execute('INSERT INTO properties (name,label,entering,`exit`,inside,outside,ipls,is_single,is_room,room_menu,price) VALUES (@name,@label,@entering,@exit,@inside,@outside,@ipl,@isSingle,@isRoom,@roommenu,@price)', 7 | { 8 | ['@name'] = label..name, 9 | ['@label'] = label, 10 | ['@entering'] = entering, 11 | ['@exit'] = inside, 12 | ['@inside'] = inside, 13 | ['@outside'] = entering, 14 | ['@ipl'] = ipl, 15 | ['@isSingle'] = isSingle, 16 | ['@isRoom'] = isRoom, 17 | ['@roommenu'] = roommenu, 18 | ['@price'] = price 19 | 20 | }, function (rowsChanged) 21 | TriggerClientEvent('esx:showNotification', _source, 'Bezeichung:'..name..'\nStraße:'..label..'\nPreis:'..price) 22 | end) 23 | end) --------------------------------------------------------------------------------