Problem oko error 014: invalid statement; not in switch

Započeo ivanboskic
23. Jul 2023.
189
pregleda
2
postova
ivanboskic
4
Shot Caller
23. Jul 2023.
Problem(error/warning): Imam problem oko jedne funkcije bit će kod ispod
Deo skripte:

_callback: VrstaGoriva(idvozilamodel)
{
    new movo = GetVehicleModel(idvozilamodel);
    switch(movo)
    {
        case 402, 411, 415, 429, 434, 439, 451, 458, 457, 480, 506:
        case 521, 522, 523, 533, 541, 555, 558, 559, 560, 561, 562:
        case 565, 587, 589, 602, 603, 462, 463, 521, 522, 468, 471:
            return 1;
        default:
            return 2;
    }
    return true;
}

Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log):
/

Slika/video ingame problema(obavezno ako je ingame problem): /
NegativeIQ
5
Kingpin
23. Jul 2023.
Naucite proklete osnove vise...Tako kako si napisao nestujes case u case...

_callback: VrstaGoriva(idvozilamodel)
{
    new movo = GetVehicleModel(idvozilamodel);
    switch(movo)
    {
        case 402, 411, 415, 429, 434, 439, 451, 458, 457, 480, 506:
            return 1;
        case 521, 522, 523, 533, 541, 555, 558, 559, 560, 561, 562:
            return 1;
        case 565, 587, 589, 602, 603, 462, 463, 521, 522, 468, 471:
            return 1;
        default:
            return 2;
    }
    return true;
}

Ili

_callback: VrstaGoriva(idvozilamodel)
{
    new movo = GetVehicleModel(idvozilamodel);
    switch(movo)
    {
        case 402, 411, 415, 429, 434, 439, 451, 458, 457, 480, 506, 521, 522, 523, 533, 541, 555, 558, 559, 560, 561, 562, 565, 587, 589, 602, 603, 462, 463, 521, 522, 468, 471:
            return 1;
        default:
            return 2;
    }
    return true;
}

Verovatno ce ti u oba slucaja izbaciti warning unreachable code za return true, ako izbaci, izbrisi ga samo.

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha