└── vRP
├── vRP_firstpersoncamera
├── __resource.lua
├── README.md
└── client.lua
├── vRP_garages
├── .gitattributes
├── vrp_garages
│ ├── .gitattributes
│ ├── __resource.lua
│ ├── README.md
│ ├── lib
│ │ ├── Proxy.lua
│ │ └── Tunnel.lua
│ ├── GUI.lua
│ ├── server.lua
│ ├── client.lua
│ └── LICENSE
├── vrpfiles
│ ├── README.md
│ ├── client
│ │ └── basic_garage.lua
│ └── modules
│ │ └── basic_garage.lua
└── LICENSE
├── vrp_gui
├── menu.png
├── README.md
└── design.css
├── vRP_HungerThirstGUI
├── becomes.png
├── howtoinstall.txt
├── README.md
└── ProgressBar.js
├── vrp_blacklistmodel
├── Blacklistmodel.net.dll
├── __resource.lua
└── README.md
├── vRP_Databases
├── README.md
└── Database_SighmirGarages
│ └── vrp_user_vehicles.sql
├── vRP_showroompack
├── withoutcars
│ └── vrp_showroom
│ │ ├── cfg
│ │ └── config.lua
│ │ ├── __resource.lua
│ │ ├── README.md
│ │ ├── lib
│ │ └── Proxy.lua
│ │ ├── server.lua
│ │ └── client.lua
└── withcars
│ └── vrp_showroom
│ ├── __resource.lua
│ ├── README.md
│ ├── lib
│ └── Proxy.lua
│ ├── server.lua
│ └── cfg
│ └── config.lua
├── README.md
└── vrp_garages
└── README.md
/vRP/vRP_firstpersoncamera/__resource.lua:
--------------------------------------------------------------------------------
1 | client_script 'client.lua'
--------------------------------------------------------------------------------
/vRP/vRP_garages/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
--------------------------------------------------------------------------------
/vRP/vrp_gui/menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexmieila09/FiveM-Scripts/HEAD/vRP/vrp_gui/menu.png
--------------------------------------------------------------------------------
/vRP/vRP_garages/vrp_garages/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
--------------------------------------------------------------------------------
/vRP/vRP_HungerThirstGUI/becomes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexmieila09/FiveM-Scripts/HEAD/vRP/vRP_HungerThirstGUI/becomes.png
--------------------------------------------------------------------------------
/vRP/vrp_blacklistmodel/Blacklistmodel.net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexmieila09/FiveM-Scripts/HEAD/vRP/vrp_blacklistmodel/Blacklistmodel.net.dll
--------------------------------------------------------------------------------
/vRP/vRP_Databases/README.md:
--------------------------------------------------------------------------------
1 | # vrp_user_vehicles
2 |
3 | Replace your vrp_user_vehicles into your database with this, for properly working.
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/vRP/vrp_blacklistmodel/__resource.lua:
--------------------------------------------------------------------------------
1 | --KilobaiD
2 | -- Blacklist model
3 | -- Started on - 03/25/2018
4 | -- (ResourceSided)
5 | client_script {
6 | "Blacklistmodel.net.dll"
7 | }
8 |
--------------------------------------------------------------------------------
/vRP/vRP_firstpersoncamera/README.md:
--------------------------------------------------------------------------------
1 | # FirstPersonCamera
2 |
3 | This script does what the title says, adds the ability to force the player to play in First Person mode, and when in a car he can select between Third Person and First Person, making the player experience more real.
--------------------------------------------------------------------------------
/vRP/vRP_showroompack/withoutcars/vrp_showroom/cfg/config.lua:
--------------------------------------------------------------------------------
1 | local cfg = {}
2 |
3 | cfg.showgarage = {
4 | vehicles = {
5 | {name = "Blista", costs = 500, model = "blista"},
6 | {name = "Brioso R/A", costs = 5010000, model = "brioso"},
7 | {name = "Sultan RS", costs = 500, model = "sultanrs"},
8 | {name = "Adder", costs = 500, model = "adder"},
9 | {name = "Bati 801", costs = 15000, model = "bati"}
10 | }
11 | }
12 |
13 | return cfg
--------------------------------------------------------------------------------
/vRP/vrp_gui/README.md:
--------------------------------------------------------------------------------
1 | # vRP_MenuGui
2 |
3 | This does exactly what the title says, it makes the vRP K menu look better by changing the style and moving it, also you dont have to scroll as much since the divs are smaller.
4 |
5 | 
6 |
7 | How to install:
8 |
9 | A. Go to resources/vrp/gui and replace design.css.
10 |
11 | Thanks to Cozonaq for helping me figure out how to make it beautifull.
--------------------------------------------------------------------------------
/vRP/vRP_firstpersoncamera/client.lua:
--------------------------------------------------------------------------------
1 | local forceFirstPerson = true
2 | Citizen.CreateThread(function()
3 | SetBlackout(false)
4 |
5 | while true do
6 | Wait(1)
7 | local currentView = GetFollowPedCamViewMode()
8 | if forceFirstPerson then
9 | if currentView ~= 4 then
10 | SetFollowPedCamViewMode(4)
11 | Citizen.Trace(GetFollowPedCamViewMode())
12 | end
13 | if IsPedInAnyVehicle(GetPlayerPed(-1), true) then
14 | SetFollowPedCamViewMode(0)
15 | Citizen.Trace(GetFollowPedCamViewMode())
16 | end
17 | end
18 | end
19 | end)
--------------------------------------------------------------------------------
/vRP/README.md:
--------------------------------------------------------------------------------
1 | # FiveM Scipts
2 |
3 | Thanks for Sighmir for
4 | -vRP_garages
5 | -vRP_showroom
6 |
7 | # License
8 |
9 | FiveM Scripts
10 | Copyright (C) 2018 KilobaiD
11 |
12 | This program is free software: you can redistribute it and/or modify
13 | it under the terms of the GNU Affero General Public License as published
14 | by the Free Software Foundation, either version 3 of the License, or
15 | (at your option) any later version.
16 |
17 | This program is distributed in the hope that it will be useful,
18 | but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 | GNU Affero General Public License for more details.
21 |
22 | You should have received a copy of the GNU Affero General Public License
23 | along with this program. If not, see .
24 |
--------------------------------------------------------------------------------
/vRP/vRP_garages/vrpfiles/README.md:
--------------------------------------------------------------------------------
1 | # vrp_garages
2 | Replace the file into vrp/client - for Client
3 | Replace thie file into vrp/modules - for Modules
4 |
5 |
6 | # License
7 |
8 | FiveM Scripts
9 | Copyright (C) 2018 Sighmir
10 |
11 | This program is free software: you can redistribute it and/or modify
12 | it under the terms of the GNU Affero General Public License as published
13 | by the Free Software Foundation, either version 3 of the License, or
14 | (at your option) any later version.
15 |
16 | This program is distributed in the hope that it will be useful,
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 | GNU Affero General Public License for more details.
20 |
21 | You should have received a copy of the GNU Affero General Public License
22 | along with this program. If not, see .
23 |
--------------------------------------------------------------------------------
/vRP/vRP_HungerThirstGUI/howtoinstall.txt:
--------------------------------------------------------------------------------
1 | How to install:
2 |
3 | Go to resources/vrp/gui and replace ProgressBar.js.
4 | Change
5 | /* progress bar */
6 | .progressbar{
7 | position: absolute;
8 | }
9 |
10 | .progressbar .inner{
11 | }
12 |
13 | .progressbar .label{
14 | position: absolute;
15 | color: white;
16 | font-weight: bold;
17 | text-align: center;
18 | text-shadow: 2px 2px black;
19 | }
20 |
21 | to
22 |
23 | /* progress bar */
24 | .progressbar{
25 | position: absolute;
26 | padding-top:3px;
27 | padding-bottom:3px;
28 | }
29 |
30 | @media only screen and (max-width: 1366px) {
31 | .progressbar{
32 | position: absolute;
33 | padding-top:2px;
34 | padding-bottom:2px;
35 | }
36 | }
37 |
38 | .progressbar .inner{
39 | }
40 |
41 | .progressbar .label{
42 | position: absolute;
43 | color: white;
44 | font-weight: bold;
45 | text-align: center;
46 | text-shadow: 2px 2px black;
47 | }
48 |
49 | inside your design.css file.
--------------------------------------------------------------------------------
/vRP/vRP_showroompack/withcars/vrp_showroom/__resource.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | FiveM Scripts
3 | Copyright C 2018 Sighmir
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU Affero General Public License as published
7 | by the Free Software Foundation, either version 3 of the License, or
8 | at your option any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU Affero General Public License for more details.
14 |
15 | You should have received a copy of the GNU Affero General Public License
16 | along with this program. If not, see .
17 | ]]
18 |
19 |
20 | description "vRP showroom"
21 | --ui_page "ui/index.html"
22 |
23 | dependency "vrp"
24 |
25 | server_scripts{
26 | "@vrp/lib/utils.lua",
27 | "server.lua"
28 | }
29 |
30 | client_scripts{
31 | "lib/Proxy.lua",
32 | "client.lua"
33 | }
--------------------------------------------------------------------------------
/vRP/vRP_showroompack/withoutcars/vrp_showroom/__resource.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | FiveM Scripts
3 | Copyright C 2018 Sighmir
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU Affero General Public License as published
7 | by the Free Software Foundation, either version 3 of the License, or
8 | at your option any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU Affero General Public License for more details.
14 |
15 | You should have received a copy of the GNU Affero General Public License
16 | along with this program. If not, see .
17 | ]]
18 |
19 |
20 | description "vRP showroom"
21 | --ui_page "ui/index.html"
22 |
23 | dependency "vrp"
24 |
25 | server_scripts{
26 | "@vrp/lib/utils.lua",
27 | "server.lua"
28 | }
29 |
30 | client_scripts{
31 | "lib/Proxy.lua",
32 | "client.lua"
33 | }
--------------------------------------------------------------------------------
/vRP/vrp_blacklistmodel/README.md:
--------------------------------------------------------------------------------
1 | # vrp_Blacklistmodel
2 |
3 | This script blocks access to cars. If a player gets into a blacklist, he will automatically drop him down and receive a message that he has been warned that he can not drive.
4 |
5 | Update for the future: If he has a job as a cop, he will be able to drive special vehicles.
6 |
7 |
8 | # License
9 |
10 | FiveM Scripts
11 | Copyright (C) 2018 KilobaiD
12 |
13 | This program is free software: you can redistribute it and/or modify
14 | it under the terms of the GNU Affero General Public License as published
15 | by the Free Software Foundation, either version 3 of the License, or
16 | (at your option) any later version.
17 |
18 | This program is distributed in the hope that it will be useful,
19 | but WITHOUT ANY WARRANTY; without even the implied warranty of
20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 | GNU Affero General Public License for more details.
22 |
23 | You should have received a copy of the GNU Affero General Public License
24 | along with this program. If not, see .
25 |
--------------------------------------------------------------------------------
/vRP/vrp_garages/README.md:
--------------------------------------------------------------------------------
1 | # vrp_garages
2 | This script brings a change to Sighmir's resource, which add the function to sell the car at 50% of the price.
3 |
4 |
5 | #If you get SQL errors it should be because its made to work with databases that accept ADD IF NOT EXISTS.
6 |
7 | Thanks for Leo SHK for helping me with this. (credits go to him for the system)
8 |
9 | # License
10 |
11 | FiveM Scripts
12 | Copyright (C) 2018 Sighmir
13 |
14 | This program is free software: you can redistribute it and/or modify
15 | it under the terms of the GNU Affero General Public License as published
16 | by the Free Software Foundation, either version 3 of the License, or
17 | (at your option) any later version.
18 |
19 | This program is distributed in the hope that it will be useful,
20 | but WITHOUT ANY WARRANTY; without even the implied warranty of
21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 | GNU Affero General Public License for more details.
23 |
24 | You should have received a copy of the GNU Affero General Public License
25 | along with this program. If not, see .
26 |
--------------------------------------------------------------------------------
/vRP/vRP_garages/vrp_garages/__resource.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | FiveM Scripts
3 | Copyright C 2018 Sighmir
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU Affero General Public License as published
7 | by the Free Software Foundation, either version 3 of the License, or
8 | at your option any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU Affero General Public License for more details.
14 |
15 | You should have received a copy of the GNU Affero General Public License
16 | along with this program. If not, see .
17 | ]]
18 |
19 |
20 | description "vRP ply_garages"
21 | --ui_page "ui/index.html"
22 |
23 | dependency "vrp"
24 |
25 | client_scripts{
26 | "lib/Tunnel.lua",
27 | "lib/Proxy.lua",
28 | "GUI.lua",
29 | "client.lua"
30 | }
31 |
32 | server_scripts{
33 | "@vrp/lib/utils.lua",
34 | "server.lua"
35 | }
36 |
--------------------------------------------------------------------------------
/vRP/vRP_showroompack/withcars/vrp_showroom/README.md:
--------------------------------------------------------------------------------
1 | # vrp_shoowroomprotection
2 | This script brings a change to Sighmir's resource, which prevents the Cheat-Engine from running on your servers.
3 |
4 |
5 | #If you get SQL errors it should be because its made to work with databases that accept ADD IF NOT EXISTS.
6 | To create the tables on your database follow the steps:
7 |
8 | Remove every IF NOT EXISTS from server.lua
9 | Run the server once.
10 | Comment out the MySQL.query("vRP/showroom_columns") adding -- before it
11 | Restart the server one more time.
12 | You're good to go from now on.
13 |
14 | Thanks for Leo SHK for helping me with this. (credits go to him for the system)
15 |
16 | # License
17 |
18 | FiveM Scripts
19 | Copyright (C) 2018 Sighmir
20 |
21 | This program is free software: you can redistribute it and/or modify
22 | it under the terms of the GNU Affero General Public License as published
23 | by the Free Software Foundation, either version 3 of the License, or
24 | (at your option) any later version.
25 |
26 | This program is distributed in the hope that it will be useful,
27 | but WITHOUT ANY WARRANTY; without even the implied warranty of
28 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 | GNU Affero General Public License for more details.
30 |
31 | You should have received a copy of the GNU Affero General Public License
32 | along with this program. If not, see .
33 |
--------------------------------------------------------------------------------
/vRP/vRP_showroompack/withoutcars/vrp_showroom/README.md:
--------------------------------------------------------------------------------
1 | # vrp_shoowroomprotection
2 | This script brings a change to Sighmir's resource, which prevents the Cheat-Engine from running on your servers.
3 |
4 |
5 | #If you get SQL errors it should be because its made to work with databases that accept ADD IF NOT EXISTS.
6 | To create the tables on your database follow the steps:
7 |
8 | Remove every IF NOT EXISTS from server.lua
9 | Run the server once.
10 | Comment out the MySQL.query("vRP/showroom_columns") adding -- before it
11 | Restart the server one more time.
12 | You're good to go from now on.
13 |
14 | Thanks for Leo SHK for helping me with this. (credits go to him for the system)
15 |
16 | # License
17 |
18 | FiveM Scripts
19 | Copyright (C) 2018 Sighmir
20 |
21 | This program is free software: you can redistribute it and/or modify
22 | it under the terms of the GNU Affero General Public License as published
23 | by the Free Software Foundation, either version 3 of the License, or
24 | (at your option) any later version.
25 |
26 | This program is distributed in the hope that it will be useful,
27 | but WITHOUT ANY WARRANTY; without even the implied warranty of
28 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 | GNU Affero General Public License for more details.
30 |
31 | You should have received a copy of the GNU Affero General Public License
32 | along with this program. If not, see .
33 |
--------------------------------------------------------------------------------
/vRP/vRP_HungerThirstGUI/README.md:
--------------------------------------------------------------------------------
1 | # vRP_HungerThirstGUI
2 |
3 | This does exactly what the title says, it makes the vRP thirst and hunger bars look much better. (Also, now when you're hungry or thirsty the bar is at 0% just like the ingame HP bar would be if you had 0 HP.)
4 |
5 | Works best on: 1920x1080, 1600x900, 1366x768, 1280x720, 1024x768 (If you want any other resolutions just leave a comment and I might make an update.)
6 |
7 | 
8 |
9 | How to install:
10 |
11 | Go to resources/vrp/gui and replace ProgressBar.js.
12 | Change
13 | /* progress bar */
14 | .progressbar{
15 | position: absolute;
16 | }
17 |
18 | .progressbar .inner{
19 | }
20 |
21 | .progressbar .label{
22 | position: absolute;
23 | color: white;
24 | font-weight: bold;
25 | text-align: center;
26 | text-shadow: 2px 2px black;
27 | }
28 |
29 | to
30 |
31 | /* progress bar */
32 | .progressbar{
33 | position: absolute;
34 | padding-top:3px;
35 | padding-bottom:3px;
36 | }
37 |
38 | @media only screen and (max-width: 1366px) {
39 | .progressbar{
40 | position: absolute;
41 | padding-top:2px;
42 | padding-bottom:2px;
43 | }
44 | }
45 |
46 | .progressbar .inner{
47 | }
48 |
49 | .progressbar .label{
50 | position: absolute;
51 | color: white;
52 | font-weight: bold;
53 | text-align: center;
54 | text-shadow: 2px 2px black;
55 | }
56 |
57 | inside your design.css file.
58 |
59 | For any further questions, comment down here.
60 | https://forum.fivem.net/t/improvement-better-looking-hunger-and-thirst-bars-for-vrp/93630/17
61 |
62 | Thanks to Cozonaq for helping me figure out how to make it beautifull.
--------------------------------------------------------------------------------
/vRP/vRP_garages/vrp_garages/README.md:
--------------------------------------------------------------------------------
1 | # vrp_garages
2 | fx-server only, requires my vrp_lscustoms
3 |
4 | Support me and my scripts on Patreon:
5 | [](https://www.patreon.com/Sighmir)
6 | ***********************************************************************************************************************************
7 | Add:
8 | ```
9 | AddEventHandler('vrp_garages:setVehicle', function(vtype, vehicle)
10 | vehicles[vtype] = vehicle
11 | end)
12 | ```
13 | to the top of your vrp/client/basic_garage.lua, under the local vehicles variable, for vehicle button compatibility.
14 | ************************************************************************************************************************************
15 | Replace:
16 | ```
17 | vRPclient.spawnGarageVehicle(player,{veh_type,vname})
18 | ```
19 | With:
20 | ```
21 | TriggerEvent('ply_garages:CheckForSpawnBasicVeh', user_id, vname)
22 | ```
23 | on line 67 of your vrp/modules/basic_garage.lua, under the vRP.closeMenu(player) function, for basic garage compatibility.
24 |
25 | ## License
26 |
27 | FiveM Scripts
28 | Copyright (C) 2018 Sighmir
29 |
30 | This program is free software: you can redistribute it and/or modify
31 | it under the terms of the GNU Affero General Public License as published
32 | by the Free Software Foundation, either version 3 of the License, or
33 | (at your option) any later version.
34 |
35 | This program is distributed in the hope that it will be useful,
36 | but WITHOUT ANY WARRANTY; without even the implied warranty of
37 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38 | GNU Affero General Public License for more details.
39 |
40 | You should have received a copy of the GNU Affero General Public License
41 | along with this program. If not, see .
42 |
--------------------------------------------------------------------------------
/vRP/vRP_garages/vrp_garages/lib/Proxy.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | FiveM Scripts
3 | Copyright C 2018 Sighmir
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU Affero General Public License as published
7 | by the Free Software Foundation, either version 3 of the License, or
8 | at your option any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU Affero General Public License for more details.
14 |
15 | You should have received a copy of the GNU Affero General Public License
16 | along with this program. If not, see .
17 | ]]
18 |
19 | -- PROXY CLIENT-SIDE VERSION (https://github.com/ImagicTheCat/vRP)
20 | -- Proxy interface system, used to add/call functions between resources
21 | Proxy = {}
22 |
23 | local proxy_rdata = {}
24 | local function proxy_callback(rvalues) -- save returned values, TriggerEvent is synchronous
25 | proxy_rdata = rvalues
26 | end
27 |
28 | local function proxy_resolve(itable,key)
29 | local iname = getmetatable(itable).name
30 |
31 | -- generate access function
32 | local fcall = function(args,callback)
33 | if args == nil then
34 | args = {}
35 | end
36 |
37 | TriggerEvent(iname..":proxy",key,args,proxy_callback)
38 | return table.unpack(proxy_rdata) -- returns
39 | end
40 |
41 | itable[key] = fcall -- add generated call to table (optimization)
42 | return fcall
43 | end
44 |
45 | --- Add event handler to call interface functions (can be called multiple times for the same interface name with different tables)
46 | function Proxy.addInterface(name, itable)
47 | AddEventHandler(name..":proxy",function(member,args,callback)
48 | local f = itable[member]
49 |
50 | if type(f) == "function" then
51 | callback({f(table.unpack(args))}) -- call function with and return values through callback
52 | -- CancelEvent() -- cancel event doesn't seem to cancel the event for the other handlers, but if it does, uncomment this
53 | else
54 | -- print("error: proxy call "..name..":"..member.." not found")
55 | end
56 | end)
57 | end
58 |
59 | function Proxy.getInterface(name)
60 | local r = setmetatable({},{ __index = proxy_resolve, name = name })
61 | return r
62 | end
63 |
64 | -- END PROXY CLIENT-SIDE VERSION
65 |
--------------------------------------------------------------------------------
/vRP/vRP_showroompack/withcars/vrp_showroom/lib/Proxy.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | FiveM Scripts
3 | Copyright C 2018 Sighmir
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU Affero General Public License as published
7 | by the Free Software Foundation, either version 3 of the License, or
8 | at your option any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU Affero General Public License for more details.
14 |
15 | You should have received a copy of the GNU Affero General Public License
16 | along with this program. If not, see .
17 | ]]
18 |
19 | -- PROXY CLIENT-SIDE VERSION (https://github.com/ImagicTheCat/vRP)
20 | -- Proxy interface system, used to add/call functions between resources
21 | Proxy = {}
22 |
23 | local proxy_rdata = {}
24 | local function proxy_callback(rvalues) -- save returned values, TriggerEvent is synchronous
25 | proxy_rdata = rvalues
26 | end
27 |
28 | local function proxy_resolve(itable,key)
29 | local iname = getmetatable(itable).name
30 |
31 | -- generate access function
32 | local fcall = function(args,callback)
33 | if args == nil then
34 | args = {}
35 | end
36 |
37 | TriggerEvent(iname..":proxy",key,args,proxy_callback)
38 | return table.unpack(proxy_rdata) -- returns
39 | end
40 |
41 | itable[key] = fcall -- add generated call to table (optimization)
42 | return fcall
43 | end
44 |
45 | --- Add event handler to call interface functions (can be called multiple times for the same interface name with different tables)
46 | function Proxy.addInterface(name, itable)
47 | AddEventHandler(name..":proxy",function(member,args,callback)
48 | local f = itable[member]
49 |
50 | if type(f) == "function" then
51 | callback({f(table.unpack(args))}) -- call function with and return values through callback
52 | -- CancelEvent() -- cancel event doesn't seem to cancel the event for the other handlers, but if it does, uncomment this
53 | else
54 | -- print("error: proxy call "..name..":"..member.." not found")
55 | end
56 | end)
57 | end
58 |
59 | function Proxy.getInterface(name)
60 | local r = setmetatable({},{ __index = proxy_resolve, name = name })
61 | return r
62 | end
63 |
64 | -- END PROXY CLIENT-SIDE VERSION
65 |
--------------------------------------------------------------------------------
/vRP/vRP_showroompack/withoutcars/vrp_showroom/lib/Proxy.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | FiveM Scripts
3 | Copyright C 2018 Sighmir
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU Affero General Public License as published
7 | by the Free Software Foundation, either version 3 of the License, or
8 | at your option any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU Affero General Public License for more details.
14 |
15 | You should have received a copy of the GNU Affero General Public License
16 | along with this program. If not, see .
17 | ]]
18 |
19 | -- PROXY CLIENT-SIDE VERSION (https://github.com/ImagicTheCat/vRP)
20 | -- Proxy interface system, used to add/call functions between resources
21 | Proxy = {}
22 |
23 | local proxy_rdata = {}
24 | local function proxy_callback(rvalues) -- save returned values, TriggerEvent is synchronous
25 | proxy_rdata = rvalues
26 | end
27 |
28 | local function proxy_resolve(itable,key)
29 | local iname = getmetatable(itable).name
30 |
31 | -- generate access function
32 | local fcall = function(args,callback)
33 | if args == nil then
34 | args = {}
35 | end
36 |
37 | TriggerEvent(iname..":proxy",key,args,proxy_callback)
38 | return table.unpack(proxy_rdata) -- returns
39 | end
40 |
41 | itable[key] = fcall -- add generated call to table (optimization)
42 | return fcall
43 | end
44 |
45 | --- Add event handler to call interface functions (can be called multiple times for the same interface name with different tables)
46 | function Proxy.addInterface(name, itable)
47 | AddEventHandler(name..":proxy",function(member,args,callback)
48 | local f = itable[member]
49 |
50 | if type(f) == "function" then
51 | callback({f(table.unpack(args))}) -- call function with and return values through callback
52 | -- CancelEvent() -- cancel event doesn't seem to cancel the event for the other handlers, but if it does, uncomment this
53 | else
54 | -- print("error: proxy call "..name..":"..member.." not found")
55 | end
56 | end)
57 | end
58 |
59 | function Proxy.getInterface(name)
60 | local r = setmetatable({},{ __index = proxy_resolve, name = name })
61 | return r
62 | end
63 |
64 | -- END PROXY CLIENT-SIDE VERSION
65 |
--------------------------------------------------------------------------------
/vRP/vRP_showroompack/withcars/vrp_showroom/server.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | FiveM Scripts
3 | Copyright C 2018 Sighmir
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU Affero General Public License as published
7 | by the Free Software Foundation, either version 3 of the License, or
8 | at your option any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU Affero General Public License for more details.
14 | z
15 | You should have received a copy of the GNU Affero General Public License
16 | along with this program. If not, see .
17 | ]]
18 |
19 | local Tunnel = module("vrp", "lib/Tunnel")
20 | local Proxy = module("vrp", "lib/Proxy")
21 |
22 | MySQL = module("vrp_mysql", "MySQL")
23 |
24 | vRP = Proxy.getInterface("vRP")
25 | vRPclient = Tunnel.getInterface("vRP","vRP_showroom")
26 | Gclient = Tunnel.getInterface("vRP_garages","vRP_showroom")
27 |
28 | local cfg = module("vrp_showroom","cfg/config")
29 | local vehgarage = cfg.showgarage
30 |
31 |
32 | -- vehicle db / garage and lscustoms compatibility
33 | MySQL.createCommand("vRP/showroom_columns", [[
34 | ALTER TABLE vrp_user_vehicles ADD veh_type varchar(255) NOT NULL DEFAULT 'default' ;
35 | ALTER TABLE vrp_user_vehicles ADD vehicle_plate varchar(255) NOT NULL;
36 | ]])
37 | --MySQL.query("vRP/showroom_columns")
38 |
39 | MySQL.createCommand("vRP/add_custom_vehicle","INSERT IGNORE INTO vrp_user_vehicles(user_id,vehicle,vehicle_plate,veh_type) VALUES(@user_id,@vehicle,@vehicle_plate,@veh_type)")
40 |
41 | -- SHOWROOM
42 | RegisterServerEvent('veh_SR:CheckMoneyForVeh')
43 | AddEventHandler('veh_SR:CheckMoneyForVeh', function(vehicle, price ,veh_type)
44 | local user_id = vRP.getUserId({source})
45 | local player = vRP.getUserSource({user_id})
46 | MySQL.query("vRP/get_vehicle", {user_id = user_id, vehicle = vehicle}, function(pvehicle, affected)
47 | if #pvehicle > 0 then
48 | vRPclient.notify(player,{"~r~You already own a car."})
49 | else
50 | for i=1, #vehgarage.vehicles do
51 | if vehgarage.vehicles[i].model == vehicle and vehgarage.vehicles[i].costs == price then
52 | if vRP.tryFullPayment({user_id,price}) then
53 | vRP.getUserIdentity({user_id, function(identity)
54 | MySQL.query("vRP/add_custom_vehicle", {user_id = user_id, vehicle = vehicle, vehicle_plate = "P "..identity.registration, veh_type = veh_type})
55 | end})
56 |
57 | TriggerClientEvent('veh_SR:CloseMenu', player, vehicle, veh_type)
58 | vRPclient.notify(player,{"Payed ~r~$ "..price.."."})
59 | else
60 | vRPclient.notify(player,{"~r~Insufficient funds."})
61 | end
62 | end
63 | end
64 | end
65 | end)
66 | end)
67 |
68 | RegisterServerEvent('veh_SR:CheckMoneyForBasicVeh')
69 | AddEventHandler('veh_SR:CheckMoneyForBasicVeh', function(user_id, vehicle, price ,veh_type)
70 | local player = vRP.getUserSource({user_id})
71 | MySQL.query("vRP/get_vehicle", {user_id = user_id, vehicle = vehicle}, function(pvehicle, affected)
72 | if #pvehicle > 0 then
73 | vRPclient.notify(player,{"~r~Vehicle already owned."})
74 | vRP.giveMoney({user_id,price})
75 | else
76 | vRPclient.notify(player,{"Paid ~r~"..price.."$."})
77 | vRP.getUserIdentity({user_id, function(identity)
78 | MySQL.query("vRP/add_custom_vehicle", {user_id = user_id, vehicle = vehicle, vehicle_plate = "P "..identity.registration, veh_type = veh_type})
79 | end})
80 | Gclient.spawnBoughtVehicle(player,{veh_type, vehicle})
81 | end
82 | end)
83 | end)
--------------------------------------------------------------------------------
/vRP/vRP_showroompack/withoutcars/vrp_showroom/server.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | FiveM Scripts
3 | Copyright C 2018 Sighmir
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU Affero General Public License as published
7 | by the Free Software Foundation, either version 3 of the License, or
8 | at your option any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU Affero General Public License for more details.
14 | z
15 | You should have received a copy of the GNU Affero General Public License
16 | along with this program. If not, see .
17 | ]]
18 |
19 | local Tunnel = module("vrp", "lib/Tunnel")
20 | local Proxy = module("vrp", "lib/Proxy")
21 |
22 | MySQL = module("vrp_mysql", "MySQL")
23 |
24 | vRP = Proxy.getInterface("vRP")
25 | vRPclient = Tunnel.getInterface("vRP","vRP_showroom")
26 | Gclient = Tunnel.getInterface("vRP_garages","vRP_showroom")
27 |
28 | local cfg = module("vrp_showroom","cfg/config")
29 | local vehgarage = cfg.showgarage
30 |
31 |
32 | -- vehicle db / garage and lscustoms compatibility
33 | MySQL.createCommand("vRP/showroom_columns", [[
34 | ALTER TABLE vrp_user_vehicles ADD veh_type varchar(255) NOT NULL DEFAULT 'default' ;
35 | ALTER TABLE vrp_user_vehicles ADD vehicle_plate varchar(255) NOT NULL;
36 | ]])
37 | --MySQL.query("vRP/showroom_columns")
38 |
39 | MySQL.createCommand("vRP/add_custom_vehicle","INSERT IGNORE INTO vrp_user_vehicles(user_id,vehicle,vehicle_plate,veh_type) VALUES(@user_id,@vehicle,@vehicle_plate,@veh_type)")
40 |
41 | -- SHOWROOM
42 | RegisterServerEvent('veh_SR:CheckMoneyForVeh')
43 | AddEventHandler('veh_SR:CheckMoneyForVeh', function(vehicle, price ,veh_type)
44 | local user_id = vRP.getUserId({source})
45 | local player = vRP.getUserSource({user_id})
46 | MySQL.query("vRP/get_vehicle", {user_id = user_id, vehicle = vehicle}, function(pvehicle, affected)
47 | if #pvehicle > 0 then
48 | vRPclient.notify(player,{"~r~You already own a car."})
49 | else
50 | for i=1, #vehgarage.vehicles do
51 | if vehgarage.vehicles[i].model == vehicle and vehgarage.vehicles[i].costs == price then
52 | if vRP.tryFullPayment({user_id,price}) then
53 | vRP.getUserIdentity({user_id, function(identity)
54 | MySQL.query("vRP/add_custom_vehicle", {user_id = user_id, vehicle = vehicle, vehicle_plate = "P "..identity.registration, veh_type = veh_type})
55 | end})
56 |
57 | TriggerClientEvent('veh_SR:CloseMenu', player, vehicle, veh_type)
58 | vRPclient.notify(player,{"Paid ~r~$ "..price.."."})
59 | else
60 | vRPclient.notify(player,{"~r~Insufficient funds."})
61 | end
62 | end
63 | end
64 | end
65 | end)
66 | end)
67 |
68 | RegisterServerEvent('veh_SR:CheckMoneyForBasicVeh')
69 | AddEventHandler('veh_SR:CheckMoneyForBasicVeh', function(user_id, vehicle, price ,veh_type)
70 | local player = vRP.getUserSource({user_id})
71 | MySQL.query("vRP/get_vehicle", {user_id = user_id, vehicle = vehicle}, function(pvehicle, affected)
72 | if #pvehicle > 0 then
73 | vRPclient.notify(player,{"~r~Vehicle already owned."})
74 | vRP.giveMoney({user_id,price})
75 | else
76 | vRPclient.notify(player,{"Paid ~r~"..price.."$."})
77 | vRP.getUserIdentity({user_id, function(identity)
78 | MySQL.query("vRP/add_custom_vehicle", {user_id = user_id, vehicle = vehicle, vehicle_plate = "P "..identity.registration, veh_type = veh_type})
79 | end})
80 | Gclient.spawnBoughtVehicle(player,{veh_type, vehicle})
81 | end
82 | end)
83 | end)
--------------------------------------------------------------------------------
/vRP/vRP_Databases/Database_SighmirGarages/vrp_user_vehicles.sql:
--------------------------------------------------------------------------------
1 | -- phpMyAdmin SQL Dump
2 | -- version 4.7.4
3 | -- https://www.phpmyadmin.net/
4 | --
5 | -- Host: 127.0.0.1
6 | -- Generation Time: 21 Mar 2018 la 17:22
7 | -- Versiune server: 10.1.28-MariaDB
8 | -- PHP Version: 7.1.10
9 |
10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11 | SET AUTOCOMMIT = 0;
12 | START TRANSACTION;
13 | SET time_zone = "+00:00";
14 |
15 |
16 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
17 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
18 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
19 | /*!40101 SET NAMES utf8mb4 */;
20 |
21 | --
22 | -- Database: `vrpfx`
23 | --
24 |
25 | -- --------------------------------------------------------
26 |
27 | --
28 | -- Structura de tabel pentru tabelul `vrp_user_vehicles`
29 | --
30 |
31 | CREATE TABLE `vrp_user_vehicles` (
32 | `user_id` int(11) NOT NULL,
33 | `vehicle` varchar(100) NOT NULL,
34 | `veh_type` varchar(255) NOT NULL DEFAULT 'default',
35 | `vehicle_plate` varchar(255) NOT NULL,
36 | `vehicle_colorprimary` varchar(255) DEFAULT NULL,
37 | `vehicle_colorsecondary` varchar(255) DEFAULT NULL,
38 | `vehicle_pearlescentcolor` varchar(255) DEFAULT NULL,
39 | `vehicle_wheelcolor` varchar(255) DEFAULT NULL,
40 | `vehicle_plateindex` varchar(255) DEFAULT NULL,
41 | `vehicle_neoncolor1` varchar(255) DEFAULT NULL,
42 | `vehicle_neoncolor2` varchar(255) DEFAULT NULL,
43 | `vehicle_neoncolor3` varchar(255) DEFAULT NULL,
44 | `vehicle_windowtint` varchar(255) DEFAULT NULL,
45 | `vehicle_wheeltype` varchar(255) DEFAULT NULL,
46 | `vehicle_mods0` varchar(255) DEFAULT NULL,
47 | `vehicle_mods1` varchar(255) DEFAULT NULL,
48 | `vehicle_mods2` varchar(255) DEFAULT NULL,
49 | `vehicle_mods3` varchar(255) DEFAULT NULL,
50 | `vehicle_mods4` varchar(255) DEFAULT NULL,
51 | `vehicle_mods5` varchar(255) DEFAULT NULL,
52 | `vehicle_mods6` varchar(255) DEFAULT NULL,
53 | `vehicle_mods7` varchar(255) DEFAULT NULL,
54 | `vehicle_mods8` varchar(255) DEFAULT NULL,
55 | `vehicle_mods9` varchar(255) DEFAULT NULL,
56 | `vehicle_mods10` varchar(255) DEFAULT NULL,
57 | `vehicle_mods11` varchar(255) DEFAULT NULL,
58 | `vehicle_mods12` varchar(255) DEFAULT NULL,
59 | `vehicle_mods13` varchar(255) DEFAULT NULL,
60 | `vehicle_mods14` varchar(255) DEFAULT NULL,
61 | `vehicle_mods15` varchar(255) DEFAULT NULL,
62 | `vehicle_mods16` varchar(255) DEFAULT NULL,
63 | `vehicle_turbo` varchar(255) NOT NULL DEFAULT 'off',
64 | `vehicle_tiresmoke` varchar(255) NOT NULL DEFAULT 'off',
65 | `vehicle_xenon` varchar(255) NOT NULL DEFAULT 'off',
66 | `vehicle_mods23` varchar(255) DEFAULT NULL,
67 | `vehicle_mods24` varchar(255) DEFAULT NULL,
68 | `vehicle_neon0` varchar(255) DEFAULT NULL,
69 | `vehicle_neon1` varchar(255) DEFAULT NULL,
70 | `vehicle_neon2` varchar(255) DEFAULT NULL,
71 | `vehicle_neon3` varchar(255) DEFAULT NULL,
72 | `vehicle_bulletproof` varchar(255) DEFAULT NULL,
73 | `vehicle_smokecolor1` varchar(255) DEFAULT NULL,
74 | `vehicle_smokecolor2` varchar(255) DEFAULT NULL,
75 | `vehicle_smokecolor3` varchar(255) DEFAULT NULL,
76 | `vehicle_modvariation` varchar(255) NOT NULL DEFAULT 'off'
77 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
78 |
79 | --
80 | -- Indexes for dumped tables
81 | --
82 |
83 | --
84 | -- Indexes for table `vrp_user_vehicles`
85 | --
86 | ALTER TABLE `vrp_user_vehicles`
87 | ADD PRIMARY KEY (`user_id`,`vehicle`);
88 |
89 | --
90 | -- Restrictii pentru tabele sterse
91 | --
92 |
93 | --
94 | -- Restrictii pentru tabele `vrp_user_vehicles`
95 | --
96 | ALTER TABLE `vrp_user_vehicles`
97 | ADD CONSTRAINT `fk_user_vehicles_users` FOREIGN KEY (`user_id`) REFERENCES `vrp_users` (`id`) ON DELETE CASCADE;
98 | COMMIT;
99 |
100 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
101 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
102 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
103 |
--------------------------------------------------------------------------------
/vRP/vRP_garages/vrp_garages/GUI.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | FiveM Scripts
3 | Copyright C 2018 Sighmir
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU Affero General Public License as published
7 | by the Free Software Foundation, either version 3 of the License, or
8 | at your option any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU Affero General Public License for more details.
14 |
15 | You should have received a copy of the GNU Affero General Public License
16 | along with this program. If not, see .
17 | ]]
18 |
19 | Menu = {}
20 | Menu.GUI = {}
21 | Menu.buttonCount = 0
22 | Menu.selection = 0
23 | Menu.hidden = true
24 | MenuTitle = "Garage"
25 |
26 | function Menu.addButton(name, func,args)
27 |
28 | local yoffset = 0.2
29 | local xoffset = 0
30 | local xmin = 0.0
31 | local xmax = 0.3
32 | local ymin = 0.05
33 | local ymax = 0.05
34 | Menu.GUI[Menu.buttonCount+1] = {}
35 | Menu.GUI[Menu.buttonCount+1]["name"] = name
36 | Menu.GUI[Menu.buttonCount+1]["func"] = func
37 | Menu.GUI[Menu.buttonCount+1]["args"] = args
38 | Menu.GUI[Menu.buttonCount+1]["active"] = false
39 | Menu.GUI[Menu.buttonCount+1]["xmin"] = xmin + xoffset
40 | Menu.GUI[Menu.buttonCount+1]["ymin"] = ymin * (Menu.buttonCount + 0.01) +yoffset
41 | Menu.GUI[Menu.buttonCount+1]["xmax"] = xmax
42 | Menu.GUI[Menu.buttonCount+1]["ymax"] = ymax
43 | Menu.buttonCount = Menu.buttonCount+1
44 | end
45 |
46 |
47 | function Menu.updateSelection()
48 | if IsControlJustPressed(3, 173) then
49 | if(Menu.selection < Menu.buttonCount -1 ) then
50 | Menu.selection = Menu.selection +1
51 | else
52 | Menu.selection = 0
53 | end
54 | elseif IsControlJustPressed(3, 172) then
55 | if(Menu.selection > 0)then
56 | Menu.selection = Menu.selection -1
57 | else
58 | Menu.selection = Menu.buttonCount-1
59 | end
60 | elseif IsControlJustPressed(3, 176) then
61 | MenuCallFunction(Menu.GUI[Menu.selection +1]["func"], Menu.GUI[Menu.selection +1]["args"])
62 | end
63 | local iterator = 0
64 | for id, settings in ipairs(Menu.GUI) do
65 | Menu.GUI[id]["active"] = false
66 | if(iterator == Menu.selection ) then
67 | Menu.GUI[iterator +1]["active"] = true
68 | end
69 | iterator = iterator +1
70 | end
71 | end
72 |
73 | function Menu.renderGUI()
74 | if not Menu.hidden then
75 | Menu.renderButtons()
76 | Menu.updateSelection()
77 | end
78 | end
79 |
80 | function Menu.renderBox(xMin,xMax,yMin,yMax,color1,color2,color3,color4)
81 | DrawRect(xMin, yMin,xMax, yMax, color1, color2, color3, color4);
82 | end
83 |
84 | function Menu.renderButtons()
85 |
86 | local yoffset = 0.2
87 | local xoffset = 0
88 |
89 | SetTextFont(1)
90 | SetTextProportional(0)
91 | SetTextScale(1.0, 1.0)
92 | SetTextColour(255, 255, 255, 255)
93 | SetTextDropShadow(0, 0, 0, 0,255)
94 | SetTextEdge(1, 0, 0, 0, 255)
95 | SetTextDropShadow()
96 | SetTextOutline()
97 | SetTextCentre(2)
98 | SetTextEntry("STRING")
99 | AddTextComponentString(string.upper(MenuTitle))
100 | DrawText((xoffset + 0.07), (yoffset - 0.065 - 0.0125 ))
101 | Menu.renderBox(xoffset,0.3,(yoffset - 0.05),0.05,20,20,255,150)
102 |
103 |
104 | for id, settings in pairs(Menu.GUI) do
105 | local screen_w = 0
106 | local screen_h = 0
107 | screen_w, screen_h = GetScreenResolution(0, 0)
108 |
109 | if(settings["active"]) then
110 | boxColor = {255,255,255,150}
111 | SetTextColour(0, 0, 0, 255)
112 | else
113 | boxColor = {0,0,0,150}
114 | SetTextColour(255, 255, 255, 255)
115 | end
116 | SetTextFont(0)
117 | SetTextScale(0.0,0.35)
118 | SetTextCentre(false)
119 | -- SetTextDropShadow(0, 0, 0, 0, 0)
120 | SetTextEdge(0, 0, 0, 0, 0)
121 | SetTextEntry("STRING")
122 | AddTextComponentString(settings["name"])
123 | DrawText(settings["xmin"]+ 0.01, (settings["ymin"] - 0.0125 ))
124 | Menu.renderBox(settings["xmin"] ,settings["xmax"], settings["ymin"], settings["ymax"],boxColor[1],boxColor[2],boxColor[3],boxColor[4])
125 | end
126 | end
127 |
128 | function ClearMenu()
129 | --Menu = {}
130 | Menu.GUI = {}
131 | Menu.buttonCount = 0
132 | Menu.selection = 0
133 | end
134 |
135 | function MenuCallFunction(fnc, arg)
136 | _G[fnc](arg)
137 | end
138 |
--------------------------------------------------------------------------------
/vRP/vrp_gui/design.css:
--------------------------------------------------------------------------------
1 | *{
2 | margin: 0;
3 | padding: 0;
4 | }
5 |
6 | /* make body full page */
7 | html, body {
8 | margin: 0;
9 | height: 100%;
10 | overflow:hidden;
11 | cursor: pointer;
12 | }
13 |
14 | @font-face {
15 | font-family: 'Pricedown';
16 | src: url(fonts/Pdown.woff);
17 | }
18 |
19 | .console{
20 | background-color: white;
21 | color: red;
22 | font-weight: bold;
23 | }
24 |
25 | /* menu */
26 |
27 | .menu{
28 | font-family: 'Arial', sans-serif;
29 | color: white;
30 | width: 280px;
31 | height: 99%;
32 | margin-left: -75px;
33 | margin: 25px;
34 | align-content: center;
35 | position: fixed;
36 | top: 50%;
37 | right: 13%;
38 | margin-top: -50px;
39 | margin-left: -100px;
40 | text-align: center;
41 | cursor: pointer;
42 | }
43 |
44 |
45 | .menu_description{
46 | margin: 8px auto;
47 | position: static;
48 | float: left;
49 | border-radius: 5px;
50 | font-weight: bold;
51 | padding: 6px;
52 | max-width: 600px;
53 | text-transform: uppercase;
54 | text-align: left;
55 | font-size: 12px;
56 | border: 1px solid white;
57 | color: white;
58 | box-shadow: inset 0px 0px 3px 3px rgba(0,0,0,0.35);
59 | background-color: rgba(0,0,0,0.5);
60 | font-family: 'Arial', sans-serif;
61 | }
62 |
63 | .menu h1{
64 | display:none;
65 | font-size: 0px;
66 | }
67 |
68 | .choices{
69 | overflow-y: scroll;
70 | overflow-x: hidden;
71 | }
72 |
73 | .choices::-webkit-scrollbar{
74 | display: none;
75 | }
76 |
77 | .choices div{
78 | border-radius: 5px;
79 | background-color: rgba(0,0,0,0.5);
80 | padding: 6px 1px;
81 | margin: 8px auto;
82 | text-transform: uppercase;
83 | font-size: 12px;
84 | border: 1px solid #ffffff;
85 | color: white;
86 | box-shadow: inset 0px 0px 3px 3px rgba(0,0,0,0.35);
87 | font-family: 'arial', sans-serif;
88 | font-weight: bold;
89 | cursor: pointer;
90 | }
91 |
92 | .choices .selected{
93 | border-radius: 5px;
94 | background-color: #ffffff;
95 | color: #000000;
96 | font-family: 'arial', sans-serif;
97 | border: 1px solid #000000;
98 | font-weight: bold;
99 | box-shadow: inset 0px 0px 5px 5px rgba(255,255,255,0.35);
100 | }
101 |
102 | /* progress bar */
103 | .progressbar{
104 | position: absolute;
105 | }
106 |
107 | .progressbar .inner{
108 | }
109 |
110 | .progressbar .label{
111 | position: absolute;
112 | color: white;
113 | font-weight: bold;
114 | text-align: center;
115 | text-shadow: 2px 2px black;
116 | }
117 |
118 | /* wprompt */
119 | .wprompt{
120 | background-color: rgba(0,0,0,0.5);
121 | border: 1px solid white;
122 | font-family: 'Arial', sans-serif;
123 | box-shadow: 1px 1px 18px 1px #000000;
124 | color: white;
125 | width: 300px;
126 | height: 200px;
127 | border-radius: 5px;
128 | display: flex;
129 | padding: 5px;
130 | flex-direction: column;
131 | cursor: pointer;
132 | }
133 |
134 | .wprompt h1{
135 | font-size: 12px;
136 | font-family: 'Arial', sans-serif;
137 | }
138 |
139 | .wprompt textarea{
140 | outline: none !important;
141 | background-color: rgba(0,0,0,0.5);
142 | border: 1px solid white;
143 | box-shadow: inset 1px 1px 18px 1px #000000;
144 | border-radius: 5px;
145 | flex: 1;
146 | color: white;
147 | width: 100%;
148 | padding: 5px;
149 | resize: none;
150 | box-sizing: border-box;
151 | }
152 |
153 | .wprompt textarea:focus{
154 | outline: none !important;
155 | }
156 |
157 | .wprompt .help{
158 | font-size: 12px;
159 | font-family: 'Arial', sans-serif;
160 | padding: 3px;
161 | text-transform: uppercase;
162 | }
163 |
164 | /* request manager */
165 | .request_manager{
166 | position: absolute;
167 | bottom: -1px;
168 | right: 25px;
169 | text-align: right;
170 | }
171 |
172 | .request_manager div{
173 | margin-bottom: 0px;
174 | }
175 |
176 | .request_manager div > span{
177 | background-color: #3A3A3A;
178 | border: 1px solid cyan;
179 | font-family: 'Roboto', sans-serif;
180 | box-shadow: inset 1px 1px 18px 1px #000000;
181 | border-radius: 5px 5px 0px 0px;
182 | font-size: 25px;
183 | color: white;
184 | margin-bottom: -1px;
185 | font-weight: bold;
186 | padding: 5px;
187 | text-align: center;
188 | }
189 |
190 | .request_manager .yes{
191 | font-family: 'Roboto', sans-serif;
192 | padding-left: 15px;
193 | color: rgb(0,255,0);
194 | font-size: 1em;
195 | text-transform: uppercase;
196 | }
197 |
198 | .request_manager .no{
199 | font-family: 'Roboto', sans-serif;
200 | color: rgb(255,0,0);
201 | font-size: 1em;
202 | text-transform: uppercase;
203 | }
204 |
205 | /* announce */
206 |
207 | .announce{
208 | position: absolute;
209 | bottom: 0;
210 | left: 50%;
211 | width: 780px;
212 | height: 130px;
213 | padding: 10px;
214 | margin-left: -400px;
215 | font-weight: bold;
216 | font-size: 1.1em;
217 | text-shadow: 2px 2px black;
218 | color: white;
219 | display: none;
220 | opacity: 0.90;
221 | }
222 |
223 |
--------------------------------------------------------------------------------
/vRP/vRP_garages/vrp_garages/lib/Tunnel.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | FiveM Scripts
3 | Copyright C 2018 Sighmir
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU Affero General Public License as published
7 | by the Free Software Foundation, either version 3 of the License, or
8 | at your option any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU Affero General Public License for more details.
14 |
15 | You should have received a copy of the GNU Affero General Public License
16 | along with this program. If not, see .
17 | ]]
18 |
19 | ---- TUNNEL CLIENT SIDE VERSION (https://github.com/ImagicTheCat/vRP)
20 | -- Too bad that require doesn't exist client-side
21 | -- TOOLS DEF
22 | Tools = {}
23 |
24 | -- ID generator
25 |
26 | local IDGenerator = {}
27 |
28 | function Tools.newIDGenerator()
29 | local r = setmetatable({}, { __index = IDGenerator })
30 | r:construct()
31 | return r
32 | end
33 |
34 | function IDGenerator:construct()
35 | self:clear()
36 | end
37 |
38 | function IDGenerator:clear()
39 | self.max = 0
40 | self.ids = {}
41 | end
42 |
43 | -- return a new id
44 | function IDGenerator:gen()
45 | if #self.ids > 0 then
46 | return table.remove(self.ids)
47 | else
48 | local r = self.max
49 | self.max = self.max+1
50 | return r
51 | end
52 | end
53 |
54 | -- free a previously generated id
55 | function IDGenerator:free(id)
56 | table.insert(self.ids,id)
57 | end
58 |
59 | -- TUNNEL DEF
60 | Tunnel = {}
61 |
62 | local function tunnel_resolve(itable,key)
63 | local mtable = getmetatable(itable)
64 | local iname = mtable.name
65 | local ids = mtable.tunnel_ids
66 | local callbacks = mtable.tunnel_callbacks
67 | local identifier = mtable.identifier
68 |
69 | -- generate access function
70 | local fcall = function(args,callback)
71 | if args == nil then
72 | args = {}
73 | end
74 |
75 | -- send request
76 | if type(callback) == "function" then -- ref callback if exists (become a request)
77 | local rid = ids:gen()
78 | callbacks[rid] = callback
79 | TriggerServerEvent(iname..":tunnel_req",key,args,identifier,rid)
80 | else -- regular trigger
81 | TriggerServerEvent(iname..":tunnel_req",key,args,"",-1)
82 | end
83 |
84 | end
85 |
86 | itable[key] = fcall -- add generated call to table (optimization)
87 | return fcall
88 | end
89 |
90 | -- bind an interface (listen to net requests)
91 | -- name: interface name
92 | -- interface: table containing functions
93 | function Tunnel.bindInterface(name,interface)
94 | -- receive request
95 | RegisterNetEvent(name..":tunnel_req")
96 | AddEventHandler(name..":tunnel_req",function(member,args,identifier,rid)
97 | local f = interface[member]
98 |
99 | local delayed = false
100 |
101 | local rets = {}
102 | if type(f) == "function" then
103 | -- bind the global function to delay the return values using the returned function with args
104 | TUNNEL_DELAYED = function()
105 | delayed = true
106 | return function(rets)
107 | rets = rets or {}
108 | if rid >= 0 then
109 | TriggerServerEvent(name..":"..identifier..":tunnel_res",rid,rets)
110 | end
111 | end
112 | end
113 |
114 | rets = {f(table.unpack(args))} -- call function
115 | -- CancelEvent() -- cancel event doesn't seem to cancel the event for the other handlers, but if it does, uncomment this
116 | end
117 |
118 | -- send response (event if the function doesn't exist)
119 | if not delayed and rid >= 0 then
120 | TriggerServerEvent(name..":"..identifier..":tunnel_res",rid,rets)
121 | end
122 | end)
123 | end
124 |
125 | -- get a tunnel interface to send requests
126 | -- name: interface name
127 | -- identifier: unique string to identify this tunnel interface access (the name of the current resource should be fine)
128 | function Tunnel.getInterface(name,identifier)
129 | local ids = Tools.newIDGenerator()
130 | local callbacks = {}
131 |
132 | -- build interface
133 | local r = setmetatable({},{ __index = tunnel_resolve, name = name, tunnel_ids = ids, tunnel_callbacks = callbacks, identifier = identifier })
134 |
135 | -- receive response
136 | RegisterNetEvent(name..":"..identifier..":tunnel_res")
137 | AddEventHandler(name..":"..identifier..":tunnel_res",function(rid,args)
138 | local callback = callbacks[rid]
139 | if callback ~= nil then
140 | -- free request id
141 | ids:free(rid)
142 | callbacks[rid] = nil
143 |
144 | -- call
145 | callback(table.unpack(args))
146 | end
147 | end)
148 |
149 | return r
150 | end
151 | ---- END TUNNEL CLIENT SIDE VERSION
152 |
--------------------------------------------------------------------------------
/vRP/vRP_HungerThirstGUI/ProgressBar.js:
--------------------------------------------------------------------------------
1 | var anchors = {}
2 | anchors["minimap"] = [];
3 | anchors["center"] = [];
4 | anchors["botright"] = [];
5 |
6 | function ProgressBar(data)
7 | {
8 | this.data = data;
9 | this.value = data.value;
10 | this.disp_value = data.value;
11 |
12 | this.div = document.createElement("div");
13 | this.div.classList.add("progressbar");
14 |
15 | this.div_label = document.createElement("div");
16 | this.div_label.classList.add("label");
17 | this.div.appendChild(this.div_label);
18 |
19 | this.setText(data.text);
20 |
21 | this.div_inner = document.createElement("div");
22 | this.div_inner.classList.add("inner");
23 | this.div.appendChild(this.div_inner);
24 |
25 | this.div_inner.style.zIndex = 1;
26 | this.div_label.style.zIndex = 2;
27 |
28 | this.div.style.backgroundColor = "rgba(0,0,0,0.5)";
29 | this.div_inner.style.backgroundColor = "rgba("+data.r+","+data.g+","+data.b+",0.5)";
30 |
31 | }
32 |
33 | ProgressBar.prototype.setValue = function(val)
34 | {
35 | this.value = val;
36 | }
37 |
38 | ProgressBar.prototype.setText = function(text)
39 | {
40 | this.div_label.innerHTML = text;
41 | }
42 |
43 | ProgressBar.prototype.frame = function(time)
44 | {
45 | //update display in function of pbar anchor
46 | var anchor_name = this.data.anchor;
47 | var anchor = anchors[this.data.anchor];
48 | if(anchor){
49 | var anchor_index = anchor.indexOf(this);
50 | if(anchor_index >= 0){
51 | if(anchor_name == "minimap"){ //MINIMAP
52 | var width = cfg.anchor_minimap_width/anchor.length; //divide horizontal map space by number of pbars
53 |
54 | if ($(window).width() >= 1900 ) {
55 | //set size
56 | this.div.style.width = this.div_label.style.width = (134)+"px";
57 | this.div_inner.style.height = this.div.style.height = this.div_label.style.height = (9)+"px";
58 | this.div_label.style.lineHeight = this.div_label.style.height;
59 |
60 | //set label font size
61 | this.div_label.style.fontSize = "0em";
62 |
63 | //set position
64 | this.div.style.left = (cfg.anchor_minimap_left+anchor_index*136-31)+"px";
65 | this.div.style.top = (document.body.offsetHeight-cfg.anchor_minimap_bottom+197)+"px";
66 | }
67 | else if ($(window).width() <= 1899 && $(window).width() >= 1600 ) {
68 | //set size
69 | this.div.style.width = this.div_label.style.width = (112)+"px";
70 | this.div_inner.style.height = this.div.style.height = this.div_label.style.height = (7)+"px";
71 | this.div_label.style.lineHeight = this.div_label.style.height;
72 |
73 | //set label font size
74 | this.div_label.style.fontSize = "0em";
75 |
76 | //set position
77 | this.div.style.left = (cfg.anchor_minimap_left+anchor_index*114-37)+"px";
78 | this.div.style.top = (document.body.offsetHeight-cfg.anchor_minimap_bottom+199)+"px";
79 | }
80 | else if ($(window).width() <= 1599 && $(window).width() >= 1366 ) {
81 | //set size
82 | this.div.style.width = this.div_label.style.width = (95)+"px";
83 | this.div_inner.style.height = this.div.style.height = this.div_label.style.height = (6)+"px";
84 | this.div_label.style.lineHeight = this.div_label.style.height;
85 |
86 | //set label font size
87 | this.div_label.style.fontSize = "0em";
88 |
89 | //set position
90 | this.div.style.left = (cfg.anchor_minimap_left+anchor_index*97-39)+"px";
91 | this.div.style.top = (document.body.offsetHeight-cfg.anchor_minimap_bottom+202)+"px";
92 | }
93 | else if ($(window).width() <= 1365 && $(window).width() >= 1280 ) {
94 | //set size
95 | this.div.style.width = this.div_label.style.width = (89)+"px";
96 | this.div_inner.style.height = this.div.style.height = this.div_label.style.height = (6)+"px";
97 | this.div_label.style.lineHeight = this.div_label.style.height;
98 |
99 | //set label font size
100 | this.div_label.style.fontSize = "0em";
101 |
102 | //set position
103 | this.div.style.left = (cfg.anchor_minimap_left+anchor_index*91-40)+"px";
104 | this.div.style.top = (document.body.offsetHeight-cfg.anchor_minimap_bottom+202)+"px";
105 | }
106 | else {
107 | //set size
108 | this.div.style.width = this.div_label.style.width = (95)+"px";
109 | this.div_inner.style.height = this.div.style.height = this.div_label.style.height = (6)+"px";
110 | this.div_label.style.lineHeight = this.div_label.style.height;
111 |
112 | //set label font size
113 | this.div_label.style.fontSize = "0em";
114 |
115 | //set position
116 | this.div.style.left = (cfg.anchor_minimap_left+anchor_index*97-45)+"px";
117 | this.div.style.top = (document.body.offsetHeight-cfg.anchor_minimap_bottom+202)+"px";
118 | }
119 | }
120 | else if(anchor_name == "botright"){ //BOTRIGHT
121 | //set size
122 | this.div.style.width = this.div_label.style.width = (200)+"px";
123 | this.div_inner.style.height = this.div.style.height = this.div_label.style.height = (20)+"px";
124 | this.div_label.style.lineHeight = this.div_label.style.height;
125 |
126 | //set label font size
127 | this.div_label.style.fontSize = "1em";
128 |
129 | //set position
130 | this.div.style.left = (document.body.offsetWidth-this.div.offsetWidth-100)+"px";
131 | this.div.style.top = (document.body.offsetHeight-120-anchor_index*22)+"px";
132 | }
133 | else if(anchor_name == "center"){ //CENTER
134 | //set size
135 | this.div.style.width = this.div_label.style.width = (400)+"px";
136 | this.div_inner.style.height = this.div.style.height = this.div_label.style.height = (100)+"px";
137 | this.div_label.style.lineHeight = this.div_label.style.height;
138 |
139 | //set label font size
140 | this.div_label.style.fontSize = "2em";
141 |
142 | //set position
143 | this.div.style.left = Math.round(document.body.offsetWidth/2-this.div.offsetWidth/2)+"px";
144 | this.div.style.top = (document.body.offsetHeight-500-anchor_index*22)+"px";
145 | }
146 | }
147 | }
148 |
149 | //smooth display value
150 | this.disp_value += (this.value - this.disp_value)*0.2;
151 |
152 | //update inner bar
153 | this.div_inner.style.width = Math.round(this.div.offsetWidth-this.div.offsetWidth*this.disp_value/100.0)+"px";
154 | }
155 |
156 | ProgressBar.prototype.addDom = function()
157 | {
158 | document.body.appendChild(this.div);
159 |
160 | //add to anchor
161 | var anchor = anchors[this.data.anchor];
162 | if(anchor)
163 | anchor.push(this);
164 | }
165 |
166 | ProgressBar.prototype.removeDom = function()
167 | {
168 | document.body.removeChild(this.div);
169 |
170 | //remove from anchors
171 | var anchor = anchors[this.data.anchor];
172 | if(anchor){
173 | var i = anchor.indexOf(this);
174 | if(i >= 0)
175 | anchor.splice(i,1);
176 | }
177 | }
178 |
--------------------------------------------------------------------------------
/vRP/vRP_garages/vrp_garages/server.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | FiveM Scripts
3 | Copyright C 2018 Sighmir
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU Affero General Public License as published
7 | by the Free Software Foundation, either version 3 of the License, or
8 | at your option any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU Affero General Public License for more details.
14 |
15 | You should have received a copy of the GNU Affero General Public License
16 | along with this program. If not, see .
17 | ]]
18 |
19 | MySQL = module("vrp_mysql", "MySQL")
20 | local Tunnel = module("vrp", "lib/Tunnel")
21 | local Proxy = module("vrp", "lib/Proxy")
22 |
23 | vRP = Proxy.getInterface("vRP")
24 | vRPclient = Tunnel.getInterface("vRP","vRP_garages")
25 | vRPgc = Tunnel.getInterface("vRP_garages","vRP_garages")
26 |
27 | --SQL--
28 | MySQL.createCommand("vRP/ply_get_vehicles","SELECT * FROM vrp_user_vehicles WHERE user_id = @user_id")
29 |
30 |
31 | -- PLY_GARAGES
32 | RegisterServerEvent('ply_garages:CheckForAptGarages')
33 | AddEventHandler('ply_garages:CheckForAptGarages', function()
34 | local user_id = vRP.getUserId({source})
35 | local player = vRP.getUserSource({user_id})
36 | vRP.getUserAddress({user_id, function(address)
37 | if address then
38 | if address.home == "Rich Housing" then
39 | TriggerClientEvent("ply_garages:addAptGarage", player, -751.5107421875,365.883117675781,86.9666687011719,267.344543457031)
40 | elseif address.home == "Basic Housing 1" then
41 | TriggerClientEvent("ply_garages:addAptGarage", player, -635.4501953125,57.4368324279785,43.8587303161621,88.8649536132813)
42 | elseif address.home == "Basic Housing 2" then
43 | TriggerClientEvent("ply_garages:addAptGarage", player, -1448.18701171875,-514.856567382813,30.6881823348999,29.5690689086914)
44 | elseif address.home == "Ranch Main" then
45 | TriggerClientEvent("ply_garages:addAptGarage", player, 1408.32495117188,1117.44665527344,113.737692260742,87.2900848388672)
46 | elseif address.home == "Regular House 1" then
47 | TriggerClientEvent("ply_garages:addAptGarage", player, 843.398803710938,-191.063568115234,71.6714935302734,339.229705810547)
48 | elseif address.home == "Regular House 2" then
49 | TriggerClientEvent("ply_garages:addAptGarage", player, 174.276748657227,483.056274414063,141.339096069336,357.040771484375)
50 | elseif address.home == "Regular House 3" then
51 | TriggerClientEvent("ply_garages:addAptGarage", player, -820.590148925781,184.175857543945,71.0921401977539,131.889053344727)
52 | elseif address.home == "Regular House 4" then
53 | TriggerClientEvent("ply_garages:addAptGarage", player, -1858.14965820313,328.570861816406,87.6500091552734,8.03947734832764)
54 | elseif address.home == "Regular House 5" then
55 | TriggerClientEvent("ply_garages:addAptGarage", player, -25.002462387085,-1436.29431152344,29.6531391143799,89.9820022583008)
56 | elseif address.home == "Rich Housing 2" then
57 | TriggerClientEvent("ply_garages:addAptGarage", player, -81.860595703125,-809.427734375,35.4030570983887,350.814697265625)
58 | elseif address.home == "Regular House 6" then
59 | TriggerClientEvent("ply_garages:addAptGarage", player, -2587,1930.97326660156,166.304656982422,93.3231887817383)
60 | end
61 | end
62 | end})
63 | end)
64 |
65 | RegisterServerEvent('ply_garages:CheckForSpawnVeh')
66 | AddEventHandler('ply_garages:CheckForSpawnVeh', function(vehicle)
67 | local user_id = vRP.getUserId({source})
68 | local player = vRP.getUserSource({user_id})
69 | MySQL.query("vRP/ls_customs", {user_id = user_id, vehicle = vehicle}, function(result, affected)
70 | vRP.closeMenu({player})
71 | vRPgc.spawnGarageVehicle(player,{result[1].veh_type,vehicle,result[1].vehicle_plate, result[1].vehicle_colorprimary, result[1].vehicle_colorsecondary, result[1].vehicle_pearlescentcolor, result[1].vehicle_wheelcolor, result[1].vehicle_plateindex, result[1].vehicle_neoncolor1, result[1].vehicle_neoncolor2, result[1].vehicle_neoncolor3, result[1].vehicle_windowtint, result[1].vehicle_wheeltype, result[1].vehicle_mods0, result[1].vehicle_mods1, result[1].vehicle_mods2, result[1].vehicle_mods3, result[1].vehicle_mods4, result[1].vehicle_mods5, result[1].vehicle_mods6, result[1].vehicle_mods7, result[1].vehicle_mods8, result[1].vehicle_mods9, result[1].vehicle_mods10, result[1].vehicle_mods11, result[1].vehicle_mods12, result[1].vehicle_mods13, result[1].vehicle_mods14, result[1].vehicle_mods15, result[1].vehicle_mods16, result[1].vehicle_turbo, result[1].vehicle_tiresmoke, result[1].vehicle_xenon, result[1].vehicle_mods23, result[1].vehicle_mods24, result[1].vehicle_neon0, result[1].vehicle_neon1, result[1].vehicle_neon2, result[1].vehicle_neon3, result[1].vehicle_bulletproof, result[1].vehicle_smokecolor1, result[1].vehicle_smokecolor2, result[1].vehicle_smokecolor3, result[1].vehicle_modvariation})
72 | end)
73 | end)
74 |
75 | RegisterServerEvent('ply_garages:CheckForSpawnBasicVeh')
76 | AddEventHandler('ply_garages:CheckForSpawnBasicVeh', function(user_id,vehicle)
77 | local player = vRP.getUserSource({user_id})
78 | MySQL.query("vRP/ls_customs", {user_id = user_id, vehicle = vehicle}, function(result, affected)
79 | vRP.closeMenu({player})
80 | vRPgc.spawnGarageVehicle(player,{result[1].veh_type,vehicle,result[1].vehicle_plate, result[1].vehicle_colorprimary, result[1].vehicle_colorsecondary, result[1].vehicle_pearlescentcolor, result[1].vehicle_wheelcolor, result[1].vehicle_plateindex, result[1].vehicle_neoncolor1, result[1].vehicle_neoncolor2, result[1].vehicle_neoncolor3, result[1].vehicle_windowtint, result[1].vehicle_wheeltype, result[1].vehicle_mods0, result[1].vehicle_mods1, result[1].vehicle_mods2, result[1].vehicle_mods3, result[1].vehicle_mods4, result[1].vehicle_mods5, result[1].vehicle_mods6, result[1].vehicle_mods7, result[1].vehicle_mods8, result[1].vehicle_mods9, result[1].vehicle_mods10, result[1].vehicle_mods11, result[1].vehicle_mods12, result[1].vehicle_mods13, result[1].vehicle_mods14, result[1].vehicle_mods15, result[1].vehicle_mods16, result[1].vehicle_turbo, result[1].vehicle_tiresmoke, result[1].vehicle_xenon, result[1].vehicle_mods23, result[1].vehicle_mods24, result[1].vehicle_neon0, result[1].vehicle_neon1, result[1].vehicle_neon2, result[1].vehicle_neon3, result[1].vehicle_bulletproof, result[1].vehicle_smokecolor1, result[1].vehicle_smokecolor2, result[1].vehicle_smokecolor3, result[1].vehicle_modvariation})
81 | end)
82 | end)
83 |
84 | RegisterServerEvent('ply_garages:CheckForVeh')
85 | AddEventHandler('ply_garages:CheckForVeh', function(plate,vehicle,vtype)
86 | local user_id = vRP.getUserId({source})
87 | local player = vRP.getUserSource({user_id})
88 | MySQL.query("vRP/lsc_get_vehicle", {user_id = user_id, vehicle = vehicle, plate = plate}, function(rows, affected)
89 | if #rows > 0 then -- has vehicle
90 | vRPgc.despawnGarageVehicle(player,{vtype,5})
91 | else
92 | vRPclient.notify(player,{"~r~No owned vehicle closeby"})
93 | end
94 | end)
95 | end)
96 |
97 | RegisterServerEvent('ply_garages:CheckGarageForVeh')
98 | AddEventHandler("ply_garages:CheckGarageForVeh", function()
99 | local user_id = vRP.getUserId({source})
100 | local player = vRP.getUserSource({user_id})
101 | MySQL.query("vRP/ply_get_vehicles", {user_id = user_id}, function(pvehicles, affected)
102 | local vehicles = {}
103 | for k,v in ipairs(pvehicles) do
104 | if v.veh_type == "car" or v.veh_type == "bike" then
105 | table.insert(vehicles, {["vehicle_model"] = v.vehicle_model, ["vehicle_name"] = v.vehicle})
106 | end
107 | end
108 | TriggerClientEvent("ply_garages:getVehicles", player, vehicles)
109 | end)
110 | end)
--------------------------------------------------------------------------------
/vRP/vRP_garages/vrpfiles/client/basic_garage.lua:
--------------------------------------------------------------------------------
1 |
2 | local vehicles = {}
3 |
4 | AddEventHandler('vrp_garages:setVehicle', function(vtype, vehicle)
5 | vehicles[vtype] = vehicle
6 | end)
7 |
8 |
9 | function tvRP.spawnGarageVehicle(vtype,name,pos) -- vtype is the vehicle type (one vehicle per type allowed at the same time)
10 |
11 | local vehicle = vehicles[vtype]
12 | if vehicle and not IsVehicleDriveable(vehicle[3]) then -- precheck if vehicle is undriveable
13 | -- despawn vehicle
14 | SetVehicleHasBeenOwnedByPlayer(vehicle[3],false)
15 | Citizen.InvokeNative(0xAD738C3085FE7E11, vehicle[3], false, true) -- set not as mission entity
16 | SetVehicleAsNoLongerNeeded(Citizen.PointerValueIntInitialized(vehicle[3]))
17 | Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(vehicle[3]))
18 | vehicles[vtype] = nil
19 | end
20 |
21 | vehicle = vehicles[vtype]
22 | if vehicle == nil then
23 | -- load vehicle model
24 | local mhash = GetHashKey(name)
25 |
26 | local i = 0
27 | while not HasModelLoaded(mhash) and i < 10000 do
28 | RequestModel(mhash)
29 | Citizen.Wait(10)
30 | i = i+1
31 | end
32 |
33 | -- spawn car
34 | if HasModelLoaded(mhash) then
35 | local x,y,z = tvRP.getPosition()
36 | if pos then
37 | x,y,z = table.unpack(pos)
38 | end
39 |
40 | local nveh = CreateVehicle(mhash, x,y,z+0.5, 0.0, true, false)
41 | SetVehicleOnGroundProperly(nveh)
42 | SetEntityInvincible(nveh,false)
43 | SetPedIntoVehicle(GetPlayerPed(-1),nveh,-1) -- put player inside
44 | SetVehicleNumberPlateText(nveh, "P "..tvRP.getRegistrationNumber())
45 | Citizen.InvokeNative(0xAD738C3085FE7E11, nveh, true, true) -- set as mission entity
46 | SetVehicleHasBeenOwnedByPlayer(nveh,true)
47 |
48 | if not cfg.vehicle_migration then
49 | local nid = NetworkGetNetworkIdFromEntity(nveh)
50 | SetNetworkIdCanMigrate(nid,false)
51 | end
52 |
53 | vehicles[vtype] = {vtype,name,nveh} -- set current vehicule
54 |
55 | SetModelAsNoLongerNeeded(mhash)
56 | end
57 | else
58 | tvRP.notify("You can only have one "..vtype.." vehicule out.")
59 | end
60 | end
61 |
62 | function tvRP.despawnGarageVehicle(vtype,max_range)
63 | local vehicle = vehicles[vtype]
64 | if vehicle then
65 | local x,y,z = table.unpack(GetEntityCoords(vehicle[3],true))
66 | local px,py,pz = tvRP.getPosition()
67 |
68 | if GetDistanceBetweenCoords(x,y,z,px,py,pz,true) < max_range then -- check distance with the vehicule
69 | -- remove vehicle
70 | SetVehicleHasBeenOwnedByPlayer(vehicle[3],false)
71 | Citizen.InvokeNative(0xAD738C3085FE7E11, vehicle[3], false, true) -- set not as mission entity
72 | SetVehicleAsNoLongerNeeded(Citizen.PointerValueIntInitialized(vehicle[3]))
73 | Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(vehicle[3]))
74 | vehicles[vtype] = nil
75 | tvRP.notify("Vehicle stored.")
76 | else
77 | tvRP.notify("Too far away from the vehicle.")
78 | end
79 | end
80 | end
81 |
82 | -- check vehicles validity
83 | --[[
84 | Citizen.CreateThread(function()
85 | Citizen.Wait(30000)
86 |
87 | for k,v in pairs(vehicles) do
88 | if IsEntityAVehicle(v[3]) then -- valid, save position
89 | v.pos = {table.unpack(GetEntityCoords(vehicle[3],true))}
90 | elseif v.pos then -- not valid, respawn if with a valid position
91 | print("[vRP] invalid vehicle "..v[1]..", respawning...")
92 | tvRP.spawnGarageVehicle(v[1], v[2], v.pos)
93 | end
94 | end
95 | end)
96 | --]]
97 |
98 | -- (experimental) this function return the nearest vehicle
99 | -- (don't work with all vehicles, but aim to)
100 | function tvRP.getNearestVehicle(radius)
101 | local x,y,z = tvRP.getPosition()
102 | local ped = GetPlayerPed(-1)
103 | if IsPedSittingInAnyVehicle(ped) then
104 | return GetVehiclePedIsIn(ped, true)
105 | else
106 | -- flags used:
107 | --- 8192: boat
108 | --- 4096: helicos
109 | --- 4,2,1: cars (with police)
110 |
111 | local veh = GetClosestVehicle(x+0.0001,y+0.0001,z+0.0001, radius+0.0001, 0, 8192+4096+4+2+1) -- boats, helicos
112 | if not IsEntityAVehicle(veh) then veh = GetClosestVehicle(x+0.0001,y+0.0001,z+0.0001, radius+0.0001, 0, 4+2+1) end -- cars
113 | return veh
114 | end
115 | end
116 |
117 | function tvRP.fixeNearestVehicle(radius)
118 | local veh = tvRP.getNearestVehicle(radius)
119 | if IsEntityAVehicle(veh) then
120 | SetVehicleFixed(veh)
121 | end
122 | end
123 |
124 | function tvRP.replaceNearestVehicle(radius)
125 | local veh = tvRP.getNearestVehicle(radius)
126 | if IsEntityAVehicle(veh) then
127 | SetVehicleOnGroundProperly(veh)
128 | end
129 | end
130 |
131 | -- try to get a vehicle at a specific position (using raycast)
132 | function tvRP.getVehicleAtPosition(x,y,z)
133 | x = x+0.0001
134 | y = y+0.0001
135 | z = z+0.0001
136 |
137 | local ray = CastRayPointToPoint(x,y,z,x,y,z+4,10,GetPlayerPed(-1),0)
138 | local a, b, c, d, ent = GetRaycastResult(ray)
139 | return ent
140 | end
141 |
142 | -- return ok,vtype,name
143 | function tvRP.getNearestOwnedVehicle(radius)
144 | local px,py,pz = tvRP.getPosition()
145 | for k,v in pairs(vehicles) do
146 | local x,y,z = table.unpack(GetEntityCoords(v[3],true))
147 | local dist = GetDistanceBetweenCoords(x,y,z,px,py,pz,true)
148 | if dist <= radius+0.0001 then return true,v[1],v[2] end
149 | end
150 |
151 | return false,"",""
152 | end
153 |
154 | -- return ok,x,y,z
155 | function tvRP.getAnyOwnedVehiclePosition()
156 | for k,v in pairs(vehicles) do
157 | if IsEntityAVehicle(v[3]) then
158 | local x,y,z = table.unpack(GetEntityCoords(v[3],true))
159 | return true,x,y,z
160 | end
161 | end
162 |
163 | return false,0,0,0
164 | end
165 |
166 | -- return x,y,z
167 | function tvRP.getOwnedVehiclePosition(vtype)
168 | local vehicle = vehicles[vtype]
169 | local x,y,z = 0,0,0
170 |
171 | if vehicle then
172 | x,y,z = table.unpack(GetEntityCoords(vehicle[3],true))
173 | end
174 |
175 | return x,y,z
176 | end
177 |
178 | -- return ok, vehicule network id
179 | function tvRP.getOwnedVehicleId(vtype)
180 | local vehicle = vehicles[vtype]
181 | if vehicle then
182 | return true, NetworkGetNetworkIdFromEntity(vehicle[3])
183 | else
184 | return false, 0
185 | end
186 | end
187 |
188 | -- eject the ped from the vehicle
189 | function tvRP.ejectVehicle()
190 | local ped = GetPlayerPed(-1)
191 | if IsPedSittingInAnyVehicle(ped) then
192 | local veh = GetVehiclePedIsIn(ped,false)
193 | TaskLeaveVehicle(ped, veh, 4160)
194 | end
195 | end
196 |
197 | -- vehicle commands
198 | function tvRP.vc_openDoor(vtype, door_index)
199 | local vehicle = vehicles[vtype]
200 | if vehicle then
201 | SetVehicleDoorOpen(vehicle[3],door_index,0,false)
202 | end
203 | end
204 |
205 | function tvRP.vc_closeDoor(vtype, door_index)
206 | local vehicle = vehicles[vtype]
207 | if vehicle then
208 | SetVehicleDoorShut(vehicle[3],door_index)
209 | end
210 | end
211 |
212 | function tvRP.vc_detachTrailer(vtype)
213 | local vehicle = vehicles[vtype]
214 | if vehicle then
215 | DetachVehicleFromTrailer(vehicle[3])
216 | end
217 | end
218 |
219 | function tvRP.vc_detachTowTruck(vtype)
220 | local vehicle = vehicles[vtype]
221 | if vehicle then
222 | local ent = GetEntityAttachedToTowTruck(vehicle[3])
223 | if IsEntityAVehicle(ent) then
224 | DetachVehicleFromTowTruck(vehicle[3],ent)
225 | end
226 | end
227 | end
228 |
229 | function tvRP.vc_detachCargobob(vtype)
230 | local vehicle = vehicles[vtype]
231 | if vehicle then
232 | local ent = GetVehicleAttachedToCargobob(vehicle[3])
233 | if IsEntityAVehicle(ent) then
234 | DetachVehicleFromCargobob(vehicle[3],ent)
235 | end
236 | end
237 | end
238 |
239 | function tvRP.vc_toggleEngine(vtype)
240 | local vehicle = vehicles[vtype]
241 | if vehicle then
242 | local running = Citizen.InvokeNative(0xAE31E7DF9B5B132E,vehicle[3]) -- GetIsVehicleEngineRunning
243 | SetVehicleEngineOn(vehicle[3],not running,true,true)
244 | if running then
245 | SetVehicleUndriveable(vehicle[3],true)
246 | else
247 | SetVehicleUndriveable(vehicle[3],false)
248 | end
249 | end
250 | end
251 |
252 | function tvRP.vc_toggleLock(vtype)
253 | local vehicle = vehicles[vtype]
254 | if vehicle then
255 | local veh = vehicle[3]
256 | local locked = GetVehicleDoorLockStatus(veh) >= 2
257 | if locked then -- unlock
258 | SetVehicleDoorsLockedForAllPlayers(veh, false)
259 | SetVehicleDoorsLocked(veh,1)
260 | SetVehicleDoorsLockedForPlayer(veh, PlayerId(), false)
261 | tvRP.notify("Vehicle unlocked.")
262 | else -- lock
263 | SetVehicleDoorsLocked(veh,2)
264 | SetVehicleDoorsLockedForAllPlayers(veh, true)
265 | tvRP.notify("Vehicle locked.")
266 | end
267 | end
268 | end
269 |
270 |
271 |
--------------------------------------------------------------------------------
/vRP/vRP_showroompack/withcars/vrp_showroom/cfg/config.lua:
--------------------------------------------------------------------------------
1 | local cfg = {}
2 |
3 | cfg.showgarage = {
4 | vehicles = {
5 | -- Exclusive
6 | {name = "Elegy Retro", costs = 255000, description = {}, model = "elegy"},
7 | {name = "Elegy", costs = 455000, description = {}, model = "elegy2"},
8 | -- Compacts
9 | {name = "Blista", costs = 15000, description = {}, model = "blista"},
10 | {name = "Brioso R/A", costs = 155000, description = {}, model = "brioso"},
11 | {name = "Dilettante", costs = 25000, description = {}, model = "Dilettante"},
12 | {name = "Issi", costs = 18000, description = {}, model = "issi2"},
13 | {name = "Panto", costs = 85000, description = {}, model = "panto"},
14 | {name = "Prairie", costs = 30000, description = {}, model = "prairie"},
15 | {name = "Rhapsody", costs = 120000, description = {}, model = "rhapsody"},
16 | -- Coupes
17 | {name = "Specter", costs = 499000, description = {}, model = "specter"},
18 | {name = "Specter CTM", costs = 555000, description = {}, model = "specter2"},
19 | {name = "Ardent", costs = 475000, description = {}, model = "ardent"},
20 | {name = "Savestra", costs = 225000, description = {}, model = "savestra"},
21 | {name = "Deluxo", costs = 375000, description = {}, model = "deluxo"},
22 | {name = "Cognoscenti Cabrio", costs = 180000, description = {}, model = "cogcabrio"},
23 | {name = "Exemplar", costs = 200000, description = {}, model = "exemplar"},
24 | {name = "F620", costs = 80000, description = {}, model = "f620"},
25 | {name = "Felon", costs = 90000, description = {}, model = "felon"},
26 | {name = "Felon GT", costs = 95000, description = {}, model = "felon2"},
27 | {name = "Jackal", costs = 60000, description = {}, model = "jackal"},
28 | {name = "Oracle", costs = 80000, description = {}, model = "oracle"},
29 | {name = "Oracle XS", costs = 82000, description = {}, model = "oracle2"},
30 | {name = "Sentinel", costs = 90000, description = {}, model = "sentinel"},
31 | {name = "Sentinel XS", costs = 60000, description = {}, model = "sentinel2"},
32 | {name = "Windsor", costs = 800000, description = {}, model = "windsor"},
33 | {name = "Windsor Drop", costs = 850000, description = {}, model = "windsor2"},
34 | {name = "Zion", costs = 60000, description = {}, model = "zion"},
35 | {name = "Zion Cabrio", costs = 65000, description = {}, model = "zion2"},
36 | -- Sports
37 | {name = "Neon", costs = 695000, description = {}, model = "neon"},
38 | {name = "Comet SR", costs = 695000, description = {}, model = "comet5"},
39 | {name = "Comet", costs = 595000, description = {}, model = "comet3"},
40 | {name = "Pariah", costs = 575000, description = {}, model = "pariah"},
41 | {name = "9F", costs = 120000, description = {}, model = "ninef"},
42 | {name = "9F Cabrio", costs = 130000, description = {}, model = "ninef2"},
43 | {name = "Alpha", costs = 150000, description = {}, model = "alpha"},
44 | {name = "Banshee", costs = 105000, description = {}, model = "banshee"},
45 | {name = "Bestia GTS", costs = 610000, description = {}, model = "bestiagts"},
46 | {name = "Blista Compact", costs = 42000, description = {}, model = "blista"},
47 | {name = "Buffalo", costs = 35000, description = {}, model = "buffalo"},
48 | {name = "Buffalo S", costs = 96000, description = {}, model = "buffalo2"},
49 | {name = "Carbonizzare", costs = 195000, description = {}, model = "carbonizzare"},
50 | {name = "Comet", costs = 100000, description = {}, model = "comet2"},
51 | {name = "Coquette", costs = 138000, description = {}, model = "coquette"},
52 | {name = "Drift Tampa", costs = 995000, description = {}, model = "tampa2"},
53 | {name = "Feltzer", costs = 130000, description = {}, model = "feltzer2"},
54 | {name = "Furore GT", costs = 448000, description = {}, model = "furoregt"},
55 | {name = "Fusilade", costs = 36000, description = {}, model = "fusilade"},
56 | {name = "Jester", costs = 240000, description = {}, model = "jester"},
57 | {name = "Jester(Racecar)", costs = 350000, description = {}, model = "jester2"},
58 | {name = "Kuruma", costs = 95000, description = {}, model = "kuruma"},
59 | {name = "Lynx", costs = 1735000, description = {}, model = "lynx"},
60 | {name = "Massacro", costs = 275000, description = {}, model = "massacro"},
61 | {name = "Massacro(Racecar)", costs = 385000, description = {}, model = "massacro2"},
62 | {name = "Omnis", costs = 701000, description = {}, model = "omnis"},
63 | {name = "Penumbra", costs = 24000, description = {}, model = "penumbra"},
64 | {name = "Rapid GT", costs = 140000, description = {}, model = "rapidgt"},
65 | {name = "Rapid GT Convertible", costs = 150000, description = {}, model = "rapidgt2"},
66 | {name = "Schafter V12", costs = 140000, description = {}, model = "schafter3"},
67 | {name = "Sultan", costs = 12000, description = {}, model = "sultan"},
68 | {name = "Surano", costs = 110000, description = {}, model = "surano"},
69 | {name = "Tropos", costs = 816000, description = {}, model = "tropos"},
70 | {name = "Verkierer", costs = 695000, description = {}, model = "verlierer2"},
71 | -- Sports Classics
72 | {name = "Rapid GT", costs = 145000, description = {}, model = "rapidgt3"},
73 | {name = "Retinue", costs = 125000, description = {}, model = "retinue"},
74 | {name = "Torero", costs = 455000, description = {}, model = "torero"},
75 | {name = "Cheetah Classic", costs = 620000, description = {}, model = "cheetah3"},
76 | {name = "Viseris", costs = 635000, description = {}, model = "viseris"},
77 | {name = "GT500", costs = 525000, description = {}, model = "gt500"},
78 | {name = "Hermes", costs = 452000, description = {}, model = "hermes"},
79 | {name = "Stromberg", costs = 415000, description = {}, model = "stromberg"},
80 | {name = "Casco", costs = 680000, description = {}, model = "casco"},
81 | {name = "Coquette Classic", costs = 665000, description = {}, model = "coquette2"},
82 | {name = "JB 700", costs = 350000, description = {}, model = "jb700"},
83 | {name = "Pigalle", costs = 400000, description = {}, model = "pigalle"},
84 | {name = "Stinger", costs = 850000, description = {}, model = "stinger"},
85 | {name = "Stinger GT", costs = 875000, description = {}, model = "stingergt"},
86 | {name = "Stirling GT", costs = 975000, description = {}, model = "feltzer3"},
87 | {name = "Z-Type", costs = 950000, description = {}, model = "ztype"},
88 | -- Supers
89 | {name = "Nero", costs = 1110000, description = {}, model = "nero"},
90 | {name = "Nero CTM", costs = 1110000, description = {}, model = "nero2"},
91 | {name = "Itali GTB", costs = 600000, description = {}, model = "italigtb"},
92 | {name = "Itali GTB CTM", costs = 675000, description = {}, model = "italigtb2"},
93 | {name = "Tempesta", costs = 585000, description = {}, model = "tempesta"},
94 | {name = "Penetrator", costs = 850000, description = {}, model = "penetrator"},
95 | {name = "Visione", costs = 995000, description = {}, model = "visione"},
96 | {name = "XA-21", costs = 995000, description = {}, model = "xa21"},
97 | {name = "Vagner", costs = 875000, description = {}, model = "vagner"},
98 | {name = "SC1", costs = 750000, description = {}, model = "sc1"},
99 | {name = "Adder", costs = 1000000, description = {}, model = "adder"},
100 | {name = "Banshee 900R", costs = 565000, description = {}, model = "banshee2"},
101 | {name = "Bullet", costs = 155000, description = {}, model = "bullet"},
102 | {name = "Cheetah", costs = 650000, description = {}, model = "cheetah"},
103 | {name = "Entity XF", costs = 795000, description = {}, model = "entityxf"},
104 | {name = "ETR1", costs = 199500, description = {}, model = "sheava"},
105 | {name = "FMJ", costs = 1750000, description = {}, model = "fmj"},
106 | {name = "Infernus", costs = 440000, description = {}, model = "infernus"},
107 | {name = "Osiris", costs = 1950000, description = {}, model = "osiris"},
108 | {name = "RE-7B", costs = 2475000, description = {}, model = "le7b"},
109 | {name = "Reaper", costs = 1595000, description = {}, model = "reaper"},
110 | {name = "Sultan RS", costs = 795000, description = {}, model = "sultanrs"},
111 | {name = "T20", costs = 2200000, description = {}, model = "t20"},
112 | {name = "Turismo R", costs = 500000, description = {}, model = "turismor"},
113 | {name = "Tyrus", costs = 2550000, description = {}, model = "tyrus"},
114 | {name = "Vacca", costs = 240000, description = {}, model = "vacca"},
115 | {name = "Voltic", costs = 150000, description = {}, model = "voltic"},
116 | {name = "X80 Proto", costs = 2700000, description = {}, model = "prototipo"},
117 | {name = "Zentorno", costs = 725000, description = {}, model = "zentorno"},
118 | -- Muscle
119 | {name = "Blade", costs = 160000, description = {}, model = "blade"},
120 | {name = "Buccaneer", costs = 29000, description = {}, model = "buccaneer"},
121 | {name = "Chino", costs = 225000, description = {}, model = "chino"},
122 | {name = "Coquette BlackFin", costs = 695000, description = {}, model = "coquette3"},
123 | {name = "Dominator", costs = 35000, description = {}, model = "dominator"},
124 | {name = "Dukes", costs = 62000, description = {}, model = "dukes"},
125 | {name = "Gauntlet", costs = 32000, description = {}, model = "gauntlet"},
126 | {name = "Hotknife", costs = 90000, description = {}, model = "hotknife"},
127 | {name = "Faction", costs = 36000, description = {}, model = "faction"},
128 | {name = "Nightshade", costs = 585000, description = {}, model = "nightshade"},
129 | {name = "Picador", costs = 9000, description = {}, model = "picador"},
130 | {name = "Sabre Turbo", costs = 15000, description = {}, model = "sabregt"},
131 | {name = "Tampa", costs = 375000, description = {}, model = "tampa"},
132 | {name = "Virgo", costs = 195000, description = {}, model = "virgo"},
133 | {name = "Vigero", costs = 21000, description = {}, model = "vigero"},
134 | -- Offroad
135 | {name = "Kamacho", costs = 315000, description = {}, model = "kamacho"},
136 | {name = "Riata", costs = 325000, description = {}, model = "riata"},
137 | {name = "Comet Safari", costs = 365000, description = {}, model = "comet4"},
138 | {name = "Streiter", costs = 235000, description = {}, model = "streiter"},
139 | {name = "Bifta", costs = 75000, description = {}, model = "bifta"},
140 | {name = "Blazer", costs = 8000, description = {}, model = "blazer"},
141 | {name = "Brawler", costs = 715000, description = {}, model = "brawler"},
142 | {name = "Bubsta 6x6", costs = 249000, description = {}, model = "dubsta3"},
143 | {name = "Dune Buggy", costs = 20000, description = {}, model = "dune"},
144 | {name = "Rebel", costs = 22000, description = {}, model = "rebel2"},
145 | {name = "Sandking", costs = 38000, description = {}, model = "sandking"},
146 | {name = "The Liberator", costs = 550000, description = {}, model = "monster"},
147 | {name = "Trophy Truck", costs = 550000, description = {}, model = "trophytruck"},
148 | -- Suvs
149 | {name = "Baller", costs = 90000, description = {}, model = "baller"},
150 | {name = "Cavalcade", costs = 60000, description = {}, model = "cavalcade"},
151 | {name = "Grabger", costs = 35000, description = {}, model = "granger"},
152 | {name = "Huntley S", costs = 195000, description = {}, model = "huntley"},
153 | {name = "Landstalker", costs = 58000, description = {}, model = "landstalker"},
154 | {name = "Radius", costs = 32000, description = {}, model = "radi"},
155 | {name = "Rocoto", costs = 85000, description = {}, model = "rocoto"},
156 | {name = "Seminole", costs = 30000, description = {}, model = "seminole"},
157 | {name = "XLS", costs = 253000, description = {}, model = "xls"},
158 | -- Vans
159 | {name = "Yosemite", costs = 285000, description = {}, model = "yosemite"},
160 | {name = "Bison", costs = 30000, description = {}, model = "bison"},
161 | {name = "Bobcat XL", costs = 23000, description = {}, model = "bobcatxl"},
162 | {name = "Gang Burrito", costs = 65000, description = {}, model = "gburrito"},
163 | {name = "Journey", costs = 15000, description = {}, model = "journey"},
164 | {name = "Minivan", costs = 30000, description = {}, model = "minivan"},
165 | {name = "Paradise", costs = 25000, description = {}, model = "paradise"},
166 | {name = "Rumpo", costs = 13000, description = {}, model = "rumpo"},
167 | {name = "Surfer", costs = 11000, description = {}, model = "surfer"},
168 | {name = "Youga", costs = 16000, description = {}, model = "youga"},
169 | -- Sedans
170 | {name = "Revolter", costs = 550000, description = {}, model = "revolter"},
171 | {name = "Raiden", costs = 435000, description = {}, model = "raiden"},
172 | {name = "Asea", costs = 1000000, description = {}, model = "asea"},
173 | {name = "Asterope", costs = 1000000, description = {}, model = "asterope"},
174 | {name = "Cognoscenti", costs = 1000000, description = {}, model = "cognoscenti"},
175 | {name = "Cognoscenti(Armored)", costs = 1000000, description = {}, model = "cognoscenti2"},
176 | {name = "Cognoscenti 55", costs = 1000000, description = {}, model = "cog55"},
177 | {name = "Cognoscenti 55(Armored", costs = 1500000, description = {}, model = "cog552"},
178 | {name = "Fugitive", costs = 24000, description = {}, model = "fugitive"},
179 | {name = "Glendale", costs = 200000, description = {}, model = "glendale"},
180 | {name = "Ingot", costs = 9000, description = {}, model = "ingot"},
181 | {name = "Intruder", costs = 16000, description = {}, model = "intruder"},
182 | {name = "Premier", costs = 10000, description = {}, model = "premier"},
183 | {name = "Primo", costs = 9000, description = {}, model = "primo"},
184 | {name = "Primo Custom", costs = 9500, description = {}, model = "primo2"},
185 | {name = "Regina", costs = 8000, description = {}, model = "regina"},
186 | {name = "Schafter", costs = 65000, description = {}, model = "schafter2"},
187 | {name = "Stanier", costs = 10000, description = {}, model = "stanier"},
188 | {name = "Stratum", costs = 10000, description = {}, model = "stratum"},
189 | {name = "Stretch", costs = 30000, description = {}, model = "stretch"},
190 | {name = "Super Diamond", costs = 250000, description = {}, model = "superd"},
191 | {name = "Surge", costs = 38000, description = {}, model = "surge"},
192 | {name = "Tailgater", costs = 55000, description = {}, model = "tailgater"},
193 | {name = "Warrener", costs = 120000, description = {}, model = "warrener"},
194 | {name = "Washington", costs = 15000, description = {}, model = "washington"},
195 | -- Motorcycles
196 | {name = "Akuma", costs = 9000, description = {}, model = "AKUMA"},
197 | {name = "Bagger", costs = 5000, description = {}, model = "bagger"},
198 | {name = "Bati 801", costs = 15000, description = {}, model = "bati"},
199 | {name = "Bati 801RR", costs = 15000, description = {}, model = "bati2"},
200 | {name = "BF400", costs = 95000, description = {}, model = "bf400"},
201 | {name = "Carbon RS", costs = 40000, description = {}, model = "carbonrs"},
202 | {name = "Cliffhanger", costs = 225000, description = {}, model = "cliffhanger"},
203 | {name = "Daemon", costs = 5000, description = {}, model = "daemon"},
204 | {name = "Double T", costs = 12000, description = {}, model = "double"},
205 | {name = "Enduro", costs = 48000, description = {}, model = "enduro"},
206 | {name = "Faggio", costs = 4000, description = {}, model = "faggio2"},
207 | {name = "Gargoyle", costs = 120000, description = {}, model = "gargoyle"},
208 | {name = "Hakuchou", costs = 82000, description = {}, model = "hakuchou"},
209 | {name = "Hexer", costs = 15000, description = {}, model = "hexer"},
210 | {name = "Innovation", costs = 90000, description = {}, model = "innovation"},
211 | {name = "Lectro", costs = 700000, description = {}, model = "lectro"},
212 | {name = "Nemesis", costs = 12000, description = {}, model = "nemesis"},
213 | {name = "PCJ-600", costs = 9000, description = {}, model = "pcj"},
214 | {name = "Ruffian", costs = 9000, description = {}, model = "ruffian"},
215 | {name = "Sanchez", costs = 7000, description = {}, model = "sanchez"},
216 | {name = "Sovereign", costs = 90000, description = {}, model = "sovereign"},
217 | {name = "Thrust", costs = 75000, description = {}, model = "thrust"},
218 | {name = "Vader", costs = 9000, description = {}, model = "vader"},
219 | {name = "Vindicator", costs = 600000, description = {}, model = "vindicator"},
220 | }
221 | }
222 |
223 | return cfg
--------------------------------------------------------------------------------
/vRP/vRP_garages/vrpfiles/modules/basic_garage.lua:
--------------------------------------------------------------------------------
1 | -- a basic garage implementation
2 |
3 | -- vehicle db
4 | MySQL.createCommand("vRP/vehicles_table", [[
5 | CREATE TABLE IF NOT EXISTS vrp_user_vehicles(
6 | user_id INTEGER,
7 | vehicle VARCHAR(100),
8 | CONSTRAINT pk_user_vehicles PRIMARY KEY(user_id,vehicle),
9 | CONSTRAINT fk_user_vehicles_users FOREIGN KEY(user_id) REFERENCES vrp_users(id) ON DELETE CASCADE
10 | );
11 | ]])
12 |
13 | MySQL.createCommand("vRP/add_vehicle","INSERT IGNORE INTO vrp_user_vehicles(user_id,vehicle) VALUES(@user_id,@vehicle)")
14 | MySQL.createCommand("vRP/remove_vehicle","DELETE FROM vrp_user_vehicles WHERE user_id = @user_id AND vehicle = @vehicle")
15 | MySQL.createCommand("vRP/get_vehicles","SELECT vehicle FROM vrp_user_vehicles WHERE user_id = @user_id")
16 | MySQL.createCommand("vRP/get_vehicle","SELECT vehicle FROM vrp_user_vehicles WHERE user_id = @user_id AND vehicle = @vehicle")
17 |
18 | -- init
19 | MySQL.execute("vRP/vehicles_table")
20 |
21 | -- load config
22 |
23 | local cfg = module("cfg/garages")
24 | local cfg_inventory = module("cfg/inventory")
25 | local vehicle_groups = cfg.garage_types
26 | local lang = vRP.lang
27 | local garages = cfg.garages
28 |
29 |
30 | -- garage menus
31 |
32 | local garage_menus = {}
33 |
34 |
35 | for group,vehicles in pairs(vehicle_groups) do
36 | local veh_type = vehicles._config.vtype or "default"
37 |
38 | local menu = {
39 | name=lang.garage.title({group}),
40 | css={top = "75px", header_color="rgba(255,125,0,0.75)"}
41 | }
42 | garage_menus[group] = menu
43 |
44 | menu[lang.garage.owned.title()] = {function(player,choice)
45 | local user_id = vRP.getUserId(player)
46 | if user_id ~= nil then
47 | -- init tmpdata for rents
48 | local tmpdata = vRP.getUserTmpTable(user_id)
49 | if tmpdata.rent_vehicles == nil then
50 | tmpdata.rent_vehicles = {}
51 | end
52 |
53 |
54 | -- build nested menu
55 | local kitems = {}
56 | local submenu = {name=lang.garage.title({lang.garage.owned.title()}), css={top="75px",header_color="rgba(255,125,0,0.75)"}}
57 | submenu.onclose = function()
58 | vRP.openMenu(player,menu)
59 | end
60 |
61 | local choose = function(player, choice)
62 | local vname = kitems[choice]
63 | if vname then
64 | -- spawn vehicle
65 | local vehicle = vehicles[vname]
66 |
67 | if vehicle then
68 | vRP.closeMenu(player)
69 | TriggerEvent('ply_garages:CheckForSpawnBasicVeh', user_id, vname)
70 | end
71 | end
72 | end
73 |
74 | -- get player owned vehicles
75 | MySQL.query("vRP/get_vehicles", {user_id = user_id}, function(pvehicles, affected)
76 | -- add rents to whitelist
77 | for k,v in pairs(tmpdata.rent_vehicles) do
78 | if v then -- check true, prevent future neolua issues
79 | table.insert(pvehicles,{vehicle = k})
80 | end
81 | end
82 |
83 | for k,v in pairs(pvehicles) do
84 | local vehicle = vehicles[v.vehicle]
85 | if vehicle then
86 | submenu[vehicle[1]] = {choose,vehicle[3]}
87 | kitems[vehicle[1]] = v.vehicle
88 | end
89 | end
90 |
91 | vRP.openMenu(player,submenu)
92 | end)
93 | end
94 | end,lang.garage.owned.description()}
95 |
96 | menu[lang.garage.buy.title()] = {function(player,choice)
97 | local user_id = vRP.getUserId(player)
98 | if user_id ~= nil then
99 |
100 | -- build nested menu
101 | local kitems = {}
102 | local submenu = {name=lang.garage.title({lang.garage.buy.title()}), css={top="75px",header_color="rgba(255,125,0,0.75)"}}
103 | submenu.onclose = function()
104 | vRP.openMenu(player,menu)
105 | end
106 |
107 | local choose = function(player, choice)
108 | local vname = kitems[choice]
109 | if vname then
110 | -- buy vehicle
111 | local vehicle = vehicles[vname]
112 | if vehicle and vRP.tryPayment(user_id,vehicle[2]) then
113 | TriggerEvent('veh_SR:CheckMoneyForBasicVeh', user_id, vname, vehicle[2] ,veh_type)
114 | vRP.closeMenu(player)
115 | else
116 | vRPclient.notify(player,{lang.money.not_enough()})
117 | end
118 | end
119 | end
120 |
121 | -- get player owned vehicles (indexed by vehicle type name in lower case)
122 | MySQL.query("vRP/get_vehicles", {user_id = user_id}, function(_pvehicles, affected)
123 | local pvehicles = {}
124 | for k,v in pairs(_pvehicles) do
125 | pvehicles[string.lower(v.vehicle)] = true
126 | end
127 |
128 | -- for each existing vehicle in the garage group
129 | for k,v in pairs(vehicles) do
130 | if k ~= "_config" and pvehicles[string.lower(k)] == nil then -- not already owned
131 | submenu[v[1]] = {choose,lang.garage.buy.info({v[2],v[3]})}
132 | kitems[v[1]] = k
133 | end
134 | end
135 |
136 | vRP.openMenu(player,submenu)
137 | end)
138 | end
139 | end,lang.garage.buy.description()}
140 |
141 | menu[lang.garage.sell.title()] = {function(player,choice)
142 | local user_id = vRP.getUserId(player)
143 | if user_id ~= nil then
144 |
145 | -- build nested menu
146 | local kitems = {}
147 | local submenu = {name=lang.garage.title({lang.garage.sell.title()}), css={top="75px",header_color="rgba(255,125,0,0.75)"}}
148 | submenu.onclose = function()
149 | vRP.openMenu(player,menu)
150 | end
151 |
152 | local choose = function(player, choice)
153 | local vname = kitems[choice]
154 | if vname then
155 | -- sell vehicle
156 | local vehicle = vehicles[vname]
157 | if vehicle then
158 | local price = math.ceil(vehicle[2]*cfg.sell_factor)
159 |
160 | MySQL.query("vRP/get_vehicle", {user_id = user_id, vehicle = vname}, function(rows, affected)
161 | if #rows > 0 then -- has vehicle
162 | vRP.giveMoney(user_id,price)
163 | MySQL.execute("vRP/remove_vehicle", {user_id = user_id, vehicle = vname})
164 |
165 | vRPclient.notify(player,{lang.money.received({price})})
166 | vRP.closeMenu(player)
167 | else
168 | vRPclient.notify(player,{lang.common.not_found()})
169 | end
170 | end)
171 | end
172 | end
173 | end
174 |
175 | -- get player owned vehicles (indexed by vehicle type name in lower case)
176 | MySQL.query("vRP/get_vehicles", {user_id = user_id}, function(_pvehicles, affected)
177 | local pvehicles = {}
178 | for k,v in pairs(_pvehicles) do
179 | pvehicles[string.lower(v.vehicle)] = true
180 | end
181 |
182 | -- for each existing vehicle in the garage group
183 | for k,v in pairs(pvehicles) do
184 | local vehicle = vehicles[k]
185 | if vehicle then -- not already owned
186 | local price = math.ceil(vehicle[2]*cfg.sell_factor)
187 | submenu[vehicle[1]] = {choose,lang.garage.buy.info({price,vehicle[3]})}
188 | kitems[vehicle[1]] = k
189 | end
190 | end
191 |
192 | vRP.openMenu(player,submenu)
193 | end)
194 | end
195 | end,lang.garage.sell.description()}
196 |
197 | menu[lang.garage.rent.title()] = {function(player,choice)
198 | local user_id = vRP.getUserId(player)
199 | if user_id ~= nil then
200 | -- init tmpdata for rents
201 | local tmpdata = vRP.getUserTmpTable(user_id)
202 | if tmpdata.rent_vehicles == nil then
203 | tmpdata.rent_vehicles = {}
204 | end
205 |
206 | -- build nested menu
207 | local kitems = {}
208 | local submenu = {name=lang.garage.title({lang.garage.rent.title()}), css={top="75px",header_color="rgba(255,125,0,0.75)"}}
209 | submenu.onclose = function()
210 | vRP.openMenu(player,menu)
211 | end
212 |
213 | local choose = function(player, choice)
214 | local vname = kitems[choice]
215 | if vname then
216 | -- rent vehicle
217 | local vehicle = vehicles[vname]
218 | if vehicle then
219 | local price = math.ceil(vehicle[2]*cfg.rent_factor)
220 | if vRP.tryPayment(user_id,price) then
221 | -- add vehicle to rent tmp data
222 | tmpdata.rent_vehicles[vname] = true
223 |
224 | vRPclient.notify(player,{lang.money.paid({price})})
225 | vRP.closeMenu(player)
226 | else
227 | vRPclient.notify(player,{lang.money.not_enough()})
228 | end
229 | end
230 | end
231 | end
232 |
233 | -- get player owned vehicles (indexed by vehicle type name in lower case)
234 | MySQL.query("vRP/get_vehicles", {user_id = user_id}, function(_pvehicles, affected)
235 | local pvehicles = {}
236 | for k,v in pairs(_pvehicles) do
237 | pvehicles[string.lower(v.vehicle)] = true
238 | end
239 |
240 | -- add rents to blacklist
241 | for k,v in pairs(tmpdata.rent_vehicles) do
242 | pvehicles[string.lower(k)] = true
243 | end
244 |
245 | -- for each existing vehicle in the garage group
246 | for k,v in pairs(vehicles) do
247 | if k ~= "_config" and pvehicles[string.lower(k)] == nil then -- not already owned
248 | local price = math.ceil(v[2]*cfg.rent_factor)
249 | submenu[v[1]] = {choose,lang.garage.buy.info({price,v[3]})}
250 | kitems[v[1]] = k
251 | end
252 | end
253 |
254 | vRP.openMenu(player,submenu)
255 | end)
256 | end
257 | end,lang.garage.rent.description()}
258 |
259 | menu[lang.garage.store.title()] = {function(player,choice)
260 | vRPclient.despawnGarageVehicle(player,{veh_type,15})
261 | end, lang.garage.store.description()}
262 | end
263 |
264 | local function build_client_garages(source)
265 | local user_id = vRP.getUserId(source)
266 | if user_id ~= nil then
267 | for k,v in pairs(garages) do
268 | local gtype,x,y,z = table.unpack(v)
269 |
270 | local group = vehicle_groups[gtype]
271 | if group then
272 | local gcfg = group._config
273 |
274 | -- enter
275 | local garage_enter = function(player,area)
276 | local user_id = vRP.getUserId(source)
277 | if user_id ~= nil and vRP.hasPermissions(user_id,gcfg.permissions or {}) then
278 | local menu = garage_menus[gtype]
279 | if menu then
280 | vRP.openMenu(player,menu)
281 | end
282 | end
283 | end
284 |
285 | -- leave
286 | local garage_leave = function(player,area)
287 | vRP.closeMenu(player)
288 | end
289 |
290 | vRPclient.addBlip(source,{x,y,z,gcfg.blipid,gcfg.blipcolor,lang.garage.title({gtype})})
291 | vRPclient.addMarker(source,{x,y,z-1,0.7,0.7,0.5,0,255,125,125,150})
292 |
293 | vRP.setArea(source,"vRP:garage"..k,x,y,z,1,1.5,garage_enter,garage_leave)
294 | end
295 | end
296 | end
297 | end
298 |
299 | AddEventHandler("vRP:playerSpawn",function(user_id,source,first_spawn)
300 | if first_spawn then
301 | build_client_garages(source)
302 | end
303 | end)
304 |
305 | -- VEHICLE MENU
306 |
307 | -- define vehicle actions
308 | -- action => {cb(user_id,player,veh_group,veh_name),desc}
309 | local veh_actions = {}
310 |
311 | -- open trunk
312 | veh_actions[lang.vehicle.trunk.title()] = {function(user_id,player,vtype,name)
313 | local chestname = "u"..user_id.."veh_"..string.lower(name)
314 | local max_weight = cfg_inventory.vehicle_chest_weights[string.lower(name)] or cfg_inventory.default_vehicle_chest_weight
315 |
316 | -- open chest
317 | vRPclient.vc_openDoor(player, {vtype,5})
318 | vRP.openChest(player, chestname, max_weight, function()
319 | vRPclient.vc_closeDoor(player, {vtype,5})
320 | end)
321 | end, lang.vehicle.trunk.description()}
322 |
323 | -- detach trailer
324 | veh_actions[lang.vehicle.detach_trailer.title()] = {function(user_id,player,vtype,name)
325 | vRPclient.vc_detachTrailer(player, {vtype})
326 | end, lang.vehicle.detach_trailer.description()}
327 |
328 | -- detach towtruck
329 | veh_actions[lang.vehicle.detach_towtruck.title()] = {function(user_id,player,vtype,name)
330 | vRPclient.vc_detachTowTruck(player, {vtype})
331 | end, lang.vehicle.detach_towtruck.description()}
332 |
333 | -- detach cargobob
334 | veh_actions[lang.vehicle.detach_cargobob.title()] = {function(user_id,player,vtype,name)
335 | vRPclient.vc_detachCargobob(player, {vtype})
336 | end, lang.vehicle.detach_cargobob.description()}
337 |
338 | -- lock/unlock
339 | veh_actions[lang.vehicle.lock.title()] = {function(user_id,player,vtype,name)
340 | vRPclient.vc_toggleLock(player, {vtype})
341 | end, lang.vehicle.lock.description()}
342 |
343 | -- engine on/off
344 | veh_actions[lang.vehicle.engine.title()] = {function(user_id,player,vtype,name)
345 | vRPclient.vc_toggleEngine(player, {vtype})
346 | end, lang.vehicle.engine.description()}
347 |
348 | local function ch_vehicle(player,choice)
349 | local user_id = vRP.getUserId(player)
350 | if user_id ~= nil then
351 | -- check vehicle
352 | vRPclient.getNearestOwnedVehicle(player,{7},function(ok,vtype,name)
353 | if ok then
354 | -- build vehicle menu
355 | vRP.buildMenu("vehicle", {user_id = user_id, player = player, vtype = vtype, vname = name}, function(menu)
356 | menu.name=lang.vehicle.title()
357 | menu.css={top="75px",header_color="rgba(255,125,0,0.75)"}
358 |
359 | for k,v in pairs(veh_actions) do
360 | menu[k] = {function(player,choice) v[1](user_id,player,vtype,name) end, v[2]}
361 | end
362 |
363 | vRP.openMenu(player,menu)
364 | end)
365 | else
366 | vRPclient.notify(player,{lang.vehicle.no_owned_near()})
367 | end
368 | end)
369 | end
370 | end
371 |
372 | -- ask trunk (open other user car chest)
373 | local function ch_asktrunk(player,choice)
374 | vRPclient.getNearestPlayer(player,{10},function(nplayer)
375 | local nuser_id = vRP.getUserId(nplayer)
376 | if nuser_id ~= nil then
377 | vRPclient.notify(player,{lang.vehicle.asktrunk.asked()})
378 | vRP.request(nplayer,lang.vehicle.asktrunk.request(),15,function(nplayer,ok)
379 | if ok then -- request accepted, open trunk
380 | vRPclient.getNearestOwnedVehicle(nplayer,{7},function(ok,vtype,name)
381 | if ok then
382 | local chestname = "u"..nuser_id.."veh_"..string.lower(name)
383 | local max_weight = cfg_inventory.vehicle_chest_weights[string.lower(name)] or cfg_inventory.default_vehicle_chest_weight
384 |
385 | -- open chest
386 | local cb_out = function(idname,amount)
387 | vRPclient.notify(nplayer,{lang.inventory.give.given({vRP.getItemName(idname),amount})})
388 | end
389 |
390 | local cb_in = function(idname,amount)
391 | vRPclient.notify(nplayer,{lang.inventory.give.received({vRP.getItemName(idname),amount})})
392 | end
393 |
394 | vRPclient.vc_openDoor(nplayer, {vtype,5})
395 | vRP.openChest(player, chestname, max_weight, function()
396 | vRPclient.vc_closeDoor(nplayer, {vtype,5})
397 | end,cb_in,cb_out)
398 | else
399 | vRPclient.notify(player,{lang.vehicle.no_owned_near()})
400 | vRPclient.notify(nplayer,{lang.vehicle.no_owned_near()})
401 | end
402 | end)
403 | else
404 | vRPclient.notify(player,{lang.common.request_refused()})
405 | end
406 | end)
407 | else
408 | vRPclient.notify(player,{lang.common.no_player_near()})
409 | end
410 | end)
411 | end
412 |
413 | -- repair nearest vehicle
414 | local function ch_repair(player,choice)
415 | local user_id = vRP.getUserId(player)
416 | if user_id ~= nil then
417 | -- anim and repair
418 | if vRP.tryGetInventoryItem(user_id,"repairkit",1,true) then
419 | vRPclient.playAnim(player,{false,{task="WORLD_HUMAN_WELDING"},false})
420 | SetTimeout(15000, function()
421 | vRPclient.fixeNearestVehicle(player,{7})
422 | vRPclient.stopAnim(player,{false})
423 | end)
424 | end
425 | end
426 | end
427 |
428 | -- replace nearest vehicle
429 | local function ch_replace(player,choice)
430 | vRPclient.replaceNearestVehicle(player,{7})
431 | end
432 |
433 | vRP.registerMenuBuilder("main", function(add, data)
434 | local user_id = vRP.getUserId(data.player)
435 | if user_id ~= nil then
436 | -- add vehicle entry
437 | local choices = {}
438 | choices[lang.vehicle.title()] = {ch_vehicle}
439 |
440 | -- add ask trunk
441 | choices[lang.vehicle.asktrunk.title()] = {ch_asktrunk}
442 |
443 | -- add repair functions
444 | if vRP.hasPermission(user_id, "vehicle.repair") then
445 | choices[lang.vehicle.repair.title()] = {ch_repair, lang.vehicle.repair.description()}
446 | end
447 |
448 | if vRP.hasPermission(user_id, "vehicle.replace") then
449 | choices[lang.vehicle.replace.title()] = {ch_replace, lang.vehicle.replace.description() }
450 | end
451 |
452 | add(choices)
453 | end
454 | end)
455 |
--------------------------------------------------------------------------------
/vRP/vRP_showroompack/withoutcars/vrp_showroom/client.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | FiveM Scripts
3 | Copyright C 2018 Sighmir
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU Affero General Public License as published
7 | by the Free Software Foundation, either version 3 of the License, or
8 | at your option any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU Affero General Public License for more details.
14 |
15 | You should have received a copy of the GNU Affero General Public License
16 | along with this program. If not, see .
17 | ]]
18 |
19 |
20 | vRP = Proxy.getInterface("vRP")
21 | vRPg = Proxy.getInterface("vRP_garages")
22 |
23 | function deleteVehiclePedIsIn()
24 | local v = GetVehiclePedIsIn(GetPlayerPed(-1),false)
25 | SetVehicleHasBeenOwnedByPlayer(v,false)
26 | Citizen.InvokeNative(0xAD738C3085FE7E11, v, false, true) -- set not as mission entity
27 | SetVehicleAsNoLongerNeeded(Citizen.PointerValueIntInitialized(v))
28 | Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(v))
29 | end
30 |
31 | local vehshop = {
32 | opened = false,
33 | title = "Vehicle Shop",
34 | currentmenu = "main",
35 | lastmenu = nil,
36 | currentpos = nil,
37 | selectedbutton = 0,
38 | marker = { r = 0, g = 155, b = 255, a = 200, type = 1 },
39 | menu = {
40 | x = 0.1,
41 | y = 0.08,
42 | width = 0.2,
43 | height = 0.04,
44 | buttons = 10,
45 | from = 1,
46 | to = 10,
47 | scale = 0.4,
48 | font = 0,
49 | ["main"] = {
50 | title = "Simeon Showroom",
51 | name = "main",
52 | buttons = {
53 | {name = "vehicles", description = ""},
54 | {name = "motorcycles", description = ""},
55 | }
56 | },
57 | ["vehicles"] = {
58 | title = "vehicles",
59 | name = "vehicles",
60 | buttons = {
61 | {name = "compacts", description = ''},
62 | --{name = "cycles", description = ''},
63 | }
64 | },
65 | ["compacts"] = {
66 | title = "compacts",
67 | name = "compacts",
68 | buttons = {
69 | {name = "Blista", costs = 500, description = {}, model = "blista"},
70 | {name = "Brioso R/A", costs = 5010000, description = {}, model = "brioso"},
71 | {name = "Sultan RS", costs = 500, description = {}, model = "sultanrs"},
72 | {name = "Adder", costs = 500, description = {}, model = "adder"}
73 | }
74 | },
75 | ["motorcycles"] = {
76 | title = "motorcycles",
77 | name = "motorcycles",
78 | buttons = {
79 | {name = "Bati 801", costs = 15000, description = {}, model = "bati"},
80 | }
81 | },
82 | }
83 | }
84 | local fakecar = {model = '', car = nil}
85 | local vehshop_locations = {
86 | {entering = {-33.803,-1102.322,25.422}, inside = {-46.56327,-1097.382,25.99875, 120.1953}, outside = {-31.849,-1090.648,25.998,322.345}},
87 | }
88 |
89 | local vehshop_blips ={}
90 | local inrangeofvehshop = false
91 | local currentlocation = nil
92 | local boughtcar = false
93 |
94 | function vehSR_drawTxt(text,font,centre,x,y,scale,r,g,b,a)
95 | SetTextFont(font)
96 | SetTextProportional(0)
97 | SetTextScale(scale, scale)
98 | SetTextColour(r, g, b, a)
99 | SetTextDropShadow(0, 0, 0, 0,255)
100 | SetTextEdge(1, 0, 0, 0, 255)
101 | SetTextDropShadow()
102 | SetTextOutline()
103 | SetTextCentre(centre)
104 | SetTextEntry("STRING")
105 | AddTextComponentString(text)
106 | DrawText(x , y)
107 | end
108 |
109 | function vehSR_IsPlayerInRangeOfVehshop()
110 | return inrangeofvehshop
111 | end
112 |
113 | local firstspawn = 0
114 | AddEventHandler('playerSpawned', function(spawn)
115 | if firstspawn == 0 then
116 | --326 car blip 227 225
117 | vehSR_ShowVehshopBlips(true)
118 | firstspawn = 1
119 | end
120 | end)
121 |
122 | function vehSR_ShowVehshopBlips(bool)
123 | if bool and #vehshop_blips == 0 then
124 | for station,pos in pairs(vehshop_locations) do
125 | local loc = pos
126 | pos = pos.entering
127 | local blip = AddBlipForCoord(pos[1],pos[2],pos[3])
128 | -- 60 58 137
129 | SetBlipSprite(blip,326)
130 | BeginTextCommandSetBlipName("STRING")
131 | AddTextComponentString("Simeon Showroom")
132 | EndTextCommandSetBlipName(blip)
133 | SetBlipAsShortRange(blip,true)
134 | SetBlipAsMissionCreatorBlip(blip,true)
135 | table.insert(vehshop_blips, {blip = blip, pos = loc})
136 | end
137 | Citizen.CreateThread(function()
138 | while #vehshop_blips > 0 do
139 | Citizen.Wait(0)
140 | local inrange = false
141 | for i,b in ipairs(vehshop_blips) do
142 | if IsPlayerWantedLevelGreater(GetPlayerIndex(),0) == false and vehshop.opened == false and IsPedInAnyVehicle(vehSR_LocalPed(), true) == false and GetDistanceBetweenCoords(b.pos.entering[1],b.pos.entering[2],b.pos.entering[3],GetEntityCoords(vehSR_LocalPed())) < 5 then
143 | DrawMarker(1,b.pos.entering[1],b.pos.entering[2],b.pos.entering[3],0,0,0,0,0,0,2.001,2.0001,0.5001,0,155,255,200,0,0,0,0)
144 | vehSR_drawTxt("Press ~g~ENTER~s~ to buy ~b~vehicle",0,1,0.5,0.8,0.6,255,255,255,255)
145 | currentlocation = b
146 | inrange = true
147 | end
148 | end
149 | inrangeofvehshop = inrange
150 | end
151 | end)
152 | elseif bool == false and #vehshop_blips > 0 then
153 | for i,b in ipairs(vehshop_blips) do
154 | if DoesBlipExist(b.blip) then
155 | SetBlipAsMissionCreatorBlip(b.blip,false)
156 | Citizen.InvokeNative(0x86A652570E5F25DD, Citizen.PointerValueIntInitialized(b.blip))
157 | end
158 | end
159 | vehshop_blips = {}
160 | end
161 | end
162 |
163 | function vehSR_f(n)
164 | return n + 0.0001
165 | end
166 |
167 | function vehSR_LocalPed()
168 | return GetPlayerPed(-1)
169 | end
170 |
171 | function vehSR_try(f, catch_f)
172 | local status, exception = pcall(f)
173 | if not status then
174 | catch_f(exception)
175 | end
176 | end
177 | function vehSR_firstToUpper(str)
178 | return (str:gsub("^%l", string.upper))
179 | end
180 | --local veh = nil
181 | function vehSR_OpenCreator()
182 | boughtcar = false
183 | local ped = vehSR_LocalPed()
184 | local pos = currentlocation.pos.inside
185 | FreezeEntityPosition(ped,true)
186 | SetEntityVisible(ped,false)
187 | local g = Citizen.InvokeNative(0xC906A7DAB05C8D2B,pos[1],pos[2],pos[3],Citizen.PointerValueFloat(),0)
188 | SetEntityCoords(ped,pos[1],pos[2],g)
189 | SetEntityHeading(ped,pos[4])
190 | vehshop.currentmenu = "main"
191 | vehshop.opened = true
192 | vehshop.selectedbutton = 0
193 | end
194 | local vehicle_price = 0
195 | function vehSR_CloseCreator(vehicle,veh_type)
196 | Citizen.CreateThread(function()
197 | local ped = vehSR_LocalPed()
198 | if not boughtcar then
199 | local pos = currentlocation.pos.entering
200 | SetEntityCoords(ped,pos[1],pos[2],pos[3])
201 | FreezeEntityPosition(ped,false)
202 | SetEntityVisible(ped,true)
203 | else
204 | deleteVehiclePedIsIn()
205 | vRP.teleport({-44.21378326416,-1079.1402587891,26.67050743103})
206 | vRPg.spawnBoughtVehicle({veh_type, vehicle})
207 | SetEntityVisible(ped,true)
208 | FreezeEntityPosition(ped,false)
209 | end
210 | vehshop.opened = false
211 | vehshop.menu.from = 1
212 | vehshop.menu.to = 10
213 | end)
214 | end
215 |
216 | function vehSR_drawMenuButton(button,x,y,selected)
217 | local menu = vehshop.menu
218 | SetTextFont(menu.font)
219 | SetTextProportional(0)
220 | SetTextScale(menu.scale, menu.scale)
221 | if selected then
222 | SetTextColour(0, 0, 0, 255)
223 | else
224 | SetTextColour(255, 255, 255, 255)
225 | end
226 | SetTextCentre(0)
227 | SetTextEntry("STRING")
228 | AddTextComponentString(button.name)
229 | if selected then
230 | DrawRect(x,y,menu.width,menu.height,255,255,255,255)
231 | else
232 | DrawRect(x,y,menu.width,menu.height,0,0,0,150)
233 | end
234 | DrawText(x - menu.width/2 + 0.005, y - menu.height/2 + 0.0028)
235 | end
236 |
237 | function vehSR_drawMenuTitle(txt,x,y)
238 | local menu = vehshop.menu
239 | SetTextFont(2)
240 | SetTextProportional(0)
241 | SetTextScale(0.5, 0.5)
242 | SetTextColour(255, 255, 255, 255)
243 | SetTextEntry("STRING")
244 | AddTextComponentString(txt)
245 | DrawRect(x,y,menu.width,menu.height,0,0,0,150)
246 | DrawText(x - menu.width/2 + 0.005, y - menu.height/2 + 0.0028)
247 | end
248 | function vehSR_tablelength(T)
249 | local count = 0
250 | for _ in pairs(T) do count = count + 1 end
251 | return count
252 | end
253 | function vehSR_Notify(text)
254 | SetNotificationTextEntry('STRING')
255 | AddTextComponentString(text)
256 | DrawNotification(false, false)
257 | end
258 |
259 | function vehSR_drawMenuRight(txt,x,y,selected)
260 | local menu = vehshop.menu
261 | SetTextFont(menu.font)
262 | SetTextProportional(0)
263 | SetTextScale(menu.scale, menu.scale)
264 | if selected then
265 | SetTextColour(0, 0, 0, 255)
266 | else
267 | SetTextColour(255, 255, 255, 255)
268 | end
269 | SetTextCentre(0)
270 | SetTextEntry("STRING")
271 | AddTextComponentString(txt)
272 | DrawText(x + menu.width/2 - 0.06, y - menu.height/2 + 0.0028)
273 | end
274 | local backlock = false
275 | Citizen.CreateThread(function()
276 | local last_dir
277 | while true do
278 | Citizen.Wait(0)
279 | if IsControlJustPressed(1,201) and vehSR_IsPlayerInRangeOfVehshop() then
280 | if vehshop.opened then
281 | vehSR_CloseCreator("","")
282 | else
283 | vehSR_OpenCreator()
284 | end
285 | end
286 | if vehshop.opened then
287 | local ped = vehSR_LocalPed()
288 | local menu = vehshop.menu[vehshop.currentmenu]
289 | vehSR_drawTxt(vehshop.title,1,1,vehshop.menu.x,vehshop.menu.y,1.0, 255,255,255,255)
290 | vehSR_drawMenuTitle(menu.title, vehshop.menu.x,vehshop.menu.y + 0.08)
291 | vehSR_drawTxt(vehshop.selectedbutton.."/"..vehSR_tablelength(menu.buttons),0,0,vehshop.menu.x + vehshop.menu.width/2 - 0.0385,vehshop.menu.y + 0.067,0.4, 255,255,255,255)
292 | local y = vehshop.menu.y + 0.12
293 | buttoncount = vehSR_tablelength(menu.buttons)
294 | local selected = false
295 |
296 | for i,button in pairs(menu.buttons) do
297 | if i >= vehshop.menu.from and i <= vehshop.menu.to then
298 |
299 | if i == vehshop.selectedbutton then
300 | selected = true
301 | else
302 | selected = false
303 | end
304 | vehSR_drawMenuButton(button,vehshop.menu.x,y,selected)
305 | if button.costs ~= nil then
306 | if vehshop.currentmenu == "compacts" or vehshop.currentmenu == "coupes" or vehshop.currentmenu == "sedans" or vehshop.currentmenu == "sports" or vehshop.currentmenu == "sportsclassics" or vehshop.currentmenu == "supers" or vehshop.currentmenu == "muscle" or vehshop.currentmenu == "offroad" or vehshop.currentmenu == "suvs" or vehshop.currentmenu == "vans" or vehshop.currentmenu == "industrial" or vehshop.currentmenu == "cycles" or vehshop.currentmenu == "motorcycles" then
307 | vehSR_drawMenuRight(button.costs.."$",vehshop.menu.x,y,selected)
308 | else
309 | vehSR_drawMenuButton(button,vehshop.menu.x,y,selected)
310 | end
311 | end
312 | y = y + 0.04
313 | if vehshop.currentmenu == "compacts" or vehshop.currentmenu == "coupes" or vehshop.currentmenu == "sedans" or vehshop.currentmenu == "sports" or vehshop.currentmenu == "sportsclassics" or vehshop.currentmenu == "supers" or vehshop.currentmenu == "muscle" or vehshop.currentmenu == "offroad" or vehshop.currentmenu == "suvs" or vehshop.currentmenu == "vans" or vehshop.currentmenu == "industrial" or vehshop.currentmenu == "cycles" or vehshop.currentmenu == "motorcycles" then
314 | if selected then
315 | if fakecar.model ~= button.model then
316 | if DoesEntityExist(fakecar.car) then
317 | Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(fakecar.car))
318 | end
319 | local pos = currentlocation.pos.inside
320 | local hash = GetHashKey(button.model)
321 | RequestModel(hash)
322 | local timer = 0
323 | while not HasModelLoaded(hash) and timer < 255 do
324 | Citizen.Wait(1)
325 | vehSR_drawTxt("Loading...",0,1,0.5,0.5,1.5,255,255-timer,255-timer,255)
326 | RequestModel(hash)
327 | timer = timer + 1
328 | end
329 | if timer < 255 then
330 | local veh = CreateVehicle(hash,pos[1],pos[2],pos[3],pos[4],false,false)
331 | while not DoesEntityExist(veh) do
332 | Citizen.Wait(1)
333 | vehSR_drawTxt("Loading...",0,1,0.5,0.5,1.5,255,255-timer,255-timer,255)
334 | end
335 | FreezeEntityPosition(veh,true)
336 | SetEntityInvincible(veh,true)
337 | SetVehicleDoorsLocked(veh,4)
338 | --SetEntityCollision(veh,false,false)
339 | TaskWarpPedIntoVehicle(vehSR_LocalPed(),veh,-1)
340 | for i = 0,24 do
341 | SetVehicleModKit(veh,0)
342 | RemoveVehicleMod(veh,i)
343 | end
344 | fakecar = { model = button.model, car = veh}
345 | else
346 | timer = 0
347 | while timer < 50 do
348 | Citizen.Wait(1)
349 | vehSR_drawTxt("Failed!",0,1,0.5,0.5,1.5,255,0,0,255)
350 | timer = timer + 1
351 | end
352 | if last_dir then
353 | if vehshop.selectedbutton < buttoncount then
354 | vehshop.selectedbutton = vehshop.selectedbutton +1
355 | if buttoncount > 10 and vehshop.selectedbutton > vehshop.menu.to then
356 | vehshop.menu.to = vehshop.menu.to + 1
357 | vehshop.menu.from = vehshop.menu.from + 1
358 | end
359 | else
360 | last_dir = false
361 | vehshop.selectedbutton = vehshop.selectedbutton -1
362 | if buttoncount > 10 and vehshop.selectedbutton < vehshop.menu.from then
363 | vehshop.menu.from = vehshop.menu.from -1
364 | vehshop.menu.to = vehshop.menu.to - 1
365 | end
366 | end
367 | else
368 | if vehshop.selectedbutton > 1 then
369 | vehshop.selectedbutton = vehshop.selectedbutton -1
370 | if buttoncount > 10 and vehshop.selectedbutton < vehshop.menu.from then
371 | vehshop.menu.from = vehshop.menu.from -1
372 | vehshop.menu.to = vehshop.menu.to - 1
373 | end
374 | else
375 | last_dir = true
376 | vehshop.selectedbutton = vehshop.selectedbutton +1
377 | if buttoncount > 10 and vehshop.selectedbutton > vehshop.menu.to then
378 | vehshop.menu.to = vehshop.menu.to + 1
379 | vehshop.menu.from = vehshop.menu.from + 1
380 | end
381 | end
382 | end
383 | end
384 | end
385 | end
386 | end
387 | if selected and IsControlJustPressed(1,201) then
388 | vehSR_ButtonSelected(button)
389 | end
390 | end
391 | end
392 | if IsControlJustPressed(1,202) then
393 | vehSR_Back()
394 | end
395 | if IsControlJustReleased(1,202) then
396 | backlock = false
397 | end
398 | if IsControlJustPressed(1,188) then
399 | last_dir = false
400 | if vehshop.selectedbutton > 1 then
401 | vehshop.selectedbutton = vehshop.selectedbutton -1
402 | if buttoncount > 10 and vehshop.selectedbutton < vehshop.menu.from then
403 | vehshop.menu.from = vehshop.menu.from -1
404 | vehshop.menu.to = vehshop.menu.to - 1
405 | end
406 | end
407 | end
408 | if IsControlJustPressed(1,187)then
409 | last_dir = true
410 | if vehshop.selectedbutton < buttoncount then
411 | vehshop.selectedbutton = vehshop.selectedbutton +1
412 | if buttoncount > 10 and vehshop.selectedbutton > vehshop.menu.to then
413 | vehshop.menu.to = vehshop.menu.to + 1
414 | vehshop.menu.from = vehshop.menu.from + 1
415 | end
416 | end
417 | end
418 | end
419 |
420 | end
421 | end)
422 |
423 |
424 | function vehSR_round(num, idp)
425 | if idp and idp>0 then
426 | local mult = 10^idp
427 | return math.floor(num * mult + 0.5) / mult
428 | end
429 | return math.floor(num + 0.5)
430 | end
431 | function vehSR_ButtonSelected(button)
432 | local ped = GetPlayerPed(-1)
433 | local this = vehshop.currentmenu
434 | local btn = button.name
435 | if this == "main" then
436 | if btn == "vehicles" then
437 | vehSR_OpenMenu('vehicles')
438 | elseif btn == "motorcycles" then
439 | vehSR_OpenMenu('motorcycles')
440 | end
441 | elseif this == "vehicles" then
442 | if btn == "sports" then
443 | vehSR_OpenMenu('sports')
444 | elseif btn == "sedans" then
445 | vehSR_OpenMenu('sedans')
446 | elseif btn == "compacts" then
447 | vehSR_OpenMenu('compacts')
448 | elseif btn == "coupes" then
449 | vehSR_OpenMenu('coupes')
450 | elseif btn == "sportsclassics" then
451 | vehSR_OpenMenu("sportsclassics")
452 | elseif btn == "supers" then
453 | vehSR_OpenMenu('supers')
454 | elseif btn == "muscle" then
455 | vehSR_OpenMenu('muscle')
456 | elseif btn == "offroad" then
457 | vehSR_OpenMenu('offroad')
458 | elseif btn == "suvs" then
459 | vehSR_OpenMenu('suvs')
460 | elseif btn == "vans" then
461 | vehSR_OpenMenu('vans')
462 | end
463 | elseif this == "compacts" or this == "coupes" or this == "sedans" or this == "sports" or this == "sportsclassics" or this == "supers" or this == "muscle" or this == "offroad" or this == "suvs" or this == "vans" or this == "industrial" then
464 | TriggerServerEvent('veh_SR:CheckMoneyForVeh',button.model,button.costs, "car")
465 | elseif this == "cycles" or this == "motorcycles" then
466 | TriggerServerEvent('veh_SR:CheckMoneyForVeh',button.model,button.costs, "bike")
467 | end
468 | end
469 |
470 | RegisterNetEvent('veh_SR:CloseMenu')
471 | AddEventHandler('veh_SR:CloseMenu', function(vehicle, veh_type)
472 | boughtcar = true
473 | vehSR_CloseCreator(vehicle,veh_type)
474 | end)
475 |
476 | function vehSR_OpenMenu(menu)
477 | fakecar = {model = '', car = nil}
478 | vehshop.lastmenu = vehshop.currentmenu
479 | if menu == "vehicles" then
480 | vehshop.lastmenu = "main"
481 | elseif menu == "bikes" then
482 | vehshop.lastmenu = "main"
483 | elseif menu == 'race_create_objects' then
484 | vehshop.lastmenu = "main"
485 | elseif menu == "race_create_objects_spawn" then
486 | vehshop.lastmenu = "race_create_objects"
487 | end
488 | vehshop.menu.from = 1
489 | vehshop.menu.to = 10
490 | vehshop.selectedbutton = 0
491 | vehshop.currentmenu = menu
492 | end
493 |
494 |
495 | function vehSR_Back()
496 | if backlock then
497 | return
498 | end
499 | backlock = true
500 | if vehshop.currentmenu == "main" then
501 | vehSR_CloseCreator("","")
502 | elseif vehshop.currentmenu == "compacts" or vehshop.currentmenu == "coupes" or vehshop.currentmenu == "sedans" or vehshop.currentmenu == "sports" or vehshop.currentmenu == "sportsclassics" or vehshop.currentmenu == "supers" or vehshop.currentmenu == "muscle" or vehshop.currentmenu == "offroad" or vehshop.currentmenu == "suvs" or vehshop.currentmenu == "vans" or vehshop.currentmenu == "industrial" or vehshop.currentmenu == "cycles" or vehshop.currentmenu == "motorcycles" then
503 | if DoesEntityExist(fakecar.car) then
504 | Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(fakecar.car))
505 | end
506 | fakecar = {model = '', car = nil}
507 | vehSR_OpenMenu(vehshop.lastmenu)
508 | else
509 | vehSR_OpenMenu(vehshop.lastmenu)
510 | end
511 |
512 | end
513 |
514 | function vehSR_stringstarts(String,Start)
515 | return string.sub(String,1,string.len(Start))==Start
516 | end
--------------------------------------------------------------------------------
/vRP/vRP_garages/vrp_garages/client.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | FiveM Scripts
3 | Copyright C 2018 Sighmir
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU Affero General Public License as published
7 | by the Free Software Foundation, either version 3 of the License, or
8 | at your option any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU Affero General Public License for more details.
14 |
15 | You should have received a copy of the GNU Affero General Public License
16 | along with this program. If not, see .
17 | ]]
18 |
19 | --[[Proxy/Tunnel]]--
20 |
21 | vRPgt = {}
22 | Tunnel.bindInterface("vRP_garages",vRPgt)
23 | Proxy.addInterface("vRP_garages",vRPgt)
24 | vRP = Proxy.getInterface("vRP")
25 |
26 | --[[Local/Global]]--
27 |
28 | GVEHICLES = {}
29 | local inrangeofgarage = false
30 | local currentlocation = nil
31 |
32 | local garages = {
33 | {name="Garage", colour=3, id=357, x=215.124, y=-791.377, z=29.646, h=0.0},
34 | {name="Garage", colour=3, id=357, x=-334.685, y=289.773, z=84.705, h=0.0},
35 | {name="Garage", colour=3, id=357, x=-55.272, y=-1838.71, z=25.442, h=0.0},
36 | {name="Garage", colour=3, id=357, x=126.434, y=6610.04, z=30.750, h=0.0},
37 | {name="Garage", colour=3, id=357, x=1230.9146728516, y=-2678.0639648438, z=2.7148849964142, h=0.0}, --Garaj linia 1000 din vrp/cfg/garages.lua
38 | {name="Garage", colour=3, id=357, x=684.44097900391, y=-719.58734130859, z=25.884830474854, h=0.0},
39 | {name="Garage", colour=3, id=357, x=-638.08142089844, y=56.500617980957, z=43.794803619385, h=0.0},
40 | {name="Garage", colour=3, id=357, x=-1457.4909667969, y=-500.61614990234, z=32.202766418457, h=0.0},
41 | {name="Garage", colour=3, id=357, x=-25.273494720459, y=-1434.4365234375, z=30.653142929077, h=0.0},
42 | {name="Garage", colour=3, id=357, x=-1155.2669677734, y=-1520.244140625, z=4.3475861549377, h=0.0},
43 | {name="Garage", colour=3, id=357, x=-819.40551757813, y=183.72904968262, z=72.136161804199, h=0.0},
44 | {name="Garage", colour=3, id=357, x=15.016004562378, y=547.76171875, z=176.14279174805, h=0.0},
45 | {name="Garage", colour=3, id=357, x=1977.1169433594, y=3827.2368164063, z=32.373237609863, h=0.0},
46 | {name="Garage", colour=3, id=357, x=2480.5893554688, y=4953.958984375, z=45.026481628418, h=0.0},
47 | {name="Garage", colour=3, id=357, x=15.016004562378, y=547.76171875, z=176.14279174805, h=0.0},
48 | {name="Garage", colour=3, id=357, x=-1415.1351318359, y=-956.41815185547, z=7.2369647026062, h=0.0},
49 | {name="Garage", colour=3, id=357, x=497.44073486328, y=-1702.4410400391, z=29.400140762329, h=0.0},
50 | {name="Garage", colour=3, id=357, x=-796.00256347656, y=304.55578613281, z=85.700416564941, h=0.0},
51 | {name="Garage", colour=3, id=357, x=-259.08013916016, y=-680.39465332031, z=32.830478668213, h=0.0},
52 | {name="Garage", colour=3, id=357, x=-72.769035339355, y=495.79925537109, z=144.10296630859, h=0.0},
53 | {name="Garage", colour=3, id=357, x=-121.71002960205, y=509.85540771484, z=142.5652923584, h=0.0},
54 | {name="Garage", colour=3, id=357, x=-188.32077026367, y=502.87573242188, z=134.23774719238, h=0.0},
55 | {name="Garage", colour=3, id=357, x=1366.5837402344, y=1147.4722900391, z=113.41327667236, h=0.0},
56 | {name="Garage", colour=3, id=357, x=-36.333103179932, y=-674.09722900391, z=32.33805847168, h=0.0},
57 | {name="Garage", colour=3, id=357, x=1274.7135009766, y=-1732.7083740234, z=52.04536819458, h=0.0},
58 | {name="Garage", colour=3, id=357, x=34.516819000244, y=6604.0004882813, z=32.449085235596, h=0.0},
59 | {name="Garage", colour=3, id=357, x=-555.20428466797, y=664.56500244141, z=145.16401672363, h=0.0},
60 | }
61 |
62 | vehicles = {}
63 | garageSelected = { {x=nil, y=nil, z=nil, h=nil}, }
64 | selectedPage = 0
65 |
66 | lang_string = {
67 | menu1 = "Store a vehicle",
68 | menu2 = "Get a vehicle",
69 | menu3 = "Close",
70 | menu4 = "Vehicles",
71 | menu5 = "Options",
72 | menu6 = "Get",
73 | menu7 = "Back",
74 | menu8 = "~g~E~s~ to open menu",
75 | menu9 = "Sell",
76 | menu10 = "~g~E~s~ to sell the vehicle at 50% of the purchase price",
77 | menu11 = "Update the vehicle",
78 | menu12 = "Next",
79 | state1 = "Out",
80 | state2 = "In",
81 | text1 = "The area is crowded",
82 | text2 = "This vehicle is not in the garage",
83 | text3 = "Vehicle out",
84 | text4 = "It's not your vehicle",
85 | text5 = "Vehicle stored",
86 | text6 = "No vehicles present",
87 | text7 = "Vehicle sold",
88 | text8 = "Vehicle bought, good drive",
89 | text9 = "Insufficient funds",
90 | text10 = "Vehicle updated"
91 | }
92 | --[[Functions]]--
93 |
94 | function vRPgt.spawnGarageVehicle(vtype, name, vehicle_plate, vehicle_colorprimary, vehicle_colorsecondary, vehicle_pearlescentcolor, vehicle_wheelcolor, vehicle_plateindex, vehicle_neoncolor1, vehicle_neoncolor2, vehicle_neoncolor3, vehicle_windowtint, vehicle_wheeltype, vehicle_mods0, vehicle_mods1, vehicle_mods2, vehicle_mods3, vehicle_mods4, vehicle_mods5, vehicle_mods6, vehicle_mods7, vehicle_mods8, vehicle_mods9, vehicle_mods10, vehicle_mods11, vehicle_mods12, vehicle_mods13, vehicle_mods14, vehicle_mods15, vehicle_mods16, vehicle_turbo, vehicle_tiresmoke, vehicle_xenon, vehicle_mods23, vehicle_mods24, vehicle_neon0, vehicle_neon1, vehicle_neon2, vehicle_neon3, vehicle_bulletproof, vehicle_smokecolor1, vehicle_smokecolor2, vehicle_smokecolor3, vehicle_modvariation) -- vtype is the vehicle type (one vehicle per type allowed at the same time)
95 |
96 | local vehicle = vehicles[vtype]
97 | if vehicle and not IsVehicleDriveable(vehicle[3]) then -- precheck if vehicle is undriveable
98 | -- despawn vehicle
99 | SetVehicleHasBeenOwnedByPlayer(vehicle[3],false)
100 | Citizen.InvokeNative(0xAD738C3085FE7E11, vehicle[3], false, true) -- set not as mission entity
101 | SetVehicleAsNoLongerNeeded(Citizen.PointerValueIntInitialized(vehicle[3]))
102 | Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(vehicle[3]))
103 | TriggerEvent("vrp_garages:setVehicle", vtype, nil)
104 | end
105 |
106 | vehicle = vehicles[vtype]
107 | if vehicle == nil then
108 | -- load vehicle model
109 | local mhash = GetHashKey(name)
110 |
111 | local i = 0
112 | while not HasModelLoaded(mhash) and i < 10000 do
113 | RequestModel(mhash)
114 | Citizen.Wait(10)
115 | i = i+1
116 | end
117 |
118 | -- spawn car
119 | if HasModelLoaded(mhash) then
120 | local x,y,z = vRP.getPosition({})
121 | local nveh = CreateVehicle(mhash, x,y,z+0.5, GetEntityHeading(GetPlayerPed(-1)), true, false) -- added player heading
122 | SetVehicleOnGroundProperly(nveh)
123 | SetEntityInvincible(nveh,false)
124 | SetPedIntoVehicle(GetPlayerPed(-1),nveh,-1) -- put player inside
125 | SetVehicleNumberPlateText(nveh, "P " .. vRP.getRegistrationNumber({}))
126 | Citizen.InvokeNative(0xAD738C3085FE7E11, nveh, true, true) -- set as mission entity
127 | SetVehicleHasBeenOwnedByPlayer(nveh,true)
128 | vehicle_migration = false
129 | if not vehicle_migration then
130 | local nid = NetworkGetNetworkIdFromEntity(nveh)
131 | SetNetworkIdCanMigrate(nid,false)
132 | end
133 |
134 | TriggerEvent("vrp_garages:setVehicle", vtype, {vtype,name,nveh})
135 |
136 | SetModelAsNoLongerNeeded(mhash)
137 |
138 | --grabbing customization
139 | local plate = plate
140 | local primarycolor = tonumber(vehicle_colorprimary)
141 | local secondarycolor = tonumber(vehicle_colorsecondary)
142 | local pearlescentcolor = vehicle_pearlescentcolor
143 | local wheelcolor = vehicle_wheelcolor
144 | local plateindex = tonumber(vehicle_plateindex)
145 | local neoncolor = {vehicle_neoncolor1,vehicle_neoncolor2,vehicle_neoncolor3}
146 | local windowtint = vehicle_windowtint
147 | local wheeltype = tonumber(vehicle_wheeltype)
148 | local mods0 = tonumber(vehicle_mods0)
149 | local mods1 = tonumber(vehicle_mods1)
150 | local mods2 = tonumber(vehicle_mods2)
151 | local mods3 = tonumber(vehicle_mods3)
152 | local mods4 = tonumber(vehicle_mods4)
153 | local mods5 = tonumber(vehicle_mods5)
154 | local mods6 = tonumber(vehicle_mods6)
155 | local mods7 = tonumber(vehicle_mods7)
156 | local mods8 = tonumber(vehicle_mods8)
157 | local mods9 = tonumber(vehicle_mods9)
158 | local mods10 = tonumber(vehicle_mods10)
159 | local mods11 = tonumber(vehicle_mods11)
160 | local mods12 = tonumber(vehicle_mods12)
161 | local mods13 = tonumber(vehicle_mods13)
162 | local mods14 = tonumber(vehicle_mods14)
163 | local mods15 = tonumber(vehicle_mods15)
164 | local mods16 = tonumber(vehicle_mods16)
165 | local turbo = vehicle_turbo
166 | local tiresmoke = vehicle_tiresmoke
167 | local xenon = vehicle_xenon
168 | local mods23 = tonumber(vehicle_mods23)
169 | local mods24 = tonumber(vehicle_mods24)
170 | local neon0 = vehicle_neon0
171 | local neon1 = vehicle_neon1
172 | local neon2 = vehicle_neon2
173 | local neon3 = vehicle_neon3
174 | local bulletproof = vehicle_bulletproof
175 | local smokecolor1 = vehicle_smokecolor1
176 | local smokecolor2 = vehicle_smokecolor2
177 | local smokecolor3 = vehicle_smokecolor3
178 | local variation = vehicle_modvariation
179 |
180 | --setting customization
181 | SetVehicleColours(nveh, primarycolor, secondarycolor)
182 | SetVehicleExtraColours(nveh, tonumber(pearlescentcolor), tonumber(wheelcolor))
183 | SetVehicleNumberPlateTextIndex(nveh,plateindex)
184 | SetVehicleNeonLightsColour(nveh,tonumber(neoncolor[1]),tonumber(neoncolor[2]),tonumber(neoncolor[3]))
185 | SetVehicleTyreSmokeColor(nveh,tonumber(smokecolor1),tonumber(smokecolor2),tonumber(smokecolor3))
186 | SetVehicleModKit(nveh,0)
187 | SetVehicleMod(nveh, 0, mods0)
188 | SetVehicleMod(nveh, 1, mods1)
189 | SetVehicleMod(nveh, 2, mods2)
190 | SetVehicleMod(nveh, 3, mods3)
191 | SetVehicleMod(nveh, 4, mods4)
192 | SetVehicleMod(nveh, 5, mods5)
193 | SetVehicleMod(nveh, 6, mods6)
194 | SetVehicleMod(nveh, 7, mods7)
195 | SetVehicleMod(nveh, 8, mods8)
196 | SetVehicleMod(nveh, 9, mods9)
197 | SetVehicleMod(nveh, 10, mods10)
198 | SetVehicleMod(nveh, 11, mods11)
199 | SetVehicleMod(nveh, 12, mods12)
200 | SetVehicleMod(nveh, 13, mods13)
201 | SetVehicleMod(nveh, 14, mods14)
202 | SetVehicleMod(nveh, 15, mods15)
203 | SetVehicleMod(nveh, 16, mods16)
204 | if turbo == "on" then
205 | ToggleVehicleMod(nveh, 18, true)
206 | else
207 | ToggleVehicleMod(nveh, 18, false)
208 | end
209 | if tiresmoke == "on" then
210 | ToggleVehicleMod(nveh, 20, true)
211 | else
212 | ToggleVehicleMod(nveh, 20, false)
213 | end
214 | if xenon == "on" then
215 | ToggleVehicleMod(nveh, 22, true)
216 | else
217 | ToggleVehicleMod(nveh, 22, false)
218 | end
219 | SetVehicleWheelType(nveh, tonumber(wheeltype))
220 | SetVehicleMod(nveh, 23, mods23)
221 | SetVehicleMod(nveh, 24, mods24)
222 | if neon0 == "on" then
223 | SetVehicleNeonLightEnabled(nveh,0, true)
224 | else
225 | SetVehicleNeonLightEnabled(nveh,0, false)
226 | end
227 | if neon1 == "on" then
228 | SetVehicleNeonLightEnabled(nveh,1, true)
229 | else
230 | SetVehicleNeonLightEnabled(nveh,1, false)
231 | end
232 | if neon2 == "on" then
233 | SetVehicleNeonLightEnabled(nveh,2, true)
234 | else
235 | SetVehicleNeonLightEnabled(nveh,2, false)
236 | end
237 | if neon3 == "on" then
238 | SetVehicleNeonLightEnabled(nveh,3, true)
239 | else
240 | SetVehicleNeonLightEnabled(nveh,3, false)
241 | end
242 | if bulletproof == "on" then
243 | SetVehicleTyresCanBurst(nveh, false)
244 | else
245 | SetVehicleTyresCanBurst(nveh, true)
246 | end
247 | --if variation == "on" then
248 | -- SetVehicleModVariation(nveh,23)
249 | --else
250 | -- SetVehicleModVariation(nveh,23, false)
251 | --end
252 | SetVehicleWindowTint(nveh,tonumber(windowtint))
253 | end
254 | else
255 | vRP.notify({"You can only have one "..vtype.." vehicule out."})
256 | end
257 | end
258 |
259 | function vRPgt.spawnBoughtVehicle(vtype, name)
260 |
261 | local vehicle = vehicles[vtype]
262 | if vehicle then -- precheck if vehicle is undriveable
263 | -- despawn vehicle
264 | SetVehicleHasBeenOwnedByPlayer(vehicle[3],false)
265 | Citizen.InvokeNative(0xAD738C3085FE7E11, vehicle[3], false, true) -- set not as mission entity
266 | SetVehicleAsNoLongerNeeded(Citizen.PointerValueIntInitialized(vehicle[3]))
267 | Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(vehicle[3]))
268 | TriggerEvent("vrp_garages:setVehicle", vtype, nil)
269 | end
270 |
271 | vehicle = vehicles[vtype]
272 | if vehicle == nil then
273 | -- load vehicle model
274 | local mhash = GetHashKey(name)
275 |
276 | local i = 0
277 | while not HasModelLoaded(mhash) and i < 10000 do
278 | RequestModel(mhash)
279 | Citizen.Wait(10)
280 | i = i+1
281 | end
282 |
283 | -- spawn car
284 | if HasModelLoaded(mhash) then
285 | local x,y,z = vRP.getPosition({})
286 | local nveh = CreateVehicle(mhash, x,y,z+0.5, GetEntityHeading(GetPlayerPed(-1)), true, false) -- added player heading
287 | SetVehicleOnGroundProperly(nveh)
288 | SetEntityInvincible(nveh,false)
289 | SetPedIntoVehicle(GetPlayerPed(-1),nveh,-1) -- put player inside
290 | SetVehicleNumberPlateText(nveh, "P " .. vRP.getRegistrationNumber({}))
291 | Citizen.InvokeNative(0xAD738C3085FE7E11, nveh, true, true) -- set as mission entity
292 | SetVehicleHasBeenOwnedByPlayer(nveh,true)
293 | vehicle_migration = false
294 | if not vehicle_migration then
295 | local nid = NetworkGetNetworkIdFromEntity(nveh)
296 | SetNetworkIdCanMigrate(nid,false)
297 | end
298 |
299 | TriggerEvent("vrp_garages:setVehicle", vtype, {vtype,name,nveh})
300 |
301 | SetModelAsNoLongerNeeded(mhash)
302 | end
303 | else
304 | vRP.notify({"You can only have one "..vtype.." vehicule out."})
305 | end
306 | end
307 |
308 | function vRPgt.despawnGarageVehicle(vtype,max_range)
309 | local vehicle = vehicles[vtype]
310 | if vehicle then
311 | local x,y,z = table.unpack(GetEntityCoords(vehicle[3],true))
312 | local px,py,pz = vRP.getPosition()
313 |
314 | if GetDistanceBetweenCoords(x,y,z,px,py,pz,true) < max_range then -- check distance with the vehicule
315 | -- remove vehicle
316 | SetVehicleHasBeenOwnedByPlayer(vehicle[3],false)
317 | Citizen.InvokeNative(0xAD738C3085FE7E11, vehicle[3], false, true) -- set not as mission entity
318 | SetVehicleAsNoLongerNeeded(Citizen.PointerValueIntInitialized(vehicle[3]))
319 | Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(vehicle[3]))
320 | TriggerEvent("vrp_garages:setVehicle", vtype, nil)
321 | vRP.notify({"~g~Vehicle stored."})
322 | else
323 | vRP.notify({"~r~Too far away from the vehicle."})
324 | end
325 | else
326 | vRP.notify({"~r~You don't have a personal vehicle out."})
327 | end
328 | end
329 |
330 | function MenuGarage()
331 | ped = GetPlayerPed(-1)
332 | selectedPage = 0
333 | MenuTitle = "Garage"
334 | ClearMenu()
335 | Menu.addButton(lang_string.menu1,"StoreVehicle",nil)
336 | Menu.addButton(lang_string.menu2,"ListVehicle",selectedPage)
337 | Menu.addButton(lang_string.menu3,"CloseMenu",nil)
338 | end
339 |
340 | function StoreVehicle()
341 | Citizen.CreateThread(function()
342 | local caissei = GetClosestVehicle(garageSelected.x, garageSelected.y, garageSelected.z, 3.000, 0, 70)
343 | SetEntityAsMissionEntity(caissei, true, true)
344 | local plate = GetVehicleNumberPlateText(caissei)
345 | local vtype = "car"
346 | if IsThisModelABike(GetEntityModel(caissei)) then
347 | vtype = "bike"
348 | end
349 | if DoesEntityExist(caissei) then
350 | TriggerServerEvent('ply_garages:CheckForVeh', plate, vehicles[vtype][2], vtype)
351 | else
352 | drawNotification(lang_string.text6)
353 | end
354 | end)
355 | CloseMenu()
356 | end
357 |
358 | function ListVehicle(page)
359 | ped = GetPlayerPed(-1)
360 | selectedPage = page
361 | MenuTitle = lang_string.menu4
362 | ClearMenu()
363 | local count = 0
364 | for ind, value in pairs(GVEHICLES) do
365 | if ((count >= (page*10)) and (count < ((page*10)+10))) then
366 | Menu.addButton(tostring(value.vehicle_name), "OptionVehicle", value.vehicle_name)
367 | end
368 | count = count + 1
369 | end
370 | Menu.addButton(lang_string.menu12,"ListVehicle",page+1)
371 | if page == 0 then
372 | Menu.addButton(lang_string.menu7,"MenuGarage",nil)
373 | else
374 | Menu.addButton(lang_string.menu7,"ListVehicle",page-1)
375 | end
376 | end
377 |
378 | function OptionVehicle(vehID)
379 | local vehID = vehID
380 | MenuTitle = "Options"
381 | ClearMenu()
382 | Menu.addButton(lang_string.menu6, "SpawnVehicle", vehID)
383 | Menu.addButton(lang_string.menu7, "ListVehicle", selectedPage)
384 | end
385 |
386 | function SpawnVehicle(vehID)
387 | local vehID = vehID
388 | TriggerServerEvent('ply_garages:CheckForSpawnVeh', vehID)
389 | CloseMenu()
390 | end
391 |
392 |
393 | function drawNotification(text)
394 | SetNotificationTextEntry("STRING")
395 | AddTextComponentString(text)
396 | DrawNotification(false, false)
397 | end
398 |
399 | function CloseMenu()
400 | Menu.hidden = true
401 | TriggerServerEvent("ply_garages:CheckGarageForVeh")
402 | end
403 |
404 | function LocalPed()
405 | return GetPlayerPed(-1)
406 | end
407 |
408 | function IsPlayerInRangeOfGarage()
409 | return inrangeofgarage
410 | end
411 |
412 | function Chat(debugg)
413 | TriggerEvent("chatMessage", '', { 0, 0x99, 255 }, tostring(debugg))
414 | end
415 |
416 | function ply_drawTxt(text,font,centre,x,y,scale,r,g,b,a)
417 | SetTextFont(font)
418 | SetTextProportional(0)
419 | SetTextScale(scale, scale)
420 | SetTextColour(r, g, b, a)
421 | SetTextDropShadow(0, 0, 0, 0,255)
422 | SetTextEdge(1, 0, 0, 0, 255)
423 | SetTextDropShadow()
424 | SetTextOutline()
425 | SetTextCentre(centre)
426 | SetTextEntry("STRING")
427 | AddTextComponentString(text)
428 | DrawText(x , y)
429 | end
430 |
431 | --[[Citizen]]--
432 |
433 | Citizen.CreateThread(function()
434 | while true do
435 | Citizen.Wait(0)
436 | for _, garage in pairs(garages) do
437 | DrawMarker(1, garage.x, garage.y, garage.z, 0, 0, 0, 0, 0, 0, 3.001, 3.0001, 0.5001, 0, 155, 255, 200, 0, 0, 0, 0)
438 | if GetDistanceBetweenCoords(garage.x, garage.y, garage.z, GetEntityCoords(LocalPed())) < 3 and IsPedInAnyVehicle(LocalPed(), true) == false then
439 | ply_drawTxt(lang_string.menu8,0,1,0.5,0.8,0.6,255,255,255,255)
440 | if IsControlJustPressed(1, 86) then
441 | garageSelected.x = garage.x
442 | garageSelected.y = garage.y
443 | garageSelected.z = garage.z
444 | MenuGarage()
445 | Menu.hidden = not Menu.hidden
446 | end
447 | Menu.renderGUI()
448 | end
449 | end
450 | end
451 | end)
452 |
453 | Citizen.CreateThread(function()
454 | while true do
455 | local near = false
456 | Citizen.Wait(0)
457 | for _, garage in pairs(garages) do
458 | if (GetDistanceBetweenCoords(garage.x, garage.y, garage.z, GetEntityCoords(LocalPed())) < 3 and near ~= true) then
459 | near = true
460 | end
461 | end
462 | if near == false then
463 | Menu.hidden = true
464 | end
465 | end
466 | end)
467 |
468 | Citizen.CreateThread(function()
469 | for _, item in pairs(garages) do
470 | item.blip = AddBlipForCoord(item.x, item.y, item.z)
471 | SetBlipSprite(item.blip, item.id)
472 | SetBlipAsShortRange(item.blip, true)
473 | SetBlipColour(item.blip, item.colour)
474 | BeginTextCommandSetBlipName("STRING")
475 | AddTextComponentString(item.name)
476 | EndTextCommandSetBlipName(item.blip)
477 | end
478 | end)
479 |
480 | --[[Events]]--
481 |
482 | RegisterNetEvent('vrp_garages:setVehicle')
483 | AddEventHandler('vrp_garages:setVehicle', function(vtype, vehicle)
484 | vehicles[vtype] = vehicle
485 | end)
486 |
487 | RegisterNetEvent('ply_garages:addAptGarage')
488 | AddEventHandler('ply_garages:addAptGarage', function(gx,gy,gz,gh)
489 | local alreadyExists = false
490 | for _, garage in pairs(garages) do
491 | if garage.x == gx and garage.y == gy then
492 | alreadyExists = true
493 | end
494 | end
495 | if not alreadyExists then
496 | table.insert(garages, #garages + 1, {name="Apartment Garage", colour=3, id=357, x=gx, y=gy, z=gz, h=gh})
497 | end
498 | end)
499 |
500 | RegisterNetEvent('ply_garages:getVehicles')
501 | AddEventHandler("ply_garages:getVehicles", function(THEVEHICLES)
502 | GVEHICLES = {}
503 | GVEHICLES = THEVEHICLES
504 | end)
505 |
506 | AddEventHandler("playerSpawned", function()
507 | TriggerServerEvent("ply_garages:CheckGarageForVeh")
508 | TriggerServerEvent("ply_garages:CheckForAptGarages")
509 | end)
510 |
--------------------------------------------------------------------------------
/vRP/vRP_garages/LICENSE:
--------------------------------------------------------------------------------
1 | GNU AFFERO GENERAL PUBLIC LICENSE
2 | Version 3, 19 November 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU Affero General Public License is a free, copyleft license for
11 | software and other kinds of works, specifically designed to ensure
12 | cooperation with the community in the case of network server software.
13 |
14 | The licenses for most software and other practical works are designed
15 | to take away your freedom to share and change the works. By contrast,
16 | our General Public Licenses are intended to guarantee your freedom to
17 | share and change all versions of a program--to make sure it remains free
18 | software for all its users.
19 |
20 | When we speak of free software, we are referring to freedom, not
21 | price. Our General Public Licenses are designed to make sure that you
22 | have the freedom to distribute copies of free software (and charge for
23 | them if you wish), that you receive source code or can get it if you
24 | want it, that you can change the software or use pieces of it in new
25 | free programs, and that you know you can do these things.
26 |
27 | Developers that use our General Public Licenses protect your rights
28 | with two steps: (1) assert copyright on the software, and (2) offer
29 | you this License which gives you legal permission to copy, distribute
30 | and/or modify the software.
31 |
32 | A secondary benefit of defending all users' freedom is that
33 | improvements made in alternate versions of the program, if they
34 | receive widespread use, become available for other developers to
35 | incorporate. Many developers of free software are heartened and
36 | encouraged by the resulting cooperation. However, in the case of
37 | software used on network servers, this result may fail to come about.
38 | The GNU General Public License permits making a modified version and
39 | letting the public access it on a server without ever releasing its
40 | source code to the public.
41 |
42 | The GNU Affero General Public License is designed specifically to
43 | ensure that, in such cases, the modified source code becomes available
44 | to the community. It requires the operator of a network server to
45 | provide the source code of the modified version running there to the
46 | users of that server. Therefore, public use of a modified version, on
47 | a publicly accessible server, gives the public access to the source
48 | code of the modified version.
49 |
50 | An older license, called the Affero General Public License and
51 | published by Affero, was designed to accomplish similar goals. This is
52 | a different license, not a version of the Affero GPL, but Affero has
53 | released a new version of the Affero GPL which permits relicensing under
54 | this license.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | TERMS AND CONDITIONS
60 |
61 | 0. Definitions.
62 |
63 | "This License" refers to version 3 of the GNU Affero General Public License.
64 |
65 | "Copyright" also means copyright-like laws that apply to other kinds of
66 | works, such as semiconductor masks.
67 |
68 | "The Program" refers to any copyrightable work licensed under this
69 | License. Each licensee is addressed as "you". "Licensees" and
70 | "recipients" may be individuals or organizations.
71 |
72 | To "modify" a work means to copy from or adapt all or part of the work
73 | in a fashion requiring copyright permission, other than the making of an
74 | exact copy. The resulting work is called a "modified version" of the
75 | earlier work or a work "based on" the earlier work.
76 |
77 | A "covered work" means either the unmodified Program or a work based
78 | on the Program.
79 |
80 | To "propagate" a work means to do anything with it that, without
81 | permission, would make you directly or secondarily liable for
82 | infringement under applicable copyright law, except executing it on a
83 | computer or modifying a private copy. Propagation includes copying,
84 | distribution (with or without modification), making available to the
85 | public, and in some countries other activities as well.
86 |
87 | To "convey" a work means any kind of propagation that enables other
88 | parties to make or receive copies. Mere interaction with a user through
89 | a computer network, with no transfer of a copy, is not conveying.
90 |
91 | An interactive user interface displays "Appropriate Legal Notices"
92 | to the extent that it includes a convenient and prominently visible
93 | feature that (1) displays an appropriate copyright notice, and (2)
94 | tells the user that there is no warranty for the work (except to the
95 | extent that warranties are provided), that licensees may convey the
96 | work under this License, and how to view a copy of this License. If
97 | the interface presents a list of user commands or options, such as a
98 | menu, a prominent item in the list meets this criterion.
99 |
100 | 1. Source Code.
101 |
102 | The "source code" for a work means the preferred form of the work
103 | for making modifications to it. "Object code" means any non-source
104 | form of a work.
105 |
106 | A "Standard Interface" means an interface that either is an official
107 | standard defined by a recognized standards body, or, in the case of
108 | interfaces specified for a particular programming language, one that
109 | is widely used among developers working in that language.
110 |
111 | The "System Libraries" of an executable work include anything, other
112 | than the work as a whole, that (a) is included in the normal form of
113 | packaging a Major Component, but which is not part of that Major
114 | Component, and (b) serves only to enable use of the work with that
115 | Major Component, or to implement a Standard Interface for which an
116 | implementation is available to the public in source code form. A
117 | "Major Component", in this context, means a major essential component
118 | (kernel, window system, and so on) of the specific operating system
119 | (if any) on which the executable work runs, or a compiler used to
120 | produce the work, or an object code interpreter used to run it.
121 |
122 | The "Corresponding Source" for a work in object code form means all
123 | the source code needed to generate, install, and (for an executable
124 | work) run the object code and to modify the work, including scripts to
125 | control those activities. However, it does not include the work's
126 | System Libraries, or general-purpose tools or generally available free
127 | programs which are used unmodified in performing those activities but
128 | which are not part of the work. For example, Corresponding Source
129 | includes interface definition files associated with source files for
130 | the work, and the source code for shared libraries and dynamically
131 | linked subprograms that the work is specifically designed to require,
132 | such as by intimate data communication or control flow between those
133 | subprograms and other parts of the work.
134 |
135 | The Corresponding Source need not include anything that users
136 | can regenerate automatically from other parts of the Corresponding
137 | Source.
138 |
139 | The Corresponding Source for a work in source code form is that
140 | same work.
141 |
142 | 2. Basic Permissions.
143 |
144 | All rights granted under this License are granted for the term of
145 | copyright on the Program, and are irrevocable provided the stated
146 | conditions are met. This License explicitly affirms your unlimited
147 | permission to run the unmodified Program. The output from running a
148 | covered work is covered by this License only if the output, given its
149 | content, constitutes a covered work. This License acknowledges your
150 | rights of fair use or other equivalent, as provided by copyright law.
151 |
152 | You may make, run and propagate covered works that you do not
153 | convey, without conditions so long as your license otherwise remains
154 | in force. You may convey covered works to others for the sole purpose
155 | of having them make modifications exclusively for you, or provide you
156 | with facilities for running those works, provided that you comply with
157 | the terms of this License in conveying all material for which you do
158 | not control copyright. Those thus making or running the covered works
159 | for you must do so exclusively on your behalf, under your direction
160 | and control, on terms that prohibit them from making any copies of
161 | your copyrighted material outside their relationship with you.
162 |
163 | Conveying under any other circumstances is permitted solely under
164 | the conditions stated below. Sublicensing is not allowed; section 10
165 | makes it unnecessary.
166 |
167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168 |
169 | No covered work shall be deemed part of an effective technological
170 | measure under any applicable law fulfilling obligations under article
171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172 | similar laws prohibiting or restricting circumvention of such
173 | measures.
174 |
175 | When you convey a covered work, you waive any legal power to forbid
176 | circumvention of technological measures to the extent such circumvention
177 | is effected by exercising rights under this License with respect to
178 | the covered work, and you disclaim any intention to limit operation or
179 | modification of the work as a means of enforcing, against the work's
180 | users, your or third parties' legal rights to forbid circumvention of
181 | technological measures.
182 |
183 | 4. Conveying Verbatim Copies.
184 |
185 | You may convey verbatim copies of the Program's source code as you
186 | receive it, in any medium, provided that you conspicuously and
187 | appropriately publish on each copy an appropriate copyright notice;
188 | keep intact all notices stating that this License and any
189 | non-permissive terms added in accord with section 7 apply to the code;
190 | keep intact all notices of the absence of any warranty; and give all
191 | recipients a copy of this License along with the Program.
192 |
193 | You may charge any price or no price for each copy that you convey,
194 | and you may offer support or warranty protection for a fee.
195 |
196 | 5. Conveying Modified Source Versions.
197 |
198 | You may convey a work based on the Program, or the modifications to
199 | produce it from the Program, in the form of source code under the
200 | terms of section 4, provided that you also meet all of these conditions:
201 |
202 | a) The work must carry prominent notices stating that you modified
203 | it, and giving a relevant date.
204 |
205 | b) The work must carry prominent notices stating that it is
206 | released under this License and any conditions added under section
207 | 7. This requirement modifies the requirement in section 4 to
208 | "keep intact all notices".
209 |
210 | c) You must license the entire work, as a whole, under this
211 | License to anyone who comes into possession of a copy. This
212 | License will therefore apply, along with any applicable section 7
213 | additional terms, to the whole of the work, and all its parts,
214 | regardless of how they are packaged. This License gives no
215 | permission to license the work in any other way, but it does not
216 | invalidate such permission if you have separately received it.
217 |
218 | d) If the work has interactive user interfaces, each must display
219 | Appropriate Legal Notices; however, if the Program has interactive
220 | interfaces that do not display Appropriate Legal Notices, your
221 | work need not make them do so.
222 |
223 | A compilation of a covered work with other separate and independent
224 | works, which are not by their nature extensions of the covered work,
225 | and which are not combined with it such as to form a larger program,
226 | in or on a volume of a storage or distribution medium, is called an
227 | "aggregate" if the compilation and its resulting copyright are not
228 | used to limit the access or legal rights of the compilation's users
229 | beyond what the individual works permit. Inclusion of a covered work
230 | in an aggregate does not cause this License to apply to the other
231 | parts of the aggregate.
232 |
233 | 6. Conveying Non-Source Forms.
234 |
235 | You may convey a covered work in object code form under the terms
236 | of sections 4 and 5, provided that you also convey the
237 | machine-readable Corresponding Source under the terms of this License,
238 | in one of these ways:
239 |
240 | a) Convey the object code in, or embodied in, a physical product
241 | (including a physical distribution medium), accompanied by the
242 | Corresponding Source fixed on a durable physical medium
243 | customarily used for software interchange.
244 |
245 | b) Convey the object code in, or embodied in, a physical product
246 | (including a physical distribution medium), accompanied by a
247 | written offer, valid for at least three years and valid for as
248 | long as you offer spare parts or customer support for that product
249 | model, to give anyone who possesses the object code either (1) a
250 | copy of the Corresponding Source for all the software in the
251 | product that is covered by this License, on a durable physical
252 | medium customarily used for software interchange, for a price no
253 | more than your reasonable cost of physically performing this
254 | conveying of source, or (2) access to copy the
255 | Corresponding Source from a network server at no charge.
256 |
257 | c) Convey individual copies of the object code with a copy of the
258 | written offer to provide the Corresponding Source. This
259 | alternative is allowed only occasionally and noncommercially, and
260 | only if you received the object code with such an offer, in accord
261 | with subsection 6b.
262 |
263 | d) Convey the object code by offering access from a designated
264 | place (gratis or for a charge), and offer equivalent access to the
265 | Corresponding Source in the same way through the same place at no
266 | further charge. You need not require recipients to copy the
267 | Corresponding Source along with the object code. If the place to
268 | copy the object code is a network server, the Corresponding Source
269 | may be on a different server (operated by you or a third party)
270 | that supports equivalent copying facilities, provided you maintain
271 | clear directions next to the object code saying where to find the
272 | Corresponding Source. Regardless of what server hosts the
273 | Corresponding Source, you remain obligated to ensure that it is
274 | available for as long as needed to satisfy these requirements.
275 |
276 | e) Convey the object code using peer-to-peer transmission, provided
277 | you inform other peers where the object code and Corresponding
278 | Source of the work are being offered to the general public at no
279 | charge under subsection 6d.
280 |
281 | A separable portion of the object code, whose source code is excluded
282 | from the Corresponding Source as a System Library, need not be
283 | included in conveying the object code work.
284 |
285 | A "User Product" is either (1) a "consumer product", which means any
286 | tangible personal property which is normally used for personal, family,
287 | or household purposes, or (2) anything designed or sold for incorporation
288 | into a dwelling. In determining whether a product is a consumer product,
289 | doubtful cases shall be resolved in favor of coverage. For a particular
290 | product received by a particular user, "normally used" refers to a
291 | typical or common use of that class of product, regardless of the status
292 | of the particular user or of the way in which the particular user
293 | actually uses, or expects or is expected to use, the product. A product
294 | is a consumer product regardless of whether the product has substantial
295 | commercial, industrial or non-consumer uses, unless such uses represent
296 | the only significant mode of use of the product.
297 |
298 | "Installation Information" for a User Product means any methods,
299 | procedures, authorization keys, or other information required to install
300 | and execute modified versions of a covered work in that User Product from
301 | a modified version of its Corresponding Source. The information must
302 | suffice to ensure that the continued functioning of the modified object
303 | code is in no case prevented or interfered with solely because
304 | modification has been made.
305 |
306 | If you convey an object code work under this section in, or with, or
307 | specifically for use in, a User Product, and the conveying occurs as
308 | part of a transaction in which the right of possession and use of the
309 | User Product is transferred to the recipient in perpetuity or for a
310 | fixed term (regardless of how the transaction is characterized), the
311 | Corresponding Source conveyed under this section must be accompanied
312 | by the Installation Information. But this requirement does not apply
313 | if neither you nor any third party retains the ability to install
314 | modified object code on the User Product (for example, the work has
315 | been installed in ROM).
316 |
317 | The requirement to provide Installation Information does not include a
318 | requirement to continue to provide support service, warranty, or updates
319 | for a work that has been modified or installed by the recipient, or for
320 | the User Product in which it has been modified or installed. Access to a
321 | network may be denied when the modification itself materially and
322 | adversely affects the operation of the network or violates the rules and
323 | protocols for communication across the network.
324 |
325 | Corresponding Source conveyed, and Installation Information provided,
326 | in accord with this section must be in a format that is publicly
327 | documented (and with an implementation available to the public in
328 | source code form), and must require no special password or key for
329 | unpacking, reading or copying.
330 |
331 | 7. Additional Terms.
332 |
333 | "Additional permissions" are terms that supplement the terms of this
334 | License by making exceptions from one or more of its conditions.
335 | Additional permissions that are applicable to the entire Program shall
336 | be treated as though they were included in this License, to the extent
337 | that they are valid under applicable law. If additional permissions
338 | apply only to part of the Program, that part may be used separately
339 | under those permissions, but the entire Program remains governed by
340 | this License without regard to the additional permissions.
341 |
342 | When you convey a copy of a covered work, you may at your option
343 | remove any additional permissions from that copy, or from any part of
344 | it. (Additional permissions may be written to require their own
345 | removal in certain cases when you modify the work.) You may place
346 | additional permissions on material, added by you to a covered work,
347 | for which you have or can give appropriate copyright permission.
348 |
349 | Notwithstanding any other provision of this License, for material you
350 | add to a covered work, you may (if authorized by the copyright holders of
351 | that material) supplement the terms of this License with terms:
352 |
353 | a) Disclaiming warranty or limiting liability differently from the
354 | terms of sections 15 and 16 of this License; or
355 |
356 | b) Requiring preservation of specified reasonable legal notices or
357 | author attributions in that material or in the Appropriate Legal
358 | Notices displayed by works containing it; or
359 |
360 | c) Prohibiting misrepresentation of the origin of that material, or
361 | requiring that modified versions of such material be marked in
362 | reasonable ways as different from the original version; or
363 |
364 | d) Limiting the use for publicity purposes of names of licensors or
365 | authors of the material; or
366 |
367 | e) Declining to grant rights under trademark law for use of some
368 | trade names, trademarks, or service marks; or
369 |
370 | f) Requiring indemnification of licensors and authors of that
371 | material by anyone who conveys the material (or modified versions of
372 | it) with contractual assumptions of liability to the recipient, for
373 | any liability that these contractual assumptions directly impose on
374 | those licensors and authors.
375 |
376 | All other non-permissive additional terms are considered "further
377 | restrictions" within the meaning of section 10. If the Program as you
378 | received it, or any part of it, contains a notice stating that it is
379 | governed by this License along with a term that is a further
380 | restriction, you may remove that term. If a license document contains
381 | a further restriction but permits relicensing or conveying under this
382 | License, you may add to a covered work material governed by the terms
383 | of that license document, provided that the further restriction does
384 | not survive such relicensing or conveying.
385 |
386 | If you add terms to a covered work in accord with this section, you
387 | must place, in the relevant source files, a statement of the
388 | additional terms that apply to those files, or a notice indicating
389 | where to find the applicable terms.
390 |
391 | Additional terms, permissive or non-permissive, may be stated in the
392 | form of a separately written license, or stated as exceptions;
393 | the above requirements apply either way.
394 |
395 | 8. Termination.
396 |
397 | You may not propagate or modify a covered work except as expressly
398 | provided under this License. Any attempt otherwise to propagate or
399 | modify it is void, and will automatically terminate your rights under
400 | this License (including any patent licenses granted under the third
401 | paragraph of section 11).
402 |
403 | However, if you cease all violation of this License, then your
404 | license from a particular copyright holder is reinstated (a)
405 | provisionally, unless and until the copyright holder explicitly and
406 | finally terminates your license, and (b) permanently, if the copyright
407 | holder fails to notify you of the violation by some reasonable means
408 | prior to 60 days after the cessation.
409 |
410 | Moreover, your license from a particular copyright holder is
411 | reinstated permanently if the copyright holder notifies you of the
412 | violation by some reasonable means, this is the first time you have
413 | received notice of violation of this License (for any work) from that
414 | copyright holder, and you cure the violation prior to 30 days after
415 | your receipt of the notice.
416 |
417 | Termination of your rights under this section does not terminate the
418 | licenses of parties who have received copies or rights from you under
419 | this License. If your rights have been terminated and not permanently
420 | reinstated, you do not qualify to receive new licenses for the same
421 | material under section 10.
422 |
423 | 9. Acceptance Not Required for Having Copies.
424 |
425 | You are not required to accept this License in order to receive or
426 | run a copy of the Program. Ancillary propagation of a covered work
427 | occurring solely as a consequence of using peer-to-peer transmission
428 | to receive a copy likewise does not require acceptance. However,
429 | nothing other than this License grants you permission to propagate or
430 | modify any covered work. These actions infringe copyright if you do
431 | not accept this License. Therefore, by modifying or propagating a
432 | covered work, you indicate your acceptance of this License to do so.
433 |
434 | 10. Automatic Licensing of Downstream Recipients.
435 |
436 | Each time you convey a covered work, the recipient automatically
437 | receives a license from the original licensors, to run, modify and
438 | propagate that work, subject to this License. You are not responsible
439 | for enforcing compliance by third parties with this License.
440 |
441 | An "entity transaction" is a transaction transferring control of an
442 | organization, or substantially all assets of one, or subdividing an
443 | organization, or merging organizations. If propagation of a covered
444 | work results from an entity transaction, each party to that
445 | transaction who receives a copy of the work also receives whatever
446 | licenses to the work the party's predecessor in interest had or could
447 | give under the previous paragraph, plus a right to possession of the
448 | Corresponding Source of the work from the predecessor in interest, if
449 | the predecessor has it or can get it with reasonable efforts.
450 |
451 | You may not impose any further restrictions on the exercise of the
452 | rights granted or affirmed under this License. For example, you may
453 | not impose a license fee, royalty, or other charge for exercise of
454 | rights granted under this License, and you may not initiate litigation
455 | (including a cross-claim or counterclaim in a lawsuit) alleging that
456 | any patent claim is infringed by making, using, selling, offering for
457 | sale, or importing the Program or any portion of it.
458 |
459 | 11. Patents.
460 |
461 | A "contributor" is a copyright holder who authorizes use under this
462 | License of the Program or a work on which the Program is based. The
463 | work thus licensed is called the contributor's "contributor version".
464 |
465 | A contributor's "essential patent claims" are all patent claims
466 | owned or controlled by the contributor, whether already acquired or
467 | hereafter acquired, that would be infringed by some manner, permitted
468 | by this License, of making, using, or selling its contributor version,
469 | but do not include claims that would be infringed only as a
470 | consequence of further modification of the contributor version. For
471 | purposes of this definition, "control" includes the right to grant
472 | patent sublicenses in a manner consistent with the requirements of
473 | this License.
474 |
475 | Each contributor grants you a non-exclusive, worldwide, royalty-free
476 | patent license under the contributor's essential patent claims, to
477 | make, use, sell, offer for sale, import and otherwise run, modify and
478 | propagate the contents of its contributor version.
479 |
480 | In the following three paragraphs, a "patent license" is any express
481 | agreement or commitment, however denominated, not to enforce a patent
482 | (such as an express permission to practice a patent or covenant not to
483 | sue for patent infringement). To "grant" such a patent license to a
484 | party means to make such an agreement or commitment not to enforce a
485 | patent against the party.
486 |
487 | If you convey a covered work, knowingly relying on a patent license,
488 | and the Corresponding Source of the work is not available for anyone
489 | to copy, free of charge and under the terms of this License, through a
490 | publicly available network server or other readily accessible means,
491 | then you must either (1) cause the Corresponding Source to be so
492 | available, or (2) arrange to deprive yourself of the benefit of the
493 | patent license for this particular work, or (3) arrange, in a manner
494 | consistent with the requirements of this License, to extend the patent
495 | license to downstream recipients. "Knowingly relying" means you have
496 | actual knowledge that, but for the patent license, your conveying the
497 | covered work in a country, or your recipient's use of the covered work
498 | in a country, would infringe one or more identifiable patents in that
499 | country that you have reason to believe are valid.
500 |
501 | If, pursuant to or in connection with a single transaction or
502 | arrangement, you convey, or propagate by procuring conveyance of, a
503 | covered work, and grant a patent license to some of the parties
504 | receiving the covered work authorizing them to use, propagate, modify
505 | or convey a specific copy of the covered work, then the patent license
506 | you grant is automatically extended to all recipients of the covered
507 | work and works based on it.
508 |
509 | A patent license is "discriminatory" if it does not include within
510 | the scope of its coverage, prohibits the exercise of, or is
511 | conditioned on the non-exercise of one or more of the rights that are
512 | specifically granted under this License. You may not convey a covered
513 | work if you are a party to an arrangement with a third party that is
514 | in the business of distributing software, under which you make payment
515 | to the third party based on the extent of your activity of conveying
516 | the work, and under which the third party grants, to any of the
517 | parties who would receive the covered work from you, a discriminatory
518 | patent license (a) in connection with copies of the covered work
519 | conveyed by you (or copies made from those copies), or (b) primarily
520 | for and in connection with specific products or compilations that
521 | contain the covered work, unless you entered into that arrangement,
522 | or that patent license was granted, prior to 28 March 2007.
523 |
524 | Nothing in this License shall be construed as excluding or limiting
525 | any implied license or other defenses to infringement that may
526 | otherwise be available to you under applicable patent law.
527 |
528 | 12. No Surrender of Others' Freedom.
529 |
530 | If conditions are imposed on you (whether by court order, agreement or
531 | otherwise) that contradict the conditions of this License, they do not
532 | excuse you from the conditions of this License. If you cannot convey a
533 | covered work so as to satisfy simultaneously your obligations under this
534 | License and any other pertinent obligations, then as a consequence you may
535 | not convey it at all. For example, if you agree to terms that obligate you
536 | to collect a royalty for further conveying from those to whom you convey
537 | the Program, the only way you could satisfy both those terms and this
538 | License would be to refrain entirely from conveying the Program.
539 |
540 | 13. Remote Network Interaction; Use with the GNU General Public License.
541 |
542 | Notwithstanding any other provision of this License, if you modify the
543 | Program, your modified version must prominently offer all users
544 | interacting with it remotely through a computer network (if your version
545 | supports such interaction) an opportunity to receive the Corresponding
546 | Source of your version by providing access to the Corresponding Source
547 | from a network server at no charge, through some standard or customary
548 | means of facilitating copying of software. This Corresponding Source
549 | shall include the Corresponding Source for any work covered by version 3
550 | of the GNU General Public License that is incorporated pursuant to the
551 | following paragraph.
552 |
553 | Notwithstanding any other provision of this License, you have
554 | permission to link or combine any covered work with a work licensed
555 | under version 3 of the GNU General Public License into a single
556 | combined work, and to convey the resulting work. The terms of this
557 | License will continue to apply to the part which is the covered work,
558 | but the work with which it is combined will remain governed by version
559 | 3 of the GNU General Public License.
560 |
561 | 14. Revised Versions of this License.
562 |
563 | The Free Software Foundation may publish revised and/or new versions of
564 | the GNU Affero General Public License from time to time. Such new versions
565 | will be similar in spirit to the present version, but may differ in detail to
566 | address new problems or concerns.
567 |
568 | Each version is given a distinguishing version number. If the
569 | Program specifies that a certain numbered version of the GNU Affero General
570 | Public License "or any later version" applies to it, you have the
571 | option of following the terms and conditions either of that numbered
572 | version or of any later version published by the Free Software
573 | Foundation. If the Program does not specify a version number of the
574 | GNU Affero General Public License, you may choose any version ever published
575 | by the Free Software Foundation.
576 |
577 | If the Program specifies that a proxy can decide which future
578 | versions of the GNU Affero General Public License can be used, that proxy's
579 | public statement of acceptance of a version permanently authorizes you
580 | to choose that version for the Program.
581 |
582 | Later license versions may give you additional or different
583 | permissions. However, no additional obligations are imposed on any
584 | author or copyright holder as a result of your choosing to follow a
585 | later version.
586 |
587 | 15. Disclaimer of Warranty.
588 |
589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597 |
598 | 16. Limitation of Liability.
599 |
600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608 | SUCH DAMAGES.
609 |
610 | 17. Interpretation of Sections 15 and 16.
611 |
612 | If the disclaimer of warranty and limitation of liability provided
613 | above cannot be given local legal effect according to their terms,
614 | reviewing courts shall apply local law that most closely approximates
615 | an absolute waiver of all civil liability in connection with the
616 | Program, unless a warranty or assumption of liability accompanies a
617 | copy of the Program in return for a fee.
618 |
619 | END OF TERMS AND CONDITIONS
620 |
621 | How to Apply These Terms to Your New Programs
622 |
623 | If you develop a new program, and you want it to be of the greatest
624 | possible use to the public, the best way to achieve this is to make it
625 | free software which everyone can redistribute and change under these terms.
626 |
627 | To do so, attach the following notices to the program. It is safest
628 | to attach them to the start of each source file to most effectively
629 | state the exclusion of warranty; and each file should have at least
630 | the "copyright" line and a pointer to where the full notice is found.
631 |
632 |
633 | Copyright (C)
634 |
635 | This program is free software: you can redistribute it and/or modify
636 | it under the terms of the GNU Affero General Public License as published
637 | by the Free Software Foundation, either version 3 of the License, or
638 | (at your option) any later version.
639 |
640 | This program is distributed in the hope that it will be useful,
641 | but WITHOUT ANY WARRANTY; without even the implied warranty of
642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643 | GNU Affero General Public License for more details.
644 |
645 | You should have received a copy of the GNU Affero General Public License
646 | along with this program. If not, see .
647 |
648 | Also add information on how to contact you by electronic and paper mail.
649 |
650 | If your software can interact with users remotely through a computer
651 | network, you should also make sure that it provides a way for users to
652 | get its source. For example, if your program is a web application, its
653 | interface could display a "Source" link that leads users to an archive
654 | of the code. There are many ways you could offer source, and different
655 | solutions will be better for different programs; see section 13 for the
656 | specific requirements.
657 |
658 | You should also get your employer (if you work as a programmer) or school,
659 | if any, to sign a "copyright disclaimer" for the program, if necessary.
660 | For more information on this, and how to apply and follow the GNU AGPL, see
661 | .
--------------------------------------------------------------------------------
/vRP/vRP_garages/vrp_garages/LICENSE:
--------------------------------------------------------------------------------
1 | GNU AFFERO GENERAL PUBLIC LICENSE
2 | Version 3, 19 November 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU Affero General Public License is a free, copyleft license for
11 | software and other kinds of works, specifically designed to ensure
12 | cooperation with the community in the case of network server software.
13 |
14 | The licenses for most software and other practical works are designed
15 | to take away your freedom to share and change the works. By contrast,
16 | our General Public Licenses are intended to guarantee your freedom to
17 | share and change all versions of a program--to make sure it remains free
18 | software for all its users.
19 |
20 | When we speak of free software, we are referring to freedom, not
21 | price. Our General Public Licenses are designed to make sure that you
22 | have the freedom to distribute copies of free software (and charge for
23 | them if you wish), that you receive source code or can get it if you
24 | want it, that you can change the software or use pieces of it in new
25 | free programs, and that you know you can do these things.
26 |
27 | Developers that use our General Public Licenses protect your rights
28 | with two steps: (1) assert copyright on the software, and (2) offer
29 | you this License which gives you legal permission to copy, distribute
30 | and/or modify the software.
31 |
32 | A secondary benefit of defending all users' freedom is that
33 | improvements made in alternate versions of the program, if they
34 | receive widespread use, become available for other developers to
35 | incorporate. Many developers of free software are heartened and
36 | encouraged by the resulting cooperation. However, in the case of
37 | software used on network servers, this result may fail to come about.
38 | The GNU General Public License permits making a modified version and
39 | letting the public access it on a server without ever releasing its
40 | source code to the public.
41 |
42 | The GNU Affero General Public License is designed specifically to
43 | ensure that, in such cases, the modified source code becomes available
44 | to the community. It requires the operator of a network server to
45 | provide the source code of the modified version running there to the
46 | users of that server. Therefore, public use of a modified version, on
47 | a publicly accessible server, gives the public access to the source
48 | code of the modified version.
49 |
50 | An older license, called the Affero General Public License and
51 | published by Affero, was designed to accomplish similar goals. This is
52 | a different license, not a version of the Affero GPL, but Affero has
53 | released a new version of the Affero GPL which permits relicensing under
54 | this license.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | TERMS AND CONDITIONS
60 |
61 | 0. Definitions.
62 |
63 | "This License" refers to version 3 of the GNU Affero General Public License.
64 |
65 | "Copyright" also means copyright-like laws that apply to other kinds of
66 | works, such as semiconductor masks.
67 |
68 | "The Program" refers to any copyrightable work licensed under this
69 | License. Each licensee is addressed as "you". "Licensees" and
70 | "recipients" may be individuals or organizations.
71 |
72 | To "modify" a work means to copy from or adapt all or part of the work
73 | in a fashion requiring copyright permission, other than the making of an
74 | exact copy. The resulting work is called a "modified version" of the
75 | earlier work or a work "based on" the earlier work.
76 |
77 | A "covered work" means either the unmodified Program or a work based
78 | on the Program.
79 |
80 | To "propagate" a work means to do anything with it that, without
81 | permission, would make you directly or secondarily liable for
82 | infringement under applicable copyright law, except executing it on a
83 | computer or modifying a private copy. Propagation includes copying,
84 | distribution (with or without modification), making available to the
85 | public, and in some countries other activities as well.
86 |
87 | To "convey" a work means any kind of propagation that enables other
88 | parties to make or receive copies. Mere interaction with a user through
89 | a computer network, with no transfer of a copy, is not conveying.
90 |
91 | An interactive user interface displays "Appropriate Legal Notices"
92 | to the extent that it includes a convenient and prominently visible
93 | feature that (1) displays an appropriate copyright notice, and (2)
94 | tells the user that there is no warranty for the work (except to the
95 | extent that warranties are provided), that licensees may convey the
96 | work under this License, and how to view a copy of this License. If
97 | the interface presents a list of user commands or options, such as a
98 | menu, a prominent item in the list meets this criterion.
99 |
100 | 1. Source Code.
101 |
102 | The "source code" for a work means the preferred form of the work
103 | for making modifications to it. "Object code" means any non-source
104 | form of a work.
105 |
106 | A "Standard Interface" means an interface that either is an official
107 | standard defined by a recognized standards body, or, in the case of
108 | interfaces specified for a particular programming language, one that
109 | is widely used among developers working in that language.
110 |
111 | The "System Libraries" of an executable work include anything, other
112 | than the work as a whole, that (a) is included in the normal form of
113 | packaging a Major Component, but which is not part of that Major
114 | Component, and (b) serves only to enable use of the work with that
115 | Major Component, or to implement a Standard Interface for which an
116 | implementation is available to the public in source code form. A
117 | "Major Component", in this context, means a major essential component
118 | (kernel, window system, and so on) of the specific operating system
119 | (if any) on which the executable work runs, or a compiler used to
120 | produce the work, or an object code interpreter used to run it.
121 |
122 | The "Corresponding Source" for a work in object code form means all
123 | the source code needed to generate, install, and (for an executable
124 | work) run the object code and to modify the work, including scripts to
125 | control those activities. However, it does not include the work's
126 | System Libraries, or general-purpose tools or generally available free
127 | programs which are used unmodified in performing those activities but
128 | which are not part of the work. For example, Corresponding Source
129 | includes interface definition files associated with source files for
130 | the work, and the source code for shared libraries and dynamically
131 | linked subprograms that the work is specifically designed to require,
132 | such as by intimate data communication or control flow between those
133 | subprograms and other parts of the work.
134 |
135 | The Corresponding Source need not include anything that users
136 | can regenerate automatically from other parts of the Corresponding
137 | Source.
138 |
139 | The Corresponding Source for a work in source code form is that
140 | same work.
141 |
142 | 2. Basic Permissions.
143 |
144 | All rights granted under this License are granted for the term of
145 | copyright on the Program, and are irrevocable provided the stated
146 | conditions are met. This License explicitly affirms your unlimited
147 | permission to run the unmodified Program. The output from running a
148 | covered work is covered by this License only if the output, given its
149 | content, constitutes a covered work. This License acknowledges your
150 | rights of fair use or other equivalent, as provided by copyright law.
151 |
152 | You may make, run and propagate covered works that you do not
153 | convey, without conditions so long as your license otherwise remains
154 | in force. You may convey covered works to others for the sole purpose
155 | of having them make modifications exclusively for you, or provide you
156 | with facilities for running those works, provided that you comply with
157 | the terms of this License in conveying all material for which you do
158 | not control copyright. Those thus making or running the covered works
159 | for you must do so exclusively on your behalf, under your direction
160 | and control, on terms that prohibit them from making any copies of
161 | your copyrighted material outside their relationship with you.
162 |
163 | Conveying under any other circumstances is permitted solely under
164 | the conditions stated below. Sublicensing is not allowed; section 10
165 | makes it unnecessary.
166 |
167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168 |
169 | No covered work shall be deemed part of an effective technological
170 | measure under any applicable law fulfilling obligations under article
171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172 | similar laws prohibiting or restricting circumvention of such
173 | measures.
174 |
175 | When you convey a covered work, you waive any legal power to forbid
176 | circumvention of technological measures to the extent such circumvention
177 | is effected by exercising rights under this License with respect to
178 | the covered work, and you disclaim any intention to limit operation or
179 | modification of the work as a means of enforcing, against the work's
180 | users, your or third parties' legal rights to forbid circumvention of
181 | technological measures.
182 |
183 | 4. Conveying Verbatim Copies.
184 |
185 | You may convey verbatim copies of the Program's source code as you
186 | receive it, in any medium, provided that you conspicuously and
187 | appropriately publish on each copy an appropriate copyright notice;
188 | keep intact all notices stating that this License and any
189 | non-permissive terms added in accord with section 7 apply to the code;
190 | keep intact all notices of the absence of any warranty; and give all
191 | recipients a copy of this License along with the Program.
192 |
193 | You may charge any price or no price for each copy that you convey,
194 | and you may offer support or warranty protection for a fee.
195 |
196 | 5. Conveying Modified Source Versions.
197 |
198 | You may convey a work based on the Program, or the modifications to
199 | produce it from the Program, in the form of source code under the
200 | terms of section 4, provided that you also meet all of these conditions:
201 |
202 | a) The work must carry prominent notices stating that you modified
203 | it, and giving a relevant date.
204 |
205 | b) The work must carry prominent notices stating that it is
206 | released under this License and any conditions added under section
207 | 7. This requirement modifies the requirement in section 4 to
208 | "keep intact all notices".
209 |
210 | c) You must license the entire work, as a whole, under this
211 | License to anyone who comes into possession of a copy. This
212 | License will therefore apply, along with any applicable section 7
213 | additional terms, to the whole of the work, and all its parts,
214 | regardless of how they are packaged. This License gives no
215 | permission to license the work in any other way, but it does not
216 | invalidate such permission if you have separately received it.
217 |
218 | d) If the work has interactive user interfaces, each must display
219 | Appropriate Legal Notices; however, if the Program has interactive
220 | interfaces that do not display Appropriate Legal Notices, your
221 | work need not make them do so.
222 |
223 | A compilation of a covered work with other separate and independent
224 | works, which are not by their nature extensions of the covered work,
225 | and which are not combined with it such as to form a larger program,
226 | in or on a volume of a storage or distribution medium, is called an
227 | "aggregate" if the compilation and its resulting copyright are not
228 | used to limit the access or legal rights of the compilation's users
229 | beyond what the individual works permit. Inclusion of a covered work
230 | in an aggregate does not cause this License to apply to the other
231 | parts of the aggregate.
232 |
233 | 6. Conveying Non-Source Forms.
234 |
235 | You may convey a covered work in object code form under the terms
236 | of sections 4 and 5, provided that you also convey the
237 | machine-readable Corresponding Source under the terms of this License,
238 | in one of these ways:
239 |
240 | a) Convey the object code in, or embodied in, a physical product
241 | (including a physical distribution medium), accompanied by the
242 | Corresponding Source fixed on a durable physical medium
243 | customarily used for software interchange.
244 |
245 | b) Convey the object code in, or embodied in, a physical product
246 | (including a physical distribution medium), accompanied by a
247 | written offer, valid for at least three years and valid for as
248 | long as you offer spare parts or customer support for that product
249 | model, to give anyone who possesses the object code either (1) a
250 | copy of the Corresponding Source for all the software in the
251 | product that is covered by this License, on a durable physical
252 | medium customarily used for software interchange, for a price no
253 | more than your reasonable cost of physically performing this
254 | conveying of source, or (2) access to copy the
255 | Corresponding Source from a network server at no charge.
256 |
257 | c) Convey individual copies of the object code with a copy of the
258 | written offer to provide the Corresponding Source. This
259 | alternative is allowed only occasionally and noncommercially, and
260 | only if you received the object code with such an offer, in accord
261 | with subsection 6b.
262 |
263 | d) Convey the object code by offering access from a designated
264 | place (gratis or for a charge), and offer equivalent access to the
265 | Corresponding Source in the same way through the same place at no
266 | further charge. You need not require recipients to copy the
267 | Corresponding Source along with the object code. If the place to
268 | copy the object code is a network server, the Corresponding Source
269 | may be on a different server (operated by you or a third party)
270 | that supports equivalent copying facilities, provided you maintain
271 | clear directions next to the object code saying where to find the
272 | Corresponding Source. Regardless of what server hosts the
273 | Corresponding Source, you remain obligated to ensure that it is
274 | available for as long as needed to satisfy these requirements.
275 |
276 | e) Convey the object code using peer-to-peer transmission, provided
277 | you inform other peers where the object code and Corresponding
278 | Source of the work are being offered to the general public at no
279 | charge under subsection 6d.
280 |
281 | A separable portion of the object code, whose source code is excluded
282 | from the Corresponding Source as a System Library, need not be
283 | included in conveying the object code work.
284 |
285 | A "User Product" is either (1) a "consumer product", which means any
286 | tangible personal property which is normally used for personal, family,
287 | or household purposes, or (2) anything designed or sold for incorporation
288 | into a dwelling. In determining whether a product is a consumer product,
289 | doubtful cases shall be resolved in favor of coverage. For a particular
290 | product received by a particular user, "normally used" refers to a
291 | typical or common use of that class of product, regardless of the status
292 | of the particular user or of the way in which the particular user
293 | actually uses, or expects or is expected to use, the product. A product
294 | is a consumer product regardless of whether the product has substantial
295 | commercial, industrial or non-consumer uses, unless such uses represent
296 | the only significant mode of use of the product.
297 |
298 | "Installation Information" for a User Product means any methods,
299 | procedures, authorization keys, or other information required to install
300 | and execute modified versions of a covered work in that User Product from
301 | a modified version of its Corresponding Source. The information must
302 | suffice to ensure that the continued functioning of the modified object
303 | code is in no case prevented or interfered with solely because
304 | modification has been made.
305 |
306 | If you convey an object code work under this section in, or with, or
307 | specifically for use in, a User Product, and the conveying occurs as
308 | part of a transaction in which the right of possession and use of the
309 | User Product is transferred to the recipient in perpetuity or for a
310 | fixed term (regardless of how the transaction is characterized), the
311 | Corresponding Source conveyed under this section must be accompanied
312 | by the Installation Information. But this requirement does not apply
313 | if neither you nor any third party retains the ability to install
314 | modified object code on the User Product (for example, the work has
315 | been installed in ROM).
316 |
317 | The requirement to provide Installation Information does not include a
318 | requirement to continue to provide support service, warranty, or updates
319 | for a work that has been modified or installed by the recipient, or for
320 | the User Product in which it has been modified or installed. Access to a
321 | network may be denied when the modification itself materially and
322 | adversely affects the operation of the network or violates the rules and
323 | protocols for communication across the network.
324 |
325 | Corresponding Source conveyed, and Installation Information provided,
326 | in accord with this section must be in a format that is publicly
327 | documented (and with an implementation available to the public in
328 | source code form), and must require no special password or key for
329 | unpacking, reading or copying.
330 |
331 | 7. Additional Terms.
332 |
333 | "Additional permissions" are terms that supplement the terms of this
334 | License by making exceptions from one or more of its conditions.
335 | Additional permissions that are applicable to the entire Program shall
336 | be treated as though they were included in this License, to the extent
337 | that they are valid under applicable law. If additional permissions
338 | apply only to part of the Program, that part may be used separately
339 | under those permissions, but the entire Program remains governed by
340 | this License without regard to the additional permissions.
341 |
342 | When you convey a copy of a covered work, you may at your option
343 | remove any additional permissions from that copy, or from any part of
344 | it. (Additional permissions may be written to require their own
345 | removal in certain cases when you modify the work.) You may place
346 | additional permissions on material, added by you to a covered work,
347 | for which you have or can give appropriate copyright permission.
348 |
349 | Notwithstanding any other provision of this License, for material you
350 | add to a covered work, you may (if authorized by the copyright holders of
351 | that material) supplement the terms of this License with terms:
352 |
353 | a) Disclaiming warranty or limiting liability differently from the
354 | terms of sections 15 and 16 of this License; or
355 |
356 | b) Requiring preservation of specified reasonable legal notices or
357 | author attributions in that material or in the Appropriate Legal
358 | Notices displayed by works containing it; or
359 |
360 | c) Prohibiting misrepresentation of the origin of that material, or
361 | requiring that modified versions of such material be marked in
362 | reasonable ways as different from the original version; or
363 |
364 | d) Limiting the use for publicity purposes of names of licensors or
365 | authors of the material; or
366 |
367 | e) Declining to grant rights under trademark law for use of some
368 | trade names, trademarks, or service marks; or
369 |
370 | f) Requiring indemnification of licensors and authors of that
371 | material by anyone who conveys the material (or modified versions of
372 | it) with contractual assumptions of liability to the recipient, for
373 | any liability that these contractual assumptions directly impose on
374 | those licensors and authors.
375 |
376 | All other non-permissive additional terms are considered "further
377 | restrictions" within the meaning of section 10. If the Program as you
378 | received it, or any part of it, contains a notice stating that it is
379 | governed by this License along with a term that is a further
380 | restriction, you may remove that term. If a license document contains
381 | a further restriction but permits relicensing or conveying under this
382 | License, you may add to a covered work material governed by the terms
383 | of that license document, provided that the further restriction does
384 | not survive such relicensing or conveying.
385 |
386 | If you add terms to a covered work in accord with this section, you
387 | must place, in the relevant source files, a statement of the
388 | additional terms that apply to those files, or a notice indicating
389 | where to find the applicable terms.
390 |
391 | Additional terms, permissive or non-permissive, may be stated in the
392 | form of a separately written license, or stated as exceptions;
393 | the above requirements apply either way.
394 |
395 | 8. Termination.
396 |
397 | You may not propagate or modify a covered work except as expressly
398 | provided under this License. Any attempt otherwise to propagate or
399 | modify it is void, and will automatically terminate your rights under
400 | this License (including any patent licenses granted under the third
401 | paragraph of section 11).
402 |
403 | However, if you cease all violation of this License, then your
404 | license from a particular copyright holder is reinstated (a)
405 | provisionally, unless and until the copyright holder explicitly and
406 | finally terminates your license, and (b) permanently, if the copyright
407 | holder fails to notify you of the violation by some reasonable means
408 | prior to 60 days after the cessation.
409 |
410 | Moreover, your license from a particular copyright holder is
411 | reinstated permanently if the copyright holder notifies you of the
412 | violation by some reasonable means, this is the first time you have
413 | received notice of violation of this License (for any work) from that
414 | copyright holder, and you cure the violation prior to 30 days after
415 | your receipt of the notice.
416 |
417 | Termination of your rights under this section does not terminate the
418 | licenses of parties who have received copies or rights from you under
419 | this License. If your rights have been terminated and not permanently
420 | reinstated, you do not qualify to receive new licenses for the same
421 | material under section 10.
422 |
423 | 9. Acceptance Not Required for Having Copies.
424 |
425 | You are not required to accept this License in order to receive or
426 | run a copy of the Program. Ancillary propagation of a covered work
427 | occurring solely as a consequence of using peer-to-peer transmission
428 | to receive a copy likewise does not require acceptance. However,
429 | nothing other than this License grants you permission to propagate or
430 | modify any covered work. These actions infringe copyright if you do
431 | not accept this License. Therefore, by modifying or propagating a
432 | covered work, you indicate your acceptance of this License to do so.
433 |
434 | 10. Automatic Licensing of Downstream Recipients.
435 |
436 | Each time you convey a covered work, the recipient automatically
437 | receives a license from the original licensors, to run, modify and
438 | propagate that work, subject to this License. You are not responsible
439 | for enforcing compliance by third parties with this License.
440 |
441 | An "entity transaction" is a transaction transferring control of an
442 | organization, or substantially all assets of one, or subdividing an
443 | organization, or merging organizations. If propagation of a covered
444 | work results from an entity transaction, each party to that
445 | transaction who receives a copy of the work also receives whatever
446 | licenses to the work the party's predecessor in interest had or could
447 | give under the previous paragraph, plus a right to possession of the
448 | Corresponding Source of the work from the predecessor in interest, if
449 | the predecessor has it or can get it with reasonable efforts.
450 |
451 | You may not impose any further restrictions on the exercise of the
452 | rights granted or affirmed under this License. For example, you may
453 | not impose a license fee, royalty, or other charge for exercise of
454 | rights granted under this License, and you may not initiate litigation
455 | (including a cross-claim or counterclaim in a lawsuit) alleging that
456 | any patent claim is infringed by making, using, selling, offering for
457 | sale, or importing the Program or any portion of it.
458 |
459 | 11. Patents.
460 |
461 | A "contributor" is a copyright holder who authorizes use under this
462 | License of the Program or a work on which the Program is based. The
463 | work thus licensed is called the contributor's "contributor version".
464 |
465 | A contributor's "essential patent claims" are all patent claims
466 | owned or controlled by the contributor, whether already acquired or
467 | hereafter acquired, that would be infringed by some manner, permitted
468 | by this License, of making, using, or selling its contributor version,
469 | but do not include claims that would be infringed only as a
470 | consequence of further modification of the contributor version. For
471 | purposes of this definition, "control" includes the right to grant
472 | patent sublicenses in a manner consistent with the requirements of
473 | this License.
474 |
475 | Each contributor grants you a non-exclusive, worldwide, royalty-free
476 | patent license under the contributor's essential patent claims, to
477 | make, use, sell, offer for sale, import and otherwise run, modify and
478 | propagate the contents of its contributor version.
479 |
480 | In the following three paragraphs, a "patent license" is any express
481 | agreement or commitment, however denominated, not to enforce a patent
482 | (such as an express permission to practice a patent or covenant not to
483 | sue for patent infringement). To "grant" such a patent license to a
484 | party means to make such an agreement or commitment not to enforce a
485 | patent against the party.
486 |
487 | If you convey a covered work, knowingly relying on a patent license,
488 | and the Corresponding Source of the work is not available for anyone
489 | to copy, free of charge and under the terms of this License, through a
490 | publicly available network server or other readily accessible means,
491 | then you must either (1) cause the Corresponding Source to be so
492 | available, or (2) arrange to deprive yourself of the benefit of the
493 | patent license for this particular work, or (3) arrange, in a manner
494 | consistent with the requirements of this License, to extend the patent
495 | license to downstream recipients. "Knowingly relying" means you have
496 | actual knowledge that, but for the patent license, your conveying the
497 | covered work in a country, or your recipient's use of the covered work
498 | in a country, would infringe one or more identifiable patents in that
499 | country that you have reason to believe are valid.
500 |
501 | If, pursuant to or in connection with a single transaction or
502 | arrangement, you convey, or propagate by procuring conveyance of, a
503 | covered work, and grant a patent license to some of the parties
504 | receiving the covered work authorizing them to use, propagate, modify
505 | or convey a specific copy of the covered work, then the patent license
506 | you grant is automatically extended to all recipients of the covered
507 | work and works based on it.
508 |
509 | A patent license is "discriminatory" if it does not include within
510 | the scope of its coverage, prohibits the exercise of, or is
511 | conditioned on the non-exercise of one or more of the rights that are
512 | specifically granted under this License. You may not convey a covered
513 | work if you are a party to an arrangement with a third party that is
514 | in the business of distributing software, under which you make payment
515 | to the third party based on the extent of your activity of conveying
516 | the work, and under which the third party grants, to any of the
517 | parties who would receive the covered work from you, a discriminatory
518 | patent license (a) in connection with copies of the covered work
519 | conveyed by you (or copies made from those copies), or (b) primarily
520 | for and in connection with specific products or compilations that
521 | contain the covered work, unless you entered into that arrangement,
522 | or that patent license was granted, prior to 28 March 2007.
523 |
524 | Nothing in this License shall be construed as excluding or limiting
525 | any implied license or other defenses to infringement that may
526 | otherwise be available to you under applicable patent law.
527 |
528 | 12. No Surrender of Others' Freedom.
529 |
530 | If conditions are imposed on you (whether by court order, agreement or
531 | otherwise) that contradict the conditions of this License, they do not
532 | excuse you from the conditions of this License. If you cannot convey a
533 | covered work so as to satisfy simultaneously your obligations under this
534 | License and any other pertinent obligations, then as a consequence you may
535 | not convey it at all. For example, if you agree to terms that obligate you
536 | to collect a royalty for further conveying from those to whom you convey
537 | the Program, the only way you could satisfy both those terms and this
538 | License would be to refrain entirely from conveying the Program.
539 |
540 | 13. Remote Network Interaction; Use with the GNU General Public License.
541 |
542 | Notwithstanding any other provision of this License, if you modify the
543 | Program, your modified version must prominently offer all users
544 | interacting with it remotely through a computer network (if your version
545 | supports such interaction) an opportunity to receive the Corresponding
546 | Source of your version by providing access to the Corresponding Source
547 | from a network server at no charge, through some standard or customary
548 | means of facilitating copying of software. This Corresponding Source
549 | shall include the Corresponding Source for any work covered by version 3
550 | of the GNU General Public License that is incorporated pursuant to the
551 | following paragraph.
552 |
553 | Notwithstanding any other provision of this License, you have
554 | permission to link or combine any covered work with a work licensed
555 | under version 3 of the GNU General Public License into a single
556 | combined work, and to convey the resulting work. The terms of this
557 | License will continue to apply to the part which is the covered work,
558 | but the work with which it is combined will remain governed by version
559 | 3 of the GNU General Public License.
560 |
561 | 14. Revised Versions of this License.
562 |
563 | The Free Software Foundation may publish revised and/or new versions of
564 | the GNU Affero General Public License from time to time. Such new versions
565 | will be similar in spirit to the present version, but may differ in detail to
566 | address new problems or concerns.
567 |
568 | Each version is given a distinguishing version number. If the
569 | Program specifies that a certain numbered version of the GNU Affero General
570 | Public License "or any later version" applies to it, you have the
571 | option of following the terms and conditions either of that numbered
572 | version or of any later version published by the Free Software
573 | Foundation. If the Program does not specify a version number of the
574 | GNU Affero General Public License, you may choose any version ever published
575 | by the Free Software Foundation.
576 |
577 | If the Program specifies that a proxy can decide which future
578 | versions of the GNU Affero General Public License can be used, that proxy's
579 | public statement of acceptance of a version permanently authorizes you
580 | to choose that version for the Program.
581 |
582 | Later license versions may give you additional or different
583 | permissions. However, no additional obligations are imposed on any
584 | author or copyright holder as a result of your choosing to follow a
585 | later version.
586 |
587 | 15. Disclaimer of Warranty.
588 |
589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597 |
598 | 16. Limitation of Liability.
599 |
600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608 | SUCH DAMAGES.
609 |
610 | 17. Interpretation of Sections 15 and 16.
611 |
612 | If the disclaimer of warranty and limitation of liability provided
613 | above cannot be given local legal effect according to their terms,
614 | reviewing courts shall apply local law that most closely approximates
615 | an absolute waiver of all civil liability in connection with the
616 | Program, unless a warranty or assumption of liability accompanies a
617 | copy of the Program in return for a fee.
618 |
619 | END OF TERMS AND CONDITIONS
620 |
621 | How to Apply These Terms to Your New Programs
622 |
623 | If you develop a new program, and you want it to be of the greatest
624 | possible use to the public, the best way to achieve this is to make it
625 | free software which everyone can redistribute and change under these terms.
626 |
627 | To do so, attach the following notices to the program. It is safest
628 | to attach them to the start of each source file to most effectively
629 | state the exclusion of warranty; and each file should have at least
630 | the "copyright" line and a pointer to where the full notice is found.
631 |
632 |
633 | Copyright (C)
634 |
635 | This program is free software: you can redistribute it and/or modify
636 | it under the terms of the GNU Affero General Public License as published
637 | by the Free Software Foundation, either version 3 of the License, or
638 | (at your option) any later version.
639 |
640 | This program is distributed in the hope that it will be useful,
641 | but WITHOUT ANY WARRANTY; without even the implied warranty of
642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643 | GNU Affero General Public License for more details.
644 |
645 | You should have received a copy of the GNU Affero General Public License
646 | along with this program. If not, see .
647 |
648 | Also add information on how to contact you by electronic and paper mail.
649 |
650 | If your software can interact with users remotely through a computer
651 | network, you should also make sure that it provides a way for users to
652 | get its source. For example, if your program is a web application, its
653 | interface could display a "Source" link that leads users to an archive
654 | of the code. There are many ways you could offer source, and different
655 | solutions will be better for different programs; see section 13 for the
656 | specific requirements.
657 |
658 | You should also get your employer (if you work as a programmer) or school,
659 | if any, to sign a "copyright disclaimer" for the program, if necessary.
660 | For more information on this, and how to apply and follow the GNU AGPL, see
661 | .
--------------------------------------------------------------------------------