Sign in to follow this  
Brolis

[HELP] ERROR: server\paynspray.lua:57: table inde

Recommended Posts

When mobako services starts, in server console writes me:

ERROR: shopsystem\server\paynspray.lua:57: table index is nil

    -- We need a list of random colors to assign, so let's have a look at the server's vehiclecolors.conf 
    local file = fileOpen( "data/vehiclecolors.conf", true ) 
    while not fileIsEOF( file ) do 
        local line = fileReadLine( file ) 
        if #line > 0 and line:sub( 1, 1 ) ~= "#" then 
            local model = tonumber( gettok( line, 1, string.byte(' ') ) ) 
            if not vehicleColors[ model ] then 
                vehicleColors[ model ] = { } 
            end 
            vehicleColors[ model ][ #vehicleColors[ model ] + 1 ] = { 
                tonumber( gettok( line, 2, string.byte(' ') ) ), 
                tonumber( gettok( line, 3, string.byte(' ') ) ) or nil, 
                tonumber( gettok( line, 4, string.byte(' ') ) ) or nil, 
                tonumber( gettok( line, 5, string.byte(' ') ) ) or nil 
            } 
        end 
    end 
    fileClose( file ) 

Share this post


Link to post

Sorry for double post, but will I get a help? I really need to fix that error...

Share this post


Link to post

#################################################################

# This file defines the color combinations a vehicle can have.

#

# The syntax is:

# [Vehicle ID]

#

# Note that most vehicles doesn't need more than two colors

#

# You can specify a vehicle ID more than once to specify more

# than one combination for a vehicle. The color combination

# used for a vehicle is randomly decided each time a player

# spawns in a vehicle.

#

# If you mess this file up, just delete it and the server will

# generate a new file with GTA's default values in it.

#################################################################

416 1 3

445 34 34

445 35 35

445 37 37

445 39 39

445 41 41

445 43 43

445 45 45

445 47 47

485 1 73

485 1 74

485 1 75

485 1 76

485 1 77

485 1 78

485 1 79

429 12 12

429 13 13

429 14 14

429 1 2

429 2 1

429 1 3

429 3 1

429 10 10

433 43 0

499 109 25

499 109 32

499 112 32

499 10 32

499 30 44

499 32 52

499 84 66

499 84 69

496 74 72

496 66 72

496 53 56

496 37 19

496 22 22

496 20 20

496 9 14

496 0 0

422 96 25

422 97 25

422 101 25

422 111 31

422 113 36

422 83 57

422 67 59

424 1 0

424 2 2

424 3 2

424 3 6

424 6 16

424 15 30

424 24 53

424 35 61

481 1 1

481 3 3

481 6 6

481 46 46

481 65 9

481 14 1

481 12 9

481 26 1

401 41 41

401 47 47

401 52 52

401 66 66

401 74 74

401 87 87

401 91 91

401 113 113

402 10 10

402 13 13

402 22 22

402 30 30

402 39 39

402 90 90

402 98 98

402 110 110

431 71 59

431 75 59

431 92 72

431 47 74

431 55 83

431 59 83

431 71 87

431 82 87

438 6 76

482 41 41

482 48 48

482 52 52

482 64 64

482 71 71

482 85 85

482 10 10

482 62 62

415 20 1

415 25 1

415 36 1

415 40 1

415 62 1

415 75 1

415 92 1

415 0 1

437 54 7

437 79 7

437 87 7

437 95 16

437 98 20

437 105 20

437 123 20

437 125 21

472 56 15

472 56 53

480 73 45

480 12 12

480 2 2

480 6 6

480 4 4

480 46 46

480 53 53

473 56 15

473 56 53

406 1 1

407 3 1

486 1 1

427 0 1

419 45 75

419 47 76

419 33 75

419 13 76

419 54 75

419 69 76

419 59 75

419 87 76

462 12 12

462 13 13

462 14 14

462 1 2

462 2 1

