├── .gitignore ├── .travis.yml ├── LICENSE.md ├── MailDelivery.Client ├── MailDelivery.Client.csproj ├── MailDelivery.cs ├── Properties │ └── AssemblyInfo.cs └── packages.config ├── MailDelivery.sln ├── README.md ├── __resource.lua └── azure-pipelines.yml /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | bld/ 24 | [Bb]in/ 25 | [Oo]bj/ 26 | [Ll]og/ 27 | 28 | # Visual Studio 2015/2017 cache/options directory 29 | .vs/ 30 | # Uncomment if you have tasks that create the project's static files in wwwroot 31 | #wwwroot/ 32 | 33 | # Visual Studio 2017 auto generated files 34 | Generated\ Files/ 35 | 36 | # MSTest test Results 37 | [Tt]est[Rr]esult*/ 38 | [Bb]uild[Ll]og.* 39 | 40 | # NUNIT 41 | *.VisualState.xml 42 | TestResult.xml 43 | 44 | # Build Results of an ATL Project 45 | [Dd]ebugPS/ 46 | [Rr]eleasePS/ 47 | dlldata.c 48 | 49 | # Benchmark Results 50 | BenchmarkDotNet.Artifacts/ 51 | 52 | # .NET Core 53 | project.lock.json 54 | project.fragment.lock.json 55 | artifacts/ 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_h.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *_wpftmp.csproj 81 | *.log 82 | *.vspscc 83 | *.vssscc 84 | .builds 85 | *.pidb 86 | *.svclog 87 | *.scc 88 | 89 | # Chutzpah Test files 90 | _Chutzpah* 91 | 92 | # Visual C++ cache files 93 | ipch/ 94 | *.aps 95 | *.ncb 96 | *.opendb 97 | *.opensdf 98 | *.sdf 99 | *.cachefile 100 | *.VC.db 101 | *.VC.VC.opendb 102 | 103 | # Visual Studio profiler 104 | *.psess 105 | *.vsp 106 | *.vspx 107 | *.sap 108 | 109 | # Visual Studio Trace Files 110 | *.e2e 111 | 112 | # TFS 2012 Local Workspace 113 | $tf/ 114 | 115 | # Guidance Automation Toolkit 116 | *.gpState 117 | 118 | # ReSharper is a .NET coding add-in 119 | _ReSharper*/ 120 | *.[Rr]e[Ss]harper 121 | *.DotSettings.user 122 | 123 | # JustCode is a .NET coding add-in 124 | .JustCode 125 | 126 | # TeamCity is a build add-in 127 | _TeamCity* 128 | 129 | # DotCover is a Code Coverage Tool 130 | *.dotCover 131 | 132 | # AxoCover is a Code Coverage Tool 133 | .axoCover/* 134 | !.axoCover/settings.json 135 | 136 | # Visual Studio code coverage results 137 | *.coverage 138 | *.coveragexml 139 | 140 | # NCrunch 141 | _NCrunch_* 142 | .*crunch*.local.xml 143 | nCrunchTemp_* 144 | 145 | # MightyMoose 146 | *.mm.* 147 | AutoTest.Net/ 148 | 149 | # Web workbench (sass) 150 | .sass-cache/ 151 | 152 | # Installshield output folder 153 | [Ee]xpress/ 154 | 155 | # DocProject is a documentation generator add-in 156 | DocProject/buildhelp/ 157 | DocProject/Help/*.HxT 158 | DocProject/Help/*.HxC 159 | DocProject/Help/*.hhc 160 | DocProject/Help/*.hhk 161 | DocProject/Help/*.hhp 162 | DocProject/Help/Html2 163 | DocProject/Help/html 164 | 165 | # Click-Once directory 166 | publish/ 167 | 168 | # Publish Web Output 169 | *.[Pp]ublish.xml 170 | *.azurePubxml 171 | # Note: Comment the next line if you want to checkin your web deploy settings, 172 | # but database connection strings (with potential passwords) will be unencrypted 173 | *.pubxml 174 | *.publishproj 175 | 176 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 177 | # checkin your Azure Web App publish settings, but sensitive information contained 178 | # in these scripts will be unencrypted 179 | PublishScripts/ 180 | 181 | # NuGet Packages 182 | *.nupkg 183 | # The packages folder can be ignored because of Package Restore 184 | **/[Pp]ackages/* 185 | # except build/, which is used as an MSBuild target. 186 | !**/[Pp]ackages/build/ 187 | # Uncomment if necessary however generally it will be regenerated when needed 188 | #!**/[Pp]ackages/repositories.config 189 | # NuGet v3's project.json files produces more ignorable files 190 | *.nuget.props 191 | *.nuget.targets 192 | 193 | # Microsoft Azure Build Output 194 | csx/ 195 | *.build.csdef 196 | 197 | # Microsoft Azure Emulator 198 | ecf/ 199 | rcf/ 200 | 201 | # Windows Store app package directories and files 202 | AppPackages/ 203 | BundleArtifacts/ 204 | Package.StoreAssociation.xml 205 | _pkginfo.txt 206 | *.appx 207 | 208 | # Visual Studio cache files 209 | # files ending in .cache can be ignored 210 | *.[Cc]ache 211 | # but keep track of directories ending in .cache 212 | !*.[Cc]ache/ 213 | 214 | # Others 215 | ClientBin/ 216 | ~$* 217 | *~ 218 | *.dbmdl 219 | *.dbproj.schemaview 220 | *.jfm 221 | *.pfx 222 | *.publishsettings 223 | orleans.codegen.cs 224 | 225 | # Including strong name files can present a security risk 226 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 227 | #*.snk 228 | 229 | # Since there are multiple workflows, uncomment next line to ignore bower_components 230 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 231 | #bower_components/ 232 | 233 | # RIA/Silverlight projects 234 | Generated_Code/ 235 | 236 | # Backup & report files from converting an old project file 237 | # to a newer Visual Studio version. Backup files are not needed, 238 | # because we have git ;-) 239 | _UpgradeReport_Files/ 240 | Backup*/ 241 | UpgradeLog*.XML 242 | UpgradeLog*.htm 243 | ServiceFabricBackup/ 244 | *.rptproj.bak 245 | 246 | # SQL Server files 247 | *.mdf 248 | *.ldf 249 | *.ndf 250 | 251 | # Business Intelligence projects 252 | *.rdl.data 253 | *.bim.layout 254 | *.bim_*.settings 255 | *.rptproj.rsuser 256 | 257 | # Microsoft Fakes 258 | FakesAssemblies/ 259 | 260 | # GhostDoc plugin setting file 261 | *.GhostDoc.xml 262 | 263 | # Node.js Tools for Visual Studio 264 | .ntvs_analysis.dat 265 | node_modules/ 266 | 267 | # Visual Studio 6 build log 268 | *.plg 269 | 270 | # Visual Studio 6 workspace options file 271 | *.opt 272 | 273 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 274 | *.vbw 275 | 276 | # Visual Studio LightSwitch build output 277 | **/*.HTMLClient/GeneratedArtifacts 278 | **/*.DesktopClient/GeneratedArtifacts 279 | **/*.DesktopClient/ModelManifest.xml 280 | **/*.Server/GeneratedArtifacts 281 | **/*.Server/ModelManifest.xml 282 | _Pvt_Extensions 283 | 284 | # Paket dependency manager 285 | .paket/paket.exe 286 | paket-files/ 287 | 288 | # FAKE - F# Make 289 | .fake/ 290 | 291 | # JetBrains Rider 292 | .idea/ 293 | *.sln.iml 294 | 295 | # CodeRush personal settings 296 | .cr/personal 297 | 298 | # Python Tools for Visual Studio (PTVS) 299 | __pycache__/ 300 | *.pyc 301 | 302 | # Cake - Uncomment if you are using it 303 | # tools/** 304 | # !tools/packages.config 305 | 306 | # Tabs Studio 307 | *.tss 308 | 309 | # Telerik's JustMock configuration file 310 | *.jmconfig 311 | 312 | # BizTalk build output 313 | *.btp.cs 314 | *.btm.cs 315 | *.odx.cs 316 | *.xsd.cs 317 | 318 | # OpenCover UI analysis results 319 | OpenCover/ 320 | 321 | # Azure Stream Analytics local run output 322 | ASALocalRun/ 323 | 324 | # MSBuild Binary and Structured Log 325 | *.binlog 326 | 327 | # NVidia Nsight GPU debugger configuration file 328 | *.nvuser 329 | 330 | # MFractors (Xamarin productivity tool) working folder 331 | .mfractor/ 332 | 333 | # Local History for Visual Studio 334 | .localhistory/ -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: csharp 2 | solution: MailDelivery.sln 3 | before_deploy: 4 | - cd /home/travis/build/d0p3t/MailDelivery/MailDelivery.Client/bin/Release/ && rm *.pdb && rm *.xml && rm CitizenFX.Core.Client.dll 5 | - wget https://d0p3t.nl/maildelivery/__resource.lua 6 | - zip -r maildelivery-$TRAVIS_TAG.zip * 7 | deploy: 8 | provider: releases 9 | api_key: $DEPLOY_KEY 10 | file: "/home/travis/build/d0p3t/MailDelivery/MailDelivery.Client/bin/Release/maildelivery-$TRAVIS_TAG.zip" 11 | skip_cleanup: true 12 | prerelease: false 13 | draft: true 14 | tag_name: $TRAVIS_TAG 15 | target_commitish: $TRAVIS_COMMIT 16 | name: "MailDelivery $TRAVIS_TAG" 17 | on: 18 | repo: d0p3t/MailDelivery 19 | branch: master 20 | tags: true 21 | after_deploy: 22 | - wget https://d0p3t.nl/maildelivery/discord.sh 23 | - chmod +x discord.sh 24 | - "./discord.sh deployed $WEBHOOK_URL" 25 | after_failure: 26 | - wget https://d0p3t.nl/maildelivery/discord.sh 27 | - chmod +x discord.sh 28 | - "./discord.sh failure $WEBHOOK_URL" -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Remco Troost - https://www.d0p3t.nu 2 | 3 | Copyright © 2018 4 | 5 | ----- 6 | 7 | THIS PROJECT USES A CUSTOM LICENSE. MAKE SURE TO READ IT BEFORE THINKING ABOUT DOING ANYTHING WITH MAILDELIVERY. 8 | 9 | ----- 10 | 11 | - YOU ARE ALLOWED TO USE MAILDELIVERY ON AS MANY SERVERS AS YOU WANT. 12 | - _YOU ARE ALSO ALLOWED TO EDIT THIS RESOURCE TO ADD/CHANGE/REMOVE WHATEVER YOU WANT._ (see the exception to this rule in the "credits" section below) 13 | - **YOU ARE HOWEVER _NOT_ ALLOWED TO RE-RELEASE (EDITED OR NON-EDITED) VERSIONS OF THIS RESOURCE WITHOUT WRITTEN PERMISSIONS BY MYSELF (REMCO TROOST / D0P3T). FOR ADDED FEATURES/CHANGES, FEEL FREE TO CREATE A FORK & CREATE A PULL REQUEST.** 14 | 15 | ---- 16 | 17 | **Credits** 18 | 19 | Never should you change the credits (for example in the source code comment section) to claim this resource to be your own. 90% of the users will recognize this job as being MailDelivery, so changing the name of it and removing the credits section, is just useless. You're just being extremely rude and nodoby likes you anymore if they find out you're a big fat liar. 20 | 21 | ----- 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /MailDelivery.Client/MailDelivery.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {5277B3D8-FA68-462E-8156-BC17DB7DE42B} 8 | Library 9 | Properties 10 | MailDelivery.Client 11 | MailDelivery.Client.net 12 | v4.5.2 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\packages\CitizenFX.Core.Client.1.0.1149\lib\net45\CitizenFX.Core.Client.dll 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /MailDelivery.Client/MailDelivery.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Drawing; 5 | using System.Threading.Tasks; 6 | using CitizenFX.Core; 7 | using CitizenFX.Core.UI; 8 | using static CitizenFX.Core.Native.API; 9 | 10 | namespace MaillDelivery.Client 11 | { 12 | internal class MailDelivery : BaseScript 13 | { 14 | private static readonly List VehicleSpawnPositions = new List 15 | { 16 | new Vector4(-400.5178f, 6163.97607f, 31.387895f, 354.08728f), 17 | new Vector4(-403.4285f, 6165.96875f, 31.426778f, 352.25277f), 18 | new Vector4(-406.0371f, 6168.61914f, 31.394813f, 353.80203f), 19 | new Vector4(-408.9385f, 6171.53271f, 31.380252f, 353.44647f), 20 | new Vector4(-411.9129f, 6174.58349f, 31.379669f, 353.77667f) 21 | }; 22 | 23 | private static readonly Dictionary> DeliveryAreas = new Dictionary> 24 | { 25 | { "Grapeseed", new List { 26 | new Vector3(2563.99f, 4692.7f, 35.02f), 27 | new Vector3(1967.33f, 4640.92f, 41.88f), 28 | new Vector3(2030.39f, 4980.46f, 42.1f), 29 | new Vector3(1717.86f, 4676.93f, 43.66f), 30 | new Vector3(1689.25f, 4818.3f, 43.06f), 31 | new Vector3(2505.48f, 4095.73f, 39.2f), // 5 32 | new Vector3(2570.87f, 4282.84f, 43.0f), 33 | new Vector3(2721.19f, 4285.98f, 48.6f), 34 | new Vector3(2727.59f, 4145.46f, 45.69f), 35 | new Vector3(3322.6f, 5166.06f, 19.92f), 36 | new Vector3(2216.42f, 5612.49f, 55.69f), // 10 37 | new Vector3(2434.51f, 4976.82f, 47.07f), 38 | new Vector3(2300.36f, 4871.94f, 42.06f), 39 | new Vector3(1962.36f, 5184.98f, 47.98f), 40 | new Vector3(1698.97f, 4921.18f, 42.56f), 41 | new Vector3(1655.87f, 4874.38f, 42.04f), // 15 42 | new Vector3(2159.72f, 4789.8f, 41.67f), 43 | new Vector3(2121.77f, 4784.71f, 41.97f), 44 | new Vector3(2639.04f, 4246.56f, 44.77f), 45 | new Vector3(2455.85f, 4058.3f, 38.06f), 46 | new Vector3(3680.06f, 4497.93f, 25.11f), // 20 47 | new Vector3(3807.8f, 4478.6f, 6.37f) 48 | } 49 | }, 50 | { "Sandy Shores", new List { 51 | new Vector3(1986.69824f, 3815.02490f, 33.32370f), 52 | new Vector3(1446.34997f, 3649.69384f, 35.48260f), 53 | new Vector3(228.27f, 3165.8f, 43.61f), 54 | new Vector3(170.36f, 3113.28f, 43.51f), 55 | new Vector3(179.76f, 3033.1f, 43.98f), 56 | new Vector3(1990.57141f, 3057.46801f, 48.06378f), // 5 57 | new Vector3(2201.01f, 3318.25f, 46.77f), 58 | new Vector3(2368.38f, 3155.96f, 48.61f), 59 | new Vector3(1881.07f,3888.5f,34.25f), 60 | new Vector3(1889.76f,3810.71f,33.75f), 61 | new Vector3(1638.8f,3734.17f,34.41f), // 10 62 | new Vector3(2630.27f,3262.88f,56.25f), 63 | new Vector3(2622.43f,3275.56f,56.3f), 64 | new Vector3(2633.7f,3287.4f,56.45f), 65 | new Vector3(2389.48f, 3341.64f, 47.72f), // 15 66 | new Vector3(2393.01f, 3320.62f, 48.24f), 67 | new Vector3(2163.38f, 3374.63f, 46.07f), 68 | new Vector3(1959.95f, 3741.99f, 33.24f), 69 | new Vector3(1931.55f, 3727.6f, 33.84f), 70 | new Vector3(1850.68f, 3690.03f, 35.5f), // 20 71 | new Vector3(1707.92f, 3585.29f, 36.57f), 72 | new Vector3(1756.33f, 3659.54f, 35.39f), 73 | new Vector3(1825.41f, 3718.35f, 34.42f), 74 | new Vector3(1899.13f, 3764.68f, 33.79f), 75 | new Vector3(1923.37f, 3797.43f, 33.44f), // 25 76 | new Vector3(1914.69f, 3813.37f, 33.44f), 77 | new Vector3(1913.61f, 3868.06f, 33.37f), 78 | new Vector3(1942.34f, 3885.42f, 33.67f), 79 | new Vector3(1728.66f, 3851.46f, 34.78f), 80 | new Vector3(903.67f, 3560.82f, 33.81f), 81 | new Vector3(910.93f, 3644.29f, 32.68f), 82 | new Vector3(1393.15f,3673.4f, 34.79f), 83 | new Vector3(1435.18f, 3682.92f, 34.84f), 84 | } 85 | }, 86 | { "Paleto Bay", new List 87 | { 88 | new Vector3(-291.14f, 6199.27f, 32.49f), // 0 89 | new Vector3(-96.43f, 6324.47f, 32.08f), 90 | new Vector3(-390.28f, 6300.23f, 30.75f), 91 | new Vector3(-360.8f, 6320.98f, 30.76f), 92 | new Vector3(-303.41f, 6329f, 32.99f), 93 | new Vector3(-215.5f, 6431.99f, 32.49f), // 5 94 | new Vector3(-46.21f,6595.62f,31.55f), 95 | new Vector3(0.46f, 6546.92f, 32.37f), 96 | new Vector3(-1.09f, 6512.9f, 33.04f), 97 | new Vector3(99.35f, 6618.56f, 33.47f), 98 | new Vector3(-774.31f, 5597.84f, 34.61f), // 10 99 | new Vector3(-696.1f, 5802.36f, 17.83f), 100 | new Vector3(-448.77f, 6009.95f, 32.22f), 101 | new Vector3(-326.55f,6083.95f,31.96f), 102 | new Vector3(-341.66f, 6212.46f,32.59f), 103 | new Vector3(-247.15f,6331.02f,32.93f), // 15 104 | new Vector3(-394.74f,6272.52f,30.94f), 105 | new Vector3(35.18f,6662.39f,32.19f), 106 | new Vector3(-130.66f,6551.98f,29.87f), 107 | new Vector3(-106.06f,6469.6f,32.63f), 108 | new Vector3(-94.5f, 6408.86f, 32.14f), // 20 109 | new Vector3(-25.2f,6472.25f,31.98f), 110 | new Vector3(-105.28f,6528.96f,30.17f), 111 | new Vector3(150.41f,6647.58f,32.11f), 112 | new Vector3(161.68f,6636.1f,32.17f), 113 | new Vector3(-9.37f,6653.93f,31.98f), //25 114 | new Vector3(-40.15f,6637.23f,31.09f), 115 | new Vector3(-5.97f,6623.07f,32.32f), 116 | new Vector3(-113.22f, 6538.18f, 30.6f), 117 | } 118 | }, 119 | }; 120 | 121 | private static readonly List DeliveryAreaWide = new List 122 | { 123 | new Vector3(2643.8f, 4784.91f, 33.52f), 124 | new Vector3(1540.14f, 3137.63f, 40.43f), 125 | new Vector3(-69.5f, 5955.26f, 128.92f) 126 | }; 127 | 128 | private static readonly Vector3 DutyPosition = new Vector3(-427.28f, 6130.83f, 28.48f); 129 | private static readonly Vector3 RentalPosition = new Vector3(-411.67f, 6181.37f, 28.48f); 130 | 131 | private static readonly Color DutyColor = Color.FromArgb(255, 92, 133, 255); 132 | 133 | private static bool _isFirstTick = true; 134 | private static bool _debug = false; 135 | private static bool _isOnDuty = false; 136 | 137 | private static Random rnd = new Random(); 138 | private Vehicle _jobVehicle; 139 | 140 | private string _currentArea = ""; 141 | private static List _currentAreaDeliveryPositions = new List(); 142 | private static List _currentAreaDeliveryBlips = new List(); 143 | 144 | private static int _minPayment = 0; 145 | private static int _maxPayment = 0; 146 | private static int _rentalAmount = 0; 147 | private static int _rentalBlipSprite = 0; 148 | private static int _rentalBlipColor = 0; 149 | private static int _jobCooldown = 0; 150 | private static int _jobBlipSprite = 0; 151 | private static int _jobBlipColor = 0; 152 | private static int _deliveryBlipSprite = 0; 153 | private static int _deliveryBlipColor = 0; 154 | private static int _areaIndex = 0; 155 | private static int _testTotal = 0; 156 | private static string _vanModel = ""; 157 | 158 | public MailDelivery() 159 | { 160 | Initialize(); 161 | CreateBlip(DutyPosition, (BlipSprite)_jobBlipSprite, (BlipColor)_jobBlipColor, "Mail Delivery"); 162 | CreateBlip(RentalPosition, (BlipSprite)_rentalBlipSprite, (BlipColor)_rentalBlipColor, "Mail Delivery : Rental"); 163 | 164 | if (_debug) 165 | { 166 | foreach (var pos in DeliveryAreaWide) 167 | { 168 | CreateBlip(pos, BlipSprite.Standard, BlipColor.Red, "Delivery Area Center"); 169 | } 170 | 171 | foreach (var pos in DeliveryAreas["Grapeseed"]) 172 | { 173 | CreateBlip(pos, (BlipSprite)_deliveryBlipSprite, BlipColor.Red, "POI GrapeSeed"); 174 | } 175 | 176 | foreach (var pos in DeliveryAreas["Paleto Bay"]) 177 | { 178 | CreateBlip(pos, (BlipSprite)_deliveryBlipSprite, BlipColor.FranklinGreen, "POI Paleto Bay"); 179 | } 180 | 181 | foreach (var pos in DeliveryAreas["Sandy Shores"]) 182 | { 183 | CreateBlip(pos, (BlipSprite)_deliveryBlipSprite, BlipColor.TrevorOrange, "POI Sandy Shores"); 184 | } 185 | 186 | Tick += OnTestTick; 187 | } 188 | 189 | Tick += OnDutyTick; 190 | Tick += OnDeliveryTick; 191 | Tick += OnRentalTick; 192 | Tick += OnMarkerTick; 193 | } 194 | 195 | private async Task OnDutyTick() 196 | { 197 | try 198 | { 199 | if (_isFirstTick) 200 | { 201 | _jobVehicle = new Vehicle(0); 202 | _isFirstTick = false; 203 | return; 204 | } 205 | 206 | var playerPos = Game.PlayerPed.Position; 207 | 208 | if (playerPos.DistanceToSquared2D(DutyPosition) < 16) 209 | { 210 | Screen.DisplayHelpTextThisFrame($"Press ~INPUT_CONTEXT~ to {(_isOnDuty ? "~r~Stop Delivering Mail" : "~g~Deliver Mail")}~s~."); 211 | 212 | if (Game.IsControlJustReleased(0, Control.Context)) 213 | { 214 | var playerPed = Game.PlayerPed; 215 | 216 | if (!playerPed.IsSittingInVehicle() || playerPed.CurrentVehicle.Model.Hash != new Model(_vanModel).Hash) 217 | { 218 | Screen.DisplayHelpTextThisFrame("You are not driving a ~r~PostOP Boxville~s~! You can rent one at the ~g~Mail Delivery: Rental~s~."); 219 | 220 | await Delay(5000); 221 | 222 | return; 223 | } 224 | 225 | ToggleDuty(!_isOnDuty); 226 | 227 | if (!_isOnDuty) 228 | { 229 | World.RemoveWaypoint(); 230 | 231 | foreach (var blip in _currentAreaDeliveryBlips) 232 | { 233 | blip.Delete(); 234 | } 235 | 236 | _currentAreaDeliveryBlips.Clear(); 237 | 238 | return; 239 | } 240 | 241 | var route = DeliveryAreas.ElementAt(rnd.Next(0, DeliveryAreas.Count)); 242 | 243 | _currentArea = route.Key; 244 | _currentAreaDeliveryPositions = route.Value.OrderBy(x => rnd.Next()).Take(rnd.Next(10, 12)).ToList(); 245 | 246 | foreach (var pos in _currentAreaDeliveryPositions) 247 | { 248 | var b = CreateBlip(pos, (BlipSprite)_deliveryBlipSprite, (BlipColor)_deliveryBlipColor, "Delivery Point", false, 1f); 249 | _currentAreaDeliveryBlips.Add(b); 250 | } 251 | 252 | _areaIndex = 0; 253 | 254 | switch (_currentArea) 255 | { 256 | case "Grapeseed": 257 | _areaIndex = 0; 258 | break; 259 | case "Sandy Shores": 260 | _areaIndex = 1; 261 | break; 262 | case "Paleto Bay": 263 | _areaIndex = 2; 264 | break; 265 | } 266 | 267 | Screen.ShowSubtitle($"Deliver ~g~{_currentAreaDeliveryPositions.Count}x~s~ mail and packages in ~y~{_currentArea}", 5000); 268 | 269 | _isOnDuty = true; 270 | 271 | await Delay(_jobCooldown); 272 | } 273 | } 274 | } 275 | catch (Exception e) 276 | { 277 | Debug.WriteLine($"{e.Message} : Exception thrown on MailDelivery:OnDutyTick()"); 278 | } 279 | 280 | await Task.FromResult(0); 281 | } 282 | 283 | private async Task OnDeliveryTick() 284 | { 285 | try 286 | { 287 | if (!_isOnDuty) 288 | { 289 | return; 290 | } 291 | 292 | var playerPed = Game.PlayerPed; 293 | 294 | if (playerPed.IsGettingIntoAVehicle || playerPed.LastVehicle == null) 295 | { 296 | return; 297 | } 298 | 299 | if (playerPed.LastVehicle.Model.Hash != new Model(_vanModel).Hash) 300 | { 301 | return; 302 | } 303 | 304 | 305 | var playerPos = Game.PlayerPed.Position; 306 | 307 | if (playerPos.DistanceToSquared2D(DeliveryAreaWide[_areaIndex]) > 2000000) 308 | { 309 | await Delay(4000); 310 | return; 311 | } 312 | 313 | foreach (var pos in _currentAreaDeliveryPositions) 314 | { 315 | if (playerPos.DistanceToSquared2D(pos) < 100) 316 | { 317 | World.DrawMarker(MarkerType.ChevronUpx1, pos, Vector3.Zero, new Vector3(0, 180f, 0), new Vector3(0.5f), DutyColor, false, true, false); 318 | } 319 | 320 | if (playerPos.DistanceToSquared2D(pos) < 4) 321 | { 322 | if (playerPed.IsSittingInVehicle()) 323 | { 324 | Screen.DisplayHelpTextThisFrame("~r~Exit~s~ your Mail Delivery Van."); 325 | return; 326 | } 327 | 328 | Screen.DisplayHelpTextThisFrame("Press ~INPUT_CONTEXT~ to Deliver Mail."); 329 | 330 | if (Game.IsControlJustReleased(0, Control.Context)) 331 | { 332 | var _payment = rnd.Next(_minPayment, _maxPayment); 333 | 334 | if (_debug) 335 | { 336 | _testTotal += _payment; 337 | } 338 | 339 | playerPed.Task.PlayAnimation("mp_safehouselost@", "package_dropoff"); 340 | await Delay(1000); 341 | 342 | TriggerServerEvent("MailDelivery:DeliveryMade", _payment); 343 | 344 | _currentAreaDeliveryBlips.Single(x => x.Position == pos).Delete(); 345 | _currentAreaDeliveryPositions.Remove(pos); 346 | 347 | if (_currentAreaDeliveryPositions.Count != 0) 348 | { 349 | Screen.ShowNotification($"Delivered Mail for ~g~${_payment}~s~."); 350 | 351 | if (_debug) 352 | { 353 | Screen.ShowSubtitle($"~r~DEBUG~s~ Current Total: ~g~{_testTotal}~s~."); 354 | } 355 | 356 | return; 357 | } 358 | 359 | Screen.ShowNotification($"Delivered last Mail for ~g~${_payment}~s~."); 360 | Screen.ShowNotification("~y~Return to PostOp for another Route~s~."); 361 | 362 | if (_debug) 363 | { 364 | Screen.ShowSubtitle($"~r~DEBUG~s~ End Total Earned: ~g~{_testTotal}~s~."); 365 | } 366 | 367 | ToggleDuty(!_isOnDuty); 368 | } 369 | } 370 | } 371 | } 372 | catch (Exception e) 373 | { 374 | Debug.WriteLine($"{e.Message} : Exception thrown on MailDelivery:OnDeliveryTick()"); 375 | } 376 | 377 | await Task.FromResult(0); 378 | } 379 | 380 | private async Task OnRentalTick() 381 | { 382 | try 383 | { 384 | var playerPos = Game.PlayerPed.Position; 385 | 386 | if (playerPos.DistanceToSquared2D(RentalPosition) < 16) 387 | { 388 | var playerPed = Game.PlayerPed; 389 | if (playerPed.IsSittingInVehicle()) 390 | { 391 | if (!DecorExistOn(playerPed.CurrentVehicle.Handle, "MailDelivery.Rental")) 392 | { 393 | Screen.DisplayHelpTextThisFrame("Exit your vehicle to rent a Mail Delivery Van"); 394 | return; 395 | } 396 | 397 | Screen.DisplayHelpTextThisFrame("Press ~INPUT_CONTEXT~ to return Mail Delivery Van"); 398 | if (Game.IsControlJustReleased(0, Control.Context)) 399 | { 400 | playerPed.CurrentVehicle.Delete(); 401 | Screen.ShowNotification("Mail Delivery Van has been returned."); 402 | } 403 | 404 | return; 405 | } 406 | 407 | Screen.DisplayHelpTextThisFrame($"Press ~INPUT_CONTEXT~ to rent Mail Delivery Van for ${_rentalAmount}"); 408 | 409 | if (Game.IsControlJustReleased(0, Control.Context)) 410 | { 411 | var _parkId = GetParkingPosition(VehicleSpawnPositions); 412 | 413 | if (_parkId < 0 || _parkId >= VehicleSpawnPositions.Count) 414 | { 415 | Screen.ShowNotification("There are no parking spots available."); 416 | return; 417 | } 418 | 419 | var parkPos = VehicleSpawnPositions[_parkId]; 420 | 421 | _jobVehicle = await World.CreateVehicle(new Model(_vanModel), new Vector3(parkPos.X, parkPos.Y, parkPos.Z), parkPos.W); 422 | 423 | SetEntityAsMissionEntity(_jobVehicle.Handle, true, true); 424 | 425 | if (!DecorExistOn(_jobVehicle.Handle, "MailDelivery.Rental")) 426 | { 427 | DecorRegister("MailDelivery.Rental", 2); 428 | DecorSetBool(_jobVehicle.Handle, "MailDelivery.Rental", true); 429 | } 430 | 431 | TriggerServerEvent("MailDelivery:VanRented", _rentalAmount); 432 | 433 | Screen.DisplayHelpTextThisFrame("Your Mail Delivery Van is ready on one of the parking spots."); 434 | 435 | await Delay(4000); 436 | } 437 | } 438 | } 439 | catch (Exception e) 440 | { 441 | Debug.WriteLine($"{e.Message} : Exception thrown on MailDelivery:OnRentalTick()"); 442 | } 443 | 444 | await Task.FromResult(0); 445 | } 446 | 447 | private async Task OnMarkerTick() 448 | { 449 | try 450 | { 451 | var playerPos = Game.PlayerPed.Position; 452 | 453 | if (playerPos.DistanceToSquared2D(RentalPosition) < 2500) 454 | { 455 | World.DrawMarker(MarkerType.VerticalCylinder, RentalPosition, Vector3.Zero, Vector3.Zero, new Vector3(3.0f), DutyColor); 456 | } 457 | 458 | if (playerPos.DistanceToSquared2D(DutyPosition) < 2500) 459 | { 460 | World.DrawMarker(MarkerType.VerticalCylinder, DutyPosition, Vector3.Zero, Vector3.Zero, new Vector3(3.0f), DutyColor); 461 | } 462 | } 463 | catch (Exception e) 464 | { 465 | Debug.WriteLine($"{e.Message} : Exception thrown on MailDelivery:OnMarkerTick()"); 466 | } 467 | 468 | await Task.FromResult(0); 469 | } 470 | 471 | private async Task OnTestTick() 472 | { 473 | try 474 | { 475 | var playerPos = Game.PlayerPed.Position; 476 | if (playerPos.DistanceToSquared(DeliveryAreaWide[0]) < 1900000) 477 | { 478 | foreach (var pos in DeliveryAreas["Grapeseed"]) 479 | { 480 | if (playerPos.DistanceToSquared(pos) < 100) 481 | { 482 | World.DrawMarker(MarkerType.ChevronUpx1, pos, Vector3.Zero, new Vector3(0, 180f, 0), new Vector3(0.5f), DutyColor, true, true, true); 483 | Screen.ShowSubtitle($"Index: {DeliveryAreas["Grapeseed"].IndexOf(pos)}"); 484 | } 485 | } 486 | } 487 | 488 | if (playerPos.DistanceToSquared(DeliveryAreaWide[1]) < 1900000) 489 | { 490 | foreach (var pos in DeliveryAreas["Sandy Shores"]) 491 | { 492 | if (playerPos.DistanceToSquared(pos) < 100) 493 | { 494 | World.DrawMarker(MarkerType.ChevronUpx1, pos, Vector3.Zero, new Vector3(0, 180f, 0), new Vector3(0.5f), DutyColor, true, true, true); 495 | Screen.ShowSubtitle($"Index: {DeliveryAreas["Sandy Shores"].IndexOf(pos)}"); 496 | } 497 | } 498 | } 499 | 500 | if (playerPos.DistanceToSquared(DeliveryAreaWide[2]) < 1900000) 501 | { 502 | foreach (var pos in DeliveryAreas["Paleto Bay"]) 503 | { 504 | if (playerPos.DistanceToSquared(pos) < 100) 505 | { 506 | World.DrawMarker(MarkerType.ChevronUpx1, pos, Vector3.Zero, new Vector3(0, 180f, 0), new Vector3(0.5f), DutyColor, true, true, true); 507 | Screen.ShowSubtitle($"Index: {DeliveryAreas["Paleto Bay"].IndexOf(pos)}"); 508 | 509 | } 510 | } 511 | } 512 | 513 | } 514 | catch (Exception e) 515 | { 516 | Debug.WriteLine($"{e.Message} : Exception thrown on MailDelivery:OnTestTick()"); 517 | } 518 | 519 | await Task.FromResult(0); 520 | } 521 | 522 | private void ToggleDuty(bool state) 523 | { 524 | _isOnDuty = state; 525 | } 526 | 527 | private int GetParkingPosition(List ParkingSpots) 528 | { 529 | for (int i = 0; i < ParkingSpots.Count; i++) 530 | { 531 | if (GetClosestVehicle(ParkingSpots[i].X, ParkingSpots[i].Y, ParkingSpots[i].Z, 3, 0, 70) == 0) 532 | { 533 | return i; 534 | } 535 | } 536 | return -1; 537 | } 538 | 539 | private void Initialize() 540 | { 541 | _minPayment = GetConvarInt("mail_min_payment", 150); 542 | _maxPayment = GetConvarInt("mail_max_payment", 1000); 543 | _rentalAmount = GetConvarInt("mail_rental_amount", 2000); 544 | _rentalBlipSprite = GetConvarInt("mail_rental_blip_sprite", 67); 545 | _rentalBlipColor = GetConvarInt("mail_rental_blip_color", 0); 546 | _jobCooldown = GetConvarInt("mail_job_cooldown", 60000); 547 | _jobBlipSprite = GetConvarInt("mail_job_blip_sprite", 67); 548 | _jobBlipColor = GetConvarInt("mail_job_blip_sprite", 0); 549 | _vanModel = GetConvar("mail_van_model", "BOXVILLE4"); 550 | _deliveryBlipSprite = GetConvarInt("mail_delivery_blip_sprite", 164); 551 | _deliveryBlipColor = GetConvarInt("mail_delivery_blip_color", 66); 552 | _debug = Convert.ToBoolean(GetConvar("mail_debug", "false")); 553 | } 554 | private Blip CreateBlip(Vector3 position, BlipSprite sprite, BlipColor color, string name, bool shortRange = true, float scale = 0.86f) 555 | { 556 | var blip = World.CreateBlip(position); 557 | blip.Sprite = sprite; 558 | blip.Color = color; 559 | blip.IsShortRange = shortRange; 560 | blip.Name = name; 561 | blip.Scale = scale; 562 | 563 | return blip; 564 | } 565 | } 566 | } 567 | -------------------------------------------------------------------------------- /MailDelivery.Client/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MaillDelivery.Client")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MaillDelivery.Client")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5277b3d8-fa68-462e-8156-bc17db7de42b")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /MailDelivery.Client/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /MailDelivery.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27703.2047 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MailDelivery.Client", "MailDelivery.Client\MailDelivery.Client.csproj", "{5277B3D8-FA68-462E-8156-BC17DB7DE42B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {5277B3D8-FA68-462E-8156-BC17DB7DE42B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {5277B3D8-FA68-462E-8156-BC17DB7DE42B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {5277B3D8-FA68-462E-8156-BC17DB7DE42B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {5277B3D8-FA68-462E-8156-BC17DB7DE42B}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {66CBB57E-649C-474B-BA3A-0C944D6739C1} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # MailDelivery Job (v1.0.2) 4 | 5 | ##### Standalone mail delivery job for Paleto Bay, Grapeseed and Sandy Shores 6 | 7 | 8 | 9 | ![Version](https://img.shields.io/badge/version-1.0.2-green.svg) [![Build Status](https://travis-ci.org/d0p3t/MailDelivery.svg?branch=master)](https://travis-ci.org/d0p3t/MailDelivery) [![Discord](https://img.shields.io/discord/330910293934997504.svg)](https://discord.gg/bSd4cYJ) 10 | 11 | [![Build Status](https://dev.azure.com/d0p3t/MailDelivery/_apis/build/status/d0p3t.MailDelivery?branchName=master)](https://dev.azure.com/d0p3t/MailDelivery/_build/latest?definitionId=1&branchName=master) [![Hello](https://vsrm.dev.azure.com/d0p3t/_apis/public/Release/badge/3b0f092f-3e8a-4624-bb9c-23ba4e3390bd/2/2)](https://vsrm.dev.azure.com/d0p3t/_apis/public/Release/badge/3b0f092f-3e8a-4624-bb9c-23ba4e3390bd/2/2) 12 | 13 |
14 | 15 | ___ 16 | **I decided to release this script after a beloved server that I played on shut down. At the time I created this, I was working together with the developers to add some unique functionalities to the server. This was one of them.** 17 | 18 | --- 19 | 20 | ## What is MailDelivery? 21 | In short, MailDelivery is a standalone **mail delivery job** that lets players deliver mail all around Blaine County. 22 | 23 | A mail delivery man always has his own unique route, designated to one of the three towns: Paleto Bay, Grapeseed, or Sandy Shores, delivering his mail to mailboxes or other interesting places. 24 | 25 | Standalone means that it _**does not have built-in ESX or vRP support**_. It does however have events that you can listen for. 26 | 27 | Written fully in C#. 28 | 29 | --- 30 | ## Features 31 | * Always receive a **unique route** in one of three towns with 10-12 delivery spots (out of max. 33) 32 | * Marked delivery spots on the map 33 | * Delivery spots are _mailboxes_, _porches_ and _other interesting spots_ 34 | * Animation when delivering mail 35 | * Ability to use your own custom van model if you don't like the PostOP Boxville 36 | * **Rental spot** in case the mail man doesn't have his own PostOP Boxville yet! 37 | * Rental vans are spawned in one of the free parking spots. 38 | * Configurable min/max pay per delivery and other settings using **ConVars** 39 | * Adaptable to your own system by using server events for payment and rental costs 40 | * **Customize** all blip sprites and colors using ConVars 41 | 42 | ___ 43 | 44 | ## Installation & Configuration 45 | 46 | ### Installation 47 | Installation is simple, download the resource through the link above, add `start maildelivery` to your `server.cfg` and you're ready to go. However, if you would like to configure settings or bind this to your existing economy system, see **Configuration**. 48 | 49 | ### Configuration 50 | This resource triggers two events for you to conveniently integrate this job into your own system as well as various ConVars to modify settings (like minimum and maximum payments). 51 | 52 | There are two server events that you can use to add delivery payments and rental costs to your existing economy system (for example ESX). 53 | 54 | **Name:** _"MailDelivery:DeliveryMade"_ 55 | **Parameters:** payment(integer) 56 | **Description:** Fired when a delivery has been made. Contains the payment amount between the min and max payment. 57 | **Example:** 58 | ```lua 59 | AddEventHandler("MailDelivery:DeliveryMade", function(payment) 60 | -- add payment to players bank account 61 | end) 62 | ``` 63 | 64 | **Name:** _"MailDelivery:VanRented"_ 65 | **Parameters:** rentalAmount(integer) 66 | **Description:** When renting a van, this event gets triggered with the set rental amount. 67 | **Example:** 68 | ```lua 69 | AddEventHandler("MailDelivery:VanRented", function(rentalAmount) 70 | -- deduct rentalAmount from players bank account 71 | end) 72 | ``` 73 | 74 | You can configure various aspects of the job using ConVars. Below is the list of all available ConVars and their default values if not set. 75 | 76 | **Name:** "mail_min_payment" (_Default: 150_) 77 | **Description:** The minimum payment of a delivery. 78 | 79 | **Name:** "mail_max_payment" (_Default: 1000_) 80 | **Description:** The maximum payment of a delivery. 81 | 82 | **Name:** "mail_rental_amount" (_Default: 2000_) 83 | **Description:** The rental cost when renting a mail delivery van via the rental spot. 84 | 85 | **Name:** "mail_rental_blip_sprite" (_Default: 67_) 86 | **Description:** Sets the blip sprite of the rental location. By default a truck sprite. 87 | 88 | **Name:** "mail_rental_blip_color" (_Default: 0_) 89 | **Description:** Sets the blip color of the rental location. By default white. 90 | 91 | **Name:** "mail_job_cooldown" (_Default: 60000_) 92 | **Description:** Sets the cooldown time between going on/off duty. A security measure to prevent people from getting the optimal route. 93 | 94 | **Name:** "mail_job_blip_sprite" (_Default: 67_) 95 | **Description:** Sets the blip sprite of the on-duty location. By default a truck sprite. 96 | 97 | **Name:** "mail_job_blip_color" (_Default: 0_) 98 | **Description:** Sets the blip color of the on-duty location. By default white. 99 | 100 | **Name:** "mail_van_model" (_Default: "BOXVILLE4"_) 101 | **Description:** Sets the van model required to start the delivery job. Also the model for the rental spot. 102 | 103 | **Name:** "mail_delivery_blip_sprite" (_Default: 164_) 104 | **Description:** Sets the blip sprites of the delivery locations. By default a flag. 105 | 106 | **Name:** "mail_delivery_blip_color" (_Default: 66_) 107 | **Description:** Sets the blip color of the delivery locations. By default yellow. 108 | 109 | **Name:** "mail_debug" (Default: false) 110 | **Description:** A debug flag for developers (Only set this convar when developing!) 111 | 112 | --- 113 | ## Changelog 114 | **v1.0.2** 115 | * New default delivery points blip 116 | * Added blip customization convars 117 | * CI: Added Azure DevOps for faster builds. Releases process still on TravisCI 118 | 119 | **v1.0.1** 120 | * Ability to use your own custom van model 121 | * Moved ConVars to client side due to new FiveM feature 122 | 123 | **v1.0.0** 124 | * Initial release 125 | 126 | --- 127 | ## Known Issues 128 | None as of right now :crossed_fingers: 129 | 130 | If you come across anything bugs/issues, please create an [Issue](https://github.com/d0p3t/MailDelivery/issues). 131 | 132 | --- 133 | ## Support 134 | If you require assistance, you can ask your question on the [FiveM forum topic](https://forum.fivem.net/t/maildelivery-v1-0-1-standalone-mail-delivery-job-for-paleto-bay-grapeseed-and-sandy-shores/168076). Please don't create topics elsewhere or ask me on the FiveM Discord about this resource. Lets keep all questions and comments in one topic, so we are all aware of what's going on. 135 | 136 | --- 137 | ## Credits 138 | Last, but not least, some credits to people that have helped me get into FiveM coding and helped other wise. 139 | 140 | Thanks @Mooshe and his stream for the preliminary logic of parking spots and toggling duty (months ago). 141 | Thanks to @Vespura for letting me use the same license :) 142 | 143 | ___ 144 | 145 | ## Final Words 146 | I hope you enjoy the release. I want this resource to not only be one that community members can use, but also learn from. I feel there is a lack of C# resources as well as source code that developers can learn from. 147 | 148 | If you have any requests, concerns, etc. please let me know. 149 | 150 | You can modify or edit the code as you like, but you cannot re-release it. Please see the [LICENSE.md](https://github.com/d0p3t/MailDelivery/blob/master/LICENSE.md) -------------------------------------------------------------------------------- /__resource.lua: -------------------------------------------------------------------------------- 1 | resource_manifest_version '05cfa83c-a124-4cfa-a768-c24a5811d8f9' 2 | 3 | name 'MailDelivery' 4 | description 'Standalone mail delivery job for Paleto Bay, Grapeseed and Sandy Shores.' 5 | author 'Remco Troost (https://www.d0p3t.nu)' 6 | version 'v1.0.2' 7 | url 'https://github.com/d0p3t/MailDelivery' 8 | 9 | client_script "MailDelivery.Client.net.dll" 10 | -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | trigger: 2 | batch: true 3 | tags: 4 | include: 5 | - v* 6 | branches: 7 | include: 8 | - master 9 | 10 | pr: 11 | - master 12 | 13 | pool: 14 | vmImage: 'VS2017-Win2016' 15 | 16 | variables: 17 | solution: '**/*.sln' 18 | buildPlatform: 'Any CPU' 19 | buildConfiguration: 'Release' 20 | 21 | steps: 22 | - task: NuGetToolInstaller@0 23 | 24 | - task: NuGetCommand@2 25 | displayName: 'Restore NuGet' 26 | inputs: 27 | restoreSolution: '$(solution)' 28 | 29 | - task: VSBuild@1 30 | displayName: 'Build solution' 31 | inputs: 32 | solution: '$(solution)' 33 | msbuildArgs: /p:DeployOnBuild=true /p:SkipInvalidConfigurations=true' 34 | platform: '$(buildPlatform)' 35 | configuration: '$(buildConfiguration)' 36 | 37 | - script: | 38 | echo "Copy build to staging" 39 | dir $(Build.SourcesDirectory)\MailDelivery.Client\bin\Release\ 40 | xcopy $(Build.SourcesDirectory)\MailDelivery.Client\bin\Release\MailDelivery.Client.net.dll $(Build.ArtifactStagingDirectory) 41 | 42 | - script: | 43 | echo "Copy __resource.lua" 44 | xcopy $(Build.SourcesDirectory)\__resource.lua $(Build.ArtifactStagingDirectory) 45 | 46 | - task: PublishBuildArtifacts@1 47 | displayName: 'Publish artifacts' 48 | inputs: 49 | artifactName: 'maildelivery' --------------------------------------------------------------------------------