SA-MP Forums Archive
Can anybody help me please ? T_T - 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: Can anybody help me please ? T_T (/showthread.php?tid=511760)



Can anybody help me please ? T_T - Trynda - 07.05.2014

When i type /members

instead of showing my ALL OF family member, it showing my name,



Код:
CMD:members(playerid, params[])

{
	if(IsPlayerConnected(playerid))

	{
	    new string[128];
	    new sendername[MAX_PLAYER_NAME];
		new teamnumber;
		if (PlayerInfo[playerid][pLeader] != 0) teamnumber = PlayerInfo[playerid][pLeader];
		else if (PlayerInfo[playerid][pFaction] != 0) teamnumber = PlayerInfo[playerid][pFaction];
		else if (PlayerInfo[playerid][pGang] != 255) teamnumber = PlayerInfo[playerid][pGang];
		else

		{
			SendClientMessage(playerid, COLOR_GRAD1, "You are not a member of an organization!");
			return 1;

		}
		SendClientMessage(playerid, 0x808000AA, "Members Online:");
		for(new i = 0; i < MAX_PLAYERS; i++)

		{
			if (IsPlayerConnected(i))

			{
				GetPlayerName(playerid, sendername, sizeof(sendername));
				format(string, sizeof(string), "");
				if(PlayerInfo[playerid][pLeader] || PlayerInfo[playerid][pFaction])

				{
					if (PlayerInfo[i][pLeader] == teamnumber)

					{
						format(string, sizeof(string), "%s (Leader)",sendername);

					}
					else if (PlayerInfo[i][pFaction] == teamnumber)

					{
						format(string, sizeof(string), "%s, Rank: %d.",sendername, PlayerInfo[i][pRank]);

					}

				}
				else if(PlayerInfo[playerid][pGang] != 255)

				{
					if (PlayerInfo[i][pGang] == teamnumber)

					{
						format(string, sizeof(string), "%s, Rank: %d.",sendername, PlayerInfo[i][pRank]);

					}

				}
				if (strlen(string) > 1) SendClientMessage(playerid, 0xF5DEB3AA, string);

			}

		}

	}
	return 1;

}



Re: Can anybody help me please ? T_T - Nathan_Taylor - 07.05.2014

the 27th line down, which is
pawn Код:
GetPlayerName(playerid, sendername, sizeof(sendername));
should be
pawn Код:
GetPlayerName(i, sendername, sizeof(sendername));
Shouldn't it?


Re: Can anybody help me please ? T_T - Trynda - 07.05.2014

Quote:
Originally Posted by Nathan_Taylor
Посмотреть сообщение
the 27th line down, which is
pawn Код:
GetPlayerName(playerid, sendername, sizeof(sendername));
should be
pawn Код:
GetPlayerName(i, sendername, sizeof(sendername));
Shouldn't it?
Cheee! Your fuc**n COOL! THANKS BRO +REP