├── LICENSE ├── README.md ├── arenas ├── fxmanifest.lua └── stream │ ├── arena1.ymap │ ├── arena2.ymap │ └── complement.ymap ├── pvpsystem-esx ├── NUI │ ├── index.html │ ├── notify.js │ └── noty.css ├── client.lua ├── config.lua ├── fxmanifest.lua └── server.lua ├── pvpsystem-qbcore ├── NUI │ ├── index.html │ ├── notify.js │ └── noty.css ├── client.lua ├── config.lua ├── fxmanifest.lua └── server.lua ├── pvpsystem-standalone ├── NUI │ ├── index.html │ ├── notify.js │ └── noty.css ├── client.lua ├── config.lua ├── fxmanifest.lua └── server.lua └── pvpsystem-vrp ├── NUI ├── index.html ├── notify.js └── noty.css ├── client.lua ├── config.lua ├── fxmanifest.lua └── server.lua /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Pedro Sandrini 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PvP System 2 | This is a 1v1 and 2v2 resource for FiveM. 3 | Fight a duel and train your PvP skills in more than one dimension with this resource. 4 | Contain two arenas `(ymaps)`. 5 | 6 | ### Modes: 7 | - `1v1` - Train alone against other player 8 | - `2v2` - Train with a team against other team 9 | 10 | ## Commands 11 | 12 | | Command | Description | 13 | | ------- | ----------- | 14 | | `/1v1` | Join the player to the 1v1 queue | 15 | | `/1v1 [ID] [ROUNDS]` | Request a player to a duel | 16 | | `/2v2` | Join the team to the 2v2 queue | 17 | | `/cancelqueue` | Cancel any queue | 18 | 19 | ## Preview 20 | ![img](https://user-images.githubusercontent.com/55068969/194797053-001effa5-4cc3-46b7-9446-e690a7f454ce.png) 21 | 22 | ## Dependency 23 | This resource needs vRP, QBCore or ESX framework to work.
24 | The *standalone* version doesn't have dependencies. 25 | 26 | ## How to install 27 | 1. Rename the folder `pvpsystem-(framework)` to `pvpsystem` 28 | 2. Add the folders `pvpsystem` and `arenas` to your resource directory 29 | 3. Add `start pvpsystem` and `start arenas` to your server.cfg 30 | 31 | ## License 32 | [MIT](LICENSE) © cSandrini 33 | 34 | -------------------------------------------------------------------------------- /arenas/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version "cerulean" 2 | games {"gta5"} 3 | 4 | this_is_a_map "yes" -------------------------------------------------------------------------------- /arenas/stream/arena1.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cSandrini/pvpsystem-resource/190fc190ed4660761a79838dac86c8f63dea957a/arenas/stream/arena1.ymap -------------------------------------------------------------------------------- /arenas/stream/arena2.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cSandrini/pvpsystem-resource/190fc190ed4660761a79838dac86c8f63dea957a/arenas/stream/arena2.ymap -------------------------------------------------------------------------------- /arenas/stream/complement.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cSandrini/pvpsystem-resource/190fc190ed4660761a79838dac86c8f63dea957a/arenas/stream/complement.ymap -------------------------------------------------------------------------------- /pvpsystem-esx/NUI/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /pvpsystem-esx/NUI/notify.js: -------------------------------------------------------------------------------- 1 | var n; 2 | $(document).ready(function () { 3 | window.addEventListener('message', function (event){ 4 | var data = event.data; 5 | if(data.action === "request") { 6 | Noty.closeAll(); 7 | n = new Noty({ 8 | type: 'notification', 9 | layout: 'topRight', 10 | text: data.text, 11 | timeout: data.time, 12 | theme: "mint", 13 | progressBar: true, 14 | buttons: [ 15 | Noty.button('Accept [Y]', 'btn btn-sm btn-success me-2', function () { 16 | n.close(); 17 | }), 18 | Noty.button('Deny [U]', 'btn btn-sm btn-danger', function () { 19 | n.close(); 20 | }) 21 | ] 22 | }).show(); 23 | } else if (data.close == true) { 24 | n.close(); 25 | } 26 | }) 27 | }); 28 | -------------------------------------------------------------------------------- /pvpsystem-esx/NUI/noty.css: -------------------------------------------------------------------------------- 1 | /* Noty.css -> Noty.js library */ 2 | 3 | .noty_layout_mixin, 4 | #noty_layout__top, 5 | #noty_layout__topLeft, 6 | #noty_layout__topCenter, 7 | #noty_layout__topRight, 8 | #noty_layout__bottom, 9 | #noty_layout__bottomLeft, 10 | #noty_layout__bottomCenter, 11 | #noty_layout__bottomRight, 12 | #noty_layout__center, 13 | #noty_layout__centerLeft, 14 | #noty_layout__centerRight { 15 | position: fixed; 16 | margin: 0; 17 | padding: 0; 18 | z-index: 9999999; 19 | -webkit-transform: translateZ(0) scale(1, 1); 20 | transform: translateZ(0) scale(1, 1); 21 | -webkit-backface-visibility: hidden; 22 | backface-visibility: hidden; 23 | -webkit-font-smoothing: subpixel-antialiased; 24 | filter: blur(0); 25 | -webkit-filter: blur(0); 26 | font-weight: bold; 27 | font-family: Arial, sans-serif; 28 | max-width: 90%; 29 | } 30 | 31 | #noty_layout__top { 32 | top: 0; 33 | left: 5%; 34 | width: 90%; 35 | } 36 | 37 | #noty_layout__topLeft { 38 | top: 20px; 39 | left: 20px; 40 | width: 325px; 41 | } 42 | 43 | #noty_layout__topCenter { 44 | top: 5%; 45 | left: 50%; 46 | width: 325px; 47 | -webkit-transform: translate(-webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 48 | transform: translate(calc(-50% - .5px)) translateZ(0) scale(1, 1); 49 | } 50 | 51 | #noty_layout__topRight { 52 | top: 20px; 53 | right: 20px; 54 | width: 325px; 55 | } 56 | 57 | #noty_layout__bottom { 58 | bottom: 0; 59 | left: 5%; 60 | width: 90%; 61 | } 62 | 63 | #noty_layout__bottomLeft { 64 | bottom: 20px; 65 | left: 20px; 66 | width: 325px; 67 | } 68 | 69 | #noty_layout__bottomCenter { 70 | bottom: 5%; 71 | left: 50%; 72 | width: 325px; 73 | -webkit-transform: translate(-webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 74 | transform: translate(calc(-50% - .5px)) translateZ(0) scale(1, 1); 75 | } 76 | 77 | #noty_layout__bottomRight { 78 | bottom: 20px; 79 | right: 20px; 80 | width: 325px; 81 | } 82 | 83 | #noty_layout__center { 84 | top: 50%; 85 | left: 50%; 86 | width: 325px; 87 | -webkit-transform: translate(-webkit-calc(-50% - .5px), -webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 88 | transform: translate(calc(-50% - .5px), calc(-50% - .5px)) translateZ(0) scale(1, 1); 89 | } 90 | 91 | #noty_layout__centerLeft { 92 | top: 50%; 93 | left: 20px; 94 | width: 325px; 95 | -webkit-transform: translate(0, -webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 96 | transform: translate(0, calc(-50% - .5px)) translateZ(0) scale(1, 1); 97 | } 98 | 99 | #noty_layout__centerRight { 100 | top: 50%; 101 | right: 20px; 102 | width: 325px; 103 | -webkit-transform: translate(0, -webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 104 | transform: translate(0, calc(-50% - .5px)) translateZ(0) scale(1, 1); 105 | } 106 | 107 | .noty_progressbar { 108 | display: none; 109 | } 110 | 111 | .noty_has_timeout.noty_has_progressbar .noty_progressbar { 112 | display: block; 113 | position: absolute; 114 | left: 0; 115 | bottom: 0; 116 | height: 3px; 117 | width: 100%; 118 | background-color: #b6c5f5; 119 | opacity: 0.6; 120 | filter: alpha(opacity=10); 121 | } 122 | 123 | .noty_bar { 124 | -webkit-backface-visibility: hidden; 125 | -webkit-transform: translate(0, 0) translateZ(0) scale(1, 1); 126 | -ms-transform: translate(0, 0) scale(1, 1); 127 | transform: translate(0, 0) scale(1, 1); 128 | -webkit-font-smoothing: subpixel-antialiased; 129 | overflow: hidden; 130 | } 131 | 132 | .noty_effects_open { 133 | opacity: 0; 134 | -webkit-transform: translate(50%); 135 | -ms-transform: translate(50%); 136 | transform: translate(50%); 137 | -webkit-animation: noty_anim_in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 138 | animation: noty_anim_in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 139 | -webkit-animation-fill-mode: forwards; 140 | animation-fill-mode: forwards; 141 | } 142 | 143 | .noty_effects_close { 144 | -webkit-animation: noty_anim_out 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 145 | animation: noty_anim_out 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 146 | -webkit-animation-fill-mode: forwards; 147 | animation-fill-mode: forwards; 148 | } 149 | 150 | .noty_fix_effects_height { 151 | -webkit-animation: noty_anim_height 75ms ease-out; 152 | animation: noty_anim_height 75ms ease-out; 153 | } 154 | 155 | .noty_close_with_click { 156 | cursor: pointer; 157 | } 158 | 159 | .noty_close_button { 160 | position: absolute; 161 | top: 2px; 162 | right: 2px; 163 | font-weight: bold; 164 | width: 20px; 165 | height: 20px; 166 | text-align: center; 167 | line-height: 20px; 168 | background-color: rgba(0, 0, 0, 0.05); 169 | border-radius: 2px; 170 | cursor: pointer; 171 | -webkit-transition: all .2s ease-out; 172 | transition: all .2s ease-out; 173 | } 174 | 175 | .noty_close_button:hover { 176 | background-color: rgba(0, 0, 0, 0.1); 177 | } 178 | 179 | .noty_modal { 180 | position: fixed; 181 | width: 100%; 182 | height: 100%; 183 | background-color: #000; 184 | z-index: 10000; 185 | opacity: .3; 186 | left: 0; 187 | top: 0; 188 | } 189 | 190 | .noty_modal.noty_modal_open { 191 | opacity: 0; 192 | -webkit-animation: noty_modal_in .3s ease-out; 193 | animation: noty_modal_in .3s ease-out; 194 | } 195 | 196 | .noty_modal.noty_modal_close { 197 | -webkit-animation: noty_modal_out .3s ease-out; 198 | animation: noty_modal_out .3s ease-out; 199 | -webkit-animation-fill-mode: forwards; 200 | animation-fill-mode: forwards; 201 | } 202 | 203 | @-webkit-keyframes noty_modal_in { 204 | 100% { 205 | opacity: .3; 206 | } 207 | } 208 | 209 | @keyframes noty_modal_in { 210 | 100% { 211 | opacity: .3; 212 | } 213 | } 214 | 215 | @-webkit-keyframes noty_modal_out { 216 | 100% { 217 | opacity: 0; 218 | } 219 | } 220 | 221 | @keyframes noty_modal_out { 222 | 100% { 223 | opacity: 0; 224 | } 225 | } 226 | 227 | @keyframes noty_modal_out { 228 | 100% { 229 | opacity: 0; 230 | } 231 | } 232 | 233 | @-webkit-keyframes noty_anim_in { 234 | 100% { 235 | -webkit-transform: translate(0); 236 | transform: translate(0); 237 | opacity: 1; 238 | } 239 | } 240 | 241 | @keyframes noty_anim_in { 242 | 100% { 243 | -webkit-transform: translate(0); 244 | transform: translate(0); 245 | opacity: 1; 246 | } 247 | } 248 | 249 | @-webkit-keyframes noty_anim_out { 250 | 100% { 251 | -webkit-transform: translate(50%); 252 | transform: translate(50%); 253 | opacity: 0; 254 | } 255 | } 256 | 257 | @keyframes noty_anim_out { 258 | 100% { 259 | -webkit-transform: translate(50%); 260 | transform: translate(50%); 261 | opacity: 0; 262 | } 263 | } 264 | 265 | @-webkit-keyframes noty_anim_height { 266 | 100% { 267 | height: 0; 268 | } 269 | } 270 | 271 | @keyframes noty_anim_height { 272 | 100% { 273 | height: 0; 274 | } 275 | } 276 | 277 | .noty_theme__relax.noty_bar { 278 | margin: 4px 0; 279 | overflow: hidden; 280 | border-radius: 2px; 281 | position: relative; 282 | } 283 | 284 | .noty_theme__relax.noty_bar .noty_body { 285 | padding: 10px; 286 | } 287 | 288 | .noty_theme__relax.noty_bar .noty_buttons { 289 | border-top: 1px solid #e7e7e7; 290 | padding: 5px 10px; 291 | } 292 | 293 | .noty_theme__relax.noty_type__alert, 294 | .noty_theme__relax.noty_type__notification { 295 | background-color: #fff; 296 | border: 1px solid #dedede; 297 | color: #444; 298 | } 299 | 300 | .noty_theme__relax.noty_type__warning { 301 | background-color: #FFEAA8; 302 | border: 1px solid #FFC237; 303 | color: #826200; 304 | } 305 | 306 | .noty_theme__relax.noty_type__warning .noty_buttons { 307 | border-color: #dfaa30; 308 | } 309 | 310 | .noty_theme__relax.noty_type__error { 311 | background-color: #FF8181; 312 | border: 1px solid #e25353; 313 | color: #FFF; 314 | } 315 | 316 | .noty_theme__relax.noty_type__error .noty_buttons { 317 | border-color: darkred; 318 | } 319 | 320 | .noty_theme__relax.noty_type__info, 321 | .noty_theme__relax.noty_type__information { 322 | background-color: #78C5E7; 323 | border: 1px solid #3badd6; 324 | color: #FFF; 325 | } 326 | 327 | .noty_theme__relax.noty_type__info .noty_buttons, 328 | .noty_theme__relax.noty_type__information .noty_buttons { 329 | border-color: #0B90C4; 330 | } 331 | 332 | .noty_theme__relax.noty_type__success { 333 | background-color: #BCF5BC; 334 | border: 1px solid #7cdd77; 335 | color: darkgreen; 336 | } 337 | 338 | .noty_theme__relax.noty_type__success .noty_buttons { 339 | border-color: #50C24E; 340 | } 341 | 342 | .noty_theme__metroui.noty_bar { 343 | margin: 4px 0; 344 | overflow: hidden; 345 | position: relative; 346 | box-shadow: rgba(0, 0, 0, 0.298039) 0 0 5px 0; 347 | } 348 | 349 | .noty_theme__metroui.noty_bar .noty_progressbar { 350 | position: absolute; 351 | left: 0; 352 | bottom: 0; 353 | height: 3px; 354 | width: 100%; 355 | background-color: #000; 356 | opacity: 0.2; 357 | filter: alpha(opacity=20); 358 | } 359 | 360 | .noty_theme__metroui.noty_bar .noty_body { 361 | padding: 1.25em; 362 | font-size: 14px; 363 | } 364 | 365 | .noty_theme__metroui.noty_bar .noty_buttons { 366 | padding: 0 10px .5em 10px; 367 | } 368 | 369 | .noty_theme__metroui.noty_type__alert, 370 | .noty_theme__metroui.noty_type__notification { 371 | background-color: #fff; 372 | color: #1d1d1d; 373 | } 374 | 375 | .noty_theme__metroui.noty_type__warning { 376 | background-color: #FA6800; 377 | color: #fff; 378 | } 379 | 380 | .noty_theme__metroui.noty_type__error { 381 | background-color: #CE352C; 382 | color: #FFF; 383 | } 384 | 385 | .noty_theme__metroui.noty_type__info, 386 | .noty_theme__metroui.noty_type__information { 387 | background-color: #1BA1E2; 388 | color: #FFF; 389 | } 390 | 391 | .noty_theme__metroui.noty_type__success { 392 | background-color: #60A917; 393 | color: #fff; 394 | } 395 | 396 | .noty_theme__mint.noty_bar { 397 | margin: 20px 4px 4px 0; 398 | overflow: hidden; 399 | border-radius: 2px; 400 | position: relative; 401 | } 402 | 403 | .noty_theme__mint.noty_bar .noty_body { 404 | padding: 10px; 405 | font-size: 14px; 406 | } 407 | 408 | .noty_theme__mint.noty_bar .noty_buttons { 409 | padding: 0px 0px 10px 10px; 410 | } 411 | 412 | .noty_theme__mint.noty_type__alert, 413 | .noty_theme__mint.noty_type__notification { 414 | background-color: rgba(49, 66, 82, 0.8); 415 | color: #ffffff; 416 | } 417 | 418 | .noty_theme__mint.noty_type__warning { 419 | background-color: #FFAE42; 420 | border-bottom: 1px solid #E89F3C; 421 | color: #fff; 422 | } 423 | 424 | .noty_theme__mint.noty_type__error { 425 | background-color: #DE636F; 426 | border-bottom: 1px solid #CA5A65; 427 | color: #fff; 428 | } 429 | 430 | .noty_theme__mint.noty_type__info, 431 | .noty_theme__mint.noty_type__information { 432 | background-color: #7F7EFF; 433 | border-bottom: 1px solid #7473E8; 434 | color: #fff; 435 | } 436 | 437 | .noty_theme__mint.noty_type__success { 438 | background-color: #AFC765; 439 | border-bottom: 1px solid #A0B55C; 440 | color: #fff; 441 | } 442 | 443 | .noty_theme__sunset.noty_bar { 444 | margin: 4px 0; 445 | overflow: hidden; 446 | border-radius: 2px; 447 | position: relative; 448 | } 449 | 450 | .noty_theme__sunset.noty_bar .noty_body { 451 | padding: 10px; 452 | font-size: 14px; 453 | text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); 454 | } 455 | 456 | .noty_theme__sunset.noty_bar .noty_buttons { 457 | padding: 10px; 458 | } 459 | 460 | .noty_theme__sunset.noty_type__alert, 461 | .noty_theme__sunset.noty_type__notification { 462 | background-color: #073B4C; 463 | color: #fff; 464 | } 465 | 466 | .noty_theme__sunset.noty_type__alert .noty_progressbar, 467 | .noty_theme__sunset.noty_type__notification .noty_progressbar { 468 | background-color: #fff; 469 | } 470 | 471 | .noty_theme__sunset.noty_type__warning { 472 | background-color: #FFD166; 473 | color: #fff; 474 | } 475 | 476 | .noty_theme__sunset.noty_type__error { 477 | background-color: #EF476F; 478 | color: #fff; 479 | } 480 | 481 | .noty_theme__sunset.noty_type__error .noty_progressbar { 482 | opacity: .4; 483 | } 484 | 485 | .noty_theme__sunset.noty_type__info, 486 | .noty_theme__sunset.noty_type__information { 487 | background-color: #118AB2; 488 | color: #fff; 489 | } 490 | 491 | .noty_theme__sunset.noty_type__info .noty_progressbar, 492 | .noty_theme__sunset.noty_type__information .noty_progressbar { 493 | opacity: .6; 494 | } 495 | 496 | .noty_theme__sunset.noty_type__success { 497 | background-color: #06D6A0; 498 | color: #fff; 499 | } 500 | 501 | .noty_theme__bootstrap-v3.noty_bar { 502 | margin: 4px 0; 503 | overflow: hidden; 504 | position: relative; 505 | border: 1px solid transparent; 506 | border-radius: 4px; 507 | } 508 | 509 | .noty_theme__bootstrap-v3.noty_bar .noty_body { 510 | padding: 15px; 511 | } 512 | 513 | .noty_theme__bootstrap-v3.noty_bar .noty_buttons { 514 | padding: 10px; 515 | } 516 | 517 | .noty_theme__bootstrap-v3.noty_bar .noty_close_button { 518 | font-size: 21px; 519 | font-weight: 700; 520 | line-height: 1; 521 | color: #000; 522 | text-shadow: 0 1px 0 #fff; 523 | filter: alpha(opacity=20); 524 | opacity: .2; 525 | background: transparent; 526 | } 527 | 528 | .noty_theme__bootstrap-v3.noty_bar .noty_close_button:hover { 529 | background: transparent; 530 | text-decoration: none; 531 | cursor: pointer; 532 | filter: alpha(opacity=50); 533 | opacity: .5; 534 | } 535 | 536 | .noty_theme__bootstrap-v3.noty_type__alert, 537 | .noty_theme__bootstrap-v3.noty_type__notification { 538 | background-color: #fff; 539 | color: inherit; 540 | } 541 | 542 | .noty_theme__bootstrap-v3.noty_type__warning { 543 | background-color: #fcf8e3; 544 | color: #8a6d3b; 545 | border-color: #faebcc; 546 | } 547 | 548 | .noty_theme__bootstrap-v3.noty_type__error { 549 | background-color: #f2dede; 550 | color: #a94442; 551 | border-color: #ebccd1; 552 | } 553 | 554 | .noty_theme__bootstrap-v3.noty_type__info, 555 | .noty_theme__bootstrap-v3.noty_type__information { 556 | background-color: #d9edf7; 557 | color: #31708f; 558 | border-color: #bce8f1; 559 | } 560 | 561 | .noty_theme__bootstrap-v3.noty_type__success { 562 | background-color: #dff0d8; 563 | color: #3c763d; 564 | border-color: #d6e9c6; 565 | } 566 | 567 | .noty_theme__bootstrap-v4.noty_bar { 568 | margin: 4px 0; 569 | overflow: hidden; 570 | position: relative; 571 | border: 1px solid transparent; 572 | border-radius: .25rem; 573 | } 574 | 575 | .noty_theme__bootstrap-v4.noty_bar .noty_body { 576 | padding: .75rem 1.25rem; 577 | } 578 | 579 | .noty_theme__bootstrap-v4.noty_bar .noty_buttons { 580 | padding: 10px; 581 | } 582 | 583 | .noty_theme__bootstrap-v4.noty_bar .noty_close_button { 584 | font-size: 1.5rem; 585 | font-weight: 700; 586 | line-height: 1; 587 | color: #000; 588 | text-shadow: 0 1px 0 #fff; 589 | filter: alpha(opacity=20); 590 | opacity: .5; 591 | background: transparent; 592 | } 593 | 594 | .noty_theme__bootstrap-v4.noty_bar .noty_close_button:hover { 595 | background: transparent; 596 | text-decoration: none; 597 | cursor: pointer; 598 | filter: alpha(opacity=50); 599 | opacity: .75; 600 | } 601 | 602 | .noty_theme__bootstrap-v4.noty_type__alert, 603 | .noty_theme__bootstrap-v4.noty_type__notification { 604 | background-color: #fff; 605 | color: inherit; 606 | } 607 | 608 | .noty_theme__bootstrap-v4.noty_type__warning { 609 | background-color: #fcf8e3; 610 | color: #8a6d3b; 611 | border-color: #faebcc; 612 | } 613 | 614 | .noty_theme__bootstrap-v4.noty_type__error { 615 | background-color: #f2dede; 616 | color: #a94442; 617 | border-color: #ebccd1; 618 | } 619 | 620 | .noty_theme__bootstrap-v4.noty_type__info, 621 | .noty_theme__bootstrap-v4.noty_type__information { 622 | background-color: #d9edf7; 623 | color: #31708f; 624 | border-color: #bce8f1; 625 | } 626 | 627 | .noty_theme__bootstrap-v4.noty_type__success { 628 | background-color: #dff0d8; 629 | color: #3c763d; 630 | border-color: #d6e9c6; 631 | } 632 | 633 | .noty_theme__semanticui.noty_bar { 634 | margin: 4px 0; 635 | overflow: hidden; 636 | position: relative; 637 | border: 1px solid transparent; 638 | font-size: 1em; 639 | border-radius: .28571429rem; 640 | box-shadow: 0 0 0 1px rgba(34, 36, 38, 0.22) inset, 0 0 0 0 transparent; 641 | } 642 | 643 | .noty_theme__semanticui.noty_bar .noty_body { 644 | padding: 1em 1.5em; 645 | line-height: 1.4285em; 646 | } 647 | 648 | .noty_theme__semanticui.noty_bar .noty_buttons { 649 | padding: 10px; 650 | } 651 | 652 | .noty_theme__semanticui.noty_type__alert, 653 | .noty_theme__semanticui.noty_type__notification { 654 | background-color: #f8f8f9; 655 | color: rgba(0, 0, 0, 0.87); 656 | } 657 | 658 | .noty_theme__semanticui.noty_type__warning { 659 | background-color: #fffaf3; 660 | color: #573a08; 661 | box-shadow: 0 0 0 1px #c9ba9b inset, 0 0 0 0 transparent; 662 | } 663 | 664 | .noty_theme__semanticui.noty_type__error { 665 | background-color: #fff6f6; 666 | color: #9f3a38; 667 | box-shadow: 0 0 0 1px #e0b4b4 inset, 0 0 0 0 transparent; 668 | } 669 | 670 | .noty_theme__semanticui.noty_type__info, 671 | .noty_theme__semanticui.noty_type__information { 672 | background-color: #f8ffff; 673 | color: #276f86; 674 | box-shadow: 0 0 0 1px #a9d5de inset, 0 0 0 0 transparent; 675 | } 676 | 677 | .noty_theme__semanticui.noty_type__success { 678 | background-color: #fcfff5; 679 | color: #2c662d; 680 | box-shadow: 0 0 0 1px #a3c293 inset, 0 0 0 0 transparent; 681 | } 682 | 683 | .noty_theme__nest.noty_bar { 684 | margin: 0 0 15px 0; 685 | overflow: hidden; 686 | border-radius: 2px; 687 | position: relative; 688 | box-shadow: rgba(0, 0, 0, 0.098039) 5px 4px 10px 0; 689 | } 690 | 691 | .noty_theme__nest.noty_bar .noty_body { 692 | padding: 10px; 693 | font-size: 14px; 694 | text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); 695 | } 696 | 697 | .noty_theme__nest.noty_bar .noty_buttons { 698 | padding: 10px; 699 | } 700 | 701 | .noty_layout .noty_theme__nest.noty_bar { 702 | z-index: 5; 703 | } 704 | 705 | .noty_layout .noty_theme__nest.noty_bar:nth-child(2) { 706 | position: absolute; 707 | top: 0; 708 | margin-top: 4px; 709 | margin-right: -4px; 710 | margin-left: 4px; 711 | z-index: 4; 712 | width: 100%; 713 | } 714 | 715 | .noty_layout .noty_theme__nest.noty_bar:nth-child(3) { 716 | position: absolute; 717 | top: 0; 718 | margin-top: 8px; 719 | margin-right: -8px; 720 | margin-left: 8px; 721 | z-index: 3; 722 | width: 100%; 723 | } 724 | 725 | .noty_layout .noty_theme__nest.noty_bar:nth-child(4) { 726 | position: absolute; 727 | top: 0; 728 | margin-top: 12px; 729 | margin-right: -12px; 730 | margin-left: 12px; 731 | z-index: 2; 732 | width: 100%; 733 | } 734 | 735 | .noty_layout .noty_theme__nest.noty_bar:nth-child(5) { 736 | position: absolute; 737 | top: 0; 738 | margin-top: 16px; 739 | margin-right: -16px; 740 | margin-left: 16px; 741 | z-index: 1; 742 | width: 100%; 743 | } 744 | 745 | .noty_layout .noty_theme__nest.noty_bar:nth-child(n+6) { 746 | position: absolute; 747 | top: 0; 748 | margin-top: 20px; 749 | margin-right: -20px; 750 | margin-left: 20px; 751 | z-index: -1; 752 | width: 100%; 753 | } 754 | 755 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(2), 756 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(2) { 757 | margin-top: 4px; 758 | margin-left: -4px; 759 | margin-right: 4px; 760 | } 761 | 762 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(3), 763 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(3) { 764 | margin-top: 8px; 765 | margin-left: -8px; 766 | margin-right: 8px; 767 | } 768 | 769 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(4), 770 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(4) { 771 | margin-top: 12px; 772 | margin-left: -12px; 773 | margin-right: 12px; 774 | } 775 | 776 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(5), 777 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(5) { 778 | margin-top: 16px; 779 | margin-left: -16px; 780 | margin-right: 16px; 781 | } 782 | 783 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(n+6), 784 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(n+6) { 785 | margin-top: 20px; 786 | margin-left: -20px; 787 | margin-right: 20px; 788 | } 789 | 790 | .noty_theme__nest.noty_type__alert, 791 | .noty_theme__nest.noty_type__notification { 792 | background-color: #073B4C; 793 | color: #fff; 794 | } 795 | 796 | .noty_theme__nest.noty_type__alert .noty_progressbar, 797 | .noty_theme__nest.noty_type__notification .noty_progressbar { 798 | background-color: #fff; 799 | } 800 | 801 | .noty_theme__nest.noty_type__warning { 802 | background-color: #FFD166; 803 | color: #fff; 804 | } 805 | 806 | .noty_theme__nest.noty_type__error { 807 | background-color: #EF476F; 808 | color: #fff; 809 | } 810 | 811 | .noty_theme__nest.noty_type__error .noty_progressbar { 812 | opacity: .4; 813 | } 814 | 815 | .noty_theme__nest.noty_type__info, 816 | .noty_theme__nest.noty_type__information { 817 | background-color: #118AB2; 818 | color: #fff; 819 | } 820 | 821 | .noty_theme__nest.noty_type__info .noty_progressbar, 822 | .noty_theme__nest.noty_type__information .noty_progressbar { 823 | opacity: .6; 824 | } 825 | 826 | .noty_theme__nest.noty_type__success { 827 | background-color: #06D6A0; 828 | color: #fff; 829 | } 830 | 831 | .noty_theme__light.noty_bar { 832 | margin: 4px 0; 833 | overflow: hidden; 834 | border-radius: 2px; 835 | position: relative; 836 | } 837 | 838 | .noty_theme__light.noty_bar .noty_body { 839 | padding: 10px; 840 | } 841 | 842 | .noty_theme__light.noty_bar .noty_buttons { 843 | border-top: 1px solid #e7e7e7; 844 | padding: 5px 10px; 845 | } 846 | 847 | .noty_theme__light.noty_type__alert, 848 | .noty_theme__light.noty_type__notification { 849 | background-color: #fff; 850 | border: 1px solid #dedede; 851 | color: #444; 852 | } 853 | 854 | .noty_theme__light.noty_type__warning { 855 | background-color: #FFEAA8; 856 | border: 1px solid #FFC237; 857 | color: #826200; 858 | } 859 | 860 | .noty_theme__light.noty_type__warning .noty_buttons { 861 | border-color: #dfaa30; 862 | } 863 | 864 | .noty_theme__light.noty_type__error { 865 | background-color: #ED7000; 866 | border: 1px solid #e25353; 867 | color: #FFF; 868 | } 869 | 870 | .noty_theme__light.noty_type__error .noty_buttons { 871 | border-color: darkred; 872 | } 873 | 874 | .noty_theme__light.noty_type__info, 875 | .noty_theme__light.noty_type__information { 876 | background-color: #78C5E7; 877 | border: 1px solid #3badd6; 878 | color: #FFF; 879 | } 880 | 881 | .noty_theme__light.noty_type__info .noty_buttons, 882 | .noty_theme__light.noty_type__information .noty_buttons { 883 | border-color: #0B90C4; 884 | } 885 | 886 | .noty_theme__light.noty_type__success { 887 | background-color: #57C880; 888 | border: 1px solid #7cdd77; 889 | color: darkgreen; 890 | } 891 | 892 | .noty_theme__light.noty_type__success .noty_buttons { 893 | border-color: #50C24E; 894 | } 895 | 896 | /*# sourceMappingURL=noty.css.map*/ 897 | -------------------------------------------------------------------------------- /pvpsystem-esx/client.lua: -------------------------------------------------------------------------------- 1 | ESX = exports["es_extended"]:getSharedObject() 2 | 3 | counter = 0 -- IF COUNTER EQUALS 1 THE PLAYER IS IN THE QUEUE 4 | 5 | -- MESSAGES 6 | RegisterNetEvent("pvpsystem:notify") 7 | AddEventHandler("pvpsystem:notify", function(text, typeMsg, time, heading) 8 | ESX.ShowNotification(text, typeMsg, time) 9 | if heading then SetGameplayCamRelativeHeading(0) end 10 | end) 11 | 12 | RegisterNetEvent("pvpsystem:cancelCounter") 13 | AddEventHandler("pvpsystem:cancelCounter", function() 14 | counter = 0 15 | end) 16 | 17 | -- ADD PLAYER TO A QUEUE 18 | RegisterNetEvent("pvpsystem:pvpqueue") 19 | AddEventHandler("pvpsystem:pvpqueue", function(ident, player, args) 20 | if ESX.IsPlayerLoaded() then 21 | if (args==nil) then 22 | if (ident==1) then 23 | if (counter == 0) then 24 | ESX.ShowNotification("You joined the queue (1v1)", "success", 3000) 25 | TriggerServerEvent("pvpsystem:counter1v1", source) 26 | if (Config.developerMode == false) then 27 | counter = 1 28 | end 29 | else 30 | ESX.ShowNotification("You are already in a queue", "error", 3000) 31 | end 32 | else 33 | if (counter == 0) then 34 | ESX.ShowNotification("You joined the queue (2v2)", "success", 3000) 35 | TriggerServerEvent("pvpsystem:counter2v2", source) 36 | if (Config.developerMode == false) then 37 | counter = 1 38 | end 39 | else 40 | ESX.ShowNotification("You are already in a queue", "error", 3000) 41 | end 42 | end 43 | else 44 | if (counter == 0) then 45 | TriggerServerEvent("pvpsystem:comargs", player, args) 46 | if (Config.developerMode == false) then 47 | counter = 1 48 | end 49 | end 50 | end 51 | end 52 | end) 53 | 54 | -- REVIVE PLAYER 55 | RegisterNetEvent("pvpsystem:revive") 56 | AddEventHandler("pvpsystem:revive", function(id) 57 | NetworkResurrectLocalPlayer(-1497.45, 139.64, 55.65, true, true, false) 58 | SetEntityHealth(GetPlayerFromServerId(id), 200) 59 | end) 60 | 61 | RegisterNetEvent("pvpsystem:request") 62 | AddEventHandler("pvpsystem:request", function(id1, id2) 63 | if ESX.IsPlayerLoaded() then 64 | notification("pvpsystem:comargs", true, id1, id2, nil, nil, 30000, "1v1 Challenge! [ID] ".. id1) 65 | end 66 | end) 67 | 68 | function notification(trigger, isServer, params1, params2, params3, params4, time, text) 69 | SendNUIMessage({ 70 | action = "request", 71 | text = text, 72 | time = time 73 | }) 74 | local time2 = time - 1 75 | Citizen.SetTimeout(time, function() 76 | time2 = time + 1 77 | end) 78 | while time > time2 do 79 | if IsControlJustPressed(1, 246) then -- IF PRESSED Y 80 | if isServer == true then 81 | TriggerServerEvent(trigger, params1, params2, params3, params4) 82 | SendNUIMessage({close = true}) 83 | break 84 | else 85 | TriggerEvent(trigger, params1, params2, params3, params4) 86 | SendNUIMessage({close = true}) 87 | break 88 | end 89 | elseif IsControlJustPressed(1, 303) then -- IF PRESSED U 90 | SendNUIMessage({close = true}) 91 | break 92 | end 93 | Wait(1) 94 | end 95 | end 96 | -------------------------------------------------------------------------------- /pvpsystem-esx/config.lua: -------------------------------------------------------------------------------- 1 | -- CONFIG FILE -- PvP System 2 | Config = {} 3 | 4 | -- DEVELOPER MODE - IF YOU ARE TESTING WITHOUT ANOTHER PLAYER: TRUE - PLAYER IS ENABLE TO JOIN IN A QUEUE MORE THAN 1 TIME 5 | Config.developerMode = false 6 | 7 | -- ENABLE VEHICLES IN SOME DIMENSION 8 | Config.disableVehicles = true -- This resource disable the spawn of vehicles in some pvp dimensions. To disable this turn the variable to false. 9 | 10 | -- WEAPONS - Default: Pistol MK2 = "weapon_pistol_mk2" 11 | Config.weapon1v1 = "weapon_pistol_mk2" -- Weapon 1v1 12 | Config.weapon2v2 = "weapon_pistol_mk2" -- Weapon 2v2 13 | 14 | -- COORDS 15 | Config.respawnCoords = {-1497.45, 139.64, 55.65} -- Respawn point coords // {X, Y, Z} 16 | Config.respawnCoordsHeading = 314.48 -- Sets a point for the player to look at when teleported 17 | 18 | Config.firstSpawnCoords1v1 = {-1748.63, 175.88, 64.37} -- First spawn point coords of 1v1 arena // {X, Y, Z} 19 | Config.firstSpawnCoords1v1Heading = 210.26 -- Sets a point for the player to look at when teleported 20 | Config.secondSpawnCoords1v1 = {-1727.01, 145.06, 64.4} -- Second spawn point coords of 1v1 arena // {X, Y, Z} 21 | Config.secondSpawnCoords1v1Heading = 38.05 -- Sets a point for the player to look at when teleported 22 | 23 | Config.firstTeamSpawnCoords2v2 = {1214.89, 3115.29, 40.41} -- (Team 1) First spawn point coords of 2v2 arena // {X, Y, Z} 24 | Config.firstTeamSpawnCoords2v2Heading = 286.34 -- Sets a point for the player to look at when teleported 25 | Config.secondTeamSpawnCoords2v2 = {1115.73, 3090.54, 40.41} -- (Team 2) Third spawn point coords of 2v2 arena // {X, Y, Z} 26 | Config.secondTeamSpawnCoords2v2Heading = 108.94 -- Sets a point for the player to look at when teleported -------------------------------------------------------------------------------- /pvpsystem-esx/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'cerulean' 2 | games {'gta5'} 3 | 4 | name 'pvpsystem' 5 | description 'PvP System (1V1, 2V2)' 6 | version '1.3' 7 | 8 | shared_scripts { 9 | '@es_extended/imports.lua' 10 | } 11 | 12 | server_scripts { 13 | 'config.lua', 14 | 'server.lua' 15 | } 16 | 17 | client_scripts { 18 | 'config.lua', 19 | 'client.lua' 20 | } 21 | 22 | ui_page 'NUI/index.html' 23 | 24 | files { 25 | 'NUI/*' 26 | } 27 | 28 | dependency 'es_extended' -------------------------------------------------------------------------------- /pvpsystem-esx/server.lua: -------------------------------------------------------------------------------- 1 | -- FUNCTIONS 2 | function function1v1(player, x, y, z, heading, dimension) 3 | SetEntityCoords(player, x, y, z, false, true, true, false) 4 | SetEntityHeading(player, heading) 5 | SetPlayerRoutingBucket(player, dimension) -- DIMENSION 6 | RemoveAllPedWeapons(player, false) 7 | GiveWeaponToPed(player, GetHashKey("weapon_pistol_mk2"), 200, true) 8 | SetCurrentPedWeapon(player, GetHashKey("weapon_pistol_mk2"), true) 9 | TriggerClientEvent("pvpsystem:notify", player, "You are in the arena: #1", "success", 3000, true) 10 | end 11 | 12 | function function2v2(player, dimension) 13 | SetPlayerRoutingBucket(player, dimension) 14 | RemoveAllPedWeapons(player, false) 15 | GiveWeaponToPed(player, GetHashKey(Config.weapon2v2), 200, true) 16 | SetCurrentPedWeapon(player, GetHashKey(Config.weapon2v2), true) 17 | TriggerClientEvent("pvpsystem:notify", player, "You are in the arena: #2", "success", 3000, true) 18 | end 19 | 20 | function revivePlayer(player, x, y, z, heading) 21 | SetEntityCoords(player, x, y, z, false, true, true, false) 22 | SetEntityHeading(player, heading) 23 | SetPlayerRoutingBucket(player, 0) 24 | TriggerClientEvent("pvpsystem:revive", player, player) 25 | TriggerClientEvent("esx_ambulancejob:revive", player) 26 | end 27 | 28 | function dimensions(dimension, initialDimension) 29 | Citizen.CreateThread(function() 30 | while true do 31 | if (dimension==(initialDimension+301)) then 32 | dimension=initialDimension 33 | end 34 | Citizen.Wait(10) 35 | end 36 | end) 37 | end 38 | 39 | -- VARS 40 | id = nil 41 | -- HEALTH LIMIT TO GET IN COMA (DIE) 42 | healthlimit = 0 -- CHANGE TO HEALTH LIMIT OF YOUR SERVER IF DOESN'T WORK 43 | 44 | -- VARS TO 1v1 45 | count = 1 46 | queue1v1 = {} 47 | initialDimension1v1 = 1000 48 | dimension1v1 = initialDimension1v1 -- INITIAL DIMENSION 1V1 49 | 50 | -- VARS TO 2v2 51 | queue2v2={} 52 | initialDimension2v2 = 100 53 | dimension2v2 = initialDimension2v2 -- INITIAL DIMENSION 2V2 54 | 55 | -- DISABLE VEHICLES IN THE SOME DIMENSIONS 56 | if Config.disableVehicles then 57 | for i = (initialDimension1v1+300),initialDimension1v1,-1 do 58 | SetRoutingBucketEntityLockdownMode(i, "strict") 59 | end 60 | for i = (initialDimension2v2+300),initialDimension2v2,-1 do 61 | SetRoutingBucketEntityLockdownMode(i, "strict") 62 | end 63 | end 64 | 65 | -- CANCEL QUEUE 66 | RegisterServerEvent("pvpsystem:cancelQueue") 67 | AddEventHandler("pvpsystem:cancelQueue", function(id) 68 | -- CANCEL 1v1 QUEUE 69 | for i=#queue1v1,1,-1 do 70 | if queue1v1[i] == id then 71 | table.remove(queue1v1, i) 72 | break 73 | end 74 | end 75 | -- CANCEL 2v2 QUEUE 76 | for i=#queue2v2,1,-1 do 77 | if queue2v2[i] == id then 78 | table.remove(queue2v2, i) 79 | break 80 | end 81 | end 82 | TriggerClientEvent("pvpsystem:cancelCounter", id) 83 | end) 84 | 85 | 86 | -- ADD A PLAYER TO THE 1V1 QUEUE 87 | RegisterServerEvent("pvpsystem:counter1v1") 88 | AddEventHandler("pvpsystem:counter1v1", function() 89 | table.insert(queue1v1, source) 90 | end) 91 | 92 | -- ADD A TEAM TO THE 2V2 QUEUE 93 | RegisterServerEvent("pvpsystem:counter2v2") 94 | AddEventHandler("pvpsystem:counter2v2", function() 95 | table.insert(queue2v2, source) 96 | end) 97 | 98 | 99 | -- 1V1 WITH QUEUE 100 | Citizen.CreateThread(function() 101 | while true do 102 | if (#queue1v1>=2) then 103 | -- PLAYER 1 104 | function1v1(queue1v1[1], Config.firstSpawnCoords1v1[1], Config.firstSpawnCoords1v1[2], Config.firstSpawnCoords1v1[3], Config.firstSpawnCoords1v1Heading, dimension1v1) 105 | -- PLAYER 2 106 | function1v1(queue1v1[2], Config.secondSpawnCoords1v1[1], Config.secondSpawnCoords1v1[2], Config.secondSpawnCoords1v1[3], Config.secondSpawnCoords1v1Heading, dimension1v1) 107 | -- CHECK IF ANY PLAYER DIE 108 | TriggerEvent("pvpsystem:die1v1", queue1v1[1], queue1v1[2]) 109 | -- DIMENSIONS SETTINGS 110 | dimension1v1 = dimension1v1 + 1 111 | table.remove(queue1v1, 2) 112 | table.remove(queue1v1, 1) 113 | end 114 | Citizen.Wait(1200) 115 | end 116 | end) 117 | 118 | -- 1V1 WITHOUT QUEUE, NEEDS AN ID OF A FRIEND (EX: /1v1 [id]) 119 | RegisterServerEvent("pvpsystem:comargs") 120 | AddEventHandler("pvpsystem:comargs", function(player1, player2) 121 | dimension1v1 = dimension1v1 + 1 -- DIMENSIONS SETTINGS 122 | -- PLAYER 1 123 | function1v1(player1, Config.firstSpawnCoords1v1[1], Config.firstSpawnCoords1v1[2], Config.firstSpawnCoords1v1[3], Config.firstSpawnCoords1v1Heading, dimension1v1) 124 | -- PLAYER 2 125 | function1v1(tonumber(player2), Config.secondSpawnCoords1v1[1], Config.secondSpawnCoords1v1[2], Config.secondSpawnCoords1v1[3], Config.secondSpawnCoords1v1Heading, dimension1v1) 126 | -- CHECK IF ANY PLAYER DIE 127 | TriggerEvent("pvpsystem:die1v1", player1, player2) 128 | end) 129 | 130 | -- 1V1 COMMAND 131 | RegisterCommand("1v1", function(source, args) 132 | if (args[1]==nil) then 133 | TriggerClientEvent("pvpsystem:pvpqueue", source, 1) 134 | elseif (source==tonumber(args[1]) and Config.developerMode==false) then 135 | TriggerClientEvent("pvpsystem:notify", source, "You can't challenge yourself!", "error", 3000, false) 136 | else 137 | TriggerClientEvent("pvpsystem:request", args[1], source, args[1]) 138 | end 139 | end) 140 | 141 | -- 2V2 COMMAND 142 | RegisterCommand("2v2", function(source) 143 | TriggerClientEvent("pvpsystem:pvpqueue", source, 2) 144 | end) 145 | 146 | RegisterCommand("cancelQueue", function(source) 147 | TriggerEvent("pvpsystem:cancelQueue", source) 148 | TriggerClientEvent("pvpsystem:notify", source, "Queue canceled!", "primary", 3000, false) 149 | end) 150 | 151 | -- IF SOMEONE DIE THE PLAYERS GO TO A POINT (1V1) 152 | RegisterServerEvent("pvpsystem:die1v1") 153 | AddEventHandler("pvpsystem:die1v1", function(player1, player2) 154 | Citizen.CreateThread(function() 155 | while true do 156 | if (GetEntityHealth(GetPlayerPed(player1))<=healthlimit or GetEntityHealth(GetPlayerPed(player2))<=healthlimit) then 157 | if (GetEntityHealth(GetPlayerPed(player1))<=healthlimit) then 158 | TriggerClientEvent("pvpsystem:notify", player1, "You lost!", "success", 3000, true) 159 | TriggerClientEvent("pvpsystem:notify", player2, "You won!", "error", 3000, true) 160 | elseif (GetEntityHealth(GetPlayerPed(player2))<=healthlimit) then 161 | TriggerClientEvent("pvpsystem:notify", player2, "You won!", "success", 3000, true) 162 | TriggerClientEvent("pvpsystem:notify", player1, "You lost!", "error", 3000, true) 163 | end 164 | Citizen.Wait(4000) 165 | -- REVIVE PLAYERS 166 | revivePlayer(player1, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 167 | revivePlayer(player2, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 168 | TriggerClientEvent("pvpsystem:cancelCounter", player1) 169 | TriggerClientEvent("pvpsystem:cancelCounter", player2) 170 | break 171 | end 172 | Citizen.Wait(1) 173 | end 174 | end) 175 | end) 176 | 177 | -- 2v2 178 | Citizen.CreateThread(function() 179 | while true do 180 | if (#queue2v2>=4) then 181 | for i=1,4 do 182 | SetEntityCoords(queue2v2[i], Config.firstTeamSpawnCoords2v2[1], Config.firstTeamSpawnCoords2v2[2], Config.firstTeamSpawnCoords2v2[3], true, true, true, false) 183 | end 184 | SetEntityHeading(queue2v2[1], Config.firstTeamSpawnCoords2v2Heading) 185 | SetEntityHeading(queue2v2[2], Config.firstTeamSpawnCoords2v2Heading) 186 | SetEntityHeading(queue2v2[3], Config.secondTeamSpawnCoords2v2Heading) 187 | SetEntityHeading(queue2v2[4], Config.secondTeamSpawnCoords2v2Heading) 188 | for i=4,1,-1 do 189 | function2v2(queue2v2[i], dimension2v2) 190 | end 191 | TriggerEvent("pvpsystem:die2v2", queue2v2[1], queue2v2[2], queue2v2[3], queue2v2[4]) 192 | dimension2v2 = dimension2v2 + 1 193 | for i=4,1,-1 do 194 | table.remove(queue2v2, i) 195 | end 196 | end 197 | Citizen.Wait(1200) 198 | end 199 | end) 200 | 201 | -- IF A TEAM DIES, THE PLAYERS GO TO A POINT (2V2) 202 | RegisterServerEvent("pvpsystem:die2v2") 203 | AddEventHandler("pvpsystem:die2v2", function(player1, player2, player3, player4) -- TEAM 1 - PLAYER 1 AND 2 204 | Citizen.CreateThread(function() -- TEAM 2 - PLAYER 3 AND 4 205 | while true do 206 | if (GetEntityHealth(GetPlayerPed(player1))<=healthlimit and GetEntityHealth(GetPlayerPed(player2))<=healthlimit or GetEntityHealth(GetPlayerPed(player3))<=healthlimit and GetEntityHealth(GetPlayerPed(player4))<=healthlimit) then 207 | if (GetEntityHealth(GetPlayerPed(player1))<=healthlimit and GetEntityHealth(GetPlayerPed(player2))<=healthlimit) then 208 | TriggerClientEvent("pvpsystem:notify", player1, "You lost!", "error", 3000, true) 209 | TriggerClientEvent("pvpsystem:notify", player2, "You lost!", "error", 3000, true) 210 | TriggerClientEvent("pvpsystem:notify", player3, "You won!", "success", 3000, true) 211 | TriggerClientEvent("pvpsystem:notify", player4, "You won!", "success", 3000, true) 212 | elseif (GetEntityHealth(GetPlayerPed(player3))<=healthlimit and GetEntityHealth(GetPlayerPed(player4))<=healthlimit) then 213 | TriggerClientEvent("pvpsystem:notify", player4, "You lost!", "error", 3000, true) 214 | TriggerClientEvent("pvpsystem:notify", player3, "You lost!", "error", 3000, true) 215 | TriggerClientEvent("pvpsystem:notify", player2, "You won!", "success", 3000, true) 216 | TriggerClientEvent("pvpsystem:notify", player1, "You won!", "success", 3000, true) 217 | end 218 | Citizen.Wait(4000) 219 | revivePlayer(player1, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 220 | revivePlayer(player2, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 221 | revivePlayer(player3, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 222 | revivePlayer(player4, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 223 | break 224 | end 225 | Citizen.Wait(1) 226 | end 227 | end) 228 | end) 229 | 230 | -- WHEN THE DIMENSION REACHES THE LIMIT, IT RETURNS TO THE INITIAL NUMBER 231 | dimensions(dimension1v1, initialDimension1v1) -- 1v1 Dimension 232 | dimensions(dimension1v1, initialDimension2v2) -- 2v2 Dimension -------------------------------------------------------------------------------- /pvpsystem-qbcore/NUI/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /pvpsystem-qbcore/NUI/notify.js: -------------------------------------------------------------------------------- 1 | var n; 2 | $(document).ready(function () { 3 | window.addEventListener('message', function (event){ 4 | var data = event.data; 5 | if(data.action === "request") { 6 | Noty.closeAll(); 7 | n = new Noty({ 8 | type: 'notification', 9 | layout: 'topRight', 10 | text: data.text, 11 | timeout: data.time, 12 | theme: "mint", 13 | progressBar: true, 14 | buttons: [ 15 | Noty.button('Accept [Y]', 'btn btn-sm btn-success me-2', function () { 16 | n.close(); 17 | }), 18 | Noty.button('Deny [U]', 'btn btn-sm btn-danger', function () { 19 | n.close(); 20 | }) 21 | ] 22 | }).show(); 23 | } else if (data.close == true) { 24 | n.close(); 25 | } 26 | }) 27 | }); 28 | -------------------------------------------------------------------------------- /pvpsystem-qbcore/NUI/noty.css: -------------------------------------------------------------------------------- 1 | /* Noty.css -> Noty.js library */ 2 | 3 | .noty_layout_mixin, 4 | #noty_layout__top, 5 | #noty_layout__topLeft, 6 | #noty_layout__topCenter, 7 | #noty_layout__topRight, 8 | #noty_layout__bottom, 9 | #noty_layout__bottomLeft, 10 | #noty_layout__bottomCenter, 11 | #noty_layout__bottomRight, 12 | #noty_layout__center, 13 | #noty_layout__centerLeft, 14 | #noty_layout__centerRight { 15 | position: fixed; 16 | margin: 0; 17 | padding: 0; 18 | z-index: 9999999; 19 | -webkit-transform: translateZ(0) scale(1, 1); 20 | transform: translateZ(0) scale(1, 1); 21 | -webkit-backface-visibility: hidden; 22 | backface-visibility: hidden; 23 | -webkit-font-smoothing: subpixel-antialiased; 24 | filter: blur(0); 25 | -webkit-filter: blur(0); 26 | font-weight: bold; 27 | font-family: Arial, sans-serif; 28 | max-width: 90%; 29 | } 30 | 31 | #noty_layout__top { 32 | top: 0; 33 | left: 5%; 34 | width: 90%; 35 | } 36 | 37 | #noty_layout__topLeft { 38 | top: 20px; 39 | left: 20px; 40 | width: 325px; 41 | } 42 | 43 | #noty_layout__topCenter { 44 | top: 5%; 45 | left: 50%; 46 | width: 325px; 47 | -webkit-transform: translate(-webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 48 | transform: translate(calc(-50% - .5px)) translateZ(0) scale(1, 1); 49 | } 50 | 51 | #noty_layout__topRight { 52 | top: 20px; 53 | right: 20px; 54 | width: 325px; 55 | } 56 | 57 | #noty_layout__bottom { 58 | bottom: 0; 59 | left: 5%; 60 | width: 90%; 61 | } 62 | 63 | #noty_layout__bottomLeft { 64 | bottom: 20px; 65 | left: 20px; 66 | width: 325px; 67 | } 68 | 69 | #noty_layout__bottomCenter { 70 | bottom: 5%; 71 | left: 50%; 72 | width: 325px; 73 | -webkit-transform: translate(-webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 74 | transform: translate(calc(-50% - .5px)) translateZ(0) scale(1, 1); 75 | } 76 | 77 | #noty_layout__bottomRight { 78 | bottom: 20px; 79 | right: 20px; 80 | width: 325px; 81 | } 82 | 83 | #noty_layout__center { 84 | top: 50%; 85 | left: 50%; 86 | width: 325px; 87 | -webkit-transform: translate(-webkit-calc(-50% - .5px), -webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 88 | transform: translate(calc(-50% - .5px), calc(-50% - .5px)) translateZ(0) scale(1, 1); 89 | } 90 | 91 | #noty_layout__centerLeft { 92 | top: 50%; 93 | left: 20px; 94 | width: 325px; 95 | -webkit-transform: translate(0, -webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 96 | transform: translate(0, calc(-50% - .5px)) translateZ(0) scale(1, 1); 97 | } 98 | 99 | #noty_layout__centerRight { 100 | top: 50%; 101 | right: 20px; 102 | width: 325px; 103 | -webkit-transform: translate(0, -webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 104 | transform: translate(0, calc(-50% - .5px)) translateZ(0) scale(1, 1); 105 | } 106 | 107 | .noty_progressbar { 108 | display: none; 109 | } 110 | 111 | .noty_has_timeout.noty_has_progressbar .noty_progressbar { 112 | display: block; 113 | position: absolute; 114 | left: 0; 115 | bottom: 0; 116 | height: 3px; 117 | width: 100%; 118 | background-color: #b6c5f5; 119 | opacity: 0.6; 120 | filter: alpha(opacity=10); 121 | } 122 | 123 | .noty_bar { 124 | -webkit-backface-visibility: hidden; 125 | -webkit-transform: translate(0, 0) translateZ(0) scale(1, 1); 126 | -ms-transform: translate(0, 0) scale(1, 1); 127 | transform: translate(0, 0) scale(1, 1); 128 | -webkit-font-smoothing: subpixel-antialiased; 129 | overflow: hidden; 130 | } 131 | 132 | .noty_effects_open { 133 | opacity: 0; 134 | -webkit-transform: translate(50%); 135 | -ms-transform: translate(50%); 136 | transform: translate(50%); 137 | -webkit-animation: noty_anim_in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 138 | animation: noty_anim_in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 139 | -webkit-animation-fill-mode: forwards; 140 | animation-fill-mode: forwards; 141 | } 142 | 143 | .noty_effects_close { 144 | -webkit-animation: noty_anim_out 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 145 | animation: noty_anim_out 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 146 | -webkit-animation-fill-mode: forwards; 147 | animation-fill-mode: forwards; 148 | } 149 | 150 | .noty_fix_effects_height { 151 | -webkit-animation: noty_anim_height 75ms ease-out; 152 | animation: noty_anim_height 75ms ease-out; 153 | } 154 | 155 | .noty_close_with_click { 156 | cursor: pointer; 157 | } 158 | 159 | .noty_close_button { 160 | position: absolute; 161 | top: 2px; 162 | right: 2px; 163 | font-weight: bold; 164 | width: 20px; 165 | height: 20px; 166 | text-align: center; 167 | line-height: 20px; 168 | background-color: rgba(0, 0, 0, 0.05); 169 | border-radius: 2px; 170 | cursor: pointer; 171 | -webkit-transition: all .2s ease-out; 172 | transition: all .2s ease-out; 173 | } 174 | 175 | .noty_close_button:hover { 176 | background-color: rgba(0, 0, 0, 0.1); 177 | } 178 | 179 | .noty_modal { 180 | position: fixed; 181 | width: 100%; 182 | height: 100%; 183 | background-color: #000; 184 | z-index: 10000; 185 | opacity: .3; 186 | left: 0; 187 | top: 0; 188 | } 189 | 190 | .noty_modal.noty_modal_open { 191 | opacity: 0; 192 | -webkit-animation: noty_modal_in .3s ease-out; 193 | animation: noty_modal_in .3s ease-out; 194 | } 195 | 196 | .noty_modal.noty_modal_close { 197 | -webkit-animation: noty_modal_out .3s ease-out; 198 | animation: noty_modal_out .3s ease-out; 199 | -webkit-animation-fill-mode: forwards; 200 | animation-fill-mode: forwards; 201 | } 202 | 203 | @-webkit-keyframes noty_modal_in { 204 | 100% { 205 | opacity: .3; 206 | } 207 | } 208 | 209 | @keyframes noty_modal_in { 210 | 100% { 211 | opacity: .3; 212 | } 213 | } 214 | 215 | @-webkit-keyframes noty_modal_out { 216 | 100% { 217 | opacity: 0; 218 | } 219 | } 220 | 221 | @keyframes noty_modal_out { 222 | 100% { 223 | opacity: 0; 224 | } 225 | } 226 | 227 | @keyframes noty_modal_out { 228 | 100% { 229 | opacity: 0; 230 | } 231 | } 232 | 233 | @-webkit-keyframes noty_anim_in { 234 | 100% { 235 | -webkit-transform: translate(0); 236 | transform: translate(0); 237 | opacity: 1; 238 | } 239 | } 240 | 241 | @keyframes noty_anim_in { 242 | 100% { 243 | -webkit-transform: translate(0); 244 | transform: translate(0); 245 | opacity: 1; 246 | } 247 | } 248 | 249 | @-webkit-keyframes noty_anim_out { 250 | 100% { 251 | -webkit-transform: translate(50%); 252 | transform: translate(50%); 253 | opacity: 0; 254 | } 255 | } 256 | 257 | @keyframes noty_anim_out { 258 | 100% { 259 | -webkit-transform: translate(50%); 260 | transform: translate(50%); 261 | opacity: 0; 262 | } 263 | } 264 | 265 | @-webkit-keyframes noty_anim_height { 266 | 100% { 267 | height: 0; 268 | } 269 | } 270 | 271 | @keyframes noty_anim_height { 272 | 100% { 273 | height: 0; 274 | } 275 | } 276 | 277 | .noty_theme__relax.noty_bar { 278 | margin: 4px 0; 279 | overflow: hidden; 280 | border-radius: 2px; 281 | position: relative; 282 | } 283 | 284 | .noty_theme__relax.noty_bar .noty_body { 285 | padding: 10px; 286 | } 287 | 288 | .noty_theme__relax.noty_bar .noty_buttons { 289 | border-top: 1px solid #e7e7e7; 290 | padding: 5px 10px; 291 | } 292 | 293 | .noty_theme__relax.noty_type__alert, 294 | .noty_theme__relax.noty_type__notification { 295 | background-color: #fff; 296 | border: 1px solid #dedede; 297 | color: #444; 298 | } 299 | 300 | .noty_theme__relax.noty_type__warning { 301 | background-color: #FFEAA8; 302 | border: 1px solid #FFC237; 303 | color: #826200; 304 | } 305 | 306 | .noty_theme__relax.noty_type__warning .noty_buttons { 307 | border-color: #dfaa30; 308 | } 309 | 310 | .noty_theme__relax.noty_type__error { 311 | background-color: #FF8181; 312 | border: 1px solid #e25353; 313 | color: #FFF; 314 | } 315 | 316 | .noty_theme__relax.noty_type__error .noty_buttons { 317 | border-color: darkred; 318 | } 319 | 320 | .noty_theme__relax.noty_type__info, 321 | .noty_theme__relax.noty_type__information { 322 | background-color: #78C5E7; 323 | border: 1px solid #3badd6; 324 | color: #FFF; 325 | } 326 | 327 | .noty_theme__relax.noty_type__info .noty_buttons, 328 | .noty_theme__relax.noty_type__information .noty_buttons { 329 | border-color: #0B90C4; 330 | } 331 | 332 | .noty_theme__relax.noty_type__success { 333 | background-color: #BCF5BC; 334 | border: 1px solid #7cdd77; 335 | color: darkgreen; 336 | } 337 | 338 | .noty_theme__relax.noty_type__success .noty_buttons { 339 | border-color: #50C24E; 340 | } 341 | 342 | .noty_theme__metroui.noty_bar { 343 | margin: 4px 0; 344 | overflow: hidden; 345 | position: relative; 346 | box-shadow: rgba(0, 0, 0, 0.298039) 0 0 5px 0; 347 | } 348 | 349 | .noty_theme__metroui.noty_bar .noty_progressbar { 350 | position: absolute; 351 | left: 0; 352 | bottom: 0; 353 | height: 3px; 354 | width: 100%; 355 | background-color: #000; 356 | opacity: 0.2; 357 | filter: alpha(opacity=20); 358 | } 359 | 360 | .noty_theme__metroui.noty_bar .noty_body { 361 | padding: 1.25em; 362 | font-size: 14px; 363 | } 364 | 365 | .noty_theme__metroui.noty_bar .noty_buttons { 366 | padding: 0 10px .5em 10px; 367 | } 368 | 369 | .noty_theme__metroui.noty_type__alert, 370 | .noty_theme__metroui.noty_type__notification { 371 | background-color: #fff; 372 | color: #1d1d1d; 373 | } 374 | 375 | .noty_theme__metroui.noty_type__warning { 376 | background-color: #FA6800; 377 | color: #fff; 378 | } 379 | 380 | .noty_theme__metroui.noty_type__error { 381 | background-color: #CE352C; 382 | color: #FFF; 383 | } 384 | 385 | .noty_theme__metroui.noty_type__info, 386 | .noty_theme__metroui.noty_type__information { 387 | background-color: #1BA1E2; 388 | color: #FFF; 389 | } 390 | 391 | .noty_theme__metroui.noty_type__success { 392 | background-color: #60A917; 393 | color: #fff; 394 | } 395 | 396 | .noty_theme__mint.noty_bar { 397 | margin: 20px 4px 4px 0; 398 | overflow: hidden; 399 | border-radius: 2px; 400 | position: relative; 401 | } 402 | 403 | .noty_theme__mint.noty_bar .noty_body { 404 | padding: 10px; 405 | font-size: 14px; 406 | } 407 | 408 | .noty_theme__mint.noty_bar .noty_buttons { 409 | padding: 0px 0px 10px 10px; 410 | } 411 | 412 | .noty_theme__mint.noty_type__alert, 413 | .noty_theme__mint.noty_type__notification { 414 | background-color: rgba(49, 66, 82, 0.8); 415 | color: #ffffff; 416 | } 417 | 418 | .noty_theme__mint.noty_type__warning { 419 | background-color: #FFAE42; 420 | border-bottom: 1px solid #E89F3C; 421 | color: #fff; 422 | } 423 | 424 | .noty_theme__mint.noty_type__error { 425 | background-color: #DE636F; 426 | border-bottom: 1px solid #CA5A65; 427 | color: #fff; 428 | } 429 | 430 | .noty_theme__mint.noty_type__info, 431 | .noty_theme__mint.noty_type__information { 432 | background-color: #7F7EFF; 433 | border-bottom: 1px solid #7473E8; 434 | color: #fff; 435 | } 436 | 437 | .noty_theme__mint.noty_type__success { 438 | background-color: #AFC765; 439 | border-bottom: 1px solid #A0B55C; 440 | color: #fff; 441 | } 442 | 443 | .noty_theme__sunset.noty_bar { 444 | margin: 4px 0; 445 | overflow: hidden; 446 | border-radius: 2px; 447 | position: relative; 448 | } 449 | 450 | .noty_theme__sunset.noty_bar .noty_body { 451 | padding: 10px; 452 | font-size: 14px; 453 | text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); 454 | } 455 | 456 | .noty_theme__sunset.noty_bar .noty_buttons { 457 | padding: 10px; 458 | } 459 | 460 | .noty_theme__sunset.noty_type__alert, 461 | .noty_theme__sunset.noty_type__notification { 462 | background-color: #073B4C; 463 | color: #fff; 464 | } 465 | 466 | .noty_theme__sunset.noty_type__alert .noty_progressbar, 467 | .noty_theme__sunset.noty_type__notification .noty_progressbar { 468 | background-color: #fff; 469 | } 470 | 471 | .noty_theme__sunset.noty_type__warning { 472 | background-color: #FFD166; 473 | color: #fff; 474 | } 475 | 476 | .noty_theme__sunset.noty_type__error { 477 | background-color: #EF476F; 478 | color: #fff; 479 | } 480 | 481 | .noty_theme__sunset.noty_type__error .noty_progressbar { 482 | opacity: .4; 483 | } 484 | 485 | .noty_theme__sunset.noty_type__info, 486 | .noty_theme__sunset.noty_type__information { 487 | background-color: #118AB2; 488 | color: #fff; 489 | } 490 | 491 | .noty_theme__sunset.noty_type__info .noty_progressbar, 492 | .noty_theme__sunset.noty_type__information .noty_progressbar { 493 | opacity: .6; 494 | } 495 | 496 | .noty_theme__sunset.noty_type__success { 497 | background-color: #06D6A0; 498 | color: #fff; 499 | } 500 | 501 | .noty_theme__bootstrap-v3.noty_bar { 502 | margin: 4px 0; 503 | overflow: hidden; 504 | position: relative; 505 | border: 1px solid transparent; 506 | border-radius: 4px; 507 | } 508 | 509 | .noty_theme__bootstrap-v3.noty_bar .noty_body { 510 | padding: 15px; 511 | } 512 | 513 | .noty_theme__bootstrap-v3.noty_bar .noty_buttons { 514 | padding: 10px; 515 | } 516 | 517 | .noty_theme__bootstrap-v3.noty_bar .noty_close_button { 518 | font-size: 21px; 519 | font-weight: 700; 520 | line-height: 1; 521 | color: #000; 522 | text-shadow: 0 1px 0 #fff; 523 | filter: alpha(opacity=20); 524 | opacity: .2; 525 | background: transparent; 526 | } 527 | 528 | .noty_theme__bootstrap-v3.noty_bar .noty_close_button:hover { 529 | background: transparent; 530 | text-decoration: none; 531 | cursor: pointer; 532 | filter: alpha(opacity=50); 533 | opacity: .5; 534 | } 535 | 536 | .noty_theme__bootstrap-v3.noty_type__alert, 537 | .noty_theme__bootstrap-v3.noty_type__notification { 538 | background-color: #fff; 539 | color: inherit; 540 | } 541 | 542 | .noty_theme__bootstrap-v3.noty_type__warning { 543 | background-color: #fcf8e3; 544 | color: #8a6d3b; 545 | border-color: #faebcc; 546 | } 547 | 548 | .noty_theme__bootstrap-v3.noty_type__error { 549 | background-color: #f2dede; 550 | color: #a94442; 551 | border-color: #ebccd1; 552 | } 553 | 554 | .noty_theme__bootstrap-v3.noty_type__info, 555 | .noty_theme__bootstrap-v3.noty_type__information { 556 | background-color: #d9edf7; 557 | color: #31708f; 558 | border-color: #bce8f1; 559 | } 560 | 561 | .noty_theme__bootstrap-v3.noty_type__success { 562 | background-color: #dff0d8; 563 | color: #3c763d; 564 | border-color: #d6e9c6; 565 | } 566 | 567 | .noty_theme__bootstrap-v4.noty_bar { 568 | margin: 4px 0; 569 | overflow: hidden; 570 | position: relative; 571 | border: 1px solid transparent; 572 | border-radius: .25rem; 573 | } 574 | 575 | .noty_theme__bootstrap-v4.noty_bar .noty_body { 576 | padding: .75rem 1.25rem; 577 | } 578 | 579 | .noty_theme__bootstrap-v4.noty_bar .noty_buttons { 580 | padding: 10px; 581 | } 582 | 583 | .noty_theme__bootstrap-v4.noty_bar .noty_close_button { 584 | font-size: 1.5rem; 585 | font-weight: 700; 586 | line-height: 1; 587 | color: #000; 588 | text-shadow: 0 1px 0 #fff; 589 | filter: alpha(opacity=20); 590 | opacity: .5; 591 | background: transparent; 592 | } 593 | 594 | .noty_theme__bootstrap-v4.noty_bar .noty_close_button:hover { 595 | background: transparent; 596 | text-decoration: none; 597 | cursor: pointer; 598 | filter: alpha(opacity=50); 599 | opacity: .75; 600 | } 601 | 602 | .noty_theme__bootstrap-v4.noty_type__alert, 603 | .noty_theme__bootstrap-v4.noty_type__notification { 604 | background-color: #fff; 605 | color: inherit; 606 | } 607 | 608 | .noty_theme__bootstrap-v4.noty_type__warning { 609 | background-color: #fcf8e3; 610 | color: #8a6d3b; 611 | border-color: #faebcc; 612 | } 613 | 614 | .noty_theme__bootstrap-v4.noty_type__error { 615 | background-color: #f2dede; 616 | color: #a94442; 617 | border-color: #ebccd1; 618 | } 619 | 620 | .noty_theme__bootstrap-v4.noty_type__info, 621 | .noty_theme__bootstrap-v4.noty_type__information { 622 | background-color: #d9edf7; 623 | color: #31708f; 624 | border-color: #bce8f1; 625 | } 626 | 627 | .noty_theme__bootstrap-v4.noty_type__success { 628 | background-color: #dff0d8; 629 | color: #3c763d; 630 | border-color: #d6e9c6; 631 | } 632 | 633 | .noty_theme__semanticui.noty_bar { 634 | margin: 4px 0; 635 | overflow: hidden; 636 | position: relative; 637 | border: 1px solid transparent; 638 | font-size: 1em; 639 | border-radius: .28571429rem; 640 | box-shadow: 0 0 0 1px rgba(34, 36, 38, 0.22) inset, 0 0 0 0 transparent; 641 | } 642 | 643 | .noty_theme__semanticui.noty_bar .noty_body { 644 | padding: 1em 1.5em; 645 | line-height: 1.4285em; 646 | } 647 | 648 | .noty_theme__semanticui.noty_bar .noty_buttons { 649 | padding: 10px; 650 | } 651 | 652 | .noty_theme__semanticui.noty_type__alert, 653 | .noty_theme__semanticui.noty_type__notification { 654 | background-color: #f8f8f9; 655 | color: rgba(0, 0, 0, 0.87); 656 | } 657 | 658 | .noty_theme__semanticui.noty_type__warning { 659 | background-color: #fffaf3; 660 | color: #573a08; 661 | box-shadow: 0 0 0 1px #c9ba9b inset, 0 0 0 0 transparent; 662 | } 663 | 664 | .noty_theme__semanticui.noty_type__error { 665 | background-color: #fff6f6; 666 | color: #9f3a38; 667 | box-shadow: 0 0 0 1px #e0b4b4 inset, 0 0 0 0 transparent; 668 | } 669 | 670 | .noty_theme__semanticui.noty_type__info, 671 | .noty_theme__semanticui.noty_type__information { 672 | background-color: #f8ffff; 673 | color: #276f86; 674 | box-shadow: 0 0 0 1px #a9d5de inset, 0 0 0 0 transparent; 675 | } 676 | 677 | .noty_theme__semanticui.noty_type__success { 678 | background-color: #fcfff5; 679 | color: #2c662d; 680 | box-shadow: 0 0 0 1px #a3c293 inset, 0 0 0 0 transparent; 681 | } 682 | 683 | .noty_theme__nest.noty_bar { 684 | margin: 0 0 15px 0; 685 | overflow: hidden; 686 | border-radius: 2px; 687 | position: relative; 688 | box-shadow: rgba(0, 0, 0, 0.098039) 5px 4px 10px 0; 689 | } 690 | 691 | .noty_theme__nest.noty_bar .noty_body { 692 | padding: 10px; 693 | font-size: 14px; 694 | text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); 695 | } 696 | 697 | .noty_theme__nest.noty_bar .noty_buttons { 698 | padding: 10px; 699 | } 700 | 701 | .noty_layout .noty_theme__nest.noty_bar { 702 | z-index: 5; 703 | } 704 | 705 | .noty_layout .noty_theme__nest.noty_bar:nth-child(2) { 706 | position: absolute; 707 | top: 0; 708 | margin-top: 4px; 709 | margin-right: -4px; 710 | margin-left: 4px; 711 | z-index: 4; 712 | width: 100%; 713 | } 714 | 715 | .noty_layout .noty_theme__nest.noty_bar:nth-child(3) { 716 | position: absolute; 717 | top: 0; 718 | margin-top: 8px; 719 | margin-right: -8px; 720 | margin-left: 8px; 721 | z-index: 3; 722 | width: 100%; 723 | } 724 | 725 | .noty_layout .noty_theme__nest.noty_bar:nth-child(4) { 726 | position: absolute; 727 | top: 0; 728 | margin-top: 12px; 729 | margin-right: -12px; 730 | margin-left: 12px; 731 | z-index: 2; 732 | width: 100%; 733 | } 734 | 735 | .noty_layout .noty_theme__nest.noty_bar:nth-child(5) { 736 | position: absolute; 737 | top: 0; 738 | margin-top: 16px; 739 | margin-right: -16px; 740 | margin-left: 16px; 741 | z-index: 1; 742 | width: 100%; 743 | } 744 | 745 | .noty_layout .noty_theme__nest.noty_bar:nth-child(n+6) { 746 | position: absolute; 747 | top: 0; 748 | margin-top: 20px; 749 | margin-right: -20px; 750 | margin-left: 20px; 751 | z-index: -1; 752 | width: 100%; 753 | } 754 | 755 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(2), 756 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(2) { 757 | margin-top: 4px; 758 | margin-left: -4px; 759 | margin-right: 4px; 760 | } 761 | 762 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(3), 763 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(3) { 764 | margin-top: 8px; 765 | margin-left: -8px; 766 | margin-right: 8px; 767 | } 768 | 769 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(4), 770 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(4) { 771 | margin-top: 12px; 772 | margin-left: -12px; 773 | margin-right: 12px; 774 | } 775 | 776 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(5), 777 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(5) { 778 | margin-top: 16px; 779 | margin-left: -16px; 780 | margin-right: 16px; 781 | } 782 | 783 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(n+6), 784 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(n+6) { 785 | margin-top: 20px; 786 | margin-left: -20px; 787 | margin-right: 20px; 788 | } 789 | 790 | .noty_theme__nest.noty_type__alert, 791 | .noty_theme__nest.noty_type__notification { 792 | background-color: #073B4C; 793 | color: #fff; 794 | } 795 | 796 | .noty_theme__nest.noty_type__alert .noty_progressbar, 797 | .noty_theme__nest.noty_type__notification .noty_progressbar { 798 | background-color: #fff; 799 | } 800 | 801 | .noty_theme__nest.noty_type__warning { 802 | background-color: #FFD166; 803 | color: #fff; 804 | } 805 | 806 | .noty_theme__nest.noty_type__error { 807 | background-color: #EF476F; 808 | color: #fff; 809 | } 810 | 811 | .noty_theme__nest.noty_type__error .noty_progressbar { 812 | opacity: .4; 813 | } 814 | 815 | .noty_theme__nest.noty_type__info, 816 | .noty_theme__nest.noty_type__information { 817 | background-color: #118AB2; 818 | color: #fff; 819 | } 820 | 821 | .noty_theme__nest.noty_type__info .noty_progressbar, 822 | .noty_theme__nest.noty_type__information .noty_progressbar { 823 | opacity: .6; 824 | } 825 | 826 | .noty_theme__nest.noty_type__success { 827 | background-color: #06D6A0; 828 | color: #fff; 829 | } 830 | 831 | .noty_theme__light.noty_bar { 832 | margin: 4px 0; 833 | overflow: hidden; 834 | border-radius: 2px; 835 | position: relative; 836 | } 837 | 838 | .noty_theme__light.noty_bar .noty_body { 839 | padding: 10px; 840 | } 841 | 842 | .noty_theme__light.noty_bar .noty_buttons { 843 | border-top: 1px solid #e7e7e7; 844 | padding: 5px 10px; 845 | } 846 | 847 | .noty_theme__light.noty_type__alert, 848 | .noty_theme__light.noty_type__notification { 849 | background-color: #fff; 850 | border: 1px solid #dedede; 851 | color: #444; 852 | } 853 | 854 | .noty_theme__light.noty_type__warning { 855 | background-color: #FFEAA8; 856 | border: 1px solid #FFC237; 857 | color: #826200; 858 | } 859 | 860 | .noty_theme__light.noty_type__warning .noty_buttons { 861 | border-color: #dfaa30; 862 | } 863 | 864 | .noty_theme__light.noty_type__error { 865 | background-color: #ED7000; 866 | border: 1px solid #e25353; 867 | color: #FFF; 868 | } 869 | 870 | .noty_theme__light.noty_type__error .noty_buttons { 871 | border-color: darkred; 872 | } 873 | 874 | .noty_theme__light.noty_type__info, 875 | .noty_theme__light.noty_type__information { 876 | background-color: #78C5E7; 877 | border: 1px solid #3badd6; 878 | color: #FFF; 879 | } 880 | 881 | .noty_theme__light.noty_type__info .noty_buttons, 882 | .noty_theme__light.noty_type__information .noty_buttons { 883 | border-color: #0B90C4; 884 | } 885 | 886 | .noty_theme__light.noty_type__success { 887 | background-color: #57C880; 888 | border: 1px solid #7cdd77; 889 | color: darkgreen; 890 | } 891 | 892 | .noty_theme__light.noty_type__success .noty_buttons { 893 | border-color: #50C24E; 894 | } 895 | 896 | /*# sourceMappingURL=noty.css.map*/ 897 | -------------------------------------------------------------------------------- /pvpsystem-qbcore/client.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | 3 | counter = 0 -- IF COUNTER EQUALS 1 THE PLAYER IS IN THE QUEUE 4 | 5 | -- MESSAGES 6 | RegisterNetEvent("pvpsystem:notify") 7 | AddEventHandler("pvpsystem:notify", function(text, typeMsg, time, heading) 8 | QBCore.Functions.Notify(text, typeMsg, time) 9 | if heading then SetGameplayCamRelativeHeading(0) end 10 | end) 11 | 12 | RegisterNetEvent("pvpsystem:cancelCounter") 13 | AddEventHandler("pvpsystem:cancelCounter", function() 14 | counter = 0 15 | end) 16 | 17 | -- ADD PLAYER TO A QUEUE 18 | RegisterNetEvent("pvpsystem:pvpqueue") 19 | AddEventHandler("pvpsystem:pvpqueue", function(ident, player, args) 20 | if LocalPlayer.state['isLoggedIn'] then 21 | if (args==nil) then 22 | if (ident==1) then 23 | if (counter == 0) then 24 | QBCore.Functions.Notify("You joined the queue (1v1)", "success", 3000) 25 | TriggerServerEvent("pvpsystem:counter1v1", source) 26 | if (Config.developerMode == false) then 27 | counter = 1 28 | end 29 | else 30 | QBCore.Functions.Notify("You are already in a queue", "error", 3000) 31 | end 32 | else 33 | if (counter == 0) then 34 | QBCore.Functions.Notify("You joined the queue (2v2)", "success", 3000) 35 | TriggerServerEvent("pvpsystem:counter2v2", source) 36 | if (Config.developerMode == false) then 37 | counter = 1 38 | end 39 | else 40 | QBCore.Functions.Notify("You are already in a queue", "error", 3000) 41 | end 42 | end 43 | else 44 | if (counter == 0) then 45 | TriggerServerEvent("pvpsystem:comargs", player, args) 46 | if (Config.developerMode == false) then 47 | counter = 1 48 | end 49 | end 50 | end 51 | end 52 | end) 53 | 54 | -- REVIVE PLAYER 55 | RegisterNetEvent("pvpsystem:revive") 56 | AddEventHandler("pvpsystem:revive", function(id) 57 | NetworkResurrectLocalPlayer(-1497.45, 139.64, 55.65, true, true, false) 58 | SetEntityHealth(GetPlayerFromServerId(id), 200) 59 | end) 60 | 61 | RegisterNetEvent("pvpsystem:heal") 62 | AddEventHandler("pvpsystem:heal", function(id) 63 | SetEntityHealth(GetPlayerFromServerId(id), 200) 64 | end) 65 | 66 | RegisterNetEvent("pvpsystem:request") 67 | AddEventHandler("pvpsystem:request", function(id1, id2, rounds) 68 | if LocalPlayer.state['isLoggedIn'] then 69 | notification("pvpsystem:comargs", true, id1, id2, rounds, 30000, "1v1 Challenge! [ID] ".. id1) 70 | end 71 | end) 72 | 73 | function notification(trigger, isServer, params1, params2, params3, time, text) 74 | SendNUIMessage({ 75 | action = "request", 76 | text = text, 77 | time = time 78 | }) 79 | local time2 = time - 1 80 | Citizen.SetTimeout(time, function() 81 | time2 = time + 1 82 | end) 83 | while time > time2 do 84 | if IsControlJustPressed(1, 246) then -- IF PRESSED Y 85 | if isServer == true then 86 | TriggerServerEvent(trigger, params1, params2, params3) 87 | SendNUIMessage({close = true}) 88 | break 89 | else 90 | TriggerEvent(trigger, params1, params2, params3) 91 | SendNUIMessage({close = true}) 92 | break 93 | end 94 | elseif IsControlJustPressed(1, 303) then -- IF PRESSED U 95 | SendNUIMessage({close = true}) 96 | break 97 | end 98 | Wait(1) 99 | end 100 | end -------------------------------------------------------------------------------- /pvpsystem-qbcore/config.lua: -------------------------------------------------------------------------------- 1 | -- CONFIG FILE -- PvP System 2 | Config = {} 3 | 4 | -- DEVELOPER MODE - IF YOU ARE TESTING WITHOUT ANOTHER PLAYER: TRUE - PLAYER IS ENABLE TO JOIN IN A QUEUE MORE THAN 1 TIME 5 | Config.developerMode = false 6 | 7 | -- ENABLE VEHICLES IN SOME DIMENSION 8 | Config.disableVehicles = true -- This resource disable the spawn of vehicles in some pvp dimensions. To disable this turn the variable to false. 9 | 10 | -- WEAPONS - Default: Pistol MK2 = "weapon_pistol_mk2" 11 | Config.weapon1v1 = "weapon_pistol_mk2" -- Weapon 1v1 12 | Config.weapon2v2 = "weapon_pistol_mk2" -- Weapon 2v2 13 | 14 | -- COORDS 15 | Config.respawnCoords = {-1497.45, 139.64, 55.65} -- Respawn point coords // {X, Y, Z} 16 | Config.respawnCoordsHeading = 314.48 -- Sets a point for the player to look at when teleported 17 | 18 | Config.firstSpawnCoords1v1 = {-1748.63, 175.88, 64.37} -- First spawn point coords of 1v1 arena // {X, Y, Z} 19 | Config.firstSpawnCoords1v1Heading = 210.26 -- Sets a point for the player to look at when teleported 20 | Config.secondSpawnCoords1v1 = {-1727.01, 145.06, 64.4} -- Second spawn point coords of 1v1 arena // {X, Y, Z} 21 | Config.secondSpawnCoords1v1Heading = 38.05 -- Sets a point for the player to look at when teleported 22 | 23 | Config.firstTeamSpawnCoords2v2 = {1214.89, 3115.29, 40.41} -- (Team 1) First spawn point coords of 2v2 arena // {X, Y, Z} 24 | Config.firstTeamSpawnCoords2v2Heading = 286.34 -- Sets a point for the player to look at when teleported 25 | Config.secondTeamSpawnCoords2v2 = {1115.73, 3090.54, 40.41} -- (Team 2) Third spawn point coords of 2v2 arena // {X, Y, Z} 26 | Config.secondTeamSpawnCoords2v2Heading = 108.94 -- Sets a point for the player to look at when teleported -------------------------------------------------------------------------------- /pvpsystem-qbcore/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'cerulean' 2 | games {'gta5'} 3 | 4 | name 'pvpsystem' 5 | description 'PvP System (1V1, 2V2)' 6 | version '1.3' 7 | 8 | server_scripts { 9 | 'config.lua', 10 | 'server.lua' 11 | } 12 | 13 | client_scripts { 14 | 'config.lua', 15 | 'client.lua' 16 | } 17 | 18 | ui_page 'NUI/index.html' 19 | 20 | files { 21 | 'NUI/*' 22 | } 23 | 24 | dependency 'qb-core' -------------------------------------------------------------------------------- /pvpsystem-qbcore/server.lua: -------------------------------------------------------------------------------- 1 | -- FUNCTIONS 2 | function function1v1(player, x, y, z, heading, dimension) 3 | SetEntityCoords(player, x, y, z, false, true, true, false) 4 | SetEntityHeading(player, heading) 5 | SetPlayerRoutingBucket(player, dimension) -- DIMENSION 6 | RemoveAllPedWeapons(player, false) 7 | GiveWeaponToPed(player, GetHashKey(Config.weapon1v1), 200, true) 8 | SetCurrentPedWeapon(player, GetHashKey(Config.weapon1v1), true) 9 | TriggerClientEvent("pvpsystem:notify", player, "You are in the arena: #1", "success", 3000, true) 10 | end 11 | 12 | function function2v2(player, dimension) 13 | SetPlayerRoutingBucket(player, dimension) 14 | RemoveAllPedWeapons(player, false) 15 | GiveWeaponToPed(player, GetHashKey(Config.weapon2v2), 200, true) 16 | SetCurrentPedWeapon(player, GetHashKey(Config.weapon2v2), true) 17 | TriggerClientEvent("pvpsystem:notify", player, "You are in the arena: #2", "success", 3000, true) 18 | end 19 | 20 | function revivePlayer(player, x, y, z, heading) 21 | SetEntityCoords(player, x, y, z, false, true, true, false) 22 | SetEntityHeading(player, heading) 23 | SetPlayerRoutingBucket(player, 0) 24 | TriggerClientEvent("pvpsystem:revive", player, player) 25 | TriggerClientEvent("hospital:client:Revive", player) 26 | end 27 | 28 | function dimensions(dimension, initialDimension) 29 | Citizen.CreateThread(function() 30 | while true do 31 | if (dimension==(initialDimension+301)) then 32 | dimension=initialDimension 33 | end 34 | Citizen.Wait(10) 35 | end 36 | end) 37 | end 38 | 39 | -- VARS 40 | id = nil 41 | -- HEALTH LIMIT TO GET IN COMA (DIE) 42 | healthlimit = 0 -- CHANGE TO HEALTH LIMIT OF YOUR SERVER IF DOESN'T WORK 43 | 44 | -- VARS TO 1v1 45 | count = 1 46 | queue1v1 = {} 47 | initialDimension1v1 = 1000 48 | dimension1v1 = initialDimension1v1 -- INITIAL DIMENSION 1V1 49 | 50 | -- VARS TO 2v2 51 | queue2v2={} 52 | initialDimension2v2 = 1000 53 | dimension2v2 = initialDimension2v2 -- INITIAL DIMENSION 2V2 54 | 55 | -- DISABLE VEHICLES IN THE SOME DIMENSIONS 56 | if Config.disableVehicles then 57 | for i = (initialDimension1v1+300),initialDimension1v1,-1 do 58 | SetRoutingBucketEntityLockdownMode(i, "strict") 59 | end 60 | for i = (initialDimension2v2+300),initialDimension2v2,-1 do 61 | SetRoutingBucketEntityLockdownMode(i, "strict") 62 | end 63 | end 64 | 65 | -- CANCEL QUEUE 66 | RegisterServerEvent("pvpsystem:cancelQueue") 67 | AddEventHandler("pvpsystem:cancelQueue", function(id) 68 | -- CANCEL 1v1 QUEUE 69 | for i=#queue1v1,1,-1 do 70 | if queue1v1[i] == id then 71 | table.remove(queue1v1, i) 72 | break 73 | end 74 | end 75 | -- CANCEL 2v2 QUEUE 76 | for i=#queue2v2,1,-1 do 77 | if queue2v2[i] == id then 78 | table.remove(queue2v2, i) 79 | break 80 | end 81 | end 82 | TriggerClientEvent("pvpsystem:cancelCounter", id) 83 | end) 84 | 85 | -- ADD A PLAYER TO THE 1V1 QUEUE 86 | RegisterServerEvent("pvpsystem:counter1v1") 87 | AddEventHandler("pvpsystem:counter1v1", function() 88 | table.insert(queue1v1, source) 89 | end) 90 | 91 | -- ADD A TEAM TO THE 2V2 QUEUE 92 | RegisterServerEvent("pvpsystem:counter2v2") 93 | AddEventHandler("pvpsystem:counter2v2", function() 94 | table.insert(queue2v2, source) 95 | end) 96 | 97 | 98 | -- 1V1 WITH QUEUE 99 | Citizen.CreateThread(function() 100 | while true do 101 | if (#queue1v1>=2) then 102 | -- PLAYER 1 103 | function1v1(queue1v1[1], Config.firstSpawnCoords1v1[1], Config.firstSpawnCoords1v1[2], Config.firstSpawnCoords1v1[3], Config.firstSpawnCoords1v1Heading, dimension1v1) 104 | -- PLAYER 2 105 | function1v1(queue1v1[2], Config.secondSpawnCoords1v1[1], Config.secondSpawnCoords1v1[2], Config.secondSpawnCoords1v1[3], Config.secondSpawnCoords1v1Heading, dimension1v1) 106 | -- CHECK IF ANY PLAYER DIE 107 | TriggerEvent("pvpsystem:die1v1", queue1v1[1], queue1v1[2]) 108 | -- DIMENSIONS SETTINGS 109 | dimension1v1 = dimension1v1 + 1 110 | table.remove(queue1v1, 2) 111 | table.remove(queue1v1, 1) 112 | end 113 | Citizen.Wait(1200) 114 | end 115 | end) 116 | 117 | -- 1V1 WITHOUT QUEUE, NEEDS AN ID OF A FRIEND (EX: /1v1 [id] [rounds]) 118 | RegisterServerEvent("pvpsystem:comargs") 119 | AddEventHandler("pvpsystem:comargs", function(player1, player2, rounds) 120 | if rounds == nil then 121 | rounds = 1 122 | end 123 | dimension1v1 = dimension1v1 + 1 -- DIMENSIONS SETTINGS 124 | -- PLAYER 1 125 | function1v1(player1, Config.firstSpawnCoords1v1[1], Config.firstSpawnCoords1v1[2], Config.firstSpawnCoords1v1[3], Config.firstSpawnCoords1v1Heading, dimension1v1) 126 | -- PLAYER 2 127 | function1v1(player2, Config.secondSpawnCoords1v1[1], Config.secondSpawnCoords1v1[2], Config.secondSpawnCoords1v1[3], Config.secondSpawnCoords1v1Heading, dimension1v1) 128 | -- CHECK IF ANY PLAYER DIE 129 | TriggerEvent("pvpsystem:die1v1", player1, player2, rounds) 130 | end) 131 | 132 | -- 1V1 COMMAND 133 | RegisterCommand("1v1", function(source, args) 134 | if args[1]~=nil then 135 | idRequested = tonumber(args[1]) 136 | end 137 | if args[2]~=nil then 138 | rounds = tonumber(args[2]) 139 | else 140 | rounds = 1 141 | end 142 | if (idRequested==nil) then 143 | TriggerClientEvent("pvpsystem:pvpqueue", source, 1) 144 | elseif (rounds<=0 or type(rounds) ~= "number") then 145 | TriggerClientEvent("pvpsystem:notify", source, "Invalid number!", "error", 3000, false) 146 | elseif (source==idRequested and Config.developerMode==false) then 147 | TriggerClientEvent("pvpsystem:notify", source, "You can't challenge yourself!", "error", 3000, false) 148 | else 149 | TriggerClientEvent("pvpsystem:request", idRequested, source, idRequested, rounds) 150 | end 151 | end) 152 | 153 | -- 2V2 COMMAND 154 | RegisterCommand("2v2", function(source) 155 | TriggerClientEvent("pvpsystem:pvpqueue", source, 2) 156 | end) 157 | 158 | RegisterCommand("cancelQueue", function(source) 159 | TriggerEvent("pvpsystem:cancelQueue", source) 160 | TriggerClientEvent("pvpsystem:notify", source, "Queue canceled!", "primary", 3000, false) 161 | end) 162 | 163 | -- IF SOMEONE DIE THE PLAYERS GO TO A POINT (1V1) 164 | RegisterServerEvent("pvpsystem:die1v1") 165 | AddEventHandler("pvpsystem:die1v1", function(player1, player2, rounds) 166 | Citizen.CreateThread(function() 167 | while true do 168 | if (GetEntityHealth(GetPlayerPed(player1))<=healthlimit or GetEntityHealth(GetPlayerPed(player2))<=healthlimit) then 169 | if (GetEntityHealth(GetPlayerPed(player1))<=healthlimit) then 170 | TriggerClientEvent("pvpsystem:notify", player1, "You lost", "error", 3000, true) 171 | TriggerClientEvent("pvpsystem:notify", player2, "You won!", "success", 3000, true) 172 | elseif (GetEntityHealth(GetPlayerPed(player2))<=healthlimit) then 173 | TriggerClientEvent("pvpsystem:notify", player1, "You won!", "success", 3000, true) 174 | TriggerClientEvent("pvpsystem:notify", player2, "You lost!", "error", 3000, true) 175 | end 176 | Citizen.Wait(5000) 177 | if rounds > 1 then 178 | -- REVIVE PLAYERS 179 | revivePlayer(player1, Config.firstSpawnCoords1v1[1], Config.firstSpawnCoords1v1[2], Config.firstSpawnCoords1v1[3], Config.firstSpawnCoords1v1Heading) 180 | revivePlayer(player2, Config.secondSpawnCoords1v1[1], Config.secondSpawnCoords1v1[2], Config.secondSpawnCoords1v1[3], Config.secondSpawnCoords1v1Heading) 181 | TriggerEvent("pvpsystem:comargs", player1, player2, rounds-1) 182 | else 183 | -- REVIVE PLAYERS 184 | revivePlayer(player1, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 185 | revivePlayer(player2, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 186 | TriggerClientEvent("pvpsystem:cancelCounter", player1) 187 | TriggerClientEvent("pvpsystem:cancelCounter", player2) 188 | end 189 | break 190 | end 191 | Citizen.Wait(1) 192 | end 193 | end) 194 | end) 195 | 196 | -- 2v2 197 | Citizen.CreateThread(function() 198 | while true do 199 | if (#queue2v2>=4) then 200 | for i=1,4 do 201 | SetEntityCoords(queue2v2[i], Config.firstTeamSpawnCoords2v2[1], Config.firstTeamSpawnCoords2v2[2], Config.firstTeamSpawnCoords2v2[3], true, true, true, false) 202 | end 203 | SetEntityHeading(queue2v2[1], Config.firstTeamSpawnCoords2v2Heading) 204 | SetEntityHeading(queue2v2[2], Config.firstTeamSpawnCoords2v2Heading) 205 | SetEntityHeading(queue2v2[3], Config.secondTeamSpawnCoords2v2Heading) 206 | SetEntityHeading(queue2v2[4], Config.secondTeamSpawnCoords2v2Heading) 207 | for i=4,1,-1 do 208 | function2v2(queue2v2[i], dimension2v2) 209 | end 210 | TriggerEvent("pvpsystem:die2v2", queue2v2[1], queue2v2[2], queue2v2[3], queue2v2[4]) 211 | dimension2v2 = dimension2v2 + 1 212 | for i=4,1,-1 do 213 | table.remove(queue2v2, i) 214 | end 215 | end 216 | Citizen.Wait(1200) 217 | end 218 | end) 219 | 220 | -- IF A TEAM DIES, THE PLAYERS GO TO A POINT (2V2) 221 | RegisterServerEvent("pvpsystem:die2v2") 222 | AddEventHandler("pvpsystem:die2v2", function(player1, player2, player3, player4) -- TEAM 1 - PLAYER 1 AND 2 223 | Citizen.CreateThread(function() -- TEAM 2 - PLAYER 3 AND 4 224 | while true do 225 | if (GetEntityHealth(GetPlayerPed(player1))<=healthlimit and GetEntityHealth(GetPlayerPed(player2))<=healthlimit or GetEntityHealth(GetPlayerPed(player3))<=healthlimit and GetEntityHealth(GetPlayerPed(player4))<=healthlimit) then 226 | if (GetEntityHealth(GetPlayerPed(player1))<=healthlimit and GetEntityHealth(GetPlayerPed(player2))<=healthlimit) then 227 | TriggerClientEvent("pvpsystem:notify", player1, "You lost!", "error", 3000, true) 228 | TriggerClientEvent("pvpsystem:notify", player2, "You lost!", "error", 3000, true) 229 | TriggerClientEvent("pvpsystem:notify", player3, "You won!", "success", 3000, true) 230 | TriggerClientEvent("pvpsystem:notify", player4, "You won!", "success", 3000, true) 231 | elseif (GetEntityHealth(GetPlayerPed(player3))<=healthlimit and GetEntityHealth(GetPlayerPed(player4))<=healthlimit) then 232 | TriggerClientEvent("pvpsystem:notify", player4, "You lost!", "error", 3000, true) 233 | TriggerClientEvent("pvpsystem:notify", player3, "You lost!", "error", 3000, true) 234 | TriggerClientEvent("pvpsystem:notify", player2, "You won!", "success", 3000, true) 235 | TriggerClientEvent("pvpsystem:notify", player2, "You won!", "success", 3000, true) 236 | 237 | end 238 | Citizen.Wait(5000) 239 | revivePlayer(player1, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 240 | revivePlayer(player2, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 241 | revivePlayer(player3, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 242 | revivePlayer(player4, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 243 | break 244 | end 245 | Citizen.Wait(1) 246 | end 247 | end) 248 | end) 249 | 250 | -- WHEN THE DIMENSION REACHES THE LIMIT, IT RETURNS TO THE INITIAL NUMBER 251 | dimensions(dimension1v1, initialDimension1v1) -- 1v1 Dimension 252 | dimensions(dimension1v1, initialDimension2v2) -- 2v2 Dimension -------------------------------------------------------------------------------- /pvpsystem-standalone/NUI/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /pvpsystem-standalone/NUI/notify.js: -------------------------------------------------------------------------------- 1 | var n; 2 | $(document).ready(function () { 3 | window.addEventListener('message', function (event){ 4 | var data = event.data; 5 | if(data.action === "request") { 6 | Noty.closeAll(); 7 | n = new Noty({ 8 | type: 'notification', 9 | layout: 'topRight', 10 | text: data.text, 11 | timeout: data.time, 12 | theme: "mint", 13 | progressBar: true, 14 | buttons: [ 15 | Noty.button('Accept [Y]', 'btn btn-sm btn-success me-2', function () { 16 | n.close(); 17 | }), 18 | Noty.button('Deny [U]', 'btn btn-sm btn-danger', function () { 19 | n.close(); 20 | }) 21 | ] 22 | }).show(); 23 | } else if (data.close == true) { 24 | n.close(); 25 | } 26 | }) 27 | }); 28 | -------------------------------------------------------------------------------- /pvpsystem-standalone/NUI/noty.css: -------------------------------------------------------------------------------- 1 | /* Noty.css -> Noty.js library */ 2 | 3 | .noty_layout_mixin, 4 | #noty_layout__top, 5 | #noty_layout__topLeft, 6 | #noty_layout__topCenter, 7 | #noty_layout__topRight, 8 | #noty_layout__bottom, 9 | #noty_layout__bottomLeft, 10 | #noty_layout__bottomCenter, 11 | #noty_layout__bottomRight, 12 | #noty_layout__center, 13 | #noty_layout__centerLeft, 14 | #noty_layout__centerRight { 15 | position: fixed; 16 | margin: 0; 17 | padding: 0; 18 | z-index: 9999999; 19 | -webkit-transform: translateZ(0) scale(1, 1); 20 | transform: translateZ(0) scale(1, 1); 21 | -webkit-backface-visibility: hidden; 22 | backface-visibility: hidden; 23 | -webkit-font-smoothing: subpixel-antialiased; 24 | filter: blur(0); 25 | -webkit-filter: blur(0); 26 | font-weight: bold; 27 | font-family: Arial, sans-serif; 28 | max-width: 90%; 29 | } 30 | 31 | #noty_layout__top { 32 | top: 0; 33 | left: 5%; 34 | width: 90%; 35 | } 36 | 37 | #noty_layout__topLeft { 38 | top: 20px; 39 | left: 20px; 40 | width: 325px; 41 | } 42 | 43 | #noty_layout__topCenter { 44 | top: 5%; 45 | left: 50%; 46 | width: 325px; 47 | -webkit-transform: translate(-webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 48 | transform: translate(calc(-50% - .5px)) translateZ(0) scale(1, 1); 49 | } 50 | 51 | #noty_layout__topRight { 52 | top: 20px; 53 | right: 20px; 54 | width: 325px; 55 | } 56 | 57 | #noty_layout__bottom { 58 | bottom: 0; 59 | left: 5%; 60 | width: 90%; 61 | } 62 | 63 | #noty_layout__bottomLeft { 64 | bottom: 20px; 65 | left: 20px; 66 | width: 325px; 67 | } 68 | 69 | #noty_layout__bottomCenter { 70 | bottom: 5%; 71 | left: 50%; 72 | width: 325px; 73 | -webkit-transform: translate(-webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 74 | transform: translate(calc(-50% - .5px)) translateZ(0) scale(1, 1); 75 | } 76 | 77 | #noty_layout__bottomRight { 78 | bottom: 20px; 79 | right: 20px; 80 | width: 325px; 81 | } 82 | 83 | #noty_layout__center { 84 | top: 50%; 85 | left: 50%; 86 | width: 325px; 87 | -webkit-transform: translate(-webkit-calc(-50% - .5px), -webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 88 | transform: translate(calc(-50% - .5px), calc(-50% - .5px)) translateZ(0) scale(1, 1); 89 | } 90 | 91 | #noty_layout__centerLeft { 92 | top: 50%; 93 | left: 20px; 94 | width: 325px; 95 | -webkit-transform: translate(0, -webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 96 | transform: translate(0, calc(-50% - .5px)) translateZ(0) scale(1, 1); 97 | } 98 | 99 | #noty_layout__centerRight { 100 | top: 50%; 101 | right: 20px; 102 | width: 325px; 103 | -webkit-transform: translate(0, -webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 104 | transform: translate(0, calc(-50% - .5px)) translateZ(0) scale(1, 1); 105 | } 106 | 107 | .noty_progressbar { 108 | display: none; 109 | } 110 | 111 | .noty_has_timeout.noty_has_progressbar .noty_progressbar { 112 | display: block; 113 | position: absolute; 114 | left: 0; 115 | bottom: 0; 116 | height: 3px; 117 | width: 100%; 118 | background-color: #b6c5f5; 119 | opacity: 0.6; 120 | filter: alpha(opacity=10); 121 | } 122 | 123 | .noty_bar { 124 | -webkit-backface-visibility: hidden; 125 | -webkit-transform: translate(0, 0) translateZ(0) scale(1, 1); 126 | -ms-transform: translate(0, 0) scale(1, 1); 127 | transform: translate(0, 0) scale(1, 1); 128 | -webkit-font-smoothing: subpixel-antialiased; 129 | overflow: hidden; 130 | } 131 | 132 | .noty_effects_open { 133 | opacity: 0; 134 | -webkit-transform: translate(50%); 135 | -ms-transform: translate(50%); 136 | transform: translate(50%); 137 | -webkit-animation: noty_anim_in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 138 | animation: noty_anim_in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 139 | -webkit-animation-fill-mode: forwards; 140 | animation-fill-mode: forwards; 141 | } 142 | 143 | .noty_effects_close { 144 | -webkit-animation: noty_anim_out 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 145 | animation: noty_anim_out 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 146 | -webkit-animation-fill-mode: forwards; 147 | animation-fill-mode: forwards; 148 | } 149 | 150 | .noty_fix_effects_height { 151 | -webkit-animation: noty_anim_height 75ms ease-out; 152 | animation: noty_anim_height 75ms ease-out; 153 | } 154 | 155 | .noty_close_with_click { 156 | cursor: pointer; 157 | } 158 | 159 | .noty_close_button { 160 | position: absolute; 161 | top: 2px; 162 | right: 2px; 163 | font-weight: bold; 164 | width: 20px; 165 | height: 20px; 166 | text-align: center; 167 | line-height: 20px; 168 | background-color: rgba(0, 0, 0, 0.05); 169 | border-radius: 2px; 170 | cursor: pointer; 171 | -webkit-transition: all .2s ease-out; 172 | transition: all .2s ease-out; 173 | } 174 | 175 | .noty_close_button:hover { 176 | background-color: rgba(0, 0, 0, 0.1); 177 | } 178 | 179 | .noty_modal { 180 | position: fixed; 181 | width: 100%; 182 | height: 100%; 183 | background-color: #000; 184 | z-index: 10000; 185 | opacity: .3; 186 | left: 0; 187 | top: 0; 188 | } 189 | 190 | .noty_modal.noty_modal_open { 191 | opacity: 0; 192 | -webkit-animation: noty_modal_in .3s ease-out; 193 | animation: noty_modal_in .3s ease-out; 194 | } 195 | 196 | .noty_modal.noty_modal_close { 197 | -webkit-animation: noty_modal_out .3s ease-out; 198 | animation: noty_modal_out .3s ease-out; 199 | -webkit-animation-fill-mode: forwards; 200 | animation-fill-mode: forwards; 201 | } 202 | 203 | @-webkit-keyframes noty_modal_in { 204 | 100% { 205 | opacity: .3; 206 | } 207 | } 208 | 209 | @keyframes noty_modal_in { 210 | 100% { 211 | opacity: .3; 212 | } 213 | } 214 | 215 | @-webkit-keyframes noty_modal_out { 216 | 100% { 217 | opacity: 0; 218 | } 219 | } 220 | 221 | @keyframes noty_modal_out { 222 | 100% { 223 | opacity: 0; 224 | } 225 | } 226 | 227 | @keyframes noty_modal_out { 228 | 100% { 229 | opacity: 0; 230 | } 231 | } 232 | 233 | @-webkit-keyframes noty_anim_in { 234 | 100% { 235 | -webkit-transform: translate(0); 236 | transform: translate(0); 237 | opacity: 1; 238 | } 239 | } 240 | 241 | @keyframes noty_anim_in { 242 | 100% { 243 | -webkit-transform: translate(0); 244 | transform: translate(0); 245 | opacity: 1; 246 | } 247 | } 248 | 249 | @-webkit-keyframes noty_anim_out { 250 | 100% { 251 | -webkit-transform: translate(50%); 252 | transform: translate(50%); 253 | opacity: 0; 254 | } 255 | } 256 | 257 | @keyframes noty_anim_out { 258 | 100% { 259 | -webkit-transform: translate(50%); 260 | transform: translate(50%); 261 | opacity: 0; 262 | } 263 | } 264 | 265 | @-webkit-keyframes noty_anim_height { 266 | 100% { 267 | height: 0; 268 | } 269 | } 270 | 271 | @keyframes noty_anim_height { 272 | 100% { 273 | height: 0; 274 | } 275 | } 276 | 277 | .noty_theme__relax.noty_bar { 278 | margin: 4px 0; 279 | overflow: hidden; 280 | border-radius: 2px; 281 | position: relative; 282 | } 283 | 284 | .noty_theme__relax.noty_bar .noty_body { 285 | padding: 10px; 286 | } 287 | 288 | .noty_theme__relax.noty_bar .noty_buttons { 289 | border-top: 1px solid #e7e7e7; 290 | padding: 5px 10px; 291 | } 292 | 293 | .noty_theme__relax.noty_type__alert, 294 | .noty_theme__relax.noty_type__notification { 295 | background-color: #fff; 296 | border: 1px solid #dedede; 297 | color: #444; 298 | } 299 | 300 | .noty_theme__relax.noty_type__warning { 301 | background-color: #FFEAA8; 302 | border: 1px solid #FFC237; 303 | color: #826200; 304 | } 305 | 306 | .noty_theme__relax.noty_type__warning .noty_buttons { 307 | border-color: #dfaa30; 308 | } 309 | 310 | .noty_theme__relax.noty_type__error { 311 | background-color: #FF8181; 312 | border: 1px solid #e25353; 313 | color: #FFF; 314 | } 315 | 316 | .noty_theme__relax.noty_type__error .noty_buttons { 317 | border-color: darkred; 318 | } 319 | 320 | .noty_theme__relax.noty_type__info, 321 | .noty_theme__relax.noty_type__information { 322 | background-color: #78C5E7; 323 | border: 1px solid #3badd6; 324 | color: #FFF; 325 | } 326 | 327 | .noty_theme__relax.noty_type__info .noty_buttons, 328 | .noty_theme__relax.noty_type__information .noty_buttons { 329 | border-color: #0B90C4; 330 | } 331 | 332 | .noty_theme__relax.noty_type__success { 333 | background-color: #BCF5BC; 334 | border: 1px solid #7cdd77; 335 | color: darkgreen; 336 | } 337 | 338 | .noty_theme__relax.noty_type__success .noty_buttons { 339 | border-color: #50C24E; 340 | } 341 | 342 | .noty_theme__metroui.noty_bar { 343 | margin: 4px 0; 344 | overflow: hidden; 345 | position: relative; 346 | box-shadow: rgba(0, 0, 0, 0.298039) 0 0 5px 0; 347 | } 348 | 349 | .noty_theme__metroui.noty_bar .noty_progressbar { 350 | position: absolute; 351 | left: 0; 352 | bottom: 0; 353 | height: 3px; 354 | width: 100%; 355 | background-color: #000; 356 | opacity: 0.2; 357 | filter: alpha(opacity=20); 358 | } 359 | 360 | .noty_theme__metroui.noty_bar .noty_body { 361 | padding: 1.25em; 362 | font-size: 14px; 363 | } 364 | 365 | .noty_theme__metroui.noty_bar .noty_buttons { 366 | padding: 0 10px .5em 10px; 367 | } 368 | 369 | .noty_theme__metroui.noty_type__alert, 370 | .noty_theme__metroui.noty_type__notification { 371 | background-color: #fff; 372 | color: #1d1d1d; 373 | } 374 | 375 | .noty_theme__metroui.noty_type__warning { 376 | background-color: #FA6800; 377 | color: #fff; 378 | } 379 | 380 | .noty_theme__metroui.noty_type__error { 381 | background-color: #CE352C; 382 | color: #FFF; 383 | } 384 | 385 | .noty_theme__metroui.noty_type__info, 386 | .noty_theme__metroui.noty_type__information { 387 | background-color: #1BA1E2; 388 | color: #FFF; 389 | } 390 | 391 | .noty_theme__metroui.noty_type__success { 392 | background-color: #60A917; 393 | color: #fff; 394 | } 395 | 396 | .noty_theme__mint.noty_bar { 397 | margin: 20px 4px 4px 0; 398 | overflow: hidden; 399 | border-radius: 2px; 400 | position: relative; 401 | } 402 | 403 | .noty_theme__mint.noty_bar .noty_body { 404 | padding: 10px; 405 | font-size: 14px; 406 | } 407 | 408 | .noty_theme__mint.noty_bar .noty_buttons { 409 | padding: 0px 0px 10px 10px; 410 | } 411 | 412 | .noty_theme__mint.noty_type__alert, 413 | .noty_theme__mint.noty_type__notification { 414 | background-color: rgba(49, 66, 82, 0.8); 415 | color: #ffffff; 416 | } 417 | 418 | .noty_theme__mint.noty_type__warning { 419 | background-color: #FFAE42; 420 | border-bottom: 1px solid #E89F3C; 421 | color: #fff; 422 | } 423 | 424 | .noty_theme__mint.noty_type__error { 425 | background-color: #DE636F; 426 | border-bottom: 1px solid #CA5A65; 427 | color: #fff; 428 | } 429 | 430 | .noty_theme__mint.noty_type__info, 431 | .noty_theme__mint.noty_type__information { 432 | background-color: #7F7EFF; 433 | border-bottom: 1px solid #7473E8; 434 | color: #fff; 435 | } 436 | 437 | .noty_theme__mint.noty_type__success { 438 | background-color: #AFC765; 439 | border-bottom: 1px solid #A0B55C; 440 | color: #fff; 441 | } 442 | 443 | .noty_theme__sunset.noty_bar { 444 | margin: 4px 0; 445 | overflow: hidden; 446 | border-radius: 2px; 447 | position: relative; 448 | } 449 | 450 | .noty_theme__sunset.noty_bar .noty_body { 451 | padding: 10px; 452 | font-size: 14px; 453 | text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); 454 | } 455 | 456 | .noty_theme__sunset.noty_bar .noty_buttons { 457 | padding: 10px; 458 | } 459 | 460 | .noty_theme__sunset.noty_type__alert, 461 | .noty_theme__sunset.noty_type__notification { 462 | background-color: #073B4C; 463 | color: #fff; 464 | } 465 | 466 | .noty_theme__sunset.noty_type__alert .noty_progressbar, 467 | .noty_theme__sunset.noty_type__notification .noty_progressbar { 468 | background-color: #fff; 469 | } 470 | 471 | .noty_theme__sunset.noty_type__warning { 472 | background-color: #FFD166; 473 | color: #fff; 474 | } 475 | 476 | .noty_theme__sunset.noty_type__error { 477 | background-color: #EF476F; 478 | color: #fff; 479 | } 480 | 481 | .noty_theme__sunset.noty_type__error .noty_progressbar { 482 | opacity: .4; 483 | } 484 | 485 | .noty_theme__sunset.noty_type__info, 486 | .noty_theme__sunset.noty_type__information { 487 | background-color: #118AB2; 488 | color: #fff; 489 | } 490 | 491 | .noty_theme__sunset.noty_type__info .noty_progressbar, 492 | .noty_theme__sunset.noty_type__information .noty_progressbar { 493 | opacity: .6; 494 | } 495 | 496 | .noty_theme__sunset.noty_type__success { 497 | background-color: #06D6A0; 498 | color: #fff; 499 | } 500 | 501 | .noty_theme__bootstrap-v3.noty_bar { 502 | margin: 4px 0; 503 | overflow: hidden; 504 | position: relative; 505 | border: 1px solid transparent; 506 | border-radius: 4px; 507 | } 508 | 509 | .noty_theme__bootstrap-v3.noty_bar .noty_body { 510 | padding: 15px; 511 | } 512 | 513 | .noty_theme__bootstrap-v3.noty_bar .noty_buttons { 514 | padding: 10px; 515 | } 516 | 517 | .noty_theme__bootstrap-v3.noty_bar .noty_close_button { 518 | font-size: 21px; 519 | font-weight: 700; 520 | line-height: 1; 521 | color: #000; 522 | text-shadow: 0 1px 0 #fff; 523 | filter: alpha(opacity=20); 524 | opacity: .2; 525 | background: transparent; 526 | } 527 | 528 | .noty_theme__bootstrap-v3.noty_bar .noty_close_button:hover { 529 | background: transparent; 530 | text-decoration: none; 531 | cursor: pointer; 532 | filter: alpha(opacity=50); 533 | opacity: .5; 534 | } 535 | 536 | .noty_theme__bootstrap-v3.noty_type__alert, 537 | .noty_theme__bootstrap-v3.noty_type__notification { 538 | background-color: #fff; 539 | color: inherit; 540 | } 541 | 542 | .noty_theme__bootstrap-v3.noty_type__warning { 543 | background-color: #fcf8e3; 544 | color: #8a6d3b; 545 | border-color: #faebcc; 546 | } 547 | 548 | .noty_theme__bootstrap-v3.noty_type__error { 549 | background-color: #f2dede; 550 | color: #a94442; 551 | border-color: #ebccd1; 552 | } 553 | 554 | .noty_theme__bootstrap-v3.noty_type__info, 555 | .noty_theme__bootstrap-v3.noty_type__information { 556 | background-color: #d9edf7; 557 | color: #31708f; 558 | border-color: #bce8f1; 559 | } 560 | 561 | .noty_theme__bootstrap-v3.noty_type__success { 562 | background-color: #dff0d8; 563 | color: #3c763d; 564 | border-color: #d6e9c6; 565 | } 566 | 567 | .noty_theme__bootstrap-v4.noty_bar { 568 | margin: 4px 0; 569 | overflow: hidden; 570 | position: relative; 571 | border: 1px solid transparent; 572 | border-radius: .25rem; 573 | } 574 | 575 | .noty_theme__bootstrap-v4.noty_bar .noty_body { 576 | padding: .75rem 1.25rem; 577 | } 578 | 579 | .noty_theme__bootstrap-v4.noty_bar .noty_buttons { 580 | padding: 10px; 581 | } 582 | 583 | .noty_theme__bootstrap-v4.noty_bar .noty_close_button { 584 | font-size: 1.5rem; 585 | font-weight: 700; 586 | line-height: 1; 587 | color: #000; 588 | text-shadow: 0 1px 0 #fff; 589 | filter: alpha(opacity=20); 590 | opacity: .5; 591 | background: transparent; 592 | } 593 | 594 | .noty_theme__bootstrap-v4.noty_bar .noty_close_button:hover { 595 | background: transparent; 596 | text-decoration: none; 597 | cursor: pointer; 598 | filter: alpha(opacity=50); 599 | opacity: .75; 600 | } 601 | 602 | .noty_theme__bootstrap-v4.noty_type__alert, 603 | .noty_theme__bootstrap-v4.noty_type__notification { 604 | background-color: #fff; 605 | color: inherit; 606 | } 607 | 608 | .noty_theme__bootstrap-v4.noty_type__warning { 609 | background-color: #fcf8e3; 610 | color: #8a6d3b; 611 | border-color: #faebcc; 612 | } 613 | 614 | .noty_theme__bootstrap-v4.noty_type__error { 615 | background-color: #f2dede; 616 | color: #a94442; 617 | border-color: #ebccd1; 618 | } 619 | 620 | .noty_theme__bootstrap-v4.noty_type__info, 621 | .noty_theme__bootstrap-v4.noty_type__information { 622 | background-color: #d9edf7; 623 | color: #31708f; 624 | border-color: #bce8f1; 625 | } 626 | 627 | .noty_theme__bootstrap-v4.noty_type__success { 628 | background-color: #dff0d8; 629 | color: #3c763d; 630 | border-color: #d6e9c6; 631 | } 632 | 633 | .noty_theme__semanticui.noty_bar { 634 | margin: 4px 0; 635 | overflow: hidden; 636 | position: relative; 637 | border: 1px solid transparent; 638 | font-size: 1em; 639 | border-radius: .28571429rem; 640 | box-shadow: 0 0 0 1px rgba(34, 36, 38, 0.22) inset, 0 0 0 0 transparent; 641 | } 642 | 643 | .noty_theme__semanticui.noty_bar .noty_body { 644 | padding: 1em 1.5em; 645 | line-height: 1.4285em; 646 | } 647 | 648 | .noty_theme__semanticui.noty_bar .noty_buttons { 649 | padding: 10px; 650 | } 651 | 652 | .noty_theme__semanticui.noty_type__alert, 653 | .noty_theme__semanticui.noty_type__notification { 654 | background-color: #f8f8f9; 655 | color: rgba(0, 0, 0, 0.87); 656 | } 657 | 658 | .noty_theme__semanticui.noty_type__warning { 659 | background-color: #fffaf3; 660 | color: #573a08; 661 | box-shadow: 0 0 0 1px #c9ba9b inset, 0 0 0 0 transparent; 662 | } 663 | 664 | .noty_theme__semanticui.noty_type__error { 665 | background-color: #fff6f6; 666 | color: #9f3a38; 667 | box-shadow: 0 0 0 1px #e0b4b4 inset, 0 0 0 0 transparent; 668 | } 669 | 670 | .noty_theme__semanticui.noty_type__info, 671 | .noty_theme__semanticui.noty_type__information { 672 | background-color: #f8ffff; 673 | color: #276f86; 674 | box-shadow: 0 0 0 1px #a9d5de inset, 0 0 0 0 transparent; 675 | } 676 | 677 | .noty_theme__semanticui.noty_type__success { 678 | background-color: #fcfff5; 679 | color: #2c662d; 680 | box-shadow: 0 0 0 1px #a3c293 inset, 0 0 0 0 transparent; 681 | } 682 | 683 | .noty_theme__nest.noty_bar { 684 | margin: 0 0 15px 0; 685 | overflow: hidden; 686 | border-radius: 2px; 687 | position: relative; 688 | box-shadow: rgba(0, 0, 0, 0.098039) 5px 4px 10px 0; 689 | } 690 | 691 | .noty_theme__nest.noty_bar .noty_body { 692 | padding: 10px; 693 | font-size: 14px; 694 | text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); 695 | } 696 | 697 | .noty_theme__nest.noty_bar .noty_buttons { 698 | padding: 10px; 699 | } 700 | 701 | .noty_layout .noty_theme__nest.noty_bar { 702 | z-index: 5; 703 | } 704 | 705 | .noty_layout .noty_theme__nest.noty_bar:nth-child(2) { 706 | position: absolute; 707 | top: 0; 708 | margin-top: 4px; 709 | margin-right: -4px; 710 | margin-left: 4px; 711 | z-index: 4; 712 | width: 100%; 713 | } 714 | 715 | .noty_layout .noty_theme__nest.noty_bar:nth-child(3) { 716 | position: absolute; 717 | top: 0; 718 | margin-top: 8px; 719 | margin-right: -8px; 720 | margin-left: 8px; 721 | z-index: 3; 722 | width: 100%; 723 | } 724 | 725 | .noty_layout .noty_theme__nest.noty_bar:nth-child(4) { 726 | position: absolute; 727 | top: 0; 728 | margin-top: 12px; 729 | margin-right: -12px; 730 | margin-left: 12px; 731 | z-index: 2; 732 | width: 100%; 733 | } 734 | 735 | .noty_layout .noty_theme__nest.noty_bar:nth-child(5) { 736 | position: absolute; 737 | top: 0; 738 | margin-top: 16px; 739 | margin-right: -16px; 740 | margin-left: 16px; 741 | z-index: 1; 742 | width: 100%; 743 | } 744 | 745 | .noty_layout .noty_theme__nest.noty_bar:nth-child(n+6) { 746 | position: absolute; 747 | top: 0; 748 | margin-top: 20px; 749 | margin-right: -20px; 750 | margin-left: 20px; 751 | z-index: -1; 752 | width: 100%; 753 | } 754 | 755 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(2), 756 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(2) { 757 | margin-top: 4px; 758 | margin-left: -4px; 759 | margin-right: 4px; 760 | } 761 | 762 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(3), 763 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(3) { 764 | margin-top: 8px; 765 | margin-left: -8px; 766 | margin-right: 8px; 767 | } 768 | 769 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(4), 770 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(4) { 771 | margin-top: 12px; 772 | margin-left: -12px; 773 | margin-right: 12px; 774 | } 775 | 776 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(5), 777 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(5) { 778 | margin-top: 16px; 779 | margin-left: -16px; 780 | margin-right: 16px; 781 | } 782 | 783 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(n+6), 784 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(n+6) { 785 | margin-top: 20px; 786 | margin-left: -20px; 787 | margin-right: 20px; 788 | } 789 | 790 | .noty_theme__nest.noty_type__alert, 791 | .noty_theme__nest.noty_type__notification { 792 | background-color: #073B4C; 793 | color: #fff; 794 | } 795 | 796 | .noty_theme__nest.noty_type__alert .noty_progressbar, 797 | .noty_theme__nest.noty_type__notification .noty_progressbar { 798 | background-color: #fff; 799 | } 800 | 801 | .noty_theme__nest.noty_type__warning { 802 | background-color: #FFD166; 803 | color: #fff; 804 | } 805 | 806 | .noty_theme__nest.noty_type__error { 807 | background-color: #EF476F; 808 | color: #fff; 809 | } 810 | 811 | .noty_theme__nest.noty_type__error .noty_progressbar { 812 | opacity: .4; 813 | } 814 | 815 | .noty_theme__nest.noty_type__info, 816 | .noty_theme__nest.noty_type__information { 817 | background-color: #118AB2; 818 | color: #fff; 819 | } 820 | 821 | .noty_theme__nest.noty_type__info .noty_progressbar, 822 | .noty_theme__nest.noty_type__information .noty_progressbar { 823 | opacity: .6; 824 | } 825 | 826 | .noty_theme__nest.noty_type__success { 827 | background-color: #06D6A0; 828 | color: #fff; 829 | } 830 | 831 | .noty_theme__light.noty_bar { 832 | margin: 4px 0; 833 | overflow: hidden; 834 | border-radius: 2px; 835 | position: relative; 836 | } 837 | 838 | .noty_theme__light.noty_bar .noty_body { 839 | padding: 10px; 840 | } 841 | 842 | .noty_theme__light.noty_bar .noty_buttons { 843 | border-top: 1px solid #e7e7e7; 844 | padding: 5px 10px; 845 | } 846 | 847 | .noty_theme__light.noty_type__alert, 848 | .noty_theme__light.noty_type__notification { 849 | background-color: #fff; 850 | border: 1px solid #dedede; 851 | color: #444; 852 | } 853 | 854 | .noty_theme__light.noty_type__warning { 855 | background-color: #FFEAA8; 856 | border: 1px solid #FFC237; 857 | color: #826200; 858 | } 859 | 860 | .noty_theme__light.noty_type__warning .noty_buttons { 861 | border-color: #dfaa30; 862 | } 863 | 864 | .noty_theme__light.noty_type__error { 865 | background-color: #ED7000; 866 | border: 1px solid #e25353; 867 | color: #FFF; 868 | } 869 | 870 | .noty_theme__light.noty_type__error .noty_buttons { 871 | border-color: darkred; 872 | } 873 | 874 | .noty_theme__light.noty_type__info, 875 | .noty_theme__light.noty_type__information { 876 | background-color: #78C5E7; 877 | border: 1px solid #3badd6; 878 | color: #FFF; 879 | } 880 | 881 | .noty_theme__light.noty_type__info .noty_buttons, 882 | .noty_theme__light.noty_type__information .noty_buttons { 883 | border-color: #0B90C4; 884 | } 885 | 886 | .noty_theme__light.noty_type__success { 887 | background-color: #57C880; 888 | border: 1px solid #7cdd77; 889 | color: darkgreen; 890 | } 891 | 892 | .noty_theme__light.noty_type__success .noty_buttons { 893 | border-color: #50C24E; 894 | } 895 | 896 | /*# sourceMappingURL=noty.css.map*/ 897 | -------------------------------------------------------------------------------- /pvpsystem-standalone/client.lua: -------------------------------------------------------------------------------- 1 | counter = 0 -- IF COUNTER EQUALS 1 THE PLAYER IS IN THE QUEUE 2 | 3 | -- MESSAGES 4 | RegisterNetEvent("pvpsystem:notify") 5 | AddEventHandler("pvpsystem:notify", function(text, heading) 6 | notify(text) 7 | if heading then SetGameplayCamRelativeHeading(0) end 8 | end) 9 | 10 | RegisterNetEvent("pvpsystem:cancelCounter") 11 | AddEventHandler("pvpsystem:cancelCounter", function() 12 | counter = 0 13 | end) 14 | 15 | -- ADD PLAYER TO A QUEUE 16 | RegisterNetEvent("pvpsystem:pvpqueue") 17 | AddEventHandler("pvpsystem:pvpqueue", function(ident, player, args) 18 | if (args==nil) then 19 | if (ident==1) then 20 | if (counter == 0) then 21 | notify("~g~You joined the queue (1v1)") 22 | TriggerServerEvent("pvpsystem:counter1v1", source) 23 | if (Config.developerMode == false) then 24 | counter = 1 25 | end 26 | else 27 | notify("~r~You are already in a queue") 28 | end 29 | else 30 | if (counter == 0) then 31 | notify("~g~You joined the queue (2v2)") 32 | TriggerServerEvent("pvpsystem:counter2v2", source) 33 | if (Config.developerMode == false) then 34 | counter = 1 35 | end 36 | else 37 | notify("~r~You are already in a queue") 38 | end 39 | end 40 | else 41 | if (counter == 0) then 42 | TriggerServerEvent("pvpsystem:comargs", player, args) 43 | if (Config.developerMode == false) then 44 | counter = 1 45 | end 46 | end 47 | end 48 | end) 49 | 50 | -- REVIVE PLAYER 51 | RegisterNetEvent("pvpsystem:revive") 52 | AddEventHandler("pvpsystem:revive", function() 53 | NetworkResurrectLocalPlayer(-1497.45, 139.64, 55.65, true, true, false) 54 | SetEntityHealth(GetPlayerFromServerId(id), 200) 55 | end) 56 | 57 | RegisterNetEvent("pvpsystem:request") 58 | AddEventHandler("pvpsystem:request", function(id1, id2) 59 | notification("pvpsystem:comargs", true, id1, id2, nil, nil, 30000, "1v1 Challenge! [ID] ".. id1) 60 | end) 61 | 62 | function notification(trigger, isServer, params1, params2, params3, params4, time, text) 63 | SendNUIMessage({ 64 | action = "request", 65 | text = text, 66 | time = time 67 | }) 68 | local time2 = time - 1 69 | Citizen.SetTimeout(time, function() 70 | time2 = time + 1 71 | end) 72 | while time > time2 do 73 | if IsControlJustPressed(1, 246) then -- IF PRESSED Y 74 | if isServer == true then 75 | TriggerServerEvent(trigger, params1, params2, params3, params4) 76 | SendNUIMessage({close = true}) 77 | break 78 | else 79 | TriggerEvent(trigger, params1, params2, params3, params4) 80 | SendNUIMessage({close = true}) 81 | break 82 | end 83 | elseif IsControlJustPressed(1, 303) then -- IF PRESSED U 84 | SendNUIMessage({close = true}) 85 | break 86 | end 87 | Wait(1) 88 | end 89 | end 90 | 91 | -- NOTIFICATIONS 92 | function notify(str) 93 | BeginTextCommandThefeedPost("STRING") 94 | AddTextComponentSubstringPlayerName(str) 95 | EndTextCommandThefeedPostTicker(true, false) 96 | end -------------------------------------------------------------------------------- /pvpsystem-standalone/config.lua: -------------------------------------------------------------------------------- 1 | -- CONFIG FILE -- PvP System 2 | Config = {} 3 | 4 | -- DEVELOPER MODE - IF YOU ARE TESTING WITHOUT ANOTHER PLAYER: TRUE - PLAYER IS ENABLE TO JOIN IN A QUEUE MORE THAN 1 TIME 5 | Config.developerMode = false 6 | 7 | -- ENABLE VEHICLES IN SOME DIMENSION 8 | Config.disableVehicles = true -- This resource disable the spawn of vehicles in some pvp dimensions. To disable this turn the variable to false. 9 | 10 | -- WEAPONS - Default: Pistol MK2 = "weapon_pistol_mk2" 11 | Config.weapon1v1 = "weapon_pistol_mk2" -- Weapon 1v1 12 | Config.weapon2v2 = "weapon_pistol_mk2" -- Weapon 2v2 13 | 14 | -- COORDS 15 | Config.respawnCoords = {-1497.45, 139.64, 55.65} -- Respawn point coords // {X, Y, Z} 16 | Config.respawnCoordsHeading = 314.48 -- Sets a point for the player to look at when teleported 17 | 18 | Config.firstSpawnCoords1v1 = {-1748.63, 175.88, 64.37} -- First spawn point coords of 1v1 arena // {X, Y, Z} 19 | Config.firstSpawnCoords1v1Heading = 210.26 -- Sets a point for the player to look at when teleported 20 | Config.secondSpawnCoords1v1 = {-1727.01, 145.06, 64.4} -- Second spawn point coords of 1v1 arena // {X, Y, Z} 21 | Config.secondSpawnCoords1v1Heading = 38.05 -- Sets a point for the player to look at when teleported 22 | 23 | Config.firstTeamSpawnCoords2v2 = {1214.89, 3115.29, 40.41} -- (Team 1) First spawn point coords of 2v2 arena // {X, Y, Z} 24 | Config.firstTeamSpawnCoords2v2Heading = 286.34 -- Sets a point for the player to look at when teleported 25 | Config.secondTeamSpawnCoords2v2 = {1115.73, 3090.54, 40.41} -- (Team 2) Third spawn point coords of 2v2 arena // {X, Y, Z} 26 | Config.secondTeamSpawnCoords2v2Heading = 108.94 -- Sets a point for the player to look at when teleported -------------------------------------------------------------------------------- /pvpsystem-standalone/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'cerulean' 2 | games {'gta5'} 3 | 4 | name 'pvpsystem' 5 | description 'PvP System (1V1, 2V2)' 6 | version '1.5' 7 | 8 | server_scripts { 9 | 'config.lua', 10 | 'server.lua' 11 | } 12 | 13 | client_scripts { 14 | 'config.lua', 15 | 'client.lua' 16 | } 17 | 18 | ui_page 'NUI/index.html' 19 | 20 | files { 21 | 'NUI/*' 22 | } 23 | -------------------------------------------------------------------------------- /pvpsystem-standalone/server.lua: -------------------------------------------------------------------------------- 1 | -- FUNCTIONS 2 | function function1v1(player, x, y, z, heading, dimension) 3 | SetEntityCoords(player, x, y, z, false, true, true, false) 4 | SetEntityHeading(player, heading) 5 | SetPlayerRoutingBucket(player, dimension) -- DIMENSION 6 | RemoveAllPedWeapons(player, false) 7 | GiveWeaponToPed(player, GetHashKey(Config.weapon1v1), 200, true) 8 | SetCurrentPedWeapon(player, GetHashKey(Config.weapon1v1), true) 9 | TriggerClientEvent("pvpsystem:notify", player, "You are in the arena: ~b~#1", true) 10 | 11 | end 12 | 13 | function function2v2(player, dimension) 14 | SetPlayerRoutingBucket(player, dimension) 15 | RemoveAllPedWeapons(player, false) 16 | GiveWeaponToPed(player, GetHashKey(Config.weapon2v2), 200, true) 17 | SetCurrentPedWeapon(player, GetHashKey(Config.weapon2v2), true) 18 | TriggerClientEvent("pvpsystem:notify", player, "You are in the arena: #2", "success", 3000, true) 19 | end 20 | 21 | function revivePlayer(player, x, y, z, heading) 22 | SetEntityCoords(player, x, y, z, false, true, true, false) 23 | SetEntityHeading(player, heading) 24 | SetPlayerRoutingBucket(player, 0) 25 | TriggerClientEvent("pvpsystem:revive", player, player) 26 | end 27 | 28 | function dimensions(dimension, initialDimension) 29 | Citizen.CreateThread(function() 30 | while true do 31 | if (dimension==(initialDimension+301)) then 32 | dimension=initialDimension 33 | end 34 | Citizen.Wait(10) 35 | end 36 | end) 37 | end 38 | 39 | -- VARS 40 | id = nil 41 | -- HEALTH LIMIT TO GET IN COMA (DIE) 42 | healthlimit = 0 -- CHANGE TO HEALTH LIMIT OF YOUR SERVER IF DOESN'T WORK 43 | 44 | -- VARS TO 1v1 45 | count = 1 46 | queue1v1 = {} 47 | initialDimension1v1 = 1000 48 | dimension1v1 = initialDimension1v1 -- INITIAL DIMENSION 1V1 49 | 50 | -- VARS TO 2v2 51 | queue2v2={} 52 | initialDimension2v2 = 100 53 | dimension2v2 = initialDimension2v2 -- INITIAL DIMENSION 2V2 54 | 55 | -- DISABLE VEHICLES IN THE SOME DIMENSIONS 56 | if Config.disableVehicles then 57 | for i = (initialDimension1v1+300),initialDimension1v1,-1 do 58 | SetRoutingBucketEntityLockdownMode(i, "strict") 59 | end 60 | for i = (initialDimension2v2+300),initialDimension2v2,-1 do 61 | SetRoutingBucketEntityLockdownMode(i, "strict") 62 | end 63 | end 64 | 65 | -- CANCEL QUEUE 66 | RegisterServerEvent("pvpsystem:cancelQueue") 67 | AddEventHandler("pvpsystem:cancelQueue", function(id) 68 | -- CANCEL 1v1 QUEUE 69 | for i=#queue1v1,1,-1 do 70 | if queue1v1[i] == id then 71 | table.remove(queue1v1, i) 72 | break 73 | end 74 | end 75 | -- CANCEL 2v2 QUEUE 76 | for i=#queue2v2,1,-1 do 77 | if queue2v2[i] == id then 78 | table.remove(queue2v2, i) 79 | break 80 | end 81 | end 82 | TriggerClientEvent("pvpsystem:cancelCounter", id) 83 | end) 84 | 85 | -- ADD A PLAYER TO THE 1V1 QUEUE 86 | RegisterServerEvent("pvpsystem:counter1v1") 87 | AddEventHandler("pvpsystem:counter1v1", function() 88 | table.insert(queue1v1, source) 89 | end) 90 | 91 | -- ADD A TEAM TO THE 2V2 QUEUE 92 | RegisterServerEvent("pvpsystem:counter2v2") 93 | AddEventHandler("pvpsystem:counter2v2", function() 94 | table.insert(queue2v2, source) 95 | end) 96 | 97 | 98 | -- 1V1 WITH QUEUE 99 | Citizen.CreateThread(function() 100 | while true do 101 | if (#queue1v1>=2) then 102 | -- PLAYER 1 103 | function1v1(queue1v1[1], Config.firstSpawnCoords1v1[1], Config.firstSpawnCoords1v1[2], Config.firstSpawnCoords1v1[3], Config.firstSpawnCoords1v1Heading, dimension1v1) 104 | -- PLAYER 2 105 | function1v1(queue1v1[2], Config.secondSpawnCoords1v1[1], Config.secondSpawnCoords1v1[2], Config.secondSpawnCoords1v1[3], Config.secondSpawnCoords1v1Heading, dimension1v1) 106 | -- CHECK IF ANY PLAYER DIE 107 | TriggerEvent("pvpsystem:die1v1", queue1v1[1], queue1v1[2]) 108 | -- DIMENSIONS SETTINGS 109 | dimension1v1 = dimension1v1 + 1 110 | table.remove(queue1v1, 2) 111 | table.remove(queue1v1, 1) 112 | end 113 | Citizen.Wait(1200) 114 | end 115 | end) 116 | 117 | -- 1V1 WITHOUT QUEUE, NEEDS AN ID OF A FRIEND (EX: /1v1 [id]) 118 | RegisterServerEvent("pvpsystem:comargs") 119 | AddEventHandler("pvpsystem:comargs", function(player1, player2) 120 | dimension1v1 = dimension1v1 + 1 -- DIMENSIONS SETTINGS 121 | -- PLAYER 1 122 | function1v1(player1, Config.firstSpawnCoords1v1[1], Config.firstSpawnCoords1v1[2], Config.firstSpawnCoords1v1[3], Config.firstSpawnCoords1v1Heading, dimension1v1) 123 | -- PLAYER 2 124 | function1v1(tonumber(player2), Config.secondSpawnCoords1v1[1], Config.secondSpawnCoords1v1[2], Config.secondSpawnCoords1v1[3], Config.secondSpawnCoords1v1Heading, dimension1v1) 125 | -- CHECK IF ANY PLAYER DIE 126 | TriggerEvent("pvpsystem:die1v1", player1, player2) 127 | end) 128 | 129 | -- 1V1 COMMAND 130 | RegisterCommand("1v1", function(source, args) 131 | if (args[1]==nil) then 132 | TriggerClientEvent("pvpsystem:pvpqueue", source, 1) 133 | elseif (source==tonumber(args[1]) and Config.developerMode==false) then 134 | TriggerClientEvent("pvpsystem:notify", source, "~r~You can't challenge yourself!", false) 135 | else 136 | TriggerClientEvent("pvpsystem:request", args[1], source, args[1]) 137 | end 138 | end) 139 | 140 | -- 2V2 COMMAND 141 | RegisterCommand("2v2", function(source) 142 | TriggerClientEvent("pvpsystem:pvpqueue", source, 2) 143 | end) 144 | 145 | RegisterCommand("cancelQueue", function(source) 146 | TriggerEvent("pvpsystem:cancelQueue", source) 147 | TriggerClientEvent("pvpsystem:notify", source, "Queue canceled!", "primary", 3000, false) 148 | end) 149 | 150 | -- IF SOMEONE DIE THE PLAYERS GO TO A POINT (1V1) 151 | RegisterServerEvent("pvpsystem:die1v1") 152 | AddEventHandler("pvpsystem:die1v1", function(player1, player2) 153 | Citizen.CreateThread(function() 154 | while true do 155 | if (GetEntityHealth(GetPlayerPed(player1))<=healthlimit or GetEntityHealth(GetPlayerPed(player2))<=healthlimit) then 156 | if (GetEntityHealth(GetPlayerPed(player1))<=healthlimit) then 157 | TriggerClientEvent("pvpsystem:notify", player1, "~r~You lost!", true) 158 | TriggerClientEvent("pvpsystem:notify", player2, "~g~You won!", true) 159 | elseif (GetEntityHealth(GetPlayerPed(player2))<=healthlimit) then 160 | TriggerClientEvent("pvpsystem:notify", player2, "~g~You won!", true) 161 | TriggerClientEvent("pvpsystem:notify", player1, "~g~You lost!", true) 162 | end 163 | Citizen.Wait(1500) 164 | -- REVIVE PLAYERS 165 | revivePlayer(player1, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 166 | revivePlayer(player2, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 167 | TriggerClientEvent("pvpsystem:cancelCounter", player1) 168 | TriggerClientEvent("pvpsystem:cancelCounter", player2) 169 | break 170 | end 171 | Citizen.Wait(1) 172 | end 173 | end) 174 | end) 175 | 176 | -- 2v2 177 | Citizen.CreateThread(function() 178 | while true do 179 | if (#queue2v2>=4) then 180 | for i=1,4 do 181 | SetEntityCoords(queue2v2[i], Config.firstTeamSpawnCoords2v2[1], Config.firstTeamSpawnCoords2v2[2], Config.firstTeamSpawnCoords2v2[3], true, true, true, false) 182 | end 183 | SetEntityHeading(queue2v2[1], Config.firstTeamSpawnCoords2v2Heading) 184 | SetEntityHeading(queue2v2[2], Config.firstTeamSpawnCoords2v2Heading) 185 | SetEntityHeading(queue2v2[3], Config.secondTeamSpawnCoords2v2Heading) 186 | SetEntityHeading(queue2v2[4], Config.secondTeamSpawnCoords2v2Heading) 187 | for i=4,1,-1 do 188 | function2v2(queue2v2[i], dimension2v2) 189 | end 190 | TriggerEvent("pvpsystem:die2v2", queue2v2[1], queue2v2[2], queue2v2[3], queue2v2[4]) 191 | dimension2v2 = dimension2v2 + 1 192 | for i=4,1,-1 do 193 | table.remove(queue2v2, i) 194 | end 195 | end 196 | Citizen.Wait(1200) 197 | end 198 | end) 199 | 200 | -- IF A TEAM DIES, THE PLAYERS GO TO A POINT (2V2) 201 | RegisterServerEvent("pvpsystem:die2v2") 202 | AddEventHandler("pvpsystem:die2v2", function(player1, player2, player3, player4) -- TEAM 1 - PLAYER 1 AND 2 203 | Citizen.CreateThread(function() -- TEAM 2 - PLAYER 3 AND 4 204 | while true do 205 | if (GetEntityHealth(GetPlayerPed(player1))<=healthlimit and GetEntityHealth(GetPlayerPed(player2))<=healthlimit or GetEntityHealth(GetPlayerPed(player3))<=healthlimit and GetEntityHealth(GetPlayerPed(player4))<=healthlimit) then 206 | if (GetEntityHealth(GetPlayerPed(player1))<=healthlimit and GetEntityHealth(GetPlayerPed(player2))<=healthlimit) then 207 | TriggerClientEvent("pvpsystem:notify", player1, "~r~You lost!", true) 208 | TriggerClientEvent("pvpsystem:notify", player2, "~r~You lost!", true) 209 | TriggerClientEvent("pvpsystem:notify", player3, "~g~You won!", true) 210 | TriggerClientEvent("pvpsystem:notify", player4, "~g~You won!", true) 211 | elseif (GetEntityHealth(GetPlayerPed(player3))<=healthlimit and GetEntityHealth(GetPlayerPed(player4))<=healthlimit) then 212 | TriggerClientEvent("pvpsystem:notify", player4, "~r~You lost!", true) 213 | TriggerClientEvent("pvpsystem:notify", player3, "~r~You lost!", true) 214 | TriggerClientEvent("pvpsystem:notify", player2, "~g~You won!", true) 215 | TriggerClientEvent("pvpsystem:notify", player1, "~g~You won!", true) 216 | end 217 | Citizen.Wait(1500) 218 | revivePlayer(player1, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 219 | revivePlayer(player2, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 220 | revivePlayer(player3, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 221 | revivePlayer(player4, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 222 | break 223 | end 224 | Citizen.Wait(1) 225 | end 226 | end) 227 | end) 228 | 229 | -- WHEN THE DIMENSION REACHES THE LIMIT, IT RETURNS TO THE INITIAL NUMBER 230 | dimensions(dimension1v1, initialDimension1v1) -- 1v1 Dimension 231 | dimensions(dimension1v1, initialDimension2v2) -- 2v2 Dimension -------------------------------------------------------------------------------- /pvpsystem-vrp/NUI/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /pvpsystem-vrp/NUI/notify.js: -------------------------------------------------------------------------------- 1 | var n; 2 | $(document).ready(function () { 3 | window.addEventListener('message', function (event){ 4 | var data = event.data; 5 | if(data.action === "request") { 6 | Noty.closeAll(); 7 | n = new Noty({ 8 | type: 'notification', 9 | layout: 'topRight', 10 | text: data.text, 11 | timeout: data.time, 12 | theme: "mint", 13 | progressBar: true, 14 | buttons: [ 15 | Noty.button('Accept [Y]', 'btn btn-sm btn-success me-2', function () { 16 | n.close(); 17 | }), 18 | Noty.button('Deny [U]', 'btn btn-sm btn-danger', function () { 19 | n.close(); 20 | }) 21 | ] 22 | }).show(); 23 | } else if (data.close == true) { 24 | n.close(); 25 | } 26 | }) 27 | }); 28 | -------------------------------------------------------------------------------- /pvpsystem-vrp/NUI/noty.css: -------------------------------------------------------------------------------- 1 | /* Noty.css -> Noty.js library */ 2 | 3 | .noty_layout_mixin, 4 | #noty_layout__top, 5 | #noty_layout__topLeft, 6 | #noty_layout__topCenter, 7 | #noty_layout__topRight, 8 | #noty_layout__bottom, 9 | #noty_layout__bottomLeft, 10 | #noty_layout__bottomCenter, 11 | #noty_layout__bottomRight, 12 | #noty_layout__center, 13 | #noty_layout__centerLeft, 14 | #noty_layout__centerRight { 15 | position: fixed; 16 | margin: 0; 17 | padding: 0; 18 | z-index: 9999999; 19 | -webkit-transform: translateZ(0) scale(1, 1); 20 | transform: translateZ(0) scale(1, 1); 21 | -webkit-backface-visibility: hidden; 22 | backface-visibility: hidden; 23 | -webkit-font-smoothing: subpixel-antialiased; 24 | filter: blur(0); 25 | -webkit-filter: blur(0); 26 | font-weight: bold; 27 | font-family: Arial, sans-serif; 28 | max-width: 90%; 29 | } 30 | 31 | #noty_layout__top { 32 | top: 0; 33 | left: 5%; 34 | width: 90%; 35 | } 36 | 37 | #noty_layout__topLeft { 38 | top: 20px; 39 | left: 20px; 40 | width: 325px; 41 | } 42 | 43 | #noty_layout__topCenter { 44 | top: 5%; 45 | left: 50%; 46 | width: 325px; 47 | -webkit-transform: translate(-webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 48 | transform: translate(calc(-50% - .5px)) translateZ(0) scale(1, 1); 49 | } 50 | 51 | #noty_layout__topRight { 52 | top: 20px; 53 | right: 20px; 54 | width: 325px; 55 | } 56 | 57 | #noty_layout__bottom { 58 | bottom: 0; 59 | left: 5%; 60 | width: 90%; 61 | } 62 | 63 | #noty_layout__bottomLeft { 64 | bottom: 20px; 65 | left: 20px; 66 | width: 325px; 67 | } 68 | 69 | #noty_layout__bottomCenter { 70 | bottom: 5%; 71 | left: 50%; 72 | width: 325px; 73 | -webkit-transform: translate(-webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 74 | transform: translate(calc(-50% - .5px)) translateZ(0) scale(1, 1); 75 | } 76 | 77 | #noty_layout__bottomRight { 78 | bottom: 20px; 79 | right: 20px; 80 | width: 325px; 81 | } 82 | 83 | #noty_layout__center { 84 | top: 50%; 85 | left: 50%; 86 | width: 325px; 87 | -webkit-transform: translate(-webkit-calc(-50% - .5px), -webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 88 | transform: translate(calc(-50% - .5px), calc(-50% - .5px)) translateZ(0) scale(1, 1); 89 | } 90 | 91 | #noty_layout__centerLeft { 92 | top: 50%; 93 | left: 20px; 94 | width: 325px; 95 | -webkit-transform: translate(0, -webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 96 | transform: translate(0, calc(-50% - .5px)) translateZ(0) scale(1, 1); 97 | } 98 | 99 | #noty_layout__centerRight { 100 | top: 50%; 101 | right: 20px; 102 | width: 325px; 103 | -webkit-transform: translate(0, -webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1); 104 | transform: translate(0, calc(-50% - .5px)) translateZ(0) scale(1, 1); 105 | } 106 | 107 | .noty_progressbar { 108 | display: none; 109 | } 110 | 111 | .noty_has_timeout.noty_has_progressbar .noty_progressbar { 112 | display: block; 113 | position: absolute; 114 | left: 0; 115 | bottom: 0; 116 | height: 3px; 117 | width: 100%; 118 | background-color: #b6c5f5; 119 | opacity: 0.6; 120 | filter: alpha(opacity=10); 121 | } 122 | 123 | .noty_bar { 124 | -webkit-backface-visibility: hidden; 125 | -webkit-transform: translate(0, 0) translateZ(0) scale(1, 1); 126 | -ms-transform: translate(0, 0) scale(1, 1); 127 | transform: translate(0, 0) scale(1, 1); 128 | -webkit-font-smoothing: subpixel-antialiased; 129 | overflow: hidden; 130 | } 131 | 132 | .noty_effects_open { 133 | opacity: 0; 134 | -webkit-transform: translate(50%); 135 | -ms-transform: translate(50%); 136 | transform: translate(50%); 137 | -webkit-animation: noty_anim_in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 138 | animation: noty_anim_in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 139 | -webkit-animation-fill-mode: forwards; 140 | animation-fill-mode: forwards; 141 | } 142 | 143 | .noty_effects_close { 144 | -webkit-animation: noty_anim_out 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 145 | animation: noty_anim_out 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 146 | -webkit-animation-fill-mode: forwards; 147 | animation-fill-mode: forwards; 148 | } 149 | 150 | .noty_fix_effects_height { 151 | -webkit-animation: noty_anim_height 75ms ease-out; 152 | animation: noty_anim_height 75ms ease-out; 153 | } 154 | 155 | .noty_close_with_click { 156 | cursor: pointer; 157 | } 158 | 159 | .noty_close_button { 160 | position: absolute; 161 | top: 2px; 162 | right: 2px; 163 | font-weight: bold; 164 | width: 20px; 165 | height: 20px; 166 | text-align: center; 167 | line-height: 20px; 168 | background-color: rgba(0, 0, 0, 0.05); 169 | border-radius: 2px; 170 | cursor: pointer; 171 | -webkit-transition: all .2s ease-out; 172 | transition: all .2s ease-out; 173 | } 174 | 175 | .noty_close_button:hover { 176 | background-color: rgba(0, 0, 0, 0.1); 177 | } 178 | 179 | .noty_modal { 180 | position: fixed; 181 | width: 100%; 182 | height: 100%; 183 | background-color: #000; 184 | z-index: 10000; 185 | opacity: .3; 186 | left: 0; 187 | top: 0; 188 | } 189 | 190 | .noty_modal.noty_modal_open { 191 | opacity: 0; 192 | -webkit-animation: noty_modal_in .3s ease-out; 193 | animation: noty_modal_in .3s ease-out; 194 | } 195 | 196 | .noty_modal.noty_modal_close { 197 | -webkit-animation: noty_modal_out .3s ease-out; 198 | animation: noty_modal_out .3s ease-out; 199 | -webkit-animation-fill-mode: forwards; 200 | animation-fill-mode: forwards; 201 | } 202 | 203 | @-webkit-keyframes noty_modal_in { 204 | 100% { 205 | opacity: .3; 206 | } 207 | } 208 | 209 | @keyframes noty_modal_in { 210 | 100% { 211 | opacity: .3; 212 | } 213 | } 214 | 215 | @-webkit-keyframes noty_modal_out { 216 | 100% { 217 | opacity: 0; 218 | } 219 | } 220 | 221 | @keyframes noty_modal_out { 222 | 100% { 223 | opacity: 0; 224 | } 225 | } 226 | 227 | @keyframes noty_modal_out { 228 | 100% { 229 | opacity: 0; 230 | } 231 | } 232 | 233 | @-webkit-keyframes noty_anim_in { 234 | 100% { 235 | -webkit-transform: translate(0); 236 | transform: translate(0); 237 | opacity: 1; 238 | } 239 | } 240 | 241 | @keyframes noty_anim_in { 242 | 100% { 243 | -webkit-transform: translate(0); 244 | transform: translate(0); 245 | opacity: 1; 246 | } 247 | } 248 | 249 | @-webkit-keyframes noty_anim_out { 250 | 100% { 251 | -webkit-transform: translate(50%); 252 | transform: translate(50%); 253 | opacity: 0; 254 | } 255 | } 256 | 257 | @keyframes noty_anim_out { 258 | 100% { 259 | -webkit-transform: translate(50%); 260 | transform: translate(50%); 261 | opacity: 0; 262 | } 263 | } 264 | 265 | @-webkit-keyframes noty_anim_height { 266 | 100% { 267 | height: 0; 268 | } 269 | } 270 | 271 | @keyframes noty_anim_height { 272 | 100% { 273 | height: 0; 274 | } 275 | } 276 | 277 | .noty_theme__relax.noty_bar { 278 | margin: 4px 0; 279 | overflow: hidden; 280 | border-radius: 2px; 281 | position: relative; 282 | } 283 | 284 | .noty_theme__relax.noty_bar .noty_body { 285 | padding: 10px; 286 | } 287 | 288 | .noty_theme__relax.noty_bar .noty_buttons { 289 | border-top: 1px solid #e7e7e7; 290 | padding: 5px 10px; 291 | } 292 | 293 | .noty_theme__relax.noty_type__alert, 294 | .noty_theme__relax.noty_type__notification { 295 | background-color: #fff; 296 | border: 1px solid #dedede; 297 | color: #444; 298 | } 299 | 300 | .noty_theme__relax.noty_type__warning { 301 | background-color: #FFEAA8; 302 | border: 1px solid #FFC237; 303 | color: #826200; 304 | } 305 | 306 | .noty_theme__relax.noty_type__warning .noty_buttons { 307 | border-color: #dfaa30; 308 | } 309 | 310 | .noty_theme__relax.noty_type__error { 311 | background-color: #FF8181; 312 | border: 1px solid #e25353; 313 | color: #FFF; 314 | } 315 | 316 | .noty_theme__relax.noty_type__error .noty_buttons { 317 | border-color: darkred; 318 | } 319 | 320 | .noty_theme__relax.noty_type__info, 321 | .noty_theme__relax.noty_type__information { 322 | background-color: #78C5E7; 323 | border: 1px solid #3badd6; 324 | color: #FFF; 325 | } 326 | 327 | .noty_theme__relax.noty_type__info .noty_buttons, 328 | .noty_theme__relax.noty_type__information .noty_buttons { 329 | border-color: #0B90C4; 330 | } 331 | 332 | .noty_theme__relax.noty_type__success { 333 | background-color: #BCF5BC; 334 | border: 1px solid #7cdd77; 335 | color: darkgreen; 336 | } 337 | 338 | .noty_theme__relax.noty_type__success .noty_buttons { 339 | border-color: #50C24E; 340 | } 341 | 342 | .noty_theme__metroui.noty_bar { 343 | margin: 4px 0; 344 | overflow: hidden; 345 | position: relative; 346 | box-shadow: rgba(0, 0, 0, 0.298039) 0 0 5px 0; 347 | } 348 | 349 | .noty_theme__metroui.noty_bar .noty_progressbar { 350 | position: absolute; 351 | left: 0; 352 | bottom: 0; 353 | height: 3px; 354 | width: 100%; 355 | background-color: #000; 356 | opacity: 0.2; 357 | filter: alpha(opacity=20); 358 | } 359 | 360 | .noty_theme__metroui.noty_bar .noty_body { 361 | padding: 1.25em; 362 | font-size: 14px; 363 | } 364 | 365 | .noty_theme__metroui.noty_bar .noty_buttons { 366 | padding: 0 10px .5em 10px; 367 | } 368 | 369 | .noty_theme__metroui.noty_type__alert, 370 | .noty_theme__metroui.noty_type__notification { 371 | background-color: #fff; 372 | color: #1d1d1d; 373 | } 374 | 375 | .noty_theme__metroui.noty_type__warning { 376 | background-color: #FA6800; 377 | color: #fff; 378 | } 379 | 380 | .noty_theme__metroui.noty_type__error { 381 | background-color: #CE352C; 382 | color: #FFF; 383 | } 384 | 385 | .noty_theme__metroui.noty_type__info, 386 | .noty_theme__metroui.noty_type__information { 387 | background-color: #1BA1E2; 388 | color: #FFF; 389 | } 390 | 391 | .noty_theme__metroui.noty_type__success { 392 | background-color: #60A917; 393 | color: #fff; 394 | } 395 | 396 | .noty_theme__mint.noty_bar { 397 | margin: 20px 4px 4px 0; 398 | overflow: hidden; 399 | border-radius: 2px; 400 | position: relative; 401 | } 402 | 403 | .noty_theme__mint.noty_bar .noty_body { 404 | padding: 10px; 405 | font-size: 14px; 406 | } 407 | 408 | .noty_theme__mint.noty_bar .noty_buttons { 409 | padding: 0px 0px 10px 10px; 410 | } 411 | 412 | .noty_theme__mint.noty_type__alert, 413 | .noty_theme__mint.noty_type__notification { 414 | background-color: rgba(49, 66, 82, 0.8); 415 | color: #ffffff; 416 | } 417 | 418 | .noty_theme__mint.noty_type__warning { 419 | background-color: #FFAE42; 420 | border-bottom: 1px solid #E89F3C; 421 | color: #fff; 422 | } 423 | 424 | .noty_theme__mint.noty_type__error { 425 | background-color: #DE636F; 426 | border-bottom: 1px solid #CA5A65; 427 | color: #fff; 428 | } 429 | 430 | .noty_theme__mint.noty_type__info, 431 | .noty_theme__mint.noty_type__information { 432 | background-color: #7F7EFF; 433 | border-bottom: 1px solid #7473E8; 434 | color: #fff; 435 | } 436 | 437 | .noty_theme__mint.noty_type__success { 438 | background-color: #AFC765; 439 | border-bottom: 1px solid #A0B55C; 440 | color: #fff; 441 | } 442 | 443 | .noty_theme__sunset.noty_bar { 444 | margin: 4px 0; 445 | overflow: hidden; 446 | border-radius: 2px; 447 | position: relative; 448 | } 449 | 450 | .noty_theme__sunset.noty_bar .noty_body { 451 | padding: 10px; 452 | font-size: 14px; 453 | text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); 454 | } 455 | 456 | .noty_theme__sunset.noty_bar .noty_buttons { 457 | padding: 10px; 458 | } 459 | 460 | .noty_theme__sunset.noty_type__alert, 461 | .noty_theme__sunset.noty_type__notification { 462 | background-color: #073B4C; 463 | color: #fff; 464 | } 465 | 466 | .noty_theme__sunset.noty_type__alert .noty_progressbar, 467 | .noty_theme__sunset.noty_type__notification .noty_progressbar { 468 | background-color: #fff; 469 | } 470 | 471 | .noty_theme__sunset.noty_type__warning { 472 | background-color: #FFD166; 473 | color: #fff; 474 | } 475 | 476 | .noty_theme__sunset.noty_type__error { 477 | background-color: #EF476F; 478 | color: #fff; 479 | } 480 | 481 | .noty_theme__sunset.noty_type__error .noty_progressbar { 482 | opacity: .4; 483 | } 484 | 485 | .noty_theme__sunset.noty_type__info, 486 | .noty_theme__sunset.noty_type__information { 487 | background-color: #118AB2; 488 | color: #fff; 489 | } 490 | 491 | .noty_theme__sunset.noty_type__info .noty_progressbar, 492 | .noty_theme__sunset.noty_type__information .noty_progressbar { 493 | opacity: .6; 494 | } 495 | 496 | .noty_theme__sunset.noty_type__success { 497 | background-color: #06D6A0; 498 | color: #fff; 499 | } 500 | 501 | .noty_theme__bootstrap-v3.noty_bar { 502 | margin: 4px 0; 503 | overflow: hidden; 504 | position: relative; 505 | border: 1px solid transparent; 506 | border-radius: 4px; 507 | } 508 | 509 | .noty_theme__bootstrap-v3.noty_bar .noty_body { 510 | padding: 15px; 511 | } 512 | 513 | .noty_theme__bootstrap-v3.noty_bar .noty_buttons { 514 | padding: 10px; 515 | } 516 | 517 | .noty_theme__bootstrap-v3.noty_bar .noty_close_button { 518 | font-size: 21px; 519 | font-weight: 700; 520 | line-height: 1; 521 | color: #000; 522 | text-shadow: 0 1px 0 #fff; 523 | filter: alpha(opacity=20); 524 | opacity: .2; 525 | background: transparent; 526 | } 527 | 528 | .noty_theme__bootstrap-v3.noty_bar .noty_close_button:hover { 529 | background: transparent; 530 | text-decoration: none; 531 | cursor: pointer; 532 | filter: alpha(opacity=50); 533 | opacity: .5; 534 | } 535 | 536 | .noty_theme__bootstrap-v3.noty_type__alert, 537 | .noty_theme__bootstrap-v3.noty_type__notification { 538 | background-color: #fff; 539 | color: inherit; 540 | } 541 | 542 | .noty_theme__bootstrap-v3.noty_type__warning { 543 | background-color: #fcf8e3; 544 | color: #8a6d3b; 545 | border-color: #faebcc; 546 | } 547 | 548 | .noty_theme__bootstrap-v3.noty_type__error { 549 | background-color: #f2dede; 550 | color: #a94442; 551 | border-color: #ebccd1; 552 | } 553 | 554 | .noty_theme__bootstrap-v3.noty_type__info, 555 | .noty_theme__bootstrap-v3.noty_type__information { 556 | background-color: #d9edf7; 557 | color: #31708f; 558 | border-color: #bce8f1; 559 | } 560 | 561 | .noty_theme__bootstrap-v3.noty_type__success { 562 | background-color: #dff0d8; 563 | color: #3c763d; 564 | border-color: #d6e9c6; 565 | } 566 | 567 | .noty_theme__bootstrap-v4.noty_bar { 568 | margin: 4px 0; 569 | overflow: hidden; 570 | position: relative; 571 | border: 1px solid transparent; 572 | border-radius: .25rem; 573 | } 574 | 575 | .noty_theme__bootstrap-v4.noty_bar .noty_body { 576 | padding: .75rem 1.25rem; 577 | } 578 | 579 | .noty_theme__bootstrap-v4.noty_bar .noty_buttons { 580 | padding: 10px; 581 | } 582 | 583 | .noty_theme__bootstrap-v4.noty_bar .noty_close_button { 584 | font-size: 1.5rem; 585 | font-weight: 700; 586 | line-height: 1; 587 | color: #000; 588 | text-shadow: 0 1px 0 #fff; 589 | filter: alpha(opacity=20); 590 | opacity: .5; 591 | background: transparent; 592 | } 593 | 594 | .noty_theme__bootstrap-v4.noty_bar .noty_close_button:hover { 595 | background: transparent; 596 | text-decoration: none; 597 | cursor: pointer; 598 | filter: alpha(opacity=50); 599 | opacity: .75; 600 | } 601 | 602 | .noty_theme__bootstrap-v4.noty_type__alert, 603 | .noty_theme__bootstrap-v4.noty_type__notification { 604 | background-color: #fff; 605 | color: inherit; 606 | } 607 | 608 | .noty_theme__bootstrap-v4.noty_type__warning { 609 | background-color: #fcf8e3; 610 | color: #8a6d3b; 611 | border-color: #faebcc; 612 | } 613 | 614 | .noty_theme__bootstrap-v4.noty_type__error { 615 | background-color: #f2dede; 616 | color: #a94442; 617 | border-color: #ebccd1; 618 | } 619 | 620 | .noty_theme__bootstrap-v4.noty_type__info, 621 | .noty_theme__bootstrap-v4.noty_type__information { 622 | background-color: #d9edf7; 623 | color: #31708f; 624 | border-color: #bce8f1; 625 | } 626 | 627 | .noty_theme__bootstrap-v4.noty_type__success { 628 | background-color: #dff0d8; 629 | color: #3c763d; 630 | border-color: #d6e9c6; 631 | } 632 | 633 | .noty_theme__semanticui.noty_bar { 634 | margin: 4px 0; 635 | overflow: hidden; 636 | position: relative; 637 | border: 1px solid transparent; 638 | font-size: 1em; 639 | border-radius: .28571429rem; 640 | box-shadow: 0 0 0 1px rgba(34, 36, 38, 0.22) inset, 0 0 0 0 transparent; 641 | } 642 | 643 | .noty_theme__semanticui.noty_bar .noty_body { 644 | padding: 1em 1.5em; 645 | line-height: 1.4285em; 646 | } 647 | 648 | .noty_theme__semanticui.noty_bar .noty_buttons { 649 | padding: 10px; 650 | } 651 | 652 | .noty_theme__semanticui.noty_type__alert, 653 | .noty_theme__semanticui.noty_type__notification { 654 | background-color: #f8f8f9; 655 | color: rgba(0, 0, 0, 0.87); 656 | } 657 | 658 | .noty_theme__semanticui.noty_type__warning { 659 | background-color: #fffaf3; 660 | color: #573a08; 661 | box-shadow: 0 0 0 1px #c9ba9b inset, 0 0 0 0 transparent; 662 | } 663 | 664 | .noty_theme__semanticui.noty_type__error { 665 | background-color: #fff6f6; 666 | color: #9f3a38; 667 | box-shadow: 0 0 0 1px #e0b4b4 inset, 0 0 0 0 transparent; 668 | } 669 | 670 | .noty_theme__semanticui.noty_type__info, 671 | .noty_theme__semanticui.noty_type__information { 672 | background-color: #f8ffff; 673 | color: #276f86; 674 | box-shadow: 0 0 0 1px #a9d5de inset, 0 0 0 0 transparent; 675 | } 676 | 677 | .noty_theme__semanticui.noty_type__success { 678 | background-color: #fcfff5; 679 | color: #2c662d; 680 | box-shadow: 0 0 0 1px #a3c293 inset, 0 0 0 0 transparent; 681 | } 682 | 683 | .noty_theme__nest.noty_bar { 684 | margin: 0 0 15px 0; 685 | overflow: hidden; 686 | border-radius: 2px; 687 | position: relative; 688 | box-shadow: rgba(0, 0, 0, 0.098039) 5px 4px 10px 0; 689 | } 690 | 691 | .noty_theme__nest.noty_bar .noty_body { 692 | padding: 10px; 693 | font-size: 14px; 694 | text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); 695 | } 696 | 697 | .noty_theme__nest.noty_bar .noty_buttons { 698 | padding: 10px; 699 | } 700 | 701 | .noty_layout .noty_theme__nest.noty_bar { 702 | z-index: 5; 703 | } 704 | 705 | .noty_layout .noty_theme__nest.noty_bar:nth-child(2) { 706 | position: absolute; 707 | top: 0; 708 | margin-top: 4px; 709 | margin-right: -4px; 710 | margin-left: 4px; 711 | z-index: 4; 712 | width: 100%; 713 | } 714 | 715 | .noty_layout .noty_theme__nest.noty_bar:nth-child(3) { 716 | position: absolute; 717 | top: 0; 718 | margin-top: 8px; 719 | margin-right: -8px; 720 | margin-left: 8px; 721 | z-index: 3; 722 | width: 100%; 723 | } 724 | 725 | .noty_layout .noty_theme__nest.noty_bar:nth-child(4) { 726 | position: absolute; 727 | top: 0; 728 | margin-top: 12px; 729 | margin-right: -12px; 730 | margin-left: 12px; 731 | z-index: 2; 732 | width: 100%; 733 | } 734 | 735 | .noty_layout .noty_theme__nest.noty_bar:nth-child(5) { 736 | position: absolute; 737 | top: 0; 738 | margin-top: 16px; 739 | margin-right: -16px; 740 | margin-left: 16px; 741 | z-index: 1; 742 | width: 100%; 743 | } 744 | 745 | .noty_layout .noty_theme__nest.noty_bar:nth-child(n+6) { 746 | position: absolute; 747 | top: 0; 748 | margin-top: 20px; 749 | margin-right: -20px; 750 | margin-left: 20px; 751 | z-index: -1; 752 | width: 100%; 753 | } 754 | 755 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(2), 756 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(2) { 757 | margin-top: 4px; 758 | margin-left: -4px; 759 | margin-right: 4px; 760 | } 761 | 762 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(3), 763 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(3) { 764 | margin-top: 8px; 765 | margin-left: -8px; 766 | margin-right: 8px; 767 | } 768 | 769 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(4), 770 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(4) { 771 | margin-top: 12px; 772 | margin-left: -12px; 773 | margin-right: 12px; 774 | } 775 | 776 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(5), 777 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(5) { 778 | margin-top: 16px; 779 | margin-left: -16px; 780 | margin-right: 16px; 781 | } 782 | 783 | #noty_layout__bottomLeft .noty_theme__nest.noty_bar:nth-child(n+6), 784 | #noty_layout__topLeft .noty_theme__nest.noty_bar:nth-child(n+6) { 785 | margin-top: 20px; 786 | margin-left: -20px; 787 | margin-right: 20px; 788 | } 789 | 790 | .noty_theme__nest.noty_type__alert, 791 | .noty_theme__nest.noty_type__notification { 792 | background-color: #073B4C; 793 | color: #fff; 794 | } 795 | 796 | .noty_theme__nest.noty_type__alert .noty_progressbar, 797 | .noty_theme__nest.noty_type__notification .noty_progressbar { 798 | background-color: #fff; 799 | } 800 | 801 | .noty_theme__nest.noty_type__warning { 802 | background-color: #FFD166; 803 | color: #fff; 804 | } 805 | 806 | .noty_theme__nest.noty_type__error { 807 | background-color: #EF476F; 808 | color: #fff; 809 | } 810 | 811 | .noty_theme__nest.noty_type__error .noty_progressbar { 812 | opacity: .4; 813 | } 814 | 815 | .noty_theme__nest.noty_type__info, 816 | .noty_theme__nest.noty_type__information { 817 | background-color: #118AB2; 818 | color: #fff; 819 | } 820 | 821 | .noty_theme__nest.noty_type__info .noty_progressbar, 822 | .noty_theme__nest.noty_type__information .noty_progressbar { 823 | opacity: .6; 824 | } 825 | 826 | .noty_theme__nest.noty_type__success { 827 | background-color: #06D6A0; 828 | color: #fff; 829 | } 830 | 831 | .noty_theme__light.noty_bar { 832 | margin: 4px 0; 833 | overflow: hidden; 834 | border-radius: 2px; 835 | position: relative; 836 | } 837 | 838 | .noty_theme__light.noty_bar .noty_body { 839 | padding: 10px; 840 | } 841 | 842 | .noty_theme__light.noty_bar .noty_buttons { 843 | border-top: 1px solid #e7e7e7; 844 | padding: 5px 10px; 845 | } 846 | 847 | .noty_theme__light.noty_type__alert, 848 | .noty_theme__light.noty_type__notification { 849 | background-color: #fff; 850 | border: 1px solid #dedede; 851 | color: #444; 852 | } 853 | 854 | .noty_theme__light.noty_type__warning { 855 | background-color: #FFEAA8; 856 | border: 1px solid #FFC237; 857 | color: #826200; 858 | } 859 | 860 | .noty_theme__light.noty_type__warning .noty_buttons { 861 | border-color: #dfaa30; 862 | } 863 | 864 | .noty_theme__light.noty_type__error { 865 | background-color: #ED7000; 866 | border: 1px solid #e25353; 867 | color: #FFF; 868 | } 869 | 870 | .noty_theme__light.noty_type__error .noty_buttons { 871 | border-color: darkred; 872 | } 873 | 874 | .noty_theme__light.noty_type__info, 875 | .noty_theme__light.noty_type__information { 876 | background-color: #78C5E7; 877 | border: 1px solid #3badd6; 878 | color: #FFF; 879 | } 880 | 881 | .noty_theme__light.noty_type__info .noty_buttons, 882 | .noty_theme__light.noty_type__information .noty_buttons { 883 | border-color: #0B90C4; 884 | } 885 | 886 | .noty_theme__light.noty_type__success { 887 | background-color: #57C880; 888 | border: 1px solid #7cdd77; 889 | color: darkgreen; 890 | } 891 | 892 | .noty_theme__light.noty_type__success .noty_buttons { 893 | border-color: #50C24E; 894 | } 895 | 896 | /*# sourceMappingURL=noty.css.map*/ 897 | -------------------------------------------------------------------------------- /pvpsystem-vrp/client.lua: -------------------------------------------------------------------------------- 1 | counter = 0 -- IF COUNTER EQUALS 1 THE PLAYER IS IN THE QUEUE 2 | 3 | -- MESSAGES 4 | RegisterNetEvent("pvpsystem:notify") 5 | AddEventHandler("pvpsystem:notify", function(text, heading) 6 | notify(text) 7 | if heading then SetGameplayCamRelativeHeading(0) end 8 | end) 9 | 10 | RegisterNetEvent("pvpsystem:cancelCounter") 11 | AddEventHandler("pvpsystem:cancelCounter", function() 12 | counter = 0 13 | end) 14 | 15 | -- ADD PLAYER TO A QUEUE 16 | RegisterNetEvent("pvpsystem:pvpqueue") 17 | AddEventHandler("pvpsystem:pvpqueue", function(ident, player, args) 18 | if (args==nil) then 19 | if (ident==1) then 20 | if (counter == 0) then 21 | notify("~g~You joined the queue (1v1)") 22 | TriggerServerEvent("pvpsystem:counter1v1", source) 23 | if (Config.developerMode == false) then 24 | counter = 1 25 | end 26 | else 27 | notify("~r~You are already in a queue") 28 | end 29 | else 30 | if (counter == 0) then 31 | notify("~g~You joined the queue (2v2)") 32 | TriggerServerEvent("pvpsystem:counter2v2", source) 33 | if (Config.developerMode == false) then 34 | counter = 1 35 | end 36 | else 37 | notify("~r~You are already in a queue") 38 | end 39 | end 40 | else 41 | if (counter==0) then 42 | TriggerServerEvent("pvpsystem:comargs", player, args) 43 | if (Config.developerMode == false) then 44 | counter = 1 45 | end 46 | end 47 | end 48 | end) 49 | 50 | -- REVIVE PLAYER 51 | RegisterNetEvent("pvpsystem:revive") 52 | AddEventHandler("pvpsystem:revive", function() 53 | NetworkResurrectLocalPlayer(-1497.45, 139.64, 55.65, true, true, false) 54 | SetEntityHealth(GetPlayerFromServerId(id), 200) 55 | end) 56 | 57 | RegisterNetEvent("pvpsystem:request") 58 | AddEventHandler("pvpsystem:request", function(id1, id2) 59 | notification("pvpsystem:comargs", true, id1, id2, nil, nil, 30000, "1v1 Challenge! [ID] ".. id1) 60 | end) 61 | 62 | function notification(trigger, isServer, params1, params2, params3, params4, time, text) 63 | SendNUIMessage({ 64 | action = "request", 65 | text = text, 66 | time = time 67 | }) 68 | local time2 = time - 1 69 | Citizen.SetTimeout(time, function() 70 | time2 = time + 1 71 | end) 72 | while time > time2 do 73 | if IsControlJustPressed(1, 246) then -- IF PRESSED Y 74 | if isServer == true then 75 | TriggerServerEvent(trigger, params1, params2, params3, params4) 76 | SendNUIMessage({close = true}) 77 | break 78 | else 79 | TriggerEvent(trigger, params1, params2, params3, params4) 80 | SendNUIMessage({close = true}) 81 | break 82 | end 83 | elseif IsControlJustPressed(1, 303) then -- IF PRESSED U 84 | SendNUIMessage({close = true}) 85 | break 86 | end 87 | Wait(1) 88 | end 89 | end 90 | 91 | -- NOTIFICATIONS 92 | function notify(str) 93 | BeginTextCommandThefeedPost("STRING") 94 | AddTextComponentSubstringPlayerName(str) 95 | EndTextCommandThefeedPostTicker(true, false) 96 | end -------------------------------------------------------------------------------- /pvpsystem-vrp/config.lua: -------------------------------------------------------------------------------- 1 | -- CONFIG FILE -- PvP System 2 | Config = {} 3 | 4 | -- DEVELOPER MODE - IF YOU ARE TESTING WITHOUT ANOTHER PLAYER: TRUE - PLAYER IS ENABLE TO JOIN IN A QUEUE MORE THAN 1 TIME 5 | Config.developerMode = false 6 | 7 | -- ENABLE VEHICLES IN SOME DIMENSION 8 | Config.disableVehicles = true -- This resource disable the spawn of vehicles in some pvp dimensions. To disable this turn the variable to false. 9 | 10 | -- WEAPONS - Default: Pistol MK2 = "weapon_pistol_mk2" 11 | Config.weapon1v1 = "weapon_pistol_mk2" -- Weapon 1v1 12 | Config.weapon2v2 = "weapon_pistol_mk2" -- Weapon 2v2 13 | 14 | -- COORDS 15 | Config.respawnCoords = {-1497.45, 139.64, 55.65} -- Respawn point coords // {X, Y, Z} 16 | Config.respawnCoordsHeading = 314.48 -- Sets a point for the player to look at when teleported 17 | 18 | Config.firstSpawnCoords1v1 = {-1748.63, 175.88, 64.37} -- First spawn point coords of 1v1 arena // {X, Y, Z} 19 | Config.firstSpawnCoords1v1Heading = 210.26 -- Sets a point for the player to look at when teleported 20 | Config.secondSpawnCoords1v1 = {-1727.01, 145.06, 64.4} -- Second spawn point coords of 1v1 arena // {X, Y, Z} 21 | Config.secondSpawnCoords1v1Heading = 38.05 -- Sets a point for the player to look at when teleported 22 | 23 | Config.firstTeamSpawnCoords2v2 = {1214.89, 3115.29, 40.41} -- (Team 1) First spawn point coords of 2v2 arena // {X, Y, Z} 24 | Config.firstTeamSpawnCoords2v2Heading = 286.34 -- Sets a point for the player to look at when teleported 25 | Config.secondTeamSpawnCoords2v2 = {1115.73, 3090.54, 40.41} -- (Team 2) Third spawn point coords of 2v2 arena // {X, Y, Z} 26 | Config.secondTeamSpawnCoords2v2Heading = 108.94 -- Sets a point for the player to look at when teleported -------------------------------------------------------------------------------- /pvpsystem-vrp/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'cerulean' 2 | games {'gta5'} 3 | 4 | name 'pvpsystem' 5 | description 'PvP System (1V1, 2V2)' 6 | version '1.5' 7 | 8 | server_scripts { 9 | '@vrp/lib/utils.lua', 10 | 'config.lua', 11 | 'server.lua' 12 | } 13 | 14 | client_scripts { 15 | 'config.lua', 16 | 'client.lua' 17 | } 18 | 19 | ui_page 'NUI/index.html' 20 | 21 | files { 22 | 'NUI/*' 23 | } 24 | 25 | dependency 'vrp' 26 | -------------------------------------------------------------------------------- /pvpsystem-vrp/server.lua: -------------------------------------------------------------------------------- 1 | local Tunnel = module("vrp","lib/Tunnel") 2 | local Proxy = module("vrp","lib/Proxy") 3 | vRP = Proxy.getInterface("vRP") 4 | vRPclient = Tunnel.getInterface("vRP") 5 | 6 | -- FUNCTIONS 7 | function function1v1(player, x, y, z, heading, dimension) 8 | SetEntityCoords(player, x, y, z, false, true, true, false) 9 | SetEntityHeading(player, heading) 10 | SetPlayerRoutingBucket(player, dimension) -- DIMENSION 11 | RemoveAllPedWeapons(player, false) 12 | GiveWeaponToPed(player, GetHashKey("weapon_pistol_mk2"), 200, true) 13 | SetCurrentPedWeapon(player, GetHashKey("weapon_pistol_mk2"), true) 14 | TriggerClientEvent("pvpsystem:notify", player, "You are in the arena: ~b~#1", true) 15 | end 16 | 17 | function function2v2(player, dimension) 18 | SetPlayerRoutingBucket(player, dimension) 19 | RemoveAllPedWeapons(player, false) 20 | GiveWeaponToPed(player, GetHashKey(Config.weapon2v2), 200, true) 21 | SetCurrentPedWeapon(player, GetHashKey(Config.weapon2v2), true) 22 | TriggerClientEvent("pvpsystem:notify", player, "You are in the arena: #2", "success", 3000, true) 23 | end 24 | 25 | function revivePlayer(player, x, y, z, heading) 26 | SetEntityCoords(player, x, y, z, false, true, true, false) 27 | SetEntityHeading(player, heading) 28 | SetPlayerRoutingBucket(player, 0) 29 | TriggerClientEvent("pvpsystem:revive", player, player) 30 | vRPclient.killGod(players[i]) 31 | vRPclient.setHealth(players[i], 200) 32 | end 33 | 34 | function dimensions(dimension, initialDimension) 35 | Citizen.CreateThread(function() 36 | while true do 37 | if (dimension==(initialDimension+301)) then 38 | dimension=initialDimension 39 | end 40 | Citizen.Wait(10) 41 | end 42 | end) 43 | end 44 | 45 | -- VARS 46 | id = nil 47 | -- HEALTH LIMIT TO GET IN COMA (DIE) 48 | healthlimit = 0 -- CHANGE TO HEALTH LIMIT OF YOUR SERVER IF DOESN'T WORK 49 | 50 | -- VARS TO 1v1 51 | count = 1 52 | queue1v1 = {} 53 | initialDimension1v1 = 1000 54 | dimension1v1 = initialDimension1v1 -- INITIAL DIMENSION 1V1 55 | 56 | -- VARS TO 2v2 57 | queue2v2={} 58 | initialDimension2v2 = 100 59 | dimension2v2 = initialDimension2v2 -- INITIAL DIMENSION 2V2 60 | 61 | -- DISABLE VEHICLES IN THE SOME DIMENSIONS 62 | if Config.disableVehicles then 63 | for i = (initialDimension1v1+300),initialDimension1v1,-1 do 64 | SetRoutingBucketEntityLockdownMode(i, "strict") 65 | end 66 | for i = (initialDimension2v2+300),initialDimension2v2,-1 do 67 | SetRoutingBucketEntityLockdownMode(i, "strict") 68 | end 69 | end 70 | 71 | -- CANCEL QUEUE 72 | RegisterServerEvent("pvpsystem:cancelQueue") 73 | AddEventHandler("pvpsystem:cancelQueue", function(id) 74 | -- CANCEL 1v1 QUEUE 75 | for i=#queue1v1,1,-1 do 76 | if queue1v1[i] == id then 77 | table.remove(queue1v1, i) 78 | break 79 | end 80 | end 81 | -- CANCEL 2v2 QUEUE 82 | for i=#queue2v2,1,-1 do 83 | if queue2v2[i] == id then 84 | table.remove(queue2v2, i) 85 | break 86 | end 87 | end 88 | TriggerClientEvent("pvpsystem:cancelCounter", id) 89 | end) 90 | 91 | 92 | -- ADD A PLAYER TO THE 1V1 QUEUE 93 | RegisterServerEvent("pvpsystem:counter1v1") 94 | AddEventHandler("pvpsystem:counter1v1", function() 95 | table.insert(queue1v1, source) 96 | end) 97 | 98 | -- ADD A TEAM TO THE 2V2 QUEUE 99 | RegisterServerEvent("pvpsystem:counter2v2") 100 | AddEventHandler("pvpsystem:counter2v2", function() 101 | table.insert(queue2v2, source) 102 | end) 103 | 104 | 105 | -- 1V1 WITH QUEUE 106 | Citizen.CreateThread(function() 107 | while true do 108 | if (#queue1v1>=2) then 109 | -- PLAYER 1 110 | function1v1(queue1v1[1], Config.firstSpawnCoords1v1[1], Config.firstSpawnCoords1v1[2], Config.firstSpawnCoords1v1[3], Config.firstSpawnCoords1v1Heading, dimension1v1) 111 | -- PLAYER 2 112 | function1v1(queue1v1[2], Config.secondSpawnCoords1v1[1], Config.secondSpawnCoords1v1[2], Config.secondSpawnCoords1v1[3], Config.secondSpawnCoords1v1Heading, dimension1v1) 113 | -- CHECK IF ANY PLAYER DIE 114 | TriggerEvent("pvpsystem:die1v1", queue1v1[1], queue1v1[2]) 115 | -- DIMENSIONS SETTINGS 116 | dimension1v1 = dimension1v1 + 1 117 | table.remove(queue1v1, 2) 118 | table.remove(queue1v1, 1) 119 | end 120 | Citizen.Wait(1200) 121 | end 122 | end) 123 | 124 | -- 1V1 WITHOUT QUEUE, NEEDS AN ID OF A FRIEND (EX: /1v1 [id]) 125 | RegisterServerEvent("pvpsystem:comargs") 126 | AddEventHandler("pvpsystem:comargs", function(player1, player2) 127 | dimension1v1 = dimension1v1 + 1 -- DIMENSIONS SETTINGS 128 | -- PLAYER 1 129 | function1v1(player1, Config.firstSpawnCoords1v1[1], Config.firstSpawnCoords1v1[2], Config.firstSpawnCoords1v1[3], Config.firstSpawnCoords1v1Heading, dimension1v1) 130 | -- PLAYER 2 131 | function1v1(tonumber(player2), Config.secondSpawnCoords1v1[1], Config.secondSpawnCoords1v1[2], Config.secondSpawnCoords1v1[3], Config.secondSpawnCoords1v1Heading, dimension1v1) 132 | -- CHECK IF ANY PLAYER DIE 133 | TriggerEvent("pvpsystem:die1v1", player1, player2) 134 | end) 135 | 136 | -- 1V1 COMMAND 137 | RegisterCommand("1v1", function(source, args) 138 | if (args[1]==nil) then 139 | TriggerClientEvent("pvpsystem:pvpqueue", source, 1) 140 | elseif (source==tonumber(args[1]) and Config.developerMode==false) then 141 | TriggerClientEvent("pvpsystem:notify", source, "~r~You can't challenge yourself!", false) 142 | else 143 | TriggerClientEvent("pvpsystem:request", args[1], source, args[1]) 144 | end 145 | end) 146 | 147 | -- 2V2 COMMAND 148 | RegisterCommand("2v2", function(source) 149 | TriggerClientEvent("pvpsystem:pvpqueue", source, 2) 150 | end) 151 | 152 | RegisterCommand("cancelQueue", function(source) 153 | TriggerEvent("pvpsystem:cancelQueue", source) 154 | TriggerClientEvent("pvpsystem:notify", source, "Queue canceled!", "primary", 3000, false) 155 | end) 156 | 157 | -- IF SOMEONE DIE THE PLAYERS GO TO A POINT (1V1) 158 | RegisterServerEvent("pvpsystem:die1v1") 159 | AddEventHandler("pvpsystem:die1v1", function(player1, player2) 160 | Citizen.CreateThread(function() 161 | while true do 162 | if (GetEntityHealth(GetPlayerPed(player1))<=healthlimit or GetEntityHealth(GetPlayerPed(player2))<=healthlimit) then 163 | if (GetEntityHealth(GetPlayerPed(player1))<=healthlimit) then 164 | TriggerClientEvent("pvpsystem:notify", player1, "~r~You lost!", true) 165 | TriggerClientEvent("pvpsystem:notify", player2, "~g~You won!", true) 166 | elseif (GetEntityHealth(GetPlayerPed(player2))<=healthlimit) then 167 | TriggerClientEvent("pvpsystem:notify", player2, "~g~You won!", true) 168 | TriggerClientEvent("pvpsystem:notify", player1, "~g~You lost!", true) 169 | end 170 | Citizen.Wait(1500) 171 | -- REVIVE PLAYERS 172 | revivePlayer(player1, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 173 | revivePlayer(player2, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 174 | TriggerClientEvent("pvpsystem:cancelCounter", player1) 175 | TriggerClientEvent("pvpsystem:cancelCounter", player2) 176 | break 177 | end 178 | Citizen.Wait(1) 179 | end 180 | end) 181 | end) 182 | 183 | -- 2v2 184 | Citizen.CreateThread(function() 185 | while true do 186 | if (#queue2v2>=4) then 187 | for i=1,4 do 188 | SetEntityCoords(queue2v2[i], Config.firstTeamSpawnCoords2v2[1], Config.firstTeamSpawnCoords2v2[2], Config.firstTeamSpawnCoords2v2[3], true, true, true, false) 189 | end 190 | SetEntityHeading(queue2v2[1], Config.firstTeamSpawnCoords2v2Heading) 191 | SetEntityHeading(queue2v2[2], Config.firstTeamSpawnCoords2v2Heading) 192 | SetEntityHeading(queue2v2[3], Config.secondTeamSpawnCoords2v2Heading) 193 | SetEntityHeading(queue2v2[4], Config.secondTeamSpawnCoords2v2Heading) 194 | for i=4,1,-1 do 195 | function2v2(queue2v2[i], dimension2v2) 196 | end 197 | TriggerEvent("pvpsystem:die2v2", queue2v2[1], queue2v2[2], queue2v2[3], queue2v2[4]) 198 | dimension2v2 = dimension2v2 + 1 199 | for i=4,1,-1 do 200 | table.remove(queue2v2, i) 201 | end 202 | end 203 | Citizen.Wait(1200) 204 | end 205 | end) 206 | 207 | -- IF A TEAM DIES, THE PLAYERS GO TO A POINT (2V2) 208 | RegisterServerEvent("pvpsystem:die2v2") 209 | AddEventHandler("pvpsystem:die2v2", function(player1, player2, player3, player4) -- TEAM 1 - PLAYER 1 AND 2 210 | Citizen.CreateThread(function() -- TEAM 2 - PLAYER 3 AND 4 211 | while true do 212 | if (GetEntityHealth(GetPlayerPed(player1))<=healthlimit and GetEntityHealth(GetPlayerPed(player2))<=healthlimit or GetEntityHealth(GetPlayerPed(player3))<=healthlimit and GetEntityHealth(GetPlayerPed(player4))<=healthlimit) then 213 | if (GetEntityHealth(GetPlayerPed(player1))<=healthlimit and GetEntityHealth(GetPlayerPed(player2))<=healthlimit) then 214 | TriggerClientEvent("pvpsystem:notify", player1, "~r~You lost!", true) 215 | TriggerClientEvent("pvpsystem:notify", player2, "~r~You lost!", true) 216 | TriggerClientEvent("pvpsystem:notify", player3, "~g~You won!", true) 217 | TriggerClientEvent("pvpsystem:notify", player4, "~g~You won!", true) 218 | elseif (GetEntityHealth(GetPlayerPed(player3))<=healthlimit and GetEntityHealth(GetPlayerPed(player4))<=healthlimit) then 219 | TriggerClientEvent("pvpsystem:notify", player4, "~r~You lost!", true) 220 | TriggerClientEvent("pvpsystem:notify", player3, "~r~You lost!", true) 221 | TriggerClientEvent("pvpsystem:notify", player2, "~g~You won!", true) 222 | TriggerClientEvent("pvpsystem:notify", player1, "~g~You won!", true) 223 | end 224 | Citizen.Wait(1500) 225 | revivePlayer(player1, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 226 | revivePlayer(player2, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 227 | revivePlayer(player3, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 228 | revivePlayer(player4, Config.respawnCoords[1], Config.respawnCoords[2], Config.respawnCoords[3], Config.respawnCoordsHeading) 229 | break 230 | end 231 | Citizen.Wait(1) 232 | end 233 | end) 234 | end) 235 | 236 | -- WHEN THE DIMENSION REACHES THE LIMIT, IT RETURNS TO THE INITIAL NUMBER 237 | dimensions(dimension1v1, initialDimension1v1) -- 1v1 Dimension 238 | dimensions(dimension1v1, initialDimension2v2) -- 2v2 Dimension --------------------------------------------------------------------------------