16.04.2013, 13:23
Hey i've had ago at making a command that lists all the registered players in the database
Its only shwoing it once and not showing the correct info
Its only shwoing it once and not showing the correct info
pawn Код:
CMD:regedplayers(playerid, params[])
{
new playerData[512], AccName[100][MAX_PLAYER_NAME], AccIDs, string[512];
mysql_query("SELECT `AccID`,`Username` FROM `Accounts` ORDER BY `AccID`");
mysql_store_result();
while(mysql_retrieve_row())
{
mysql_fetch_row(playerData);
sscanf(playerData, "is[24]", AccIDs,AccName);
// do something with 'playersName' and 'playersScore'
format(string, sizeof(string), "ID: %i Name: %s",AccIDs,AccName);
//SendClientMessage(playerid, ~1, string);
ShowPlayerDialog( playerid, 350, DIALOG_STYLE_MSGBOX,"Location: Players", string, "(Close)", "");
}
mysql_free_result();
return 1;
}