possible? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: possible? (
/showthread.php?tid=182766)
possible? -
Ribber - 12.10.2010
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.
|
Re: possible? -
M4S7ERMIND - 12.10.2010
This will fix the error: PlayerStatistics[playerid][ClassAchs][cname] = 0;
AW: possible? -
Ribber - 12.10.2010
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?
Re: AW: possible? -
M4S7ERMIND - 12.10.2010
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++)