New to scripting and some warnings error
#1

Hello,
I am new to scripting and planning to rescript a gamemode.
Recently i have this error:
pawn Код:
C:\Users\sduser\Desktop\GTA Project\TranspWorld\gamemodes\Bus.pwn(464) : warning 217: loose indentation
C:\Users\sduser\Desktop\GTA Project\TranspWorld\gamemodes\Bus.pwn(503) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.
This is my code:
pawn Код:
if(!strcmp("/work", cmdtext, true))
    {
        new pvehiclemodel = GetVehicleModel(GetPlayerVehicleID(playerid));
        if (pvehiclemodel == 437 || pvehiclemodel == 431)
        {
            TextDrawHideForPlayer(playerid, NotWorking);
            if (IsPlayerInMission[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, ">> You are currently in a mission use \"/cancelmission\" to cancel your current mission!"); // prevents them de starting another mission
            new rand = random(sizeof(TruckingMissionRandom));

            IsPlayerInMission[playerid] = 1; // asign it to 1 becuase there in a mission
            CreatePlayerMission(playerid, TruckingMissionRandom[rand][UseTrailerCheck], TruckingMissionRandom[rand][MissionPay], TruckingMissionRandom[rand][loadx],TruckingMissionRandom[rand][loady], TruckingMissionRandom[rand][loadz], TruckingMissionRandom[rand][unloadx],TruckingMissionRandom[rand][unloady], TruckingMissionRandom[rand][unloadz]);
            SendClientMessage(playerid, 0x00FF00FF, "You start a mission! Take a look in the info. box bellow !.");
            new Cock[128];
            format(Cock, sizeof(Cock), "%s", TruckingMissionRandom[rand][MissionName]);
            TextDrawSetString(Working, Cock);
            TextDrawShowForPlayer(playerid, Working);
        }
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "Im sorry but this mission requires that you use a vehicle that can pull a semi trailer Ex: Roadtrain with an Artict1!");
        }
        return 1;
    }


    if (strcmp(cmdtext, "/reglas", true)==0)
    {
    ShowPlayerDialog(playerid, 8899, DIALOG_STYLE_MSGBOX, "Reglas","1. No cheats, mods cleo and any hack!\n\n2. No DM.\n\n3. Respec all players.\n\n4. No crash for fun.\n\n5. No Flood/Spam ", "I' Agree", "KICK");
    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
    return 1;
    }

    if(!strcmp("/stopwork", cmdtext, true))
    {
        if (IsPlayerInMission[playerid] == 0) return SendClientMessage(playerid, 0xFF0000AA, "You are not working idiot !"); // prevents them if there currently not in a mission
        IsPlayerInMission[playerid] = 0; // resets it so they can start another mission
        CancelPlayersCurrentMission(playerid);
        return 1;
    }
    return ShowPlayerDialog(playerid, Rules, DIALOG_STYLE_MSGBOX, "{00F6F6}Error 404 Not Found - Unknow Command:",ErrorCMD, "Salir");

}
Additional infromation:
I am working with 0.3e, I read alot of topics but still couldn't understand the error. If possible please reply with a fixed code. I would like to rep+ you.

Please do not blame on me because i am bad at scripting.
Reply
#2

Show line 464 and 503
Reply
#3

Loose indentation is a warning caused by not properly indenting a line after a { or } usage. Post line 503 please.
Reply
#4




Since line 464 is just }
Reply
#5

Copy and paste the whole lbe on 503. It cuts off.
Also line 463 and so on is indented wrong.
Reply
#6

Код:
ShowPlayerDialog(playerid, Rules, DIALOG_STYLE_MSGBOX, "Title" "{00F6F6}Error 404 Not Found - Unknow Command:", "Button 1", "Salir");
Reply
#7

Then how should it be indicated?
pawn Код:
if(!strcmp("/repair", cmdtext))
    {
        GivePlayerMoney(playerid, -500);
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a damaged vehicle!");
        RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been repaired. You have been charged 500$");
        return 1;
    }
And this is 498-514:
pawn Код:
if (strcmp(cmdtext, "/reglas", true)==0)
    {
    ShowPlayerDialog(playerid, 8899, DIALOG_STYLE_MSGBOX, "Reglas","1. No cheats, mods cleo and any hack!\n\n2. No DM.\n\n3. Respec all players.\n\n4. No crash for fun.\n\n5. No Flood/Spam ", "I' Agree", "KICK");
    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
    return 1;
    }
   
    if(!strcmp("/stopwork", cmdtext, true))
    {
        if (IsPlayerInMission[playerid] == 0) return SendClientMessage(playerid, 0xFF0000AA, "You are not working right now. Use /work to work"); // prevents them if there currently not in a mission
        IsPlayerInMission[playerid] = 0; // resets it so they can start another mission
        CancelPlayersCurrentMission(playerid);
        return 1;
    }
    return ShowPlayerDialog(playerid, Rules, DIALOG_STYLE_MSGBOX, "{00F6F6}Error 404 Not Found - Unknow Command:",ErrorCMD, "Salir");

}
Reply
#8

Код:
    if(!strcmp("/stopwork", cmdtext, true))
    {
        if (IsPlayerInMission[playerid] == 0) return SendClientMessage(playerid, 0xFF0000AA, "You are not working right now. Use /work to work"); // prevents them if there currently not in a mission
        IsPlayerInMission[playerid] = 0; // resets it so they can start another mission
        CancelPlayersCurrentMission(playerid);
        return 1;
    }
    return ShowPlayerDialog(playerid, Rules, DIALOG_STYLE_MSGBOX, "Title", "{00F6F6}Error 404 Not Found - Unknow Command:", "Button 1", "Salir");
Reply
#9

return ShowPlayerDialog(playerid, Rules, DIALOG_STYLE_MSGBOX, "{00F6F6}Error 404 Not Found - Unknow Command:",ErrorCMD, "Salir");

I think errorcmd needs to be in quotes.
Sorry I'm on a mobile phone.
Reply
#10

Quote:
Originally Posted by EAsT-OAK_510
Посмотреть сообщение
return ShowPlayerDialog(playerid, Rules, DIALOG_STYLE_MSGBOX, "{00F6F6}Error 404 Not Found - Unknow Command:",ErrorCMD, "Salir");

I think errorcmd needs to be in quotes.
Sorry I'm on a mobile phone.
not fixing it ;S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)