SA-MP Forums Archive
Only showing one line. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Only showing one line. (/showthread.php?tid=350482)



Only showing one line. - Elysian` - 12.06.2012

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;
}



Re: Only showing one line. - Pizzy - 12.06.2012

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);


Re: Only showing one line. - Faisal_khan - 12.06.2012

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;
}