My Team on 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)
+--- Thread: My Team on stats (
/showthread.php?tid=346242)
My Team on stats -
cod5devious - 27.05.2012
How do I put my team on stats like
"Team: %s", (codeeee));
Please help
Re: My Team on stats -
miokie - 27.05.2012
What do you mean? Like getting the amount of kills a certain team has or?
Re: My Team on stats -
ReneG - 27.05.2012
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
Re: My Team on stats -
Audi_Quattrix - 27.05.2012
pawn Код:
CMD:stats(playerid,params[])
{
new string[128];
format(string, sizeof(string), "|| [Team]: %s ||", GetPlayerTeam(playerid));
SendClientMessage(playerid, COLOR, string);
}
Re: My Team on stats -
FalconX - 27.05.2012
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