462 1 3

462 3 1

462 10 10

490 0 0

455 84 15

455 84 58

455 84 31

455 32 74

455 43 31

455 1 31

455 77 31

455 32 74

463 79 79

463 84 84

463 7 7

463 11 11

463 19 19

463 22 22

463 36 36

463 53 53

466 67 76

466 68 76

466 78 76

466 2 76

466 16 76

466 18 76

466 25 76

466 45 88

434 1 1

434 12 12

434 2 2

434 6 6

434 4 4

434 46 46

434 53 53

474 97 1

474 81 1

474 105 1

474 110 1

474 91 1

474 74 1

474 84 1

474 83 1

492 30 26

492 77 26

492 81 27

492 24 55

492 28 56

492 49 59

492 52 69

492 71 107

425 43 0

411 12 1

411 64 1

411 123 1

411 116 1

411 112 1

411 106 1

411 80 1

411 75 1

400 4 1

400 123 1

400 113 1

400 101 1

400 75 1

400 62 1

400 40 1

400 36 1

403 36 1

403 37 1

403 30 1

403 28 1

403 25 1

403 40 1

403 101 1

403 113 1

410 4 1

410 9 1

410 10 1

410 25 1

410 36 1

410 40 1

410 45 1

410 84 1

484 12 35

484 50 32

484 40 26

484 66 36

487 26 14

487 29 42

487 26 57

487 54 29

487 26 3

487 3 29

487 12 39

487 74 35

500 75 84

500 40 84

500 40 110

500 28 119

500 25 119

500 21 119

500 13 119

500 4 119

444 32 36

444 32 42

444 32 53

444 32 66

444 32 14

444 32 32

418 119 119

418 117 227

418 114 114

418 108 108

418 95 95

418 81 81

418 61 61

418 41 41

423 1 16

423 1 56

423 1 17

423 1 53

423 1 5

423 1 35

414 25 1

414 28 1

414 43 1

414 67 1

414 72 1

414 9 1

414 95 1

414 24 1

404 113 39

404 119 50

404 123 92

404 109 100

404 101 101

404 95 105

404 83 110

404 66 25

443 4 1

443 20 1

443 24 1

443 25 1

443 36 1

443 40 1

443 54 1

443 84 1

461 36 1

461 37 1

461 43 1

461 53 1

461 61 1

461 75 1

461 79 1

461 88 1

467 51 1

467 58 8

467 60 1

467 68 8

467 2 1

467 13 8

467 22 1

467 36 8

470 43 0

448 3 6

413 87 1

413 88 1

413 91 1

413 105 1

413 109 1

413 119 1

413 4 1

413 25 1

430 46 26

426 37 37

426 42 42

426 53 53

426 62 62

426 7 7

426 10 10

426 11 11

426 15 15

436 83 1

436 87 1

436 92 1

436 95 1

436 109 1

436 119 45

436 11 1

441 2 96

441 79 42

441 82 54

441 67 86

441 126 96

441 70 96

441 110 54

441 67 98

464 14 75

465 14 75

489 13 118

489 14 123

489 120 123

489 112 120

489 84 110

489 76 102

501 14 75

453 56 56

479 27 36

479 59 36

479 60 35

479 55 41

479 54 31

479 49 23

479 45 32

479 40 29

432 43 0

440 34 34

440 32 32

440 20 20

440 110 110

440 66 66

440 84 84

440 118 118

440 121 121

442 0 0

442 11 105

442 25 109

442 36 0

442 40 36

442 75 36

442 0 36

442 0 109

475 2 39

475 9 39

475 17 1

475 21 1

475 33 0

475 37 0

475 41 29

475 56 29

476 6 7

476 7 6

476 1 6

476 89 91

476 119 117

476 103 102

476 77 87

476 71 77

495 123 124

495 119 122

495 118 117

495 116 115

495 114 108

495 101 106

495 88 99

495 5 6

405 11 1

