10.09.2011, 13:25
(
Last edited by JaTochNietDan; 10/09/2011 at 04:05 PM.
Reason: Stop double posting, use the edit button.
)
I try to do but i don't know you to do and with your position? i try to do:
But,i don't get players for ex:
I'am "Player1" and when i write /top10 i only get my
but i want to do that:
Then how "DESC LIMIT 10" and limit will be not 10,but that how much is registered players.
pawn Code:
mysql_query("SELECT Exp, Name FROM playerdata ORDER BY Exp DESC LIMIT 10");
mysql_store_result();
new id,output[512],username[24], scorevariable[5],tmpStr[64],tmpStr2[64];
while(mysql_retrieve_row())
{
id ++;
mysql_fetch_field_row(username, "Name");
mysql_fetch_field_row(scorevariable, "Exp");
format(tmpStr, sizeof(tmpStr), "%d. %s %d XP\n", id, username, strval(scorevariable));
strcat(output, tmpStr);
}
format(tmpStr2, sizeof(tmpStr2), "Your position is %d of %d with %d XP",id,ReturnUserCount(),strval(scorevariable));
strcat(output, tmpStr2);
mysql_free_result();
ShowPlayerDialog(playerid, 8, DIALOG_STYLE_MSGBOX, "players top10", output, "OK", "");
return 1;
}
pawn Code:
Player1 = 2000XP
Player2 = 1000XP
pawn Code:
1.Player1 2000XP
pawn Code:
1.Player1 2000XP
2.Player2 1000XP
pawn Code:
mysql_query("SELECT Exp, Name FROM playerdata ORDER BY Exp DESC LIMIT 10");