05.12.2013, 09:47
i'v got errors about cache_get_row?,is the mysql plugin older or ?
pawn Код:
ublic f_LoadPlayer(playerid)
{
new rows, fields,name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
cache_get_data(rows,fields);
if(!rows)
{
mysql_format(dbhandle,bigquery,"INSERT INTO `players` (`name`,`slot1`,`slot2`,`slot3`,`slot4`,`slot5`,`slot6`,`slot7`,`slot8`,`slot9`,`slot10`) VALUES ('%e',0,0,0,0,0,0,0,0,0,0)",name);
mysql_function_query(dbhandle,bigquery,false,"","");
printf("MySQL: Player %s added to furniture database!",name);
}
else if(rows)
{
new temp[24],countused;
cache_get_row(0,0,temp); FurnitureInfo[playerid][id] = strval(temp);
cache_get_row(0,1,temp); format(FurnitureInfo[playerid][Name],MAX_PLAYER_NAME,"%s",name);
cache_get_row(0,2,temp); FurnitureInfo[playerid][Slot][0] = strval(temp);
cache_get_row(0,3,temp); FurnitureInfo[playerid][Slot][1] = strval(temp);
cache_get_row(0,4,temp); FurnitureInfo[playerid][Slot][2] = strval(temp);
cache_get_row(0,5,temp); FurnitureInfo[playerid][Slot][3] = strval(temp);
cache_get_row(0,6,temp); FurnitureInfo[playerid][Slot][4] = strval(temp);
cache_get_row(0,7,temp); FurnitureInfo[playerid][Slot][5] = strval(temp);
cache_get_row(0,8,temp); FurnitureInfo[playerid][Slot][6] = strval(temp);
cache_get_row(0,9,temp); FurnitureInfo[playerid][Slot][7] = strval(temp);
cache_get_row(0,10,temp); FurnitureInfo[playerid][Slot][8] = strval(temp);
cache_get_row(0,11,temp); FurnitureInfo[playerid][Slot][9] = strval(temp);
cache_get_row(0,12,temp); FurnitureInfo[playerid][Slot][10] = strval(temp);
cache_get_row(0,13,temp); FurnitureInfo[playerid][Slot][11] = strval(temp);
cache_get_row(0,14,temp); FurnitureInfo[playerid][Slot][12] = strval(temp);
cache_get_row(0,15,temp); FurnitureInfo[playerid][Slot][13] = strval(temp);
cache_get_row(0,16,temp); FurnitureInfo[playerid][Slot][14] = strval(temp);
cache_get_row(0,17,temp); FurnitureInfo[playerid][Slot][15] = strval(temp);
cache_get_row(0,18,temp); FurnitureInfo[playerid][Slot][16] = strval(temp);
cache_get_row(0,19,temp); FurnitureInfo[playerid][Slot][17] = strval(temp);
cache_get_row(0,20,temp); FurnitureInfo[playerid][Slot][18] = strval(temp);
cache_get_row(0,21,temp); FurnitureInfo[playerid][Slot][19] = strval(temp);
cache_get_row(0,22,temp); FurnitureInfo[playerid][Slot][20] = strval(temp);
cache_get_row(0,23,temp); FurnitureInfo[playerid][Slot][21] = strval(temp);
cache_get_row(0,24,temp); FurnitureInfo[playerid][Slot][22] = strval(temp);
cache_get_row(0,25,temp); FurnitureInfo[playerid][Slot][23] = strval(temp);
cache_get_row(0,26,temp); FurnitureInfo[playerid][Slot][24] = strval(temp);
cache_get_row(0,27,temp); FurnitureInfo[playerid][Slot][25] = strval(temp);
cache_get_row(0,28,temp); FurnitureInfo[playerid][Slot][26] = strval(temp);
cache_get_row(0,29,temp); FurnitureInfo[playerid][Slot][27] = strval(temp);
cache_get_row(0,30,temp); FurnitureInfo[playerid][Slot][28] = strval(temp);
cache_get_row(0,31,temp); FurnitureInfo[playerid][Slot][29] = strval(temp);
for(new i = 0; i < 10; i++)
{
if(FurnitureInfo[playerid][Slot][i] != 0) countused++;
}
printf("MySQL: Player %s loaded from furniture database. Objects used: %d!",name,countused);
}
return 1;
}