My Team on stats
#5

Quote:
Originally Posted by Audi_Quattrix
Посмотреть сообщение
pawn Код:
CMD:stats(playerid,params[])
{
    new string[128];
    format(string, sizeof(string), "|| [Team]: %s ||", GetPlayerTeam(playerid));
    SendClientMessage(playerid, COLOR, string);
}
GetPlayerTeam(playerid) returns the team id (eg: 1, 2, 3 etc) so I don't think it's a string. Use "%d" and "string[128]" why will we use THAT big amount of a string? it must be no more then 10.. and the command must return a value ?

Quote:
Originally Posted by WIKI
Placeholder Meaning
%b Inserts a number at this position in binary radix
%c Inserts a single character.
%d Inserts an integer (whole) number
%f Inserts a floating point number.
%i Inserts an integer.
%s Inserts a string.
%x Inserts a number in hexadecimal notation.
%% Inserts the literal '%'
So I will remake the command:-

pawn Код:
CMD:team(playerid,params[])
{
    new Fstring[10]; // 10 digits is enough -.-
    format(Fstring, sizeof(Fstring), "Team: %d", GetPlayerTeam(playerid));
    SendClientMessage(playerid, -1, Fstring); // change -1 to your own colour if you want, -1 is WHITE COLOUR
    return 1;
}
I hope this helps. But, if you want the name to show instead of the TEAM number, you must click the following link, it has been made by Antonio in your previous topic.

http://forum.sa-mp.com/showpost.php?...75&postcount=7
-FalconX
Reply


Messages In This Thread
My Team on stats - by cod5devious - 27.05.2012, 19:42
Re: My Team on stats - by miokie - 27.05.2012, 19:43
Re: My Team on stats - by ReneG - 27.05.2012, 19:46
Re: My Team on stats - by Audi_Quattrix - 27.05.2012, 20:04
Re: My Team on stats - by FalconX - 27.05.2012, 20:10

Forum Jump:


Users browsing this thread: 1 Guest(s)