405 24 1

405 36 1

405 40 1

405 75 1

405 91 1

405 123 1

405 4 1

428 4 75

447 75 2

452 1 3

452 1 5

452 1 16

452 1 22

452 1 35

452 1 44

452 1 53

452 1 57

458 91 1

458 101 1

458 109 1

458 113 1

458 4 1

458 25 1

458 30 1

458 36 1

469 1 3

439 57 8

439 8 17

439 43 21

439 54 38

439 67 8

439 37 78

439 65 79

439 25 78

409 1 1

506 3 3

506 6 6

506 7 7

506 52 52

506 76 76

420 6 1

459 26 26

459 28 28

459 44 44

459 51 51

459 57 57

459 72 72

459 106 106

459 112 112

408 26 26

454 26 26

451 123 123

451 125 125

451 36 36

451 16 16

451 18 18

451 46 46

451 61 61

451 75 75

412 9 1

412 10 8

412 11 1

412 25 8

412 27 1

412 29 8

412 30 1

412 37 8

421 4 1

421 13 1

421 25 1

421 30 1

421 36 1

421 40 1

421 75 1

421 95 1

478 72 1

478 66 1

478 59 1

478 45 1

478 40 1

478 39 1

478 35 1

478 20 1

491 40 65

491 71 72

491 52 66

491 64 72

491 30 72

491 60 72

456 84 63

456 91 63

456 102 65

456 105 72

456 110 93

456 121 93

456 12 95

456 23 1

477 92 1

477 94 1

477 101 1

477 121 1

477 0 1

477 22 1

477 36 1

477 75 1

602 58 1

602 69 1

602 75 77

602 18 1

602 32 1

602 45 45

602 13 1

602 34 1

577 1 3

577 8 7

577 8 10

577 8 16

577 23 31

577 40 44

568 2 39

568 9 39

568 17 1

568 21 1

568 33 0

568 37 0

568 41 29

568 56 29

511 3 90

511 4 90

511 7 68

511 8 66

511 12 60

511 27 97

511 34 51

511 37 51

581 54 1

581 58 1

581 66 1

581 72 1

581 75 1

581 87 1

581 101 1

581 36 1

509 7 1

509 74 1

509 61 1

509 16 1

509 25 1

509 30 1

509 36 1

509 53 1

536 9 1

536 12 1

536 26 96

536 30 96

536 32 1

536 37 1

536 57 96

536 71 96

609 36 36

575 12 1

575 19 96

575 31 64

575 25 96

575 38 1

575 51 96

575 57 1

575 66 96

518 2 39

518 9 39

518 17 1

518 21 1

518 33 0

518 37 0

518 41 29

518 56 29

541 51 1

541 58 8

541 60 1

541 68 8

541 2 1

541 13 8

541 22 1

541 36 8

527 52 1

527 53 1

527 66 1

527 75 1

527 76 1

527 81 1

527 95 1

527 109 1

548 1 1

592 1 1

542 13 118

542 24 118

542 31 93

542 32 92

542 45 92

542 113 92

542 119 113

542 122 113

589 37 37

589 31 31

589 23 23

589 22 22

589 7 7

589 124 124

589 114 114

589 112 112

512 17 39

512 15 123

512 32 112

512 45 88

512 52 71

512 57 67

512 61 96

512 96 96

578 1 1

593 51 1

593 58 8

593 60 1

593 68 8

593 2 1

593 13 8

593 22 1

593 36 8

507 37 37

507 42 42

507 53 53

507 62 62

507 7 7

507 10 10

507 11 11

507 15 15

562 36 1

562 35 1

562 17 1

562 11 1

562 116 1

562 113 1

562 101 1

562 92 1

585 37 37

585 42 42

585 53 53

585 62 62

585 7 7

585 10 10

585 11 11

585 15 15

587 36 1

587 40 1

587 43 1

587 53 1

587 72 1

587 75 1

587 95 1

587 101 1

