/stats not working
#1

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;
    }
Reply
#2

If you want to use colors, try this: {RRGGBB}, without the ""!
Reply
#3

Script gets any error? if not, what happen if you type /stats? Please add more details.
Reply
#4

PHP код:
if (strcmp("/stats"cmdtexttrue10) == 0)
    {
     new 
mystring[182];
    
format(mystringsizeof(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(playeridredmystring);
    return 
1;
    } 
Reply
#5

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;
}
Reply
#6

128 its not enough i think.
Reply
#7

The max amount of characters that can be displayed in 1 message on sa-mp is 128.
Reply
#8

Why put it all in one line? But more "SendClientMessage" below it..add more lines, then it might work.
Reply
#9

Or use a dialog msg, much better.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)