This is one of the most important parts, since without the dependencies, the resource will never work or not start, here we will list the dependencies with their respective links for you to download and add them to your server.
Not required but recommended:
Step 2 โก Resources in server.cfg
if you are using ESX โก NEVER, but NEVER, you must place the resources above es_extended, if you do this they will never work and will throw errors
The correct order of the resources is as follows, always keeping es_extended, sfjob and its cores above, but the other normal resources below
ensure sfpolice
Step 3 โก Database
Run query/SQL query and paste below code
CREATETABLE `jobs_police_cars` (`id`int(11) NOT NULL,`plate`varchar(16) NOT NULL,`status`textNOT NULLDEFAULT ('[]'),`notes`textNOT NULLDEFAULT ('[]'),`towtruck`textNOT NULLDEFAULT ('[]')) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;CREATETABLE `jobs_police_category` (`id`int(11) NOT NULL,`name`varchar(64) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;CREATETABLE `jobs_police_matters` (`id`int(11) NOT NULL,`title`varchar(128) NOT NULL,`date`varchar(32) NOT NULL,`date_create`varchar(32) NOT NULL,`whoAdd`varchar(64) NOT NULL,`status`int(11) NOT NULLDEFAULT0,`citizens`textNOT NULLDEFAULT ('[]'),`officers`textNOT NULLDEFAULT ('[]'),`cars`textNOT NULLDEFAULT ('[]'),`photos`textNOT NULLDEFAULT ('[]'),`message`textDEFAULTNULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;CREATETABLE `jobs_police_otherdata` (`lastWantedPeoples`textNOT NULLDEFAULT ('[]'),`lastWantedCars`textNOT NULLDEFAULT ('[]')) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;INSERT INTO`jobs_police_otherdata` (`lastWantedPeoples`, `lastWantedCars`) VALUES ('[]', '[]');CREATETABLE `jobs_police_players` (`id`int(11) NOT NULL,`cid`varchar(64) NOT NULL,`avatar`varchar(1024) DEFAULTNULL,`status`textNOT NULLDEFAULT ('[]'),`notes`textNOT NULLDEFAULT ('[]'),`historyJudgments`textNOT NULLDEFAULT ('[]')) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;CREATETABLE `jobs_police_regulations` (`id`int(11) NOT NULL,`name`varchar(128) NOT NULL,`category`int(11) NOT NULL,`money`int(11) NOT NULL,`time`int(11) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;CREATETABLE `sf_customstash` (`id`int(11) NOT NULL,`name`varchar(128) NOT NULL,`job`varchar(32) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;CREATETABLE `jobs_police_evidenceItems` (`id`int(11) NOT NULL,`item`varchar(64) NOT NULL,`name`varchar(128) NOT NULL,`serial`varchar(64) NOT NULL,`date`varchar(64) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;ALTERTABLE`jobs_police_cars`ADDPRIMARY KEY (`id`);ALTERTABLE`jobs_police_category`ADDPRIMARY KEY (`id`);ALTERTABLE`jobs_police_matters`ADDPRIMARY KEY (`id`);ALTERTABLE`jobs_police_players`ADDPRIMARY KEY (`id`);ALTERTABLE`jobs_police_regulations`ADDPRIMARY KEY (`id`);ALTERTABLE`sf_customstash`ADDPRIMARY KEY (`id`);ALTERTABLE`jobs_police_evidenceItems`ADDPRIMARY KEY (`id`);ALTERTABLE`jobs_police_cars`MODIFY`id`int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;ALTERTABLE`jobs_police_category`MODIFY`id`int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;ALTERTABLE`jobs_police_matters`MODIFY`id`int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;ALTERTABLE`jobs_police_players`MODIFY`id`int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;ALTERTABLE`jobs_police_regulations`MODIFY`id`int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;ALTERTABLE`sf_customstash`MODIFY`id`int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;ALTERTABLE`jobs_police_evidenceItems`MODIFY`id`int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;;
A vin column should be added to the table with vehicles. For example, in ESX, in the owned_vehicles table, add the vin column varchar(32) not null.
ALTERTABLE`owned_vehicles`ADD`vin`varchar(32) NOT NULLAFTER`plate`;
Step 4 โก folder install-need-data
Copy the data to the appropriate scripts or database, everything is described there.
Step 5 โก folder install-need-data
Add the VIN number generation code to the script where the vehicle can be purchased so that the VIN number is generated (in the script, e.g.: esx_vehicleshop)
functionGenerateVIN()local foundNumber =falselocal vin =nilwhilenot foundNumber do vin =makeid(16)local result = exports.oxmysql:executeSync('SELECT COUNT(*) AS `count` FROM `owned_vehicles` WHERE `vin`=@info',{['@info'] = vin})local count =tonumber(result[1].count)if count ==0then foundNumber =trueendendreturn vinendlocal charset ="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"math.randomseed(os.time())functionmakeid(length)local ret = {}local rfor i =1, length do r =math.random(1, #charset)table.insert(ret, charset:sub(r, r))endreturntable.concat(ret)end