521 74 74

521 75 13

521 87 118

521 92 3

521 115 118

521 25 118

521 36 0

521 118 118

533 73 1

533 74 1

533 75 1

533 77 1

533 79 1

533 83 1

533 84 1

533 91 1

544 3 1

565 37 37

565 42 42

565 53 53

565 62 62

565 7 7

565 10 10

565 11 11

565 15 15

530 110 1

530 111 1

530 112 1

530 114 1

530 119 1

530 122 1

530 4 1

530 13 1

526 2 39

526 9 39

526 17 1

526 21 1

526 33 0

526 37 0

526 41 29

526 56 29

537 1 1

588 1 1

579 37 37

579 42 42

579 53 53

579 62 62

579 7 7

579 10 10

579 11 11

579 15 15

545 50 1

545 47 1

545 44 96

545 40 96

545 39 1

545 30 1

545 28 96

545 9 96

546 62 37

546 78 38

546 2 62

546 3 87

546 2 78

546 113 78

546 119 62

546 7 78

559 51 1

559 58 8

559 60 1

559 68 8

559 2 1

559 13 8

559 22 1

559 36 8

493 36 13

508 1 1

571 2 35

571 36 2

571 51 53

571 91 2

571 11 22

571 40 35

595 112 20

517 37 36

517 36 36

517 40 36

517 43 41

517 47 41

517 51 72

517 54 75

517 55 84

596 0 1

597 0 1

598 0 1

599 0 1

435 1 1

450 1 1

591 1 1

504 51 39

504 57 38

504 45 29

504 34 9

504 65 9

504 14 1

504 12 9

504 26 1

498 11 123

498 13 120

498 20 117

498 24 112

498 27 107

498 36 105

498 37 107

498 43 93

457 58 1

457 2 1

457 63 1

457 18 1

457 32 1

457 45 1

457 13 1

457 34 1

573 91 38

573 115 43

573 85 6

573 79 7

573 78 8

573 77 18

573 79 18

573 86 24

604 67 76

604 68 76

604 78 76

604 2 76

604 16 76

604 18 76

604 25 76

604 45 88

502 7 94

502 36 88

502 51 75

502 53 75

502 58 67

502 75 67

502 75 61

502 79 62

503 83 66

503 87 74

503 87 75

503 98 83

503 101 100

503 103 101

503 117 116

503 123 36

494 36 117

494 36 13

494 42 30

494 42 33

494 54 36

494 75 79

494 92 101

494 98 109

471 120 117

471 103 111

471 120 114

471 74 91

471 120 112

471 74 83

471 120 113

471 66 71

510 43 43

510 46 46

510 39 39

510 28 28

510 16 16

510 6 6

510 5 5

510 2 2

551 67 1

551 72 1

551 75 1

551 83 1

551 91 1

551 101 1

551 109 1

551 20 1

556 1 1

557 1 1

572 94 1

572 101 1

572 116 1

572 117 1

572 4 1

572 25 1

572 30 1

572 37 1

516 116 1

516 119 1

516 122 1

516 4 1

516 9 1

516 24 1

516 27 1

516 36 1

553 38 9

553 55 23

553 61 74

553 71 87

553 91 87

553 98 114

553 102 119

553 111 3

582 41 10

582 41 20

582 49 11

582 56 123

582 110 113

582 112 116

582 114 118

582 119 101

522 3 3

522 3 8

522 6 25

522 7 79

522 8 82

522 36 105

522 39 106

522 51 118

514 10 1

514 25 1

514 28 1

514 36 1

514 40 1

514 54 1

514 75 1

514 113 1

584 1 1

603 58 1

603 69 1

603 75 77

603 18 1

603 32 1

603 45 45

603 13 1

603 34 1

600 81 8

600 32 8

600 43 8

600 67 8

600 11 11

600 8 90

600 2 2

600 83 13

497 0 1

547 122 1

547 123 1

547 125 1

