SA-MP Forums Archive
/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: /stats (/showthread.php?tid=367219)



/stats - SumX - 09.08.2012

Hello! How can I show my team in the /stats command? I tried like this,but its fully error.

Код:
CMD:stats( playerid, params[ ] )
{
	if ( GetPVarInt( playerid, "Logged" ) == 0 )
	    return SendClientMessage( playerid, -1, ""COLOR_RED"{FFFFFF}To view your stats you must be logged in.");

	new
		iBox[ 1024 ],
		RegDate[ 40 ],
		pLastOn[ 20 + 20 ],
  		TeamText[ 20 ],
		pLevel = GetPVarInt( playerid, "AdminLevel")
	;
	GetPVarString( playerid, "Date", RegDate, sizeof RegDate );
	GetPVarString( playerid, "On", pLastOn, sizeof pLastOn );
	
	if(GetPlayerTeam == 0) { TeamText = "{FFFFFF}Civillians"; }
	else if(GetPlayerTeam == 1) { TeamText = "{6CCFFF}SouthBoys"; }
	else if(GetPlayerTeam == 2) { TeamText = "{F27900}Yakoo"; }
	else if(GetPlayerTeam == 3) { TeamText = "{548200}The Triads"; }
	else if(GetPlayerTeam == 4) { TeamText = "{CC0000}The Mafia"; }
	else if(GetPlayerTeam == 5) { TeamText = "{E6E600}Vagos"; }
	else if(GetPlayerTeam == 6) { TeamText = "{0000A0}Cops"; }

	format( iBox, sizeof iBox, "{FFFFFF}Hello "COLOR_LIGHTBLUE"%s{FFFFFF}, these are your stats\n\n\
	                            {FFFFFF}Admin Level: "COLOR_LIGHTBLUE"%s{FFFFFF}["COLOR_LIGHTBLUE"%d{FFFFFF}]\n\
	                            {FFFFFF}VIP Level: "COLOR_LIGHTBLUE"%d\n\
	                            {FFFFFF}Money: "COLOR_LIGHTBLUE"%d\n\
	                            {FFFFFF}Score: "COLOR_LIGHTBLUE"%d\n\
	                            {FFFFFF}Coins: "COLOR_LIGHTBLUE"%d\n\
                             	    {FFFFFF}SkinID: "COLOR_LIGHTBLUE"%d\n\
				    {FFFFFF}Team: %s\n\
	                            {FFFFFF}Drugs: "COLOR_LIGHTBLUE"%d\n\
	                            {FFFFFF}Kills: "COLOR_LIGHTBLUE"%d\n\
	                            {FFFFFF}Deaths: "COLOR_LIGHTBLUE"%d\n",
							pName( playerid ),
							GetPlayerLevelName( playerid ),
							pLevel,
							GetPlayerVLevel( playerid ),
							GetPlayerMoney( playerid ),
							GetPlayerScore( playerid ),
							GetPVarInt( playerid,"Coins" ),
							GetPlayerSkin( playerid ),
							TeamText,
							GetPVarInt( playerid,"Drugs" ),
							GetPVarInt( playerid,"Kills" ),
							GetPVarInt( playerid,"Deaths" ) );
											  
	format( iBox, sizeof iBox, "%s{FFFFFF}Registration Date: "COLOR_LIGHTBLUE"%s\n\
			{FFFFFF}Last On: "COLOR_LIGHTBLUE"%s\n\
				  {FFFFFF}PM Disabled: "COLOR_LIGHTBLUE"%s\n\
					  {FFFFFF}Car God: "COLOR_LIGHTBLUE"%s\n\
					  {FFFFFF}Player God: "COLOR_LIGHTBLUE"%s",
							iBox,
							RegDate,
							pLastOn,
							GetPVarInt( playerid, "Disable_PM" ) ? (""COLOR_GREEN"YES") : (""COLOR_RED"NO"),
							GetPVarInt( playerid, "CGod" ) ? (""COLOR_GREEN"YES") : (""COLOR_RED"NO"),
							GetPVarInt( playerid, "God" ) ? (""COLOR_GREEN"YES") : (""COLOR_RED"NO"));
											  
	ShowPlayerDialog( playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, ""COLOR_LIGHTBLUE"Your Stats!", iBox, "OK", "");
	return 1;
}



Re: /stats - grand.Theft.Otto - 09.08.2012

Did you #define the teams at the top of the script ? Like so for example:

pawn Код:
#define Civilians 0
#define SouthBoys 1
// etc ....



Re: /stats - SumX - 09.08.2012

Код:
#define TEAM_CIVILS 0
#define TEAM_SOUTHBOYS 1
#define TEAM_YAKOO 2
#define TEAM_TRIADS 3
#define TEAM_MAFIA 4
#define TEAM_VAGOS 5
#define TEAM_COPS 6
TeamText its only a text.I detect the players team and i show it on /stats


Re: /stats - [GO]Hardstyle - 09.08.2012

Can you post the errors received?


Re: /stats - SumX - 09.08.2012

There are MANY errors,can you look at the command? Tell me what's wrong.


Re: /stats - xSkullx - 09.08.2012

We need the errors to see what's wrong...