[Release] - ESX_GarbageCrew_v2

[Reason for full release - instead of updating current release is the security issues the other release had. I want any server that might be running GarbageCrew to see there is a better version out.]

This video is from the first GarbageCrew job. Will upload a updated video as soon as i can get one made.


Download
GitHub - GarbageCrew v2


This is a the next step in my GarbageCrew job. Most servers you can rob a bank with 1 - 4 people, rob a store with 1-4 people, but any legal work must be done solo. This shows it can be done - with the pay split between everyone that is doing the job. I have spent a fair bit of time testing the networking on my personal test server, on a live dev server with 2-3 people helping me, and as of the last 12hrs live on 2 seperate servers.

To help with some of the questions:

  • Only the ā€œJobBossā€ needs to pull out vehicle.
  • Each member will receive even split of pay right after the last bag is placed into the truck.

The original creator is listed on the copy that I received are:

ā€“ ORIGINAL SCRIPT BY Marcio FOR CFX-ESX

Changes to my version of script:

  • Security Fix: I have completly rewritten how the script handles pay. No more clientside being able to send request for amount of money. When last bag is done the sever looks
    in the list of jobs for who has put bags in the truck and pays them the correct amount.

  • added: anyone can work the same job.

  • added: Pay is sent after every last bag or jobboss disconnects.

  • added: Changed the draw location of the back of the trunk to use offset. (If you use a replacement truck you might have to change the offset)

  • added: Config.UseWorkClothing - allows servers to decide if they want to make players change into work outfit or not.

  • added: Truck Plate Configuration - Plates will start with GCREW001 at server start and will go up to 999 before restarting at 001.

  • added: Easier to add additional routes for pickups in the Config.Collections (just need to copy the last line increase the number 1 and change the pos for pickup)

Changes to the original script:

  • added: bag collection to each destination. (driver will have to get out to collect bags from trash bin.)
  • added: pay per bag - the more you do the more you earn.
  • added: animations from heist ā€œSeries A Fundingā€ for walking while holding bag, and putting bag in truck.
  • added: check for last job region to keep from getting sent to the same region over and over.

Changes to my version of script:

added: Anyone can help take bags out of a bin and place inside the truck.
added: Pay is sent after every pickup (in case driver disconnects)
added: Pay is split among everyone that puts bags into the truck.
added: Changed the draw location of the back of the trunk to use platelight.(even if vehicle is blown up still finds the platelight)
Changes to the original script:

added: bag collection to each destination. (driver will have to get out to collect bags from trash bin.)
added: pay per bag - the more you do the more you earn.
added: animations from heist ā€œSeries A Fundingā€ for walking while holding bag, and putting bag in truck.
added: check for last job to keep from getting sent to the same job over and over.

ā€“ Requiresā€“

ESX_Jobs

ā€“ Install ā€“

Import garbagejob_v2.sql if you do not already have the garbagejob on your server for work clothes settings.
add esx_garbagecrew to your resource folder.
start esx_garbagecrew in your server.cfg

Any questions about the additions I have made to this ill be more then happy to answerā€¦ If you have questions or issues with the rest of the script I can try to answer but might not be able to help.

SpikE

17 Likes

In this version the bug was fixed where ā€œthe work vehicleā€ disappears and you could not continue working because the vehicle lost it.

I love this job :heart:

1 Like

It sets the work vehicle as a mission entity when pulled out. This should mean it stays in the world until you put it away or disconnect. If it is vanishing othe rthen thatā€¦ that is a different issue and not a issue with this paticular script that i know of.

SpikE

1 Like

Have added a NetworkIsPlayerActive(id) check to make sure when it is time to run the pay the player is still active on the server.

SpikE

Received a report of Server error while using NetworkIsPlayerActive(id) ā€¦ After looking into it, if two people placed a bag in at the same time the 2nd person was being ignored by the server and added in as a nil id. To keep this from happening I have made a small adjust ment to the server file ā€¦ any time the server uses source to figure out who is calling the eventā€¦ i have put it into a list and process the list 1 item at a time so people can not get skipped over. I just did a quick test on a live server and it seems to be working 100% now - pay every time - Even pays out anyone that was working on the crew as soon as the jobboss disconnects (incase the last bag was not put in the bin)

I have updated the github with new versionā€¦ if you have downloaded GarbageCrew v2 before this post I would recommend getting the newest version.

SpikE

hello thanks for your job great!!

i have this probleme whit it some point dont add marker to park the truck and pick-up the trash.
thanks for your responce.

fxmanifest.lua (310 Bytes)

Here is the fxmanifest :smiley:

Okā€¦ are you driving to where the ā€˜white truckā€™ icon is. I think the one you are looking at is in the hotel parking lot across the street from where you are parked.

SpikE

its ok i removed it ā€œthe location pickā€ bicause im not able to go into the parking whit the truck thank you.

Sure thing.

Have a report from a server that they are having issues with the red circle not going away after all the bags are done, is anyone else seeing this as i am waiting for the server owner to get back to meā€¦ and i can not replicate it on my end.

SpikE

Hi. Can u please check my PR?

will check it now rex

Ty for the interest in the script the pull request has been merged into the main.

SpikE

Hello, do I get this error every time I take a bag from a trash can or put it in the truck? Thank you

https://gyazo.com/f80b4e9de65b44332dabf616b3afedd8

From a quick searchā€¦

https://github.com/ESX-Org/es_extended/issues/172

Seems like this error has happened because the script is using vector3 to send the position across to the server. If you have older server files updating seems like it should solve the error or you would need to find the old c# file that is having trouble with a vector3.

You could also change the script to not send vector3 positions across but that would take a bit of editing to the script for you.

SpikE

I found that when 2 trucks are out on the job, it breaks the script and people can no longer collect trash. Could be an issue on a full server.

Can you dm me and explain in detail what happensā€¦ is it just when 2 trucks get pulled outā€¦ or is it when both people start a pick upā€¦ or try to put bags in. I have had this running on a server that had multi people using it at the same time and wasnā€™t reported so might be something in the recent changes that I will need to look into.

As long as when you pull a truck out the plate number increases from GCREW001 - GCREW002 it shouldnā€™t effect any other truck.

SpikE

I have found the issue and i am currently working on a fix for it. Hopefully have it updated in a couple hrs with a fix.