547 10 1

547 24 1

547 37 1

547 55 1

547 66 1

563 1 6

515 13 76

515 24 77

515 63 78

515 42 76

515 54 77

515 39 78

515 11 76

515 62 77

534 37 37

534 42 42

534 53 53

534 62 62

534 7 7

534 10 10

534 11 11

534 15 15

505 13 118

505 14 123

505 120 123

505 112 120

505 84 110

505 76 102

543 76 8

543 32 8

543 43 8

543 67 8

543 11 11

543 8 90

543 2 2

543 83 13

605 61 8

605 32 8

605 43 8

605 67 8

605 11 11

605 8 90

605 2 2

605 83 13

468 6 6

468 46 46

468 53 53

468 3 3

567 97 96

567 88 64

567 90 96

567 93 64

567 97 96

567 99 81

567 102 114

567 114 1

519 1 1

538 1 1

570 1 1

460 1 3

460 1 9

460 1 18

460 1 30

460 17 23

460 46 23

460 46 32

460 57 34

535 3 1

535 28 1

535 31 1

535 55 1

535 66 1

535 97 1

535 123 1

535 118 1

580 92 92

580 81 81

580 67 67

580 66 66

580 61 61

580 53 53

580 51 51

580 47 47

580 43 43

561 57 8

561 8 17

561 43 21

561 54 38

561 67 8

561 37 78

561 65 79

561 25 78

513 38 51

513 21 36

513 21 34

513 30 34

513 54 34

513 55 20

513 48 18

513 51 6

560 52 39

560 9 39

560 17 1

560 21 1

560 33 0

560 37 0

560 41 29

560 56 29

550 37 37

550 42 42

550 53 53

550 62 62

550 7 7

550 10 10

550 11 11

550 15 15

601 1 1

574 26 26

566 109 1

566 30 8

566 95 1

566 84 8

566 83 1

566 72 8

566 71 1

566 52 8

549 74 39

549 72 39

549 75 39

549 79 39

549 83 36

549 84 36

549 89 35

549 91 35

576 67 1

576 68 96

576 72 1

576 74 8

576 75 96

576 76 8

576 79 1

576 84 96

525 1 1

525 17 20

525 18 20

525 22 30

525 36 43

525 44 51

525 52 54

531 2 35

531 36 2

531 51 53

531 91 2

531 11 22

531 40 35

449 1 74

583 1 1

608 1 1

558 112 1

558 116 1

558 117 1

558 24 1

558 30 1

558 35 1

558 36 1

558 40 1

552 56 56

552 49 49

552 26 124

488 2 26

488 2 29

540 37 37

540 42 42

540 53 53

540 62 62

540 7 7

540 10 10

540 11 11

540 15 15

539 96 67

539 86 70

539 79 74

539 70 86

539 61 98

539 75 75

539 75 91

586 119 1

586 122 1

586 8 1

586 10 1

586 13 1

586 25 1

586 27 1

586 32 1

529 37 37

529 42 42

529 53 53

529 62 62

529 7 7

529 10 10

529 11 11

529 15 15

555 51 1

555 58 1

555 60 1

555 68 1

555 2 1

555 13 1

555 22 1

555 36 1

554 53 32

554 15 32

554 45 32

554 34 30

554 65 32

554 14 32

554 12 32

554 43 32

483 1 31 1 0

483 1 31 1 0

483 1 20 3 0

483 1 5 0 0

483 0 6 3 0

483 3 6 3 0

483 16 0 8 0

483 17 0 120 0

524 60 24 23 0

524 61 27 123 0

524 65 31 31 0

524 61 61 30 0

524 81 35 23 0

524 62 61 62 0

524 83 66 64 0

524 83 64 64 0

446 0 0 0 1

446 1 5 1 1

446 3 3 0 1

446 1 22 1 1

446 1 35 1 1

446 1 44 1 1

446 1 53 1 1

446 1 57 1

Share this post


