02.10.2010, 01:08
Код:
dcmd_login(playerid, params[]) { new tmpname[128], tmppass[32], query[256]; GetPlayerName(playerid, tmpname, sizeof(tmpname)); if(sscanf(params,"s",tmppass)) { format(query,sizeof(query), "SELECT * FROM `samp` WHERE name='%s'", tmpname); mysql_query(query); mysql_store_result(); if(mysql_num_rows() != 0) { new line[256], data[2][32], id; if(mysql_fetch_row(line)) { sscanf(line,"p|dss",id,data[0],data[1]); mysql_free_result(); if(data[1] == tmppass) { SendClientMessage(playerid, COLOR_MAIN, "Logged in"); return 1; } else { SendClientMessage(playerid, COLOR_ALERT, "Incorrect password"); return 1; } } } } }
error 033: array must be indexed (variable "data")
I've tried switching them around, and various other things, but I haven't got a clue what's wrong! Help!