Have a problem with /stats command...
#1

Hello my prob is right here:
Код:
error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
My command with error line:
Код:
CMD:stats(playerid,params[])
{
    if(IsPlayerConnected(playerid))
    {
        new Password = PlayerInfo[playerid][Pass],//This is error line.... maybe someone can help me out !
        Adminlevel = PlayerInfo[playerid][ Adminlevel],
        VIPlevel = PlayerInfo[playerid][VIPlevel],
        Money = PlayerInfo[playerid][Money],
        Scores = PlayerInfo[playerid][Scores],
        Kills = PlayerInfo[playerid][Kills],
        Deaths = PlayerInfo[playerid][Deaths],
        Respect = PlayerInfo[playerid]Respect],
        Gun1 = PlayerInfo[playerid][Gun1],
        Gun2 = PlayerInfo[playerid][Gun2],
        Gun3 = PlayerInfo[playerid][Gun3],
        Gun4 = PlayerInfo[playerid][Gun4],
        Gun5 = PlayerInfo[playerid][Gun5],
        Ammo1 = PlayerInfo[playerid][Ammo1],
        Ammo2 = PlayerInfo[playerid][Ammo2],
        Ammo3 = PlayerInfo[playerid][Ammo3],
        Ammo4 = PlayerInfo[playerid][Ammo4],
        Ammo5 = PlayerInfo[playerid][Ammo5],
        House = PlayerInfo[playerid][House],
        Car = PlayerInfo[playerid][Car],
        Business = PlayerInfo[playerid][Business],
        Raped = PlayerInfo[playerid][Raped],
        Jailed = PlayerInfo[playerid][Jailed],
        Farted = PlayerInfo[playerid][Farted],
        Fish = PlayerInfo[playerid][Fish],
        Phone = PlayerInfo[playerid][Phone],
        PhoneNumber = PlayerInfo[playerid][PhoneNumber],
        string[500];
        format(string,sizeof(string),"Password: %s | Admin: %d | VIP: %d | Money: %d | Score: %d | Kills: %d | Deaths: %d | Respect: %d",Pass,Adminlevel,VIPlevel,Money,Scores,Kills,Deaths,Respect);
        format(string,sizeof(string),"Gun1: %d | Gun2: %d | Gun3: %d | Gun4: %d | Gun5: %d | Ammo1: %d | Ammo2: %d | Ammo3: %d | Ammo4: %d | Ammo5: %d",Gun1,Gun2,Gun3,Gun4,Gun5,Ammo1,Ammo2,Ammo3,Ammo4,Ammo5);
        format(string,sizeof(string),"House: %d | Business: %d | Raped: %d | Jailed: %d | Farted: %d | Fish: %d | Phone: %d | PhoneNumber: %s",House,Business,Raped,Jailed,Farted,Fish,Phone,PhoneNumber);
        SendClientMessage(playerid,COLOR_WHITE,string);
    }
    return 1;
}
Reply
#2

State the error lines.
Reply
#3

try this,

pawn Код:
new Password ;
Password = PlayerInfo[playerid][Pass],//This is error line.... maybe someone can help me out !
Reply
#4

Same error! And there is only one error line

This :
Quote:

new Password = PlayerInfo[playerid][Pass],//This is error line.... maybe someone can help me out !

Reply
#5

Is "Password" the only method which is not defined so you placed "new" or all the methods are not defined so you used "," ?

If "Password" the only method which is not defined so you mixed, just replace the "," with ";"
Reply
#6

It will give the same error.. Anyway.. So the problem is somewhere I just don't know where... new and , is used to list everything so I don't need to write after each new write new AdminLevel example so yeah.. Please somebody help me out I will give you a + rep anyway
Reply
#7

Cancel

EDIT: All of the string have to be arrayed, i think, like Password[32] or something like that
Reply
#8

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
It will give the same error.. Anyway.. So the problem is somewhere I just don't know where... new and , is used to list everything so I don't need to write after each new write new AdminLevel example so yeah.. Please somebody help me out I will give you a + rep anyway
What do I understand is you are defining them(^^ I understood something else), any way when I compiled it , none errors warnings appeared, it may be caused of something else or you put in "enum" for example:
pawn Код:
enum pInfo
{
    Pass[32]//for example
}
if I'm right then I think you will must add
Код:
Password[32]
Reply
#9

Quote:
Originally Posted by IceMeteor
Посмотреть сообщение
Replace all , to ;

Show me the result
It is the same error! nothing is changing... so yeah and same in second code too... If I'm using Password [129](It's how much I puted)
Reply
#10

All of the string have to be arrayed, i think, like Password[32] = ... or something like that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)