CMD:stats(playerid, params[])
{
new string[200];
format(string, sizeof(string), "Name: %s | ID: %d | Score: %d | Kills: %i | Deaths: %i | Money: %d | Adminlevel: %d", GetName(playerid), playerid, GetPlayerScore(playerid), PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], GetPlayerMoney(playerid), AdminLevel[playerid]);
SendClientMessage(playerid ,COLOR_WHITE, string);
return 1;
}
C:\Users\бгйчд\Desktop\RolePlay Server\gamemodes\RolePlay.pwn(860) : error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo" C:\Users\бгйчд\Desktop\RolePlay Server\gamemodes\RolePlay.pwn(860) : warning 215: expression has no effect C:\Users\бгйчд\Desktop\RolePlay Server\gamemodes\RolePlay.pwn(860) : error 001: expected token: ";", but found "]" C:\Users\бгйчд\Desktop\RolePlay Server\gamemodes\RolePlay.pwn(860) : error 029: invalid expression, assumed zero C:\Users\бгйчд\Desktop\RolePlay Server\gamemodes\RolePlay.pwn(860) : fatal error 107: too many error messages on one line
format(string, sizeof(string), "Name: %s | ID: %d | Score: %d | Kills: %i | Deaths: %i | Money: %d | Adminlevel: %d", GetName(playerid), playerid, GetPlayerScore(playerid), PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], GetPlayerMoney(playerid), AdminLevel[playerid]);
enum PlayerInfo
{
Pass[129], //User's password
Adminlevel, //User's admin level
VIPlevel, //User's vip level
Money, //User's money
Scores, //User's scores
Kills, //User's kills
Deaths //User's deaths
}
enum PlayerInfo
{
Pass[129], //User's password
Adminlevel, //User's admin level
VIPlevel, //User's vip level
Money, //User's money
Scores, //User's scores
Kills, //User's kills
Deaths //User's deaths
};
new pInfo[MAX_PLAYERS][PlayerInfo];
CMD:stats(playerid, params[])
{
new string[128];
format(string, sizeof(string), "Name: %s | ID: %d | Score: %d | Kills: %i | Deaths: %i | Money: %d | Adminlevel: %d", GetName(playerid), playerid, GetPlayerScore(playerid), pInfo[playerid][Kills], pInfo[playerid][Deaths], GetPlayerMoney(playerid), pInfo[playerid][Adminlevel]);
SendClientMessage(playerid, -1, string);
return 1;
}
"PlayerInfo" is the name of the enum, not of the array. So use the name of the array. An example:
pawn Код:
pawn Код:
|