possible?
#1

I like to know wheter is something like this possibile:

pawn Код:
enum PlayerData
{
    DatabaseID,
    Username[MAX_PLAYER_NAME],
    Password[20],
    IP[16],
    Money,
    Score,
    Kills,
    Deaths,
    Level,
    Rank[50],
...
    ClassAchs[12],
...
}

new PlayerStatistics[MAX_PLAYERS][PlayerData];
then:

pawn Код:
for(new cname; cname < sizeof(PlayerStatistics[playerid][ClassAchs]); cname++) PlayerStatistics[playerid][ ClassAchs[cname] ] = 0;
I can't compile it, I get these errors:

Quote:

error 001: expected token: "]", but found "-identifier-"
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#2

This will fix the error: PlayerStatistics[playerid][ClassAchs][cname] = 0;
Reply
#3

yeah, thx this is fixed.
But I think the sizeof(PlayerStatistics[playerid][ClassAchs]) still buggs, because when I write 12 it work.
So how I can fix this?
Reply
#4

I don't know how to fix that.. This is one solution:
pawn Код:
#define ACHS 12

enum PlayerData
{
    ...
    ClassAchs[ACHS]
    ...
}
And then:
pawn Код:
for(new cname; cname < ACHS; cname++)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)