command CMD: ranks dont work
#1

CMD:ranks(playerid)
{
new string[156], dialogstr[sizeof(string) * sizeof(gRank)];
strcat(dialogstr, "Rank\tRank name\tScore\n");
for(new i; i < sizeof(gRank); i++)
{
if(GetPlayerRank(playerid) >= i) format(string, sizeof(string), ""SAMP_BLUE"%i.\t"SAMP_BLUE"%s\t"SAMP_BLUE"%i+ score\n", i, gRank[i][r_name], gRank[i][r_score]);
else format(string, sizeof(string), ""GREY"%i.\t"GREY"%s\t"GREY"%i+ score\n", i, gRank[i][r_name], gRank[i][r_score]);
strcat(dialogstr, string);

ShowPlayerDialog(playerid, DIALOG_COMMON, DIALOG_STYLE_TABLIST_HEADERS, "Ranks list", dialogstr, "Close", "");
return 1;
}







THAT S THE COMMAND BUT IN-GAME IT SAYS UNKNOWN COMMAND ! PLEASE HELP
I ADDED SOME RANKS THAT WORKS IN GAME WITH /RANK BUT I CANT SEE THE RANK LIST WTF
Reply
#2

Please don't go all caps and please, start using the [PHP] or at least [CODE] tag for PAWN codes in the forums..
However, here's a fixed code:

PHP код:
CMD:ranks(playerid) {
    new 
string[156], dialogstr[sizeof(string) * sizeof(gRank)];
    
strcat(dialogstr"Rank\tRank name\tScore\n");
    for(new 
isizeof(gRank); i++) {
        if(
GetPlayerRank(playerid) >= i)
                
format(stringsizeof(string), ""SAMP_BLUE"%i.\t"SAMP_BLUE"%s\t"SAMP_BLUE"%i+ score\n"igRank[i][r_name], gRank[i][r_score]);
        else
            
format(stringsizeof(string), ""GREY"%i.\t"GREY"%s\t"GREY"%i+ score\n"igRank[i][r_name], gRank[i][r_score]);
    }
    
strcat(dialogstrstring);
    
ShowPlayerDialog(playeridDIALOG_COMMONDIALOG_STYLE_TABLIST_HEADERS"Ranks list"dialogstr"Close""");
    return 
1;

You should've received lots of errors over missing the closing bracket of the for() loop; at line 9.

Mhm-.
Reply
#3

wow...omg i love you +rep

ok i dont get the errors but the command dont work..
Reply
#4

i dont know what to do
Reply
#5

First off, stop bumping after literally 7 minutes, be patient.

Start with debugging the cells, the strings, the dialog ID, check the limits.

Don't expect us to do everything for you G'.
Reply
#6

i dont understand why it s saying unknown command...it should work but it doesnt
Reply
#7

Quote:
Originally Posted by DeX24
Посмотреть сообщение
i dont understand why it s saying unknown command...it should work but it doesnt
Then make sure that you've read the documentation of whatever command proccessor you're using, make sure you don't return false where you shouldn't and so on. We can't guess from whatever code you've got that you're not providig us with; what's the problem. You gotta do some things yourself.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)