class errors
#1

Hello got these errors :

C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(104) : error 001: expected token: "{", but found ";"
C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(106) : error 014: invalid statement; not in switch
C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(106) : warning 215: expression has no effect
C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(106) : error 001: expected token: ";", but found ":"
C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(106) : error 029: invalid expression, assumed zero
C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(106) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.


pawn Код:
new Team[MAX_PLAYERS] = -1;
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1220.0737,-6.3703,1001.3281);
    SetPlayerInterior(playerid,2);
    SetPlayerFacingAngle(playerid,92.3402);
    SetPlayerCameraPos(playerid,1214.3527,-6.4071,1001.3290);
    SetPlayerCameraLookAt(playerid, 1220.0737,-6.3703,1000.3281);
    {
    switch(classid);
    {
        case 1:
        {
            GameTextForPlayer(playerid, "~b~~h~Englad", 5000, 6);
            Team[playerid] = 1;
        }
        case 2:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 5000, 6);
            Team[playerid] = 1;
        }
        case 3:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 5000, 6);
            Team[playerid] = 1;
        }
        case 4:
        {
            GameTextForPlayer(playerid, "~P~Russia", 5000, 6);
            Team[playerid] = 2;
        }
        case 5:
        {
            GameTextForPlayer(playerid, "~P~Russia", 5000, 6);
            Team[playerid] = 2;
        }
  SetPlayerTeamFromClass(playerid, classid)
{
        switch(classid)
    {
        case 1:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 5000, 6);
            Team[playerid] = 1;
        }
        case 2:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 5000, 6);
            Team[playerid] = 1;
        }
        case 3:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 5000, 6);
            Team[playerid] = 1;
        }
        case 4:
        {
            GameTextForPlayer(playerid, "~p~Russia", 5000, 6);
            Team[playerid] = 2;
        }
        case 5:
        {
            GameTextForPlayer(playerid, "~p~Russia", 5000, 6);
            Team[playerid] = 2;
        }
    return 1;
}
thats all my things with classes ^
Reply
#2

pawn Код:
switch(classid);
to

pawn Код:
switch(classid)
Reply
#3

pawn Код:
new Team[MAX_PLAYERS] = -1;
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1220.0737,-6.3703,1001.3281);
    SetPlayerInterior(playerid,2);
    SetPlayerFacingAngle(playerid,92.3402);
    SetPlayerCameraPos(playerid,1214.3527,-6.4071,1001.3290);
    SetPlayerCameraLookAt(playerid, 1220.0737,-6.3703,1000.3281);
    {
    switch(classid)
    {
        case 1:
        {
            GameTextForPlayer(playerid, "~b~~h~Englad", 5000, 6);
            Team[playerid] = 1;
        }
        case 2:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 5000, 6);
            Team[playerid] = 1;
        }
        case 3:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 5000, 6);
            Team[playerid] = 1;
        }
        case 4:
        {
            GameTextForPlayer(playerid, "~P~Russia", 5000, 6);
            Team[playerid] = 2;
        }
        case 5:
        {
            GameTextForPlayer(playerid, "~P~Russia", 5000, 6);
            Team[playerid] = 2;
        }
  SetPlayerTeamFromClass(playerid, classid)
{
        switch(classid)
    {
        case 1:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 5000, 6);
            Team[playerid] = 1;
        }
        case 2:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 5000, 6);
            Team[playerid] = 1;
        }
        case 3:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 5000, 6);
            Team[playerid] = 1;
        }
        case 4:
        {
            GameTextForPlayer(playerid, "~p~Russia", 5000, 6);
            Team[playerid] = 2;
        }
        case 5:
        {
            GameTextForPlayer(playerid, "~p~Russia", 5000, 6);
            Team[playerid] = 2;
        }
    return 1;
}
Reply
#4

Ok, ive now got this:


C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(131) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(131 -- 132) : error 028: invalid subscript (not an array or too many subscripts): "classid"
C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(131 -- 133) : error 001: expected token: "}", but found "switch"
C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(131 -- 133) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.


EDIT: dodo added your code exact same errors ^
Reply
#5

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1220.0737,-6.3703,1001.3281);
    SetPlayerInterior(playerid,2);
    SetPlayerFacingAngle(playerid,92.3402);
    SetPlayerCameraPos(playerid,1214.3527,-6.4071,1001.3290);
    SetPlayerCameraLookAt(playerid, 1220.0737,-6.3703,1000.3281);
    switch(classid)
    {
        case 1:
        {
            GameTextForPlayer(playerid, "~b~~h~Englad", 5000, 6);
            Team[playerid] = 1;
        }
        case 2:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 5000, 6);
            Team[playerid] = 1;
        }
        case 3:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 5000, 6);
            Team[playerid] = 1;
        }
        case 4:
        {
            GameTextForPlayer(playerid, "~P~Russia", 5000, 6);
            Team[playerid] = 2;
        }
        case 5:
        {
            GameTextForPlayer(playerid, "~P~Russia", 5000, 6);
            Team[playerid] = 2;
        }
    }
    return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
    switch(classid)
    {
        case 1:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 5000, 6);
            Team[playerid] = 1;
        }
        case 2:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 5000, 6);
            Team[playerid] = 1;
        }
        case 3:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 5000, 6);
            Team[playerid] = 1;
        }
        case 4:
        {
            GameTextForPlayer(playerid, "~p~Russia", 5000, 6);
            Team[playerid] = 2;
        }
        case 5:
        {
            GameTextForPlayer(playerid, "~p~Russia", 5000, 6);
            Team[playerid] = 2;
        }
    }
    return 1;
}
I indent the code, your code indent is bad
Reply
#6

Thanks +rep
Reply
#7

oh crap i have a bug since i added the code, the first class skin the gametext doesnt show
Reply
#8

Use Case 0 also
Reply
#9

thanks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)