CMD:admlevel10(playerid, params[])
{
mysql_query("SELECT user FROM playerdata WHERE level = 10");
mysql_store_result();
if(mysql_num_rows()) {
new
ID,
output[800];
while(mysql_retrieve_row())
{
ID ++;
new
username[24];
mysql_fetch_field_row(username, "user");
format(output, sizeof(output), "%s"ccwhite"%d. %s\n", output, ID, username);
}
mysql_free_result();
ShowPlayerDialog(playerid, 1101, DIALOG_STYLE_MSGBOX, "Level 10 Admins", output, "OK", "Cancel");}
else {
ShowPlayerDialog(playerid, 1101, DIALOG_STYLE_MSGBOX, "Level 10 Admins", "No Admins of this level.", "OK", "Cancel");}
return 1;
}
Can u please ****** for tutorials / check the R40+ wiki page?
If you encounter problems while converting (meaning you at least tried), then you can come here |
CMD:admlevel10(playerid, params[])
{
new Cache:results, rows;
results = mysql_query(connectionHandle, "SELECT user FROM playerdata WHERE level = 10");
rows = cache_num_rows();
if(rows) {
new
ID,
output[800];
for(new i; i < rows; i++) {
ID ++;
new
username[24];
cache_get_value_name(i, "user", username);
format(output, sizeof(output), "%s"ccwhite"%d. %s\n", output, ID, username);
}
ShowPlayerDialog(playerid, 1101, DIALOG_STYLE_MSGBOX, "Level 10 Admins", output, "OK", "Cancel");
}
else ShowPlayerDialog(playerid, 1101, DIALOG_STYLE_MSGBOX, "Level 10 Admins", "No Admins of this level.", "OK", "Cancel");
cache_delete(results);
return 1;
}
This should work, But don't just copy paste.
Next time search before posting. PHP код:
|
This should work, But don't just copy paste.
Next time search before posting. PHP код:
|
CMD:admlevel10(playerid, params[])
{
new Cache:results, rows;
results = mysql_query(mysql, "SELECT user FROM players WHERE Admin = 10");
rows = cache_num_rows();
if(rows) {
new
output[800];
for(new i; i < rows; i++) {
new
username[24];
cache_get_value_name(i, "Username", username);
format(output, sizeof(output), "%s %s\n", output, username);
}
ShowPlayerDialog(playerid, 1101, DIALOG_STYLE_MSGBOX, "Level 10 Admins", output, "OK", "Cancel");
}
else ShowPlayerDialog(playerid, 1101, DIALOG_STYLE_MSGBOX, "Level 10 Admins", "No Admins of this level.", "OK", "Cancel");
cache_delete(results);
return 1;
}
No Admins of this level.
Martex [Level 10] (ServerOwner)
PHP код:
Код:
No Admins of this level. Код:
Martex [Level 10] (ServerOwner) |
PHP код:
Код:
No Admins of this level. Код:
Martex [Level 10] (ServerOwner) |
CMD:admlevel10(playerid, params[]) { new Cache:results, rows; results = mysql_query(mysql, "SELECT user FROM players WHERE Admin = 10"); rows = cache_num_rows(); if(rows) { new output[800]; for(new i; i < rows; i++) { new username[24]; cache_get_value_name(i, "Username", username); format(output, sizeof(output), "%s %s\n", output, username); } ShowPlayerDialog(playerid, 1101, DIALOG_STYLE_MSGBOX, "Level 10 Admins", output, "OK", "Cancel"); } else ShowPlayerDialog(playerid, 1101, DIALOG_STYLE_MSGBOX, "Level 10 Admins", "No Admins of this level.", "OK", "Cancel"); cache_delete(results); return 1; }
CMD:admlevel10(playerid, params[])
{
static Cache:results,
rows;
results = mysql_query(mysql, "SELECT user FROM players WHERE Admin = 10");
rows = cache_num_rows();
if(rows) {
new
output[800];
static username[24];
for(new i; i < rows; i++) {
cache_get_value_name(i, "user", username);
format(output, sizeof(output), "%s %s\n", output, username);
}
ShowPlayerDialog(playerid, 1101, DIALOG_STYLE_MSGBOX, "Level 10 Admins", output, "OK", "Cancel");
}
else ShowPlayerDialog(playerid, 1101, DIALOG_STYLE_MSGBOX, "Level 10 Admins", "No Admins of this level.", "OK", "Cancel");
cache_delete(results);
return 1;
}
Change the query to: "SELECT user FROM playerdata WHERE level = 10"
Also you said: You are just copy and paste oMa37's code, and you don't even change the query. |