Link to post

paynspray.lua

local paynsprayCosts = get( "PayNSprayCosts" ) 
local disallowedVehicles = get("DisallowedVehicles") 
local vehicleColors = { } 
  
local paynsprays = { } 
  
function fileReadLine( file ) 
    local buffer = "" 
    local tmp 
    repeat 
        tmp = fileRead( file, 1 ) or nil 
        if tmp and tmp ~= "\r" and tmp ~= "\n" then 
            buffer = buffer .. tmp 
        end 
    until not tmp or tmp == "\n" or tmp == "" 
     
    return buffer 
end 
  
function onResourceStart(res) 
    -- load the Garages... 
    local garageElements = getElementsByType ( "garage", getResourceRootElement(res) ) 
     
    for k,v in ipairs(garageElements) do 
        local garage_type = tonumber( getElementData( v, "garageType" ) ) 
        if( garage_type == 5 ) then -- 5 = Pay'N'Sprays 
            local num = #paynsprays+1 
            paynsprays[num] = { } 
            paynsprays[num].Name = getElementData( v, "name" ) 
            paynsprays[num].lowerLeftFrontX = tonumber( getElementData( v, "lowerLeftFrontX" ) ) 
            paynsprays[num].lowerLeftFrontY = tonumber( getElementData( v, "lowerLeftFrontY" ) ) 
            paynsprays[num].lowerLeftFrontZ = tonumber( getElementData( v, "lowerLeftFrontZ" ) ) 
            paynsprays[num].lowerRightFrontX = tonumber( getElementData( v, "lowerRightFrontX" ) ) 
            paynsprays[num].lowerRightFrontY = tonumber( getElementData( v, "lowerRightFrontY" ) ) 
            paynsprays[num].upperLeftRearX = tonumber( getElementData( v, "upperLeftRearX" ) ) 
            paynsprays[num].upperLeftRearY = tonumber( getElementData( v, "upperLeftRearY" ) ) 
            paynsprays[num].upperLeftRearZ = tonumber( getElementData( v, "upperLeftRearZ" ) ) 
             
            paynsprays[num].smallestX = math.min( paynsprays[num].lowerLeftFrontX, paynsprays[num].lowerRightFrontX, paynsprays[num].upperLeftRearX ) 
            paynsprays[num].width = math.max( paynsprays[num].lowerLeftFrontX, paynsprays[num].lowerRightFrontX, paynsprays[num].upperLeftRearX ) - paynsprays[num].smallestX 
             
            paynsprays[num].smallestY = math.min( paynsprays[num].lowerLeftFrontY, paynsprays[num].lowerRightFrontY, paynsprays[num].upperLeftRearY ) 
            paynsprays[num].depth = math.max( paynsprays[num].lowerLeftFrontY, paynsprays[num].lowerRightFrontY, paynsprays[num].upperLeftRearY ) - paynsprays[num].smallestY 
             
            paynsprays[num].smallestZ = math.min( paynsprays[num].lowerLeftFrontZ, paynsprays[num].upperLeftRearZ ) 
            paynsprays[num].height = math.max( paynsprays[num].lowerLeftFrontZ, paynsprays[num].upperLeftRearZ ) - paynsprays[num].smallestZ 
        end 
    end 
     
    -- We need a list of random colors to assign, so let's have a look at the server's vehiclecolors.conf 
    local file = fileOpen( "data/vehiclecolors.conf", true ) 
    while not fileIsEOF( file ) do 
        local line = fileReadLine( file ) 
        if #line > 0 and line:sub( 1, 1 ) ~= "#" then 
            local model = tonumber( gettok( line, 1, string.byte(' ') ) ) 
            if not vehicleColors[ model ] then 
                vehicleColors[ model ] = { } 
            end 
            vehicleColors[ model ][ #vehicleColors[ model ] + 1 ] = { 
                tonumber( gettok( line, 2, string.byte(' ') ) ), 
                tonumber( gettok( line, 3, string.byte(' ') ) ) or nil, 
                tonumber( gettok( line, 4, string.byte(' ') ) ) or nil, 
                tonumber( gettok( line, 5, string.byte(' ') ) ) or nil 
            } 
        end 
    end 
    fileClose( file ) 
