03.02.2011, 15:55
thats my question.
LoadOstats(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); new query[128]; format(query, sizeof(query), "SELECT * FROM ostats WHERE name='%s'", name); mysql_query(query); mysql_store_result(); new row[128]; new field[13][32]; mysql_fetch_row_format(row, "|"); explode(row, field, "|"); org[playerid] =strval(field[1]); leader[playerid]=strval(field[3]); req[playerid]=strval(field[2]); mysql_free_result(); new string[128]; format(string, sizeof(string), "SELECT * FROM orgs WHERE ID=%d", org[playerid]); mysql_query(string); mysql_store_result(); mysql_fetch_row_format(row, "|"); explode(row, field, "|"); oname[playerid]=strval(field[1]); ocolour[playerid]=strval(field[2]); otype[playerid]=strval(field[3]); oskin[playerid]=strval(field[4]); oskin1[playerid]=strval(field[5]); oskin2[playerid]=strval(field[6]); mysql_free_result(); return 1; }
oname[playerid] = field[1];
ocolour[playerid] = field[2];
format(oname[playerid], 24, "%s" field[1]); format(ocolour[playerid], 10, "%s" field[2]); |
i didnt get you. i just removed strval and it says it should be assigned to an array
|
new oname[MAX_PLAYERS][24];
strmid([playerid]oname, field[1], 0, strlen(field[1]), 255);
strmid([playerid]ocolour, field[2], 0, strlen(field[2]), 255);
strmid(oname[playerid], field[1], 0, strlen(field[1]), 255);
strmid(ocolour[playerid], field[2], 0, strlen(field[2]), 255);