[ HELP ] Player Status...
#1

Hello. How do I do? In Dialog ?
Reply
#2

well here is my /stats command see if it helps

Код:
// Player Stats
	if ((strcmp(cmd, "/stats", true) == 0) || (strcmp(cmd, "/sts", true) == 0))
	{
	  tmp = strtok(cmdtext, idx);
		giveplayerid = strval(tmp);
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, playername, sizeof(playername));
		if(!strlen(tmp))
		{
		  if (PlayerInfo[playerid][vowner] == 0)
			{
			  vown[playerid] = "NO";
			}
			if (PlayerInfo[playerid][vowner] == 1)
			{
			  vown[playerid] = "YES";
			}
			if (PlayerInfo[playerid][pCan] == 0)
			{
			  pown[playerid] = "NO";
			}
			if (PlayerInfo[playerid][pCan] == 1)
			{
			  pown[playerid] = "YES";
			}
		  new stsmsg[256],stsmsg2[256];
			format(stsmsg2,256,"Stats For ( %s ) ( ID:%d )",playername,playerid);
			if (PlayerInfo[playerid][pAdmin] == 0)
			{
			  if (PlayerInfo[playerid][pCan] == 1)
			  {
					format(stsmsg,256,"Cash: $%d\nBank: $%d\nScore: %d\nKills: %d\nDeaths: %d\nVehicle Owned: %s\nPetrol Can: %s Amount: %d%%",PlayerInfo[playerid][pCash],
					PlayerInfo[playerid][pBank],
					PlayerInfo[playerid][pScore],
					PlayerInfo[playerid][pKills],
					PlayerInfo[playerid][pDeaths],
					vown[playerid],
					pown[playerid],
					PlayerInfo[playerid][pCanAmount]);
				}
				if (PlayerInfo[playerid][pCan] == 0)
			  {
					format(stsmsg,256,"Cash: $%d\nBank: $%d\nScore: %d\nKills: %d\nDeaths: %d\nVehicle Owned: %s\nPetrol Can: %s",PlayerInfo[playerid][pCash],
					PlayerInfo[playerid][pBank],
					PlayerInfo[playerid][pScore],
					PlayerInfo[playerid][pKills],
					PlayerInfo[playerid][pDeaths],
					vown[playerid],
					pown[playerid]);
				}
				
			}
			if (PlayerInfo[playerid][pAdmin] > 0)
			{
			  if (PlayerInfo[playerid][pCan] == 1)
			  {
					format(stsmsg,256,"Cash: $%d\nBank: $%d\nScore: %d\nKills: %d\nDeaths: %d\nVehicle Owned: %s\nPetrol Can: %s Amount: %d%%\nAdmin: %d",PlayerInfo[playerid][pCash],
					PlayerInfo[playerid][pBank],
					PlayerInfo[playerid][pScore],
					PlayerInfo[playerid][pKills],
					PlayerInfo[playerid][pDeaths],
					vown[playerid],
					pown[playerid],
					PlayerInfo[playerid][pCanAmount],
					PlayerInfo[playerid][pAdmin]);
				}
				if (PlayerInfo[playerid][pCan] == 0)
			  {
					format(stsmsg,256,"Cash: $%d\nBank: $%d\nScore: %d\nKills: %d\nDeaths: %d\nVehicle Owned: %s\nPetrol Can: %s\nAdmin: %d",PlayerInfo[playerid][pCash],
					PlayerInfo[playerid][pBank],
					PlayerInfo[playerid][pScore],
					PlayerInfo[playerid][pKills],
					PlayerInfo[playerid][pDeaths],
					vown[playerid],
					pown[playerid],
					PlayerInfo[playerid][pAdmin]);
				}
			}
			ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,stsmsg2,stsmsg,"Ok","Cancel");
			return 1;
		}
		if (IsPlayerConnected(giveplayerid))
		{
		  if (PlayerInfo[giveplayerid][vowner] == 0)
			{
			  vown[giveplayerid] = "NO";
			}
			if (PlayerInfo[giveplayerid][vowner] == 1)
			{
			  vown[giveplayerid] = "YES";
			}
			if (PlayerInfo[giveplayerid][pCan] == 0)
			{
			  pown[giveplayerid] = "NO";
			}
			if (PlayerInfo[giveplayerid][pCan] == 1)
			{
			  pown[giveplayerid] = "YES";
			}
			new stsmsg[256],stsmsg2[256];
			format(stsmsg2,256,"Stats For ( %s ) ( ID:%d )",giveplayer,giveplayerid);
			if (PlayerInfo[playerid][pAdmin] == 0)
			{
			  if (PlayerInfo[playerid][pCan] == 1)
			  {
					format(stsmsg,256,"Cash: $%d\nBank: $%d\nScore: %d\nKills: %d\nDeaths: %d\nVehicle Owned: %s\nPetrol Can: %s Amount: %d%%",PlayerInfo[giveplayerid][pCash],
					PlayerInfo[giveplayerid][pBank],
					PlayerInfo[giveplayerid][pScore],
					PlayerInfo[giveplayerid][pKills],
					PlayerInfo[giveplayerid][pDeaths],
					vown[giveplayerid],
					pown[giveplayerid],
					PlayerInfo[giveplayerid][pCanAmount]);
				}
				if (PlayerInfo[playerid][pCan] == 0)
			  {
					format(stsmsg,256,"Cash: $%d\nBank: $%d\nScore: %d\nKills: %d\nDeaths: %d\nVehicle Owned: %s\nPetrol Can: %s",PlayerInfo[giveplayerid][pCash],
					PlayerInfo[giveplayerid][pBank],
					PlayerInfo[giveplayerid][pScore],
					PlayerInfo[giveplayerid][pKills],
					PlayerInfo[giveplayerid][pDeaths],
					vown[giveplayerid],
					pown[giveplayerid]);
				}
			}
			if (PlayerInfo[playerid][pAdmin] > 0)
			{
			  if(PlayerInfo[giveplayerid][pCan] == 1)
			  {
					format(stsmsg,256,"Cash: $%d\nBank: $%d\nScore: %d\nKills: %d\nDeaths: %d\nVehicle Owned: %s\nPetrol Can: %s Amount: %d%%\nAdmin: %d",PlayerInfo[giveplayerid][pCash],
					PlayerInfo[giveplayerid][pBank],
					PlayerInfo[giveplayerid][pScore],
					PlayerInfo[giveplayerid][pKills],
					PlayerInfo[giveplayerid][pDeaths],
					vown[giveplayerid],
					pown[giveplayerid],
					PlayerInfo[giveplayerid][pCanAmount],
					PlayerInfo[giveplayerid][pAdmin]);
				}
				if(PlayerInfo[giveplayerid][pCan] == 0)
			  {
					format(stsmsg,256,"Cash: $%d\nBank: $%d\nScore: %d\nKills: %d\nDeaths: %d\nVehicle Owned: %s\nPetrol Can: %s\nAdmin: %d",PlayerInfo[giveplayerid][pCash],
					PlayerInfo[giveplayerid][pBank],
					PlayerInfo[giveplayerid][pScore],
					PlayerInfo[giveplayerid][pKills],
					PlayerInfo[giveplayerid][pDeaths],
					vown[giveplayerid],
					pown[giveplayerid],
					PlayerInfo[giveplayerid][pAdmin]);
				}
			}
			ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,stsmsg2,stsmsg,"Ok","Cancel");
			return 1;
		}
		else {
			format(string, sizeof(string), "* ID:%d Was not found on the server", giveplayerid);
			SendClientMessage(playerid, COLOR_BRIGHTRED, string);
		}
		return 1;
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)