COMPILE ERROR tagmosmatch and array index out of bounds PLSHELP !
#1

Код:
#include <a_samp>
#include <a_mysql>
#include <zcmd>

#define MAX_FACTION_NAME 32
#define COLOR_BLUE3 0xA9C4E4FF

enum E_PLAYER
{
	ORM:ORM_ID,
	ID,
	Name[MAX_PLAYER_NAME+1],
	Password[32],
	Admin,
	Class,
	Level,
	Respect,
	Point,
	Cash,
	Fac,
	Rank,
	Job,
	Skill
}
new PlayerInfo[MAX_PLAYERS][E_PLAYER];

enum E_FAC
{
	ORM:ORM_ID,
	ID,
	Name[MAX_FACTION_NAME+1],
	Float:SpX,
	Float:SpY,
	Float:SpZ,
	SpI,
	SpV,
	Level,
	Exp,
	Money
}
new FacInfo[MAX_PLAYERS][E_FAC];

CMD:stats(playerid, params[])
{
	new string[144];
	format(string, sizeof(string),"Player Name:%s Class:%s Level:%d Respect:%d Point:%d Cash:%d",
	PlayerInfo[playerid][Name],
	GetPlayerClass(playerid),
	PlayerInfo[playerid][Level],
	PlayerInfo[playerid][Respect],
	PlayerInfo[playerid][Point],
	PlayerInfo[playerid][Cash]);
	SendClientMessage(playerid, COLOR_BLUE3, string);
	format(string, sizeof(string), "Faction Name:%s Level:%d Respect:%d Money:%d Spawn Pos:%f,%f,%f,%d,%d",
	FacInfo[playerid][Name],
	FacInfo[playerid][Level],
	FacInfo[playerid][Respect],
	FacInfo[playerid][Money],
	FacInfo[playerid][SpX],
	FacInfo[playerid][SpY],
	FacInfo[playerid][SpZ],
	FacInfo[playerid][SpI],
	FacInfo[playerid][SpV]);
	SendClientMessage(playerid, COLOR_BLUE3, string);
	return 1;
}
warning 213: tag mismatch
(112 -- 115) : error 032: array index out of bounds (variable "FacInfo")
Reply
#2

That's because respect name and level are stored in PlayerInfo not FacInfo
Reply
#3

Quote:

enum E_PLAYER
{
ORMORM_ID,
pID,
pName[MAX_PLAYER_NAME+1],
pPassword[32],
pAdmin,
pClass,
pLevel,
pRespect,
pPoint,
pCash,
pFac,
pRank,
pJob,
pSkill
}
new PlayerInfo[MAX_PLAYERS][E_PLAYER];

enum E_FAC
{
ORM:fORM_ID,
fID,
fName[MAX_FACTION_NAME+1],
Float:fSpX,
Float:fSpY,
Float:fSpZ,
fSpI,
fSpV,
fLevel,
fExp,
fMoney
}

this right ?
Reply
#4

many thanks how to rep you i undetstood
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)