Stats wont show good
#1

pawn Код:
CMD:stats(playerid, params)
{
    ShowStats(playerid);
    return true;
}

stock ShowStats(playerid)
{
    new HugeString[1024];
    new str[128], str1[128], str2[128], str3[128], str4[128], str5[128], str6[128], str7[128], str8[128], str9[128], str10[128];
    format(str, sizeof str, ""Blue"|| "White"Name:"Red" %s \n", GetName(playerid));
    format(str1, sizeof str1, ""Blue"|| "White"ID:"Red" %s \n", playerid);
    format(str2, sizeof str2, ""Blue"|| "White"Admin Level:"Red" %s \n", PlayerInfo[playerid][pAdminLevel]);
    format(str3, sizeof str3, ""Blue"|| "White"Level:"Red" %s \n", PlayerInfo[playerid][pLevel]);
    format(str4, sizeof str4, ""Blue"|| "White"Kills:"Red" %s \n", PlayerInfo[playerid][pKills]);
    format(str5, sizeof str5, ""Blue"|| "White"Deaths:"Red" %s \n", PlayerInfo[playerid][pDeaths]);
    format(str6, sizeof str6, ""Blue"|| "White"Times Kicked:"Red" %s \n", PlayerInfo[playerid][pKicked]);
    format(str7, sizeof str7, ""Blue"|| "White"Times Hacked:"Red" %s \n", PlayerInfo[playerid][pHacked]);
    format(str8, sizeof str8, ""Blue"|| "White"Times on Server:"Red" %s \n", PlayerInfo[playerid][pServerTime]);
    format(str9, sizeof str9, ""Blue"|| "White"Jailed:"Red" %s \n", PlayerInfo[playerid][pJailed]);
    format(str10, sizeof str10,""Blue"|| "White"Muted:"Red" %s \n", PlayerInfo[playerid][pMuted]);
    strcat(HugeString, ""Blue"===========================================================\n\n");
    strcat(HugeString, str);
    strcat(HugeString, str1);
    strcat(HugeString, str2);
    strcat(HugeString, str3);
    strcat(HugeString, str4);
    strcat(HugeString, str5);
    strcat(HugeString, str6);
    strcat(HugeString, str7);
    strcat(HugeString, str8);
    strcat(HugeString, str9);
    strcat(HugeString, str10);
    strcat(HugeString, ""Blue"===========================================================\n\n");
    ShowPlayerDialog(playerid, Stats, DIALOG_STYLE_MSGBOX, ""Red"Player Stats", HugeString, "Okay", "Close");
}
The problem is, i come ingame, tipe /stats and i see the Name: Markx, the ID: here should be my id, but it isnt, same case to all other things (admin level, level etc...)
And i got another question, if PlayerInfo[playerid][pJailed] was 1, how to show the one as "Yes" and 0 as "No" ?
Reply
#2

pawn Код:
IsJailed(playerid) {
     new string[4];
     switch(PlayerInfo[playerid][pJailed]) {
           case 0: format(string, sizeof(string), "No");
           case 1: format(string, sizeof(string), "Yes");
           default: format(string, sizeof(string), "ERR");
     }
     return string;
}
Now just use it as:
pawn Код:
format(str9, sizeof str9, ""Blue"|| "White"Jailed:"Red" %s \n", IsJailed(playerid));
Don't know why I helped you after you insulted me, but oh well.
Reply
#3

Quote:
Originally Posted by jameskmonger
Посмотреть сообщение
pawn Код:
IsJailed(playerid) {
     new string[4];
     switch(PlayerInfo[playerid][pJailed]) {
           case 0: format(string, sizeof(string), "No");
           case 1: format(string, sizeof(string), "Yes");
           default: format(string, sizeof(string), "ERR");
     }
     return string;
}
Now just use it as:
pawn Код:
format(str9, sizeof str9, ""Blue"|| "White"Jailed:"Red" %s \n", IsJailed(playerid));
Don't know why I helped you after you insulted me, but oh well.
Thanks, but whats wrong with the whole code why doesnt it show? And i cant remember when did i insult you...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)