problem with /vips command
#2

I dont know what are you trying to do there, but this is quite better:

Код:
static const AdminTypeNames[4][10] =
{
	"None",
    "Silver",
	"Gold",
	"Premium"
};

dcmd_vips(playerid, params[])
{
	#pragma unused params
	if (!AccInfo[playerid][LoggedIn])
		return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");

	if (!AccInfo[playerid][Level])
		return ErrorMessages(playerid, 1);

	new 
		Count,
		string[128],
		adminname[MAX_PLAYER_NAME]
	;

	SendClientMessage(playerid, yellow, "VIP Players:");

	for (new j = GetMaxPlayers(), i; i < j; i++)
	{
		if (!IsPlayerConnected(i))
			continue;
		
		if (!AccInfo[i][pVip])
			continue;

		Count++;
		GetPlayerName(i, adminname, sizeof(adminname));
		
		format(string,sizeof(string),"%s (%d), %s",adminname, i, AdminTypeNames[AccInfo[i][pVip]]);
		SendClientMessage(playerid, yellow, string);
	}

	if (!Count)
		SendClientMessage(playerid,red, "None");

	return 1;
}
Reply


Messages In This Thread
problem with /vips command - by Toxik - 14.08.2015, 11:51
Re: problem with /vips command - by Evocator - 14.08.2015, 12:04
Re: problem with /vips command - by Toxik - 14.08.2015, 12:48

Forum Jump:


Users browsing this thread: 1 Guest(s)