PDA

View Full Version : Only showing one line.


Elysian`
12/06/2012, 06:50 PM
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.

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

Pizzy
12/06/2012, 06:54 PM
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);

Faisal_khan
12/06/2012, 06:57 PM
Yeah the dude over there is right do like this: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;
}