/stats not working - 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: /stats not working (
/showthread.php?tid=312213)
/stats not working -
geerdinho8 - 20.01.2012
pawn Код:
if (strcmp("/stats", cmdtext, true, 10) == 0)
{
format(string, sizeof(string), ""COL_GREEN"Kills: [%d]"COL_YELLOW" | "COL_RED"Deaths: [%d] "COL_YELLOW"| Ratio: [%0.2f] | "COL_GREEN"Money: [$ %d]"COL_YELLOW" | Adminlevel: [%d] | "COL_BLUE"VIP level: [%d]", pInfo[playerid][Kills], pInfo[playerid][Deaths], pInfo[playerid][Kills]/pInfo[playerid][Deaths],GetPlayerMoney(playerid), pInfo[playerid][Admin], pInfo[playerid][VIP]);
SendClientMessage(playerid, red, string);
return 1;
}
AW: /stats not working -
Rimeau - 20.01.2012
If you want to use colors, try this: {RRGGBB}, without the ""!
Re: /stats not working -
iZN - 20.01.2012
Script gets any error? if not, what happen if you type /stats? Please add more details.
Re: /stats not working -
Bogdan1992 - 20.01.2012
PHP код:
if (strcmp("/stats", cmdtext, true, 10) == 0)
{
new mystring[182];
format(mystring, sizeof(mystring), ""COL_GREEN"Kills: [%d]"COL_YELLOW" | "COL_RED"Deaths: [%d] "COL_YELLOW"| Ratio: [%0.2f] | "COL_GREEN"Money: [$ %d]"COL_YELLOW" | Adminlevel: [%d] | "COL_BLUE"VIP level: [%d]", pInfo[playerid][Kills], pInfo[playerid][Deaths], pInfo[playerid][Kills]/pInfo[playerid][Deaths],GetPlayerMoney(playerid), pInfo[playerid][Admin], pInfo[playerid][VIP]);
SendClientMessage(playerid, red, mystring);
return 1;
}
Re: AW: /stats not working -
Konstantinos - 20.01.2012
Quote:
Originally Posted by Rimeau
If you want to use colors, try this: {RRGGBB}, without the ""!
|
It works with "" too.
pawn Код:
if (strcmp("/stats", cmdtext, true, 6) == 0) // It's 6, not 10.
{
// new string[ 128 ];
// Incase you don't have it!
format(string, sizeof(string), ""COL_GREEN"Kills: [%d]"COL_YELLOW" | "COL_RED"Deaths: [%d] "COL_YELLOW"| Ratio: [%0.2f] | "COL_GREEN"Money: [$ %d]"COL_YELLOW" | Adminlevel: [%d] | "COL_BLUE"VIP level: [%d]", pInfo[playerid][Kills], pInfo[playerid][Deaths], pInfo[playerid][Kills]/pInfo[playerid][Deaths],GetPlayerMoney(playerid), pInfo[playerid][Admin], pInfo[playerid][VIP]);
SendClientMessage(playerid, red, string);
return 1;
}
Re: /stats not working -
Bogdan1992 - 20.01.2012
128 its not enough i think.
Re: /stats not working -
Konstantinos - 20.01.2012
The max amount of characters that can be displayed in 1 message on sa-mp is 128.
Re: /stats not working - Guest9328472398472 - 20.01.2012
Why put it all in one line? But more "SendClientMessage" below it..add more lines, then it might work.
Re: /stats not working -
Bogdan1992 - 20.01.2012
Or use a dialog msg, much better.
Re: /stats not working -
Konstantinos - 20.01.2012
Guys, the problem wasn't if the text is too long (it isn't). The problem was on the length
Quote:
Originally Posted by Bogdan1992
Or use a dialog msg, much better.
|
+1. I like the style of Dialog Msg