Some "Expected Token" Errors!
#1

Код:
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(41) : error 001: expected token: "-identifier-", but found "-string-"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(127) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(138) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(371) : error 001: expected token: "-string end-", but found "-identifier-"
These are the bits of code the errors are in. Usually I solve expected token errors myself, but I can't figure this out!
Код:
enum Info
{
    IP[16],
    Password[129],
    Admin,
    Score,
    Money,
    Deaths,
    Kills,
    Float:PosX,
    Float:PosY,
    Float:PosZ,
    Float:PosA,
    IsRegistered,
    IsOnDutyRCPD,
    Skin // Line 41
}
Код:
if(fexist(UserPath(playerid)))
    {
        GetPlayerPos(playerid, PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosY], PlayerInfo[playerid][PosZ]);
        GetPlayerFacingAngle(playerid, PlayerInfo[playerid][PosA]);
        file_Open(UserPath(playerid));
        file_SetVal("Admin", PlayerInfo[playerid][Admin]);
        file_SetVal("Score", PlayerInfo[playerid][Score]);
        file_SetVal("Money", PlayerInfo[playerid][Money]);
        file_SetVal("Deaths", PlayerInfo[playerid][Deaths]);
        file_SetVal("Kills", PlayerInfo[playerid][Kills]);
        file_SetFloat("PosX", PlayerInfo[playerid][PosX]);
        file_SetFloat("PosY", PlayerInfo[playerid][PosY]);
        file_SetFloat("PosZ", PlayerInfo[playerid][PosZ]);
        file_SetFloat("PosA", PlayerInfo[playerid][PosA]);
        file_SetVal("IsRegistered", PlayerInfo[playerid][IsRegistered]);
        file_SetVal("IsOnDutyRCPD", PlayerInfo[playerid][IsOnDutyRCPD]);
        file_SetVal("Skin", PlayerInfo[playerid][Skin]); // Line 127
        file_Save(UserPath(playerid));
        file_Close();
    }
Код:
public OnPlayerSpawn(playerid)
{
	SetPlayerPos(playerid,PlayerInfo[playerid][PosX],PlayerInfo[playerid][PosY],PlayerInfo[playerid][PosZ]);
	SetPlayerFacingAngle(playerid,PlayerInfo[playerid][PosA]);
    SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]); // Line 138
	return 1;
}
Код:
if(!strcmp(HashPass, PlayerInfo[playerid][Password]))
            {
                file_Open(UserPath(playerid)); // open his file
                PlayerInfo[playerid][Admin] = file_GetVal("Admin");
                PlayerInfo[playerid][Score] = file_GetVal("Score");
                PlayerInfo[playerid][Money] = file_GetVal("Money");
                PlayerInfo[playerid][Deaths] = file_GetVal("Deaths");
                PlayerInfo[playerid][Kills] = file_GetVal("Kills");
                PlayerInfo[playerid][PosX] = file_GetFloat("PosX");
                PlayerInfo[playerid][PosY] = file_GetFloat("PosY");
                PlayerInfo[playerid][PosZ] = file_GetFloat("PosZ");
                PlayerInfo[playerid][PosA] = file_GetFloat("PosA");
                PlayerInfo[playerid][IsRegistered] = file_GetVal("IsRegistered");
                PlayerInfo[playerid][IsOnDutyRCPD] = file_GetVal("IsOnDutyRCPD");
                PlayerInfo[playerid][Skin] = file_GetVal("Skin"); // Line 371
                file_Close();
            }
The only thing I get is that something went wrong when I added saving of the skin, but I don't see what.

Any help is appreciated!
Reply
#2

Try to move the Variable:
pawn Код:
enum Info
{
    IP[16],
    Password[129],
    Admin,
    Score,
    Money,
    Deaths,
    Kills,
    Skin.
    Float:PosX,
    Float:PosY,
    Float:PosZ,
    Float:PosA,
    IsRegistered,
    IsOnDutyRCPD
}
Reply
#3

Well, that didn't really help that much :/
Код:
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(35) : error 001: expected token: "-identifier-", but found "-string-"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(113) : error 017: undefined symbol "PosX"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(114) : error 017: undefined symbol "PosA"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(121) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(122) : error 017: undefined symbol "PosX"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(123) : error 017: undefined symbol "PosY"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(124) : error 017: undefined symbol "PosZ"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(125) : error 017: undefined symbol "PosA"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(126) : error 017: undefined symbol "IsRegistered"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(127) : error 017: undefined symbol "IsOnDutyRCPD"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(136) : error 017: undefined symbol "PosX"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(137) : error 017: undefined symbol "PosA"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(138) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(365) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(366) : error 017: undefined symbol "PosX"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(366) : warning 213: tag mismatch
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(367) : error 017: undefined symbol "PosY"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(367) : warning 213: tag mismatch
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(368) : error 017: undefined symbol "PosZ"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(368) : warning 213: tag mismatch
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(369) : error 017: undefined symbol "PosA"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(369) : warning 213: tag mismatch
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(370) : error 017: undefined symbol "IsRegistered"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(371) : error 017: undefined symbol "IsOnDutyRCPD"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(388) : error 017: undefined symbol "IsOnDutyRCPD"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(390) : error 017: undefined symbol "IsOnDutyRCPD"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(396) : error 017: undefined symbol "IsOnDutyRCPD"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(405) : error 017: undefined symbol "IsOnDutyRCPD"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(418) : error 017: undefined symbol "IsOnDutyRCPD"
C:\Users\Hans\Desktop\Server\gamemodes\location.pwn(430) : error 017: undefined symbol "IsOnDutyRCPD"
Reply
#4

Try this then:
pawn Код:
enum Info
{
    IP[16],
    Password[129],
    Admin,
    Score,
    Money,
    Deaths,
    Kills,
    Skin.
    Float:PosX,
    Float:PosY,
    Float:PosZ,
    Float:PosA,
    IsRegistered,
    IsOnDutyRCPD,
    Skin
};
Reply
#5

Shouldn't there be a comma after Skin?
Reply
#6

Quote:
Originally Posted by Roach_
Посмотреть сообщение
Try this then:
pawn Код:
enum Info
{
    IP[16],
    Password[129],
    Admin,
    Score,
    Money,
    Deaths,
    Kills,
    Skin.
    Float:PosX,
    Float:PosY,
    Float:PosZ,
    Float:PosA,
    IsRegistered,
    IsOnDutyRCPD,
    Skin
};
are you blind ? you placed a . instead of , and there is no need for ; at the end
pawn Код:
enum Info
{
    IP[16],
    Password[129],
    Admin,
    Score,
    Money,
    Deaths,
    Kills,
    Skin,
    Float:PosX,
    Float:PosY,
    Float:PosZ,
    Float:PosA,
    IsRegistered,
    IsOnDutyRCPD
}
Reply
#7

Yeah, I replaced the dot with a comma, and didn't add the semicolon, but still came up with that bunch of errors I posted on my last post.
Reply
#8

Add a " , " after the last one.
Reply
#9

Quote:
Originally Posted by Johndaonee
Посмотреть сообщение
Add a " , " after the last one.
Never.

And you do need ; after } of enum.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)