Class Errors: loose indentation (2 Errors)
#1

I get errors from code
pawn Code:
Trucking Server\gamemodes\Trucking.pwn(74) : warning 217: loose indentation
Trucking Server\gamemodes\Trucking.pwn(77) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.
pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0:
        {
           gTeam[playerid] = TEAM_TRUCKER;
           SetPlayerTeam(playerid, TEAM_TRUCKER);
           GameTextForPlayer(playerid, "Trucker", 5000, 5);
           SetPlayerPos(playerid, 1522.6503,-806.6635,72.1700);
           SetPlayerFacingAngle(playerid, 4018);
           SetPlayerCameraPos(playerid, 1514.0861,-806.9355,72.0768);
           SetPlayerCameraLookAt(playerid, 1522.6503,-806.6635,72.1700);

        }
        case 1:
        {

           gTeam[playerid] = TEAM_COP;
           SetPlayerTeam(playerid, TEAM_COP);
           GameTextForPlayer(playerid, "Police", 5000, 5);
           SetPlayerPos(playerid, 1279.3276,-778.4965,95.9663);
           SetPlayerFacingAngle(playerid,8298);
           SetPlayerCameraPos(playerid,1266.1062,-778.3137,95.9665);
           SetPlayerCameraLookAt(playerid,1279.3276,-778.4965,95.9663);

        }

        }
        SetPlayerToTeamColour(playerid);
        {
    }
    return 1;
}
Reply
#2

You can remove the brackets over and under setplayertoteamcolor. They are useless and will remove the warnings.
Reply
#3

Quote:
Originally Posted by DerickClark
View Post
I get errors from code
pawn Code:
Trucking Server\gamemodes\Trucking.pwn(74) : warning 217: loose indentation
Trucking Server\gamemodes\Trucking.pwn(77) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.
pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0:
        {
           gTeam[playerid] = TEAM_TRUCKER;
           SetPlayerTeam(playerid, TEAM_TRUCKER);
           GameTextForPlayer(playerid, "Trucker", 5000, 5);
           SetPlayerPos(playerid, 1522.6503,-806.6635,72.1700);
           SetPlayerFacingAngle(playerid, 4018);
           SetPlayerCameraPos(playerid, 1514.0861,-806.9355,72.0768);
           SetPlayerCameraLookAt(playerid, 1522.6503,-806.6635,72.1700);

        }
        case 1:
        {

           gTeam[playerid] = TEAM_COP;
           SetPlayerTeam(playerid, TEAM_COP);
           GameTextForPlayer(playerid, "Police", 5000, 5);
           SetPlayerPos(playerid, 1279.3276,-778.4965,95.9663);
           SetPlayerFacingAngle(playerid,8298);
           SetPlayerCameraPos(playerid,1266.1062,-778.3137,95.9665);
           SetPlayerCameraLookAt(playerid,1279.3276,-778.4965,95.9663);

        }
        // Suppose there should be a case here?
        } // What the heck is this?
        SetPlayerToTeamColour(playerid); // And this... Would like a TAB on this one.
        { // And what is this...
    }
    return 1;
}
Read the comments.
Reply
#4

Quote:
Originally Posted by AlonzoTorres
View Post
Read the comments.
ok, srry I didn't code at.
Reply
#5

pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0:
        {
           gTeam[playerid] = TEAM_TRUCKER;
           SetPlayerTeam(playerid, TEAM_TRUCKER);
           GameTextForPlayer(playerid, "Trucker", 5000, 5);
           SetPlayerPos(playerid, 1522.6503,-806.6635,72.1700);
           SetPlayerFacingAngle(playerid, 4018);
           SetPlayerCameraPos(playerid, 1514.0861,-806.9355,72.0768);
           SetPlayerCameraLookAt(playerid, 1522.6503,-806.6635,72.1700);

        }
        case 1:
        {

           gTeam[playerid] = TEAM_COP;
           SetPlayerTeam(playerid, TEAM_COP);
           GameTextForPlayer(playerid, "Police", 5000, 5);
           SetPlayerPos(playerid, 1279.3276,-778.4965,95.9663);
           SetPlayerFacingAngle(playerid,8298);
           SetPlayerCameraPos(playerid,1266.1062,-778.3137,95.9665);
           SetPlayerCameraLookAt(playerid,1279.3276,-778.4965,95.9663);

        }
        else:
        {
               SetPlayerToTeamColour(playerid);
        }
    }
    return 1;
}
should fix it. You made a mistake with the brackets
Reply
#6

