Only showing one line.
#1

Hello,

Say if I had 2 lines:
StatsLine1
StatsLine2...
it would only show StatsLine2
I add another stats line;
StatsLine3.
It will only show StatsLine3.

No compile errors, no console errors.

pawn Код:
CMD:stats(playerid, params[])
{
    new string[1000];
   
    format(string, sizeof(string), "|__________________Stats of: {007BD0FF}%s{FFFFFF}__________________|", RemoveUnderScore(playerid));
    format(string, sizeof(string), "Name: %s | Playing Hours: %d | Money: %d | Admin Level: %d |", RemoveUnderScore(playerid), PlayerInfo[playerid][pScore], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pAdmin]);
    format(string, sizeof(string), "Kicked Times: %d | Banned Times: %d | Jailed Times: %d |", PlayerInfo[playerid][pKickTimes], PlayerInfo[playerid][pBanTimes], PlayerInfo[playerid][pJailTimes]);
    SendClientMessage(playerid, COLOR_WHITE, string);
    return 1;
}
Reply
#2

you keep overwriting (string);

You need to have it in this format:

format(string,blablabla)
SendClientMessage(playerid, COLOR_WHITE, string);
format(string,blablabla)
SendClientMessage(playerid, COLOR_WHITE, string);
format(string,blablabla)
SendClientMessage(playerid, COLOR_WHITE, string);
Reply
#3

Yeah the dude over there is right do like this:
pawn Код:
CMD:stats(playerid, params[])
{
    new string[1000];

    format(string, sizeof(string), "|__________________Stats of: {007BD0FF}%s{FFFFFF}__________________|", RemoveUnderScore(playerid));
    SendClientMessage(playerid, COLOR_WHITE, string);
    format(string, sizeof(string), "Name: %s | Playing Hours: %d | Money: %d | Admin Level: %d |", RemoveUnderScore(playerid), PlayerInfo[playerid][pScore], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pAdmin]);
    SendClientMessage(playerid, COLOR_WHITE, string);
    format(string, sizeof(string), "Kicked Times: %d | Banned Times: %d | Jailed Times: %d |", PlayerInfo[playerid][pKickTimes], PlayerInfo[playerid][pBanTimes], PlayerInfo[playerid][pJailTimes]);
    SendClientMessage(playerid, COLOR_WHITE, string);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)