Unfair Warning ?
#1

So in my gamemode, i've created Vehicle Spawner. But there is other problem!

I get: Loose Indentation.

But i don't know how to fix it!

Here is the code:

https://pastebin.com/kD367JCt

And the line in which i got warning is:

if(dialogid == 5681)

Please help!
Reply
#2

Yes, poor indentation.

What is poor indentation

-Poor indentation be like this:

Код:
public OnPlayerSpawn(playerid)
{
SendClientMessage(playerid, -1,"Welcome bud");
GivePlayerWeapon(playerid, 24, 500000000);
SetPlayerArmour(playerid, 100000000);
     GivePlayerMoney(playerid, 41000);
     SetPlayerHealth(playerid, 50);
return 1;
}
To fix it, you should do this for ex:

Код:
public OnPlayerSpawn(playerid)
{
     SendClientMessage(playerid, -1,"Welcome bud");
     GivePlayerWeapon(playerid, 24, 500000000);
     SetPlayerArmour(playerid, 100000000);
     GivePlayerMoney(playerid, 41000);
     SetPlayerHealth(playerid, 50);
     return 1;
}
I did my best on fixing the indentation;

PHP код:
if (response)
   {
     switch (
dialogid)
     {
       case 
3434:
       {
            switch (
listitem)
            {
               case 
0ShowPlayerDialog(playerid3435DIALOG_STYLE_LIST"Airplanes""Andromada\nAT-400\nBeagle\nCropduster\nDodo\nHydra\nNevada\nRustler\nShamal\nSkimmer\nStuntplane\nBack""Select""Cancel");
               case 
1ShowPlayerDialog(playerid3436DIALOG_STYLE_LIST"Helicopters""Cargobob\nHunter\nLeviathan\nMaverick\nNews Maverick\nPolice Maverick\nRaindance\nSeasparrow\nSparrow\nBack""Select""Cancel");
               case 
2ShowPlayerDialog(playerid3437DIALOG_STYLE_LIST"Bikes""BF-400\nBike\nBMX\nFaggio\nFCR-900\nFreeway\nMountain Bike\nNRG-500\nPCJ-600\nPizzaboy\nQuad\nSanchez\nWayfarer\nBack""Select""Cancel");
               case 
3ShowPlayerDialog(playerid3438DIALOG_STYLE_LIST"Convertibles""Comet\nFeltzer\nStallion\nWindsor\nBack""Select""Cancel" );
               case 
4ShowPlayerDialog(playerid3439DIALOG_STYLE_LIST"Industrial""Benson\nBobcat\nBurrito\nBoxville\nBoxburg\nCement Truck\nDFT-30\nFlatbed\nLinerunner\nMule\nNewsvan\nPacker\nPetrol Tanker\nPony\nRoadtrain\nRumpo\nSadler\nSadler Shit\nTopfun\nTractor\nTrashmaster\nUtility Van\nWalton\nYankee\nYosemite\nBack""Select""Cancel");
               case 
5ShowPlayerDialog(playerid3440DIALOG_STYLE_LIST"Lowriders""Blade\nBroadway\nRemington\nSavanna\nSlamvan\nTahoma\nTornado\nVoodoo\nBack""Select""Cancel" );
               case 
6ShowPlayerDialog(playerid3441DIALOG_STYLE_LIST"Off Road""Bandito\nBF Injection\nDune\nHuntley\nLandstalker\nMesa\nMonster\nMonster A\nMonster B\nPatriot\nRancher A\nRancher B\nSandking\nBack""Select""Cancel");
               case 
7ShowPlayerDialog(playerid3442DIALOG_STYLE_LIST"Public Service Vehicles""Ambulance\nBarracks\nBus\nCabbie\nCoach\nCop Bike (HPV-1000)\nEnforcer\nFBI Rancher\nFBI Truck\nFiretruck\nFiretruck LA\nPolice Car (LSPD)\nPolice Car (LVPD)\nPolice Car (SFPD)\nRanger\nRhino\nS.W.A.T\nTaxi\nBack""Select""Cancel");
               case 
8ShowPlayerDialog(playerid3443DIALOG_STYLE_LIST"Saloons""Admiral\nBloodring Banger\nBravura\nBuccaneer\nCadrona\nClover\nElegant\nElegy\nEmperor\nEsperanto\nFortune\nGlendale Shit\nGlendale\nGreenwood\nHermes\nIntruder\nMajestic\nManana\nMerit\nNebula\nOceanic\nPicador\nPremier\nPrevion\nPrimo\nSentinel\nStafford\nSultan\nSunrise\nTampa\nVincent\nVirgo\nWillard\nWashington\nBack""Select""Cancel");
               case 
9ShowPlayerDialog(playerid3444DIALOG_STYLE_LIST"Sport Vehicles""Alpha\nBanshee\nBlista Compact\nBuffalo\nBullet\nCheetah\nClub\nEuros\nFlash\nHotring Racer\nHotring Racer A\nHotring Racer B\nInfernus\nJester\nPhoenix\nSabre\nSuper GT\nTurismo\nUranus\nZR-350\nBack""Select""Cancel");
               case 
10ShowPlayerDialog(playerid3445DIALOG_STYLE_LIST"Station Wagons""Moonbeam\nPerenniel\nRegina\nSolair\nStratum\nBack""Select""Cancel");
               case 
11ShowPlayerDialog(playerid3446DIALOG_STYLE_LIST"Boats""Coastguard\nDinghy\nJetmax\nLaunch\nMarquis\nPredator\nReefer\nSpeeder\nSquallo\nTropic\nBack""Select""Cancel");
               case 
12ShowPlayerDialog(playerid3447DIALOG_STYLE_LIST"Trailers""Article Trailer\nArticle Trailer 2\nArticle Trailer 3\nBaggage Trailer A\nBaggage Trailer B\nFarm Trailer\nFreight Flat Trailer (Train)\nFreight Box Trailer (Train)\nPetrol Trailer\nStreak Trailer (Train)\nStairs Trailer\nUtility Trailer\nBack""Select""Cancel");
               case 
13ShowPlayerDialog(playerid3448DIALOG_STYLE_LIST"Unique Vehicles""Baggage\nBrownstreak (Train)\nCaddy\nCamper\nCamper A\nCombine Harvester\nDozer\nDumper\nForklift\nFreight (Train)\nHotknife\nHustler\nHotdog\nKart\nMower\nMr Whoopee\nRomero\nSecuricar\nStretch\nSweeper\nTram\nTowtruck\nTug\nVortex\nBack""Select""Cancel");
               case 
14ShowPlayerDialog(playerid3449DIALOG_STYLE_LIST"RC Vehicles""RC Bandit\nRC Baron\nRC Raider\nRC Goblin\nRC Tiger\nRC Cam\nBack""Select""Cancel");
            }
        }
            case 
3435:
            {
                if ( 
listitem 10 ) return ShowPlayerDefaultDialog(playerid);
                new 
model_array[] = {592577511512593520553476519460513};
                return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
            }
            case 
3436:
            {
                if (
listitem 8) return ShowPlayerDefaultDialog(playerid);
                new 
model_array[] = { 548425417487488497563447469 };
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3437:
            {
                if (
listitem 12) return ShowPlayerDefaultDialog(playerid);
                new 
model_array[] = {581509481462521463510522461448471468586};
                return 
CreatePlayerVehicle(playeridmodel_array[listitem ]);
            }
            case 
3438:
            {
                if (
listitem 3) return ShowPlayerDefaultDialog(playerid);
                new 
model_array[] = {480533439555};
                return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
            }
            case 
3439:
            {
                if (
listitem 24) return ShowPlayerDefaultDialog(playerid);
                new 
model_array[] = {499422482498609524578455403414582443514413515440543605459531408552478456554};
                return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
            }
            case 
3440:
            {
                if (
listitem 7) return ShowPlayerDefaultDialog(playerid);
                new 
model_array[] = {536575534567535566576412};
                return 
CreatePlayerVehicleplayeridmodel_array[listitem]);
            }
            case 
3441:
            {
                if (
listitem 12) return ShowPlayerDefaultDialog(playerid);
                new 
model_array[] = {568424573579400500444556557470489505495};
                return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
            }
            case 
3442:
            {
                if (
listitem 17) return ShowPlayerDefaultDialog(playerid);
                new 
model_array[] = {416433431438437523427490528407544596598597599432601420};
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3443:
            {
                if (
listitem 33) return ShowPlayerDefaultDialog(playerid);
                new 
model_array[] = {445504401518527542507562585419526604466492474546517410551516467600426436547405580560550549540491529421};
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3444:
            {
                if (
listitem 19) return ShowPlayerDefaultDialog(playerid);
                new 
model_array[] = {602429496402541415589587565494502503411559603475506451558477};
                return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
            }
            case 
3445:
            {
                if (
listitem 4) return ShowPlayerDefaultDialog(playerid);
                new 
model_array[] = {418404479458561};
                return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
            }
            case 
3446:
            {
                if (
listitem 9) return ShowPlayerDefaultDialog(playerid);
                new 
model_array[] = {472473493595484430453452446454};
                return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
            }
            case 
3447:
            {
                if (
listitem 11) return ShowPlayerDefaultDialog(playerid);
                new 
model_array[] = {435450591606607610569590584570608611};
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3448:
            {
                if (
listitem 23) return ShowPlayerDefaultDialog(playerid);
                new 
model_array[] = {485537457483508532486406530538434545588571572423442428409574449525583539};
                return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
            }
            case 
3449:
            {
                if (
listitem 5) return ShowPlayerDefaultDialog(playerid);
                new 
model_array[] = {441464465501564594};
                return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
            }
        }
    }
    if(
dialogid == 5681
Reply
#3

I tried it over 3 times and it doesn't work. The warning is on the same line the same thing.
...
Reply
#4

you can ignore it it wont cause any problems
Reply
#5

But if i can fix the warrning there's no use of it. So please if anyone know how to fix it, tell me
Reply
#6

try:
PHP код:
if (response)
{
    switch (
dialogid)
    {
        case 
3434:
        {
            switch (
listitem)
            {
                case 
0ShowPlayerDialog(playerid3435DIALOG_STYLE_LIST"Airplanes""Andromada\nAT-400\nBeagle\nCropduster\nDodo\nHydra\nNevada\nRustler\nShamal\nSkimmer\nStuntplane\nBack""Select""Cancel");
                case 
1ShowPlayerDialog(playerid3436DIALOG_STYLE_LIST"Helicopters""Cargobob\nHunter\nLeviathan\nMaverick\nNews Maverick\nPolice Maverick\nRaindance\nSeasparrow\nSparrow\nBack""Select""Cancel");
                case 
2ShowPlayerDialog(playerid3437DIALOG_STYLE_LIST"Bikes""BF-400\nBike\nBMX\nFaggio\nFCR-900\nFreeway\nMountain Bike\nNRG-500\nPCJ-600\nPizzaboy\nQuad\nSanchez\nWayfarer\nBack""Select""Cancel");
                case 
3ShowPlayerDialog(playerid3438DIALOG_STYLE_LIST"Convertibles""Comet\nFeltzer\nStallion\nWindsor\nBack""Select""Cancel" );
                case 
4ShowPlayerDialog(playerid3439DIALOG_STYLE_LIST"Industrial""Benson\nBobcat\nBurrito\nBoxville\nBoxburg\nCement Truck\nDFT-30\nFlatbed\nLinerunner\nMule\nNewsvan\nPacker\nPetrol Tanker\nPony\nRoadtrain\nRumpo\nSadler\nSadler Shit\nTopfun\nTractor\nTrashmaster\nUtility Van\nWalton\nYankee\nYosemite\nBack""Select""Cancel");
                case 
5ShowPlayerDialog(playerid3440DIALOG_STYLE_LIST"Lowriders""Blade\nBroadway\nRemington\nSavanna\nSlamvan\nTahoma\nTornado\nVoodoo\nBack""Select""Cancel" );
                case 
6ShowPlayerDialog(playerid3441DIALOG_STYLE_LIST"Off Road""Bandito\nBF Injection\nDune\nHuntley\nLandstalker\nMesa\nMonster\nMonster A\nMonster B\nPatriot\nRancher A\nRancher B\nSandking\nBack""Select""Cancel");
                case 
7ShowPlayerDialog(playerid3442DIALOG_STYLE_LIST"Public Service Vehicles""Ambulance\nBarracks\nBus\nCabbie\nCoach\nCop Bike (HPV-1000)\nEnforcer\nFBI Rancher\nFBI Truck\nFiretruck\nFiretruck LA\nPolice Car (LSPD)\nPolice Car (LVPD)\nPolice Car (SFPD)\nRanger\nRhino\nS.W.A.T\nTaxi\nBack""Select""Cancel");
                case 
8ShowPlayerDialog(playerid3443DIALOG_STYLE_LIST"Saloons""Admiral\nBloodring Banger\nBravura\nBuccaneer\nCadrona\nClover\nElegant\nElegy\nEmperor\nEsperanto\nFortune\nGlendale Shit\nGlendale\nGreenwood\nHermes\nIntruder\nMajestic\nManana\nMerit\nNebula\nOceanic\nPicador\nPremier\nPrevion\nPrimo\nSentinel\nStafford\nSultan\nSunrise\nTampa\nVincent\nVirgo\nWillard\nWashington\nBack""Select""Cancel");
                case 
9ShowPlayerDialog(playerid3444DIALOG_STYLE_LIST"Sport Vehicles""Alpha\nBanshee\nBlista Compact\nBuffalo\nBullet\nCheetah\nClub\nEuros\nFlash\nHotring Racer\nHotring Racer A\nHotring Racer B\nInfernus\nJester\nPhoenix\nSabre\nSuper GT\nTurismo\nUranus\nZR-350\nBack""Select""Cancel");
                case 
10ShowPlayerDialog(playerid3445DIALOG_STYLE_LIST"Station Wagons""Moonbeam\nPerenniel\nRegina\nSolair\nStratum\nBack""Select""Cancel");
                case 
11ShowPlayerDialog(playerid3446DIALOG_STYLE_LIST"Boats""Coastguard\nDinghy\nJetmax\nLaunch\nMarquis\nPredator\nReefer\nSpeeder\nSquallo\nTropic\nBack""Select""Cancel");
                case 
12ShowPlayerDialog(playerid3447DIALOG_STYLE_LIST"Trailers""Article Trailer\nArticle Trailer 2\nArticle Trailer 3\nBaggage Trailer A\nBaggage Trailer B\nFarm Trailer\nFreight Flat Trailer (Train)\nFreight Box Trailer (Train)\nPetrol Trailer\nStreak Trailer (Train)\nStairs Trailer\nUtility Trailer\nBack""Select""Cancel");
                case 
13ShowPlayerDialog(playerid3448DIALOG_STYLE_LIST"Unique Vehicles""Baggage\nBrownstreak (Train)\nCaddy\nCamper\nCamper A\nCombine Harvester\nDozer\nDumper\nForklift\nFreight (Train)\nHotknife\nHustler\nHotdog\nKart\nMower\nMr Whoopee\nRomero\nSecuricar\nStretch\nSweeper\nTram\nTowtruck\nTug\nVortex\nBack""Select""Cancel");
                case 
14ShowPlayerDialog(playerid3449DIALOG_STYLE_LIST"RC Vehicles""RC Bandit\nRC Baron\nRC Raider\nRC Goblin\nRC Tiger\nRC Cam\nBack""Select""Cancel");
            }
        }
        case 
3435:
        {
            if ( 
listitem 10 ) return ShowPlayerDefaultDialog(playerid);
            new 
model_array[] = {592577511512593520553476519460513};
            return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
        }
        case 
3436:
        {
            if (
listitem 8) return ShowPlayerDefaultDialog(playerid);
            new 
model_array[] = { 548425417487488497563447469 };
            return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
        }
        case 
3437:
        {
            if (
listitem 12) return ShowPlayerDefaultDialog(playerid);
            new 
model_array[] = {581509481462521463510522461448471468586};
            return 
CreatePlayerVehicle(playeridmodel_array[listitem ]);
        }
        case 
3438:
        {
            if (
listitem 3) return ShowPlayerDefaultDialog(playerid);
            new 
model_array[] = {480533439555};
            return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
        }
        case 
3439:
        {
            if (
listitem 24) return ShowPlayerDefaultDialog(playerid);
            new 
model_array[] = {499422482498609524578455403414582443514413515440543605459531408552478456554};
            return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
        }
        case 
3440:
        {
            if (
listitem 7) return ShowPlayerDefaultDialog(playerid);
            new 
model_array[] = {536575534567535566576412};
            return 
CreatePlayerVehicleplayeridmodel_array[listitem]);
        }
        case 
3441:
        {
            if (
listitem 12) return ShowPlayerDefaultDialog(playerid);
            new 
model_array[] = {568424573579400500444556557470489505495};
            return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
        }
        case 
3442:
        {
            if (
listitem 17) return ShowPlayerDefaultDialog(playerid);
            new 
model_array[] = {416433431438437523427490528407544596598597599432601420};
            return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
        }
        case 
3443:
        {
            if (
listitem 33) return ShowPlayerDefaultDialog(playerid);
            new 
model_array[] = {445504401518527542507562585419526604466492474546517410551516467600426436547405580560550549540491529421};
            return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
        }
        case 
3444:
        {
            if (
listitem 19) return ShowPlayerDefaultDialog(playerid);
            new 
model_array[] = {602429496402541415589587565494502503411559603475506451558477};
            return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
        }
        case 
3445:
        {
            if (
listitem 4) return ShowPlayerDefaultDialog(playerid);
            new 
model_array[] = {418404479458561};
            return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
        }
        case 
3446:
        {
            if (
listitem 9) return ShowPlayerDefaultDialog(playerid);
            new 
model_array[] = {472473493595484430453452446454};
            return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
        }
        case 
3447:
        {
            if (
listitem 11) return ShowPlayerDefaultDialog(playerid);
            new 
model_array[] = {435450591606607610569590584570608611};
            return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
        }
        case 
3448:
        {
            if (
listitem 23) return ShowPlayerDefaultDialog(playerid);
            new 
model_array[] = {485537457483508532486406530538434545588571572423442428409574449525583539};
            return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
        }
        case 
3449:
        {
            if (
listitem 5) return ShowPlayerDefaultDialog(playerid);
            new 
model_array[] = {441464465501564594};
            return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
        }
    }
}
if(
dialogid == 5681)            return CreatePlayerVehicle(playeridmodel_array[listitem]);
        }
        case 
3449:
        {
            if (
listitem 5) return ShowPlayerDefaultDialog(playerid);
            new 
model_array[] = {441464465501564594};
            return 
CreatePlayerVehicle(playeridmodel_array[listitem]);
        }
    }
}
if(
dialogid == 5681
Reply
#7

I think it won't working and this time the problem is on me.

The (dialogid == 5681) creates a new dialog it doesn't supposed to be in the dialog where i gave on Pastebin.

I just gave (dialogid == 5681) because there is the error. Not (dialogid == 5681) supposed to be here. Whit this i start a new dialog.

And what i see on your code is i need to use (dialogid == 5681) on the dialog for spawning cars.

(This time the error is on me), didn't note that (dialogid == 5681) is on other dialog its not in this dialog for spawning cars.

(If you understand me what im trying to say)
Reply
#8

Quote:
Originally Posted by Lixyde
Посмотреть сообщение
I think it won't working and this time the problem is on me.

The (dialogid == 5681) creates a new dialog it doesn't supposed to be in the dialog where i gave on Pastebin.

I just gave (dialogid == 5681) because there is the error. Not (dialogid == 5681) supposed to be here. Whit this i start a new dialog.

And what i see on your code is i need to use (dialogid == 5681) on the dialog for spawning cars.

(This time the error is on me), didn't note that (dialogid == 5681) is on other dialog its not in this dialog for spawning cars.

(If you understand me what im trying to say)
Well he did it wrong, he duplicated it, just ignore it, it won't affect on your script.
Reply
#9

Search : https://sampforum.blast.hk/showthread.php?tid=256961
Reply
#10

The problem was that if(response) needs to be in the same line as if(dialogid
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)