Quote:
Originally Posted by kooltuO
View Post
pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0:
        {
           gTeam[playerid] = TEAM_TRUCKER;
           SetPlayerTeam(playerid, TEAM_TRUCKER);
           GameTextForPlayer(playerid, "Trucker", 5000, 5);
           SetPlayerPos(playerid, 1522.6503,-806.6635,72.1700);
           SetPlayerFacingAngle(playerid, 4018);
           SetPlayerCameraPos(playerid, 1514.0861,-806.9355,72.0768);
           SetPlayerCameraLookAt(playerid, 1522.6503,-806.6635,72.1700);

        }
        case 1:
        {

           gTeam[playerid] = TEAM_COP;
           SetPlayerTeam(playerid, TEAM_COP);
           GameTextForPlayer(playerid, "Police", 5000, 5);
           SetPlayerPos(playerid, 1279.3276,-778.4965,95.9663);
           SetPlayerFacingAngle(playerid,8298);
           SetPlayerCameraPos(playerid,1266.1062,-778.3137,95.9665);
           SetPlayerCameraLookAt(playerid,1279.3276,-778.4965,95.9663);

        }
        else:
        {
               SetPlayerToTeamColour(playerid);
        }
    }
    return 1;
}
should fix it. You made a mistake with the brackets
pawn Code:
Trucking.pwn(72) : error 002: only a single statement (or expression) can follow each "case"
Trucking.pwn(75) : error 054: unmatched closing brace ("}")
Trucking.pwn(76) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Reply
#7

Quote:
Originally Posted by DerickClark
View Post
pawn Code:
Trucking.pwn(72) : error 002: only a single statement (or expression) can follow each "case"
Trucking.pwn(75) : error 054: unmatched closing brace ("}")
Trucking.pwn(76) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Show me line 71 - 77 then. I can't really make up where it is bugged now.
Reply
#8

Quote:
Originally Posted by kooltuO
View Post
Show me line 71 - 77 then. I can't really make up where it is bugged now.
Line 74
SetPlayerToTeamColour(playerid);

Line 77
return 1;

That where the errors at.
Reply
#9

Quote:
Originally Posted by kooltuO
View Post
pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0:
        {
           gTeam[playerid] = TEAM_TRUCKER;
           SetPlayerTeam(playerid, TEAM_TRUCKER);
           GameTextForPlayer(playerid, "Trucker", 5000, 5);
           SetPlayerPos(playerid, 1522.6503,-806.6635,72.1700);
           SetPlayerFacingAngle(playerid, 4018);
           SetPlayerCameraPos(playerid, 1514.0861,-806.9355,72.0768);
           SetPlayerCameraLookAt(playerid, 1522.6503,-806.6635,72.1700);

        }
        case 1:
        {

           gTeam[playerid] = TEAM_COP;
           SetPlayerTeam(playerid, TEAM_COP);
           GameTextForPlayer(playerid, "Police", 5000, 5);
           SetPlayerPos(playerid, 1279.3276,-778.4965,95.9663);
           SetPlayerFacingAngle(playerid,8298);
           SetPlayerCameraPos(playerid,1266.1062,-778.3137,95.9665);
           SetPlayerCameraLookAt(playerid,1279.3276,-778.4965,95.9663);

        }
        else:
        {
               SetPlayerToTeamColour(playerid);
        }
    }
    return 1;
}
should fix it. You made a mistake with the brackets
Change "else" to "default" then post a reply.
Reply
#10

Quote:
Originally Posted by Isolated
View Post
Change "else" to "default" then post a reply.
no errors, but don't change the colors.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)