My Team on stats
#1

How do I put my team on stats like

"Team: %s", (codeeee));


Please help
Reply
#2

What do you mean? Like getting the amount of kills a certain team has or?
Reply
#3

You've been posting thread after thread, been given tons of answers, and haven't learned a thing?

https://sampwiki.blast.hk/wiki/Category:Tutorials
Reply
#4

pawn Код:
CMD:stats(playerid,params[])
{
    new string[128];
    format(string, sizeof(string), "|| [Team]: %s ||", GetPlayerTeam(playerid));
    SendClientMessage(playerid, COLOR, string);
}
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)