#1

Код:
		if(strcmp("/stats", cmd, true) == 0){
    {
    new str[256];
		new ttext[20];
		if(PlayerInfo[playerid][faction] == 0 || PlayerInfo[playerid][leader] == 0) { ttext = "None"; }
    format(str, sizeof(str), "Reputation[%d] Faction:[%d] ", PlayerInfo[playerid][reputation], PlayerInfo[playerid][faction]);
		SendClientMessage(playerid, COLOR_YELLOW, str);
		}
		return 1;
		}
I want the Faction:[0] to show [None] but it shows this:
/imageshack/img705/3903/samp009n.png
Reply
#2

Maybe something like this?:
pawn Код:
if(strcmp("/stats", cmd, true) == 0)
{
   new
        str[128],
        ttext[20];

   if(PlayerInfo[playerid][faction] == 0)
     format(str, sizeof(str), "Reputation[%d] Faction: None ", PlayerInfo[playerid][reputation]);

   else
     format(str, sizeof(str), "Reputation[%d] Faction: %d", PlayerInfo[playerid][reputation], PlayerInfo[playerid][faction]);
       
   SendClientMessage(playerid, COLOR_YELLOW, str);
   return 1;
}
I haven't made this really accurate, because I don't know the correct functions of your variables, you may make it a little bit more advanced.

P.S. Don't use strings 256 cells big if you don't need them!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)