end 
  
addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), onResourceStart) 
  
  
function requestServicesColShapes( ) 
    for num = 1,#paynsprays,1 do 
        triggerClientEvent( source, "recieveServicesColShapes", source, paynsprays[num].smallestX, paynsprays[num].smallestY, paynsprays[num].smallestZ, paynsprays[num].width, paynsprays[num].depth, paynsprays[num].height ) 
    end 
end 
  
addEvent( "onPayNSpray", false ) 
addEvent( "onPayNSprayFix", false ) 
function requestRespray()  
    if( getPlayerMoney( source ) >= paynsprayCosts ) then 
        local EventCanceled = false 
        local vehicle = getPedOccupiedVehicle ( source ) 
         
        -- you can use cancelEvent() to cancel this. 
        EventCanceled = triggerEvent ( "onPayNSpray", getRootElement(), vehicle, source ) 
        if( EventCanceled == false ) then return end 
  
         
        for v = 1,#disallowedVehicles,1 do 
            if( disallowedVehicles[v] == getElementModel( vehicle ) ) then  
                outputChatBox( "I don't touch that shit!", source, 255, 255, 0 ) 
                return  
            end 
        end 
         
        toggleAllControls( source, false, true, true ) 
        setElementHealth( vehicle, 1000 ) -- prevent the car from "accidently" exploding before we resprayed 
        fadeCamera(source, false, 1 ) 
         
        setTimer( function (s,v)  
            takePlayerMoney( s, paynsprayCosts ) 
            fixVehicle( v ) 
             
            local a, b, c, d = getVehicleColor( v ) 
            local model = getElementModel( v ) 
            if vehicleColors[ model ] then 
                local newColorSet = { } 
                if #vehicleColors[ model ] > 1 then 
                    repeat 
                        newColorSet = vehicleColors[ model ][ math.random( 1, #vehicleColors[ model ] ) ] 
                    until not( newColorSet[ 1 ] == a and (not newColorSet[ 2 ] or newColorSet[ 2 ] == b) and (not newColorSet[ 3 ] or newColorSet[ 3 ] == c) and (not newColorSet[ 4 ] or newColorSet[ 4 ] == d) ) 
                else 
                    newColorSet = vehicleColors[ model ][ 1 ] 
                end 
                 
                if newColorSet[ 2 ] then b = newColorSet[ 2 ] end 
                if newColorSet[ 3 ] then c = newColorSet[ 3 ] end 
                if newColorSet[ 4 ] then d = newColorSet[ 4 ] end 
                setVehicleColor( v, newColorSet[ 1 ], b, c, d ) 
            end 
             
            fadeCamera(s, true, 1 ) 
             
            setTimer( toggleAllControls, 1000, 1, s, true, true, true ) 
             
            outputChatBox( "INFO: Your Vehicle has been resprayed! Costs: $" .. paynsprayCosts, s, 0, 255, 0 ) 
            triggerEvent( "onPayNSprayFix", getRootElement(), v, s ) 
             
            end, 1000, 1, source, vehicle ) 
    else 
        outputChatBox( "INFO: You don't have enough cash to pay me, the price is $" .. paynsprayCosts, source, 255, 255, 0 ) 
    end 
end 
  
addEvent("requestServicesColShapes", true) 
addEventHandler( "requestServicesColShapes", getRootElement(), requestServicesColShapes) 
addEvent("requestRespray", true) 
addEventHandler( "requestRespray", getRootElement(), requestRespray ) 

Share this post


Link to post
Guest Guest4401

model is nil

This returns nil:

tonumber( gettok( line, 1, string.byte(' ') ) ) 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.