for (new i = 0; i < 13; i ++) {
format(query, sizeof(query), "Gun%d", i + 1);
cache_get_value_int(i, query, PlayerData[playerid][pGuns][i]);
format(query, sizeof(query), "Ammo%d", i + 1);
cache_get_value_int(i, query, PlayerData[playerid][pAmmo][i]);
}
enum playerData {
pID,
pIP[16],
pGuns[13],
pAmmo[13]
};
new PlayerData[MAX_PLAYERS][playerData];
forward OnAccountLoad(playerid);
public OnAccountLoad(playerid)
{
new
query[2048];
cache_get_value_int(0, "ID", PlayerData[playerid][pID]);
cache_get_value(0, "IP", PlayerData[playerid][pIP]);
/*for (new i = 0; i < 13; i ++) {
format(query, sizeof(query), "Gun%d", i + 1);
cache_get_value_int(i, query, PlayerData[playerid][pGuns][i]);
format(query, sizeof(query), "Ammo%d", i + 1);
cache_get_value_int(i, query, PlayerData[playerid][pAmmo][i]);
}*/
return 1;
}
enum playerData
{
pID,
pIP[16],
};
new zdata[MAX_PLAYERS][playerData];
new pGuns[MAX_PLAYERS][13];
new pAmmo[MAX_PLAYERS][13];
forward OnAccountLoad(playerid);
public OnAccountLoad(playerid)
{
new
query[2048];
cache_get_value_int(0, "ID", zdata[playerid][pID]);
cache_get_value(0, "IP", zdata[playerid][pIP]);
for (new i = 0; i < 13; i ++)
{
format(query, sizeof(query), "Gun%d", i + 1);
cache_get_value_name_int(i, query, pGuns[playerid][i]);
format(query, sizeof(query), "Ammo%d", i + 1);
cache_get_value_name_int(i, query, pAmmo[playerid][i]);
}
return 1;
}
CMD:daskj(playerid)
{
OnAccountLoad(playerid);
return 1;
}
Tente assim amigo, depois posta o resultado.
PHP код:
|
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '1' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '1' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '2' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '2' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '3' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '3' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '4' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '4' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '6' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '6' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '7' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '7' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '8' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '8' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '9' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '9' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '10' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '10' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '11' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '11' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '12' (number of rows: '1') [21:39:56] [ERROR] cache_get_value_name_int: invalid row index '12' (number of rows: '1')
cache_get_value_name_int(0