Skip to content

Major vehicle overhaul #640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
afe905f
Initial vehicle work
DomT602 Mar 26, 2020
4e27721
Vehicle format
DomT602 Mar 26, 2020
a89c50b
More changes
DomT602 Mar 26, 2020
8c5b027
Further work
DomT602 Mar 26, 2020
97143e7
Adding prefix
DomT602 Mar 26, 2020
4e6f1ed
Further fixes, sideToString, BE Filter update, default plate prefix
DomT602 Mar 27, 2020
41c57b9
Illegal use of tabs
DomT602 Mar 27, 2020
88436d3
Missing query and loop change
DomT602 Mar 27, 2020
b24e4bf
Config option for unique plates
DomT602 Mar 27, 2020
81b672a
Tab and cleanup
DomT602 Mar 27, 2020
11b6870
Different method of returning vehicle ID
DomT602 Mar 27, 2020
a15a7e0
Copy'n'Pasta
DomT602 Mar 27, 2020
09318f0
Local var
DomT602 Mar 27, 2020
c92ac4c
Colours to strings and cleanup
DomT602 Mar 31, 2020
cfe5a4e
Optimisation of other vehicle files
DomT602 Mar 31, 2020
ff3665f
Remove tab
DomT602 Mar 31, 2020
cecf7f2
Cleanup
DomT602 Mar 31, 2020
5187ba5
Default colour, few optimisations
DomT602 Mar 31, 2020
4e0f8a4
Remove life_fnc_requestClientID and associated TON function
DomT602 Apr 2, 2020
2f9fff3
Remove life_impound_inUse
DomT602 Apr 2, 2020
56d3328
Couple of fixes
DomT602 Apr 2, 2020
4e8c637
Small changes
DomT602 Apr 3, 2020
de47bbf
Resolve conflicts
DomT602 Apr 14, 2020
9af0a8c
Merge branch 'master' into vehicleOverhaul
DomT602 Apr 14, 2020
7a3b13e
Move to utils folder
DomT602 Apr 14, 2020
259329d
Missing space
DomT602 Apr 16, 2020
fa9faab
Resolve conflicts
DomT602 Apr 22, 2020
8347060
Further fixes
DomT602 Apr 22, 2020
a1f348f
Remove old file
DomT602 Apr 22, 2020
3d08029
Resolve conflicts
BoGuu Apr 22, 2020
30ec65f
Final fixes
DomT602 Apr 22, 2020
298f8c5
Update life_hc
DomT602 Apr 24, 2020
607ed00
Wrong macro path
DomT602 Apr 24, 2020
e74a11b
use prefix when checking plate
DomT602 Apr 24, 2020
8957a91
SQM edits for garages
DomT602 Dec 27, 2021
547b31c
Fix inserting into DB
DomT602 Dec 27, 2021
77e6b49
Default value and cleanup
DomT602 Dec 28, 2021
98d72be
Merge branch 'master' into vehicleOverhaul
DomT602 Dec 28, 2021
d597dc8
Review and match HC
DomT602 Dec 28, 2021
226d6d6
Oops
DomT602 Dec 28, 2021
9c4ad3e
Final changes
DomT602 Dec 28, 2021
1c5124b
Swap
DomT602 Dec 28, 2021
899d2cc
Var name change
DomT602 Dec 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions AL.ini
Original file line number Diff line number Diff line change
Expand Up @@ -245,17 +245,20 @@ SQL1_1 = UPDATE containers SET owned = '0', pos = '[]' WHERE id = ?
SQL1_INPUTS = 1



[checkPlate]
SQL1_1 = SELECT plate FROM vehicles WHERE plate=?
SQL1_INPUTS = 1
OUTPUT = 1-STRING

[selectVehicles]
SQL1_1 = SELECT id, side, classname, type, pid, alive, active, plate, color FROM vehicles WHERE pid = ? AND alive = '1' AND active = '0' AND side = ? AND type = ?
SQL1_1 = SELECT id, plate, classname, color FROM vehicles WHERE pid = ? AND alive = '1' AND active = '0' AND side = ? AND type = ?
SQL1_INPUTS = 1, 2, 3
OUTPUT = 1, 2-STRING, 3-STRING, 4-STRING, 5-STRING, 6, 7, 8, 9
OUTPUT = 1, 2-STRING, 3-STRING, 4-STRING

[selectVehiclesMore]
SQL1_1 = SELECT id, side, classname, type, pid, alive, active, plate, color, inventory, gear, fuel, damage, blacklist FROM vehicles WHERE id = ? AND pid = ?
SQL1_1 = SELECT classname, plate, color, inventory, gear, fuel, damage, blacklist, active, alive FROM vehicles WHERE id = ? AND pid = ?
SQL1_INPUTS = 1, 2
OUTPUT = 1, 2-STRING, 3-STRING, 4-STRING, 5-STRING, 6, 7, 8, 9, 10, 11, 12, 13, 14
OUTPUT = 1-STRING, 2-STRING, 3-STRING, 4, 5, 6, 7, 8, 9, 10

