hi, I have just modified for display rank at all player
it displays like: <nick> stats: 0 kills | 3 death | ...
Code:
public SQLGetMyRank(Handle:owner, Handle:hndl, const String:error[], any:client){
if(hndl == INVALID_HANDLE)
{
LogError(error);
PrintToServer("Last Connect SQL Error: %s", error);
return;
}
decl String:name[64];
decl RAkills;
decl RAdeaths;
decl RAheadshots;
decl RAsucsides;
decl RAnkNum;
if(SQL_FetchRow(hndl))
{
SQL_FetchString(hndl, 0, name, sizeof(name));
RAkills=SQL_FetchInt(hndl,1);
RAdeaths=SQL_FetchInt(hndl,2);
RAheadshots=SQL_FetchInt(hndl,3);
RAsucsides=SQL_FetchInt(hndl,4);
RAnkNum=RAkills/RAdeaths;
decl String:buffer[512];
Format(buffer, sizeof(buffer), "SELECT rank_id FROM css_rank WHERE (kills/deaths) >= '%i'", RAnkNum);
if(DEBUG == 1){
PrintToServer("DEBUG: SQLGetMyRank (%s)", buffer);
}
SQL_TQuery(db, SQLShowRank, buffer, client);
PrintToChatAll("%c%s's stats: Tués: %i | Morts: %i | Headshots: %i | Suicides: %i", GREEN, name, RAkills, RAdeaths, RAheadshots, RAsucsides);
} else {
PrintToChat(client, "%cYour rank is not avlilable!", GREEN);
}
}
but in SQLShowRank, I can not change for display like:
<nick> is ranked 20/160
Im french, sorry for my bad english
Thanks in advance.