19.05.2017, 09:52
So, iam trying to get the player stats from the data base
But not working fine gives me errors
Errors
But not working fine gives me errors
PHP код:
IRCCMD:ostats(botid, channel[], user[], host[], params[])
{
new account[24],Query[72];
if(sscanf(params, "s[24]", account))
return IRC_Say(groupID, channel, "7Usage: 1!ostats [Account]");
if(4 <= strlen(account) >= 24) return IRC_Say(groupID, channel, "7Error: 1Player name cannot exceed 24 characters!");
mysql_format(mysql, Query, sizeof(Query), "SELECT Hours,Minutes,SkinID,Admin,Tokens,RaceWon,Kills,Deaths,Score,Money,Rdate FROM `players` WHERE `Username` = '%e'", account);
mysql_query(mysql, Query);
if(cache_num_rows() >= 1)
{
new score,string[143];
cache_get_value_name_int(0, "SkinID", pData[account][Skin]);
cache_get_value_name_int(0, "Admin", pData[account][Admin]); //we're getting a field 4 from row 0. And since it's an integer, we use cache_get_row_int
cache_get_value_name_int(0, "Money", pData[account][Money]);//Above
cache_get_value_name_int(0,"Kills", pData[account][Kills]);
cache_get_value_name_int(0,"Tokens", pData[account][Tokens]);
cache_get_value_name_int(0, "Deaths", pData[account][Deaths]);
cache_get_value_name_int(0, "Hours", pData[account][pHours]);
cache_get_value_name_int(0, "Minutes", pData[account][pMinutes]);
cache_get_value_name_int(0, "RaceWon", pData[account][RaceWon]);
//cache_get_value_name_int(0, "Score", score);
//SetPlayerScore(playerid, score);
}
else IRC_Say(groupID, channel, "7Error: 1this name not exists on database");
return 1;
}
Код:
D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn(12484) : error 033: array must be indexed (variable "account") D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn(12485) : error 033: array must be indexed (variable "account") D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn(12486) : error 033: array must be indexed (variable "account") D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn(12487) : error 033: array must be indexed (variable "account") D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn(12488) : error 033: array must be indexed (variable "account") D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn(12489) : error 033: array must be indexed (variable "account") D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn(12490) : error 033: array must be indexed (variable "account") D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn(12491) : error 033: array must be indexed (variable "account") D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn(12492) : error 033: array must be indexed (variable "account")