Help in scripting
#1

Hello.
This is code
pawn Код:
stock GetPlayerFRank(playerid)
{
    new string[64];
    format(string, sizeof(string), "%s", "None");
    // if player is in a family, format family rank
    if(PlayerInfo[playerid][pFMember] != 255)
    {
        new fam = PlayerInfo[playerid][pFMember];
        new rank = PlayerInfo[playerid][pFRank];
        if(rank >= 1 && rank <= 6)
        {
            format(string, sizeof(string), "%s", FamilyRank[fam][rank-1]);
        }
        else
        {
            format(string, sizeof(string), "%s", FamilyRank[fam][0]);
        }
    }
    return string;
}


I have 12 LSPD ranks and 6 ranks of each faction.
And I am getting this error
pawn Код:
C:\Users\Hassan\Desktop\Pictures of Server\Equality_Roleplayr\gamemodes\EQRP.pwn(5124) : error 001: expected token: "-identifier-", but found "="
C:\Users\Hassan\Desktop\Pictures of Server\Equality_Roleplayr\gamemodes\EQRP.pwn(5125) : error 029: invalid expression, assumed zero
C:\Users\Hassan\Desktop\Pictures of Server\Equality_Roleplayr\gamemodes\EQRP.pwn(5125) : error 029: invalid expression, assumed zero
C:\Users\Hassan\Desktop\Pictures of Server\Equality_Roleplayr\gamemodes/EQRP.pwn(5125) : warning 215: expression has no effect
C:\Users\Hassan\Desktop\Pictures of Server\Equality_Roleplayr\gamemodes\EQRP.pwn(5125) : error 001: expected token: ";", but found ")"
C:\Users\Hassan\Desktop\Pictures of Server\Equality_Roleplayr\gamemodes\EQRP.pwn(5125) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
Reply
#2

Show error line? and try this one.
pawn Код:
stock GetPlayerFRank(playerid)
{
    new string[64];
    format(string, sizeof(string), "%s", "None");
    // if player is in a family, format family rank
    if(PlayerInfo[playerid][pFMember] != 255)
    {
        new fam = PlayerInfo[playerid][pFMember];
        new rank = PlayerInfo[playerid][pFRank];
        if(rank >= 1 && rank <= 6);
        {
            format(string, sizeof(string), "%s", FamilyRank[fam][rank-1]);
        }
        else
        {
            format(string, sizeof(string), "%s", FamilyRank[fam][0]);
        }
    }
    return string;
}
Reply
#3

Error is on these lines
pawn Код:
new rank = PlayerInfo[playerid][pFRank];
if(rank >= 1 && rank <= 6)
Reply
#4

pawn Код:
new rank = PlayerInfo[playerid][pFRank];
if(rank >= 1 && < 6)
Reply
#5

pawn Код:
stock GetPlayerFRank(playerid)
{
    new string[64];
    format(string, sizeof(string), "%s", "None");
    // if player is in a family, format family rank
    if(PlayerInfo[playerid][pFMember] != 255)
    {
        new fam = PlayerInfo[playerid][pFMember];
        if(PlayerInfo[playerid][pFRank]>= 1 && PlayerInfo[playerid][pFRank]<= 6)
        {
            format(string, sizeof(string), "%s", FamilyRank[fam][rank-1]);
        }
        else
        {
            format(string, sizeof(string), "%s", FamilyRank[fam][0]);
        }
    }
    return string;
}
Reply
#6

Quote:
Originally Posted by Maro06
Посмотреть сообщение
pawn Код:
stock GetPlayerFRank(playerid)
{
    new string[64];
    format(string, sizeof(string), "%s", "None");
    // if player is in a family, format family rank
    if(PlayerInfo[playerid][pFMember] != 255)
    {
        new fam = PlayerInfo[playerid][pFMember];
        if(PlayerInfo[playerid][pFRank]>= 1 && PlayerInfo[playerid][pFRank]<= 6)
        {
            format(string, sizeof(string), "%s", FamilyRank[fam][rank-1]);
        }
        else
        {
            format(string, sizeof(string), "%s", FamilyRank[fam][0]);
        }
    }
    return string;
}
dude mine works too ! he should give us both a +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)