stats - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: stats (
/showthread.php?tid=112821)
stats -
armyoftwo - 10.12.2009
Код:
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
Re: stats -
SpiderPork - 10.12.2009
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!