[updateVehicle]
SQL1_1 = UPDATE vehicles SET active = '1' WHERE pid = ? AND id = ?
Expand All @@ -266,39 +269,36 @@ SQL1_1 = UPDATE vehicles SET blacklist = '0' WHERE id = ? AND pid = ?
SQL1_INPUTS = 1, 2

[updateVehicleBlacklistPlate]
SQL1_1 = UPDATE vehicles SET blacklist = '1' WHERE pid = ? AND plate = ?
SQL1_1 = UPDATE vehicles SET blacklist = '1' WHERE pid = ? AND id = ?
SQL1_INPUTS = 1, 2

[updateVehicleFuel]
SQL1_1 = UPDATE vehicles SET active = '0', fuel = ?, damage = ? WHERE pid = ? AND plate = ?
SQL1_1 = UPDATE vehicles SET active = '0', fuel = ?, damage = ? WHERE pid = ? AND id = ?
SQL1_INPUTS = 1, 2, 3, 4

[updateVehicleAll]
SQL1_1 = UPDATE vehicles SET active = '0', inventory = ?, gear = ?, fuel = ?, damage = ? WHERE pid = ? AND plate = ?
SQL1_1 = UPDATE vehicles SET active = '0', inventory = ?, gear = ?, fuel = ?, damage = ? WHERE pid = ? AND id = ?
SQL1_INPUTS = 1, 2, 3, 4, 5, 6

[updateVehicleGear]
SQL1_1 = UPDATE vehicles SET gear = ? WHERE pid = ? AND plate = ?
SQL1_1 = UPDATE vehicles SET gear = ? WHERE pid = ? AND id = ?
SQL1_INPUTS = 1, 2, 3

[updateVehicleTrunk]
SQL1_1 = UPDATE vehicles SET inventory = ? WHERE pid = ? AND plate = ?
SQL1_1 = UPDATE vehicles SET inventory = ? WHERE pid = ? AND id = ?
SQL1_INPUTS = 1, 2, 3

[insertVehicle]
SQL1_1 = INSERT INTO vehicles (side, classname, type, pid, alive, active, inventory, color, plate, gear, damage) VALUES (?, ?, ?, ?, '1','1','[[],0]', ?, ?,'[]','[]')
SQL1_1 = INSERT INTO vehicles (side, classname, type, pid, alive, active, inventory, color, plate, gear) VALUES (?, ?, ?, ?, '1','1','[[],0]', ?, ?,'[]'); SELECT LAST_INSERT_ID()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a separate statement.

Suggested change
SQL1_1 = INSERT INTO vehicles (side, classname, type, pid, alive, active, inventory, color, plate, gear) VALUES (?, ?, ?, ?, '1','1','[[],0]', ?, ?,'[]'); SELECT LAST_INSERT_ID()
SQL1_1 = INSERT INTO vehicles (side, classname, type, pid, alive, active, inventory, color, plate, gear) VALUES (?, ?, ?, ?, '1','1','[[],0]', ?, ?,'[]')
SQL1_2 = SELECT LAST_INSERT_ID()

SQL1_INPUTS = 1, 2, 3, 4, 5, 6
OUTPUT = 1

[deleteVehicle]
SQL1_1 = UPDATE vehicles SET alive = '0' WHERE pid = ? AND plate = ?
SQL1_INPUTS = 1, 2

[deleteVehicleID]
SQL1_1 = UPDATE vehicles SET alive = '0' WHERE pid = ? AND id = ?
SQL1_INPUTS = 1, 2

[cleanupVehicle]
SQL1_1 = UPDATE vehicles SET active = '0', fuel = ? WHERE pid = ? AND plate = ?
SQL1_1 = UPDATE vehicles SET active = '0', fuel = ? WHERE pid = ? AND id = ?
SQL1_INPUTS = 1, 2, 3


Expand Down
3 changes: 1 addition & 2 deletions Altis_Life.Altis/CfgRemoteExec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class CfgRemoteExec {
JIP(life_fnc_mediclights,CLIENT)
F(life_fnc_medicRequest,CLIENT)
JIP(life_fnc_medicSiren,CLIENT)
F(life_fnc_colorVehicle,CLIENT)
F(life_fnc_moveIn,CLIENT)
F(life_fnc_pickupItem,CLIENT)
F(life_fnc_pickupMoney,CLIENT)
Expand All @@ -59,7 +60,6 @@ class CfgRemoteExec {
F(life_fnc_tazeSound,CLIENT)
F(life_fnc_ticketPaid,CLIENT)
F(life_fnc_ticketPrompt,CLIENT)
F(life_fnc_vehicleAnimate,CLIENT)
F(life_fnc_wantedList,CLIENT)
F(life_fnc_wireTransfer,CLIENT)
F(life_fnc_gangBankResponse,CLIENT)
Expand Down Expand Up @@ -154,7 +154,6 @@ class CfgRemoteExec {
F(BIS_fnc_effectKilledSecondaries,ANYONE)
F(life_fnc_animSync,ANYONE)
F(life_fnc_broadcast,ANYONE)
F(life_fnc_colorVehicle,ANYONE)
F(life_fnc_corpse,ANYONE)
F(life_fnc_demoChargeTimer,ANYONE)
F(life_fnc_flashbang,ANYONE)
Expand Down
Loading