CMD:loopserial(playerid, params[]) { if(!PlayerInfo[playerid][pAdmin]) return SCM(playerid, RED, "Not authorized"); new query[128], serial[40]; if(sscanf(params, "s[45]", serial)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /loopserial [Serial IDl]"); mysql_format(sqlL, query, sizeof(query), "SELECT Name, LastLogged FROM players WHERE Serial = '%e'", serial); mysql_pquery(sqlL, query, "GetListSerial", "i", playerid); return 1; }
forward GetListSerial(playerid); public GetListSerial(playerid) { if(!PlayerInfo[playerid][pAdmin]) return 1; if(cache_num_rows() == 0) return SendClientMessage(playerid, COLOR_WHITE, "I couldn't find any account with the matching SERIAL ID."); new serial[10000], lastlog[64], name[MAX_PLAYER_NAME]; for(new i = 0; i < cache_num_rows(); i++) { cache_get_field_content(i, "Name", name); cache_get_field_content(i, "LastLogin", lastlog); format(serial, sizeof(serial), "%s{FFFF00}%s (%s)\t\t{FFFFFF}\n", serial, name, lastlog); } ShowPlayerDialog(playerid, NOTEXISTING, DIALOG_STYLE_TABLIST, "Serials IDS", serial, "Okay", ""); return 1; }
mysql_format(sqlL, query, sizeof(query), "SELECT Name, LastLogged FROM players WHERE Serial = '%e'", serial);
cache_get_field_content(i, "LastLogin", lastlog);
new query[128], serial[41];
What's your correct row name? LastLogged or LastLogin?
Code:
mysql_format(sqlL, query, sizeof(query), "SELECT Name, LastLogged FROM players WHERE Serial = '%e'", serial); Code:
cache_get_field_content(i, "LastLogin", lastlog); |