cmd:admins
#1

Hello sampers!

I have one question!

Why if there is one admin online command works normaly but if there is two or more it says "UNKNOWN COMMAND" -- and yea this is from old good PPC trucking gamemode

Код:
// This command lists all online admins
COMMAND:admins(playerid, params[])
{
	// Setup local variables
	new AdminList[500], Name[24];

	// Send the command to all admins so they can see it
	SendAdminText(playerid, "/admins", params);

	// Check if the player has logged in
	if (APlayerData[playerid][LoggedIn] == true)
	{
		// Scan through all players
		for (new i; i < MAX_PLAYERS; i++)
		{
			// Check if this player is connected
			if (IsPlayerConnected(i))
			{
				// Get the name of the player
				GetPlayerName(i, Name, sizeof(Name));

				// Check if this player is an RCON admin
				if (IsPlayerAdmin(i))
				{
					// Add all admin players to the list
					format(AdminList, 500, "%s%s: %s (id: %i), admin-level: %i (RCON admin)\n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
					// Re-start the for loop (skipping the remaining code for this iteration)
					continue;
				}

				//Check if that player is an admin (using the PlayerLevel)
				if (APlayerData[i][PlayerLevel] > 0)
				{
					// Add all admin players to the list
					format(AdminList, 500, "%s%s: %s (id: %i), admin-level: %i\n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
				}
			}
		}

		// Check if there were admin-names added to the list
		if (strlen(AdminList) > 0)
		    ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Online admins:", AdminList, "OK", "Cancel");
		else
			SendClientMessage(playerid, 0xFF0000FF, "No admin online"); // No admins are online
	}
	else
	    return SendClientMessage(playerid, 0xFF0000FF, "REPORT THIS TO ADMIN"); // No admins are online;

	// Let the server know that this was a valid command
	return 1;
}
Reply


Messages In This Thread
cmd:admins - by kalanerik99 - 12.05.2015, 19:16
Re: cmd:admins - by Yashas - 12.05.2015, 19:19
Re: cmd:admins - by C4SH - 12.05.2015, 19:26
Re: cmd:admins - by Konstantinos - 12.05.2015, 19:27
Re: cmd:admins - by StR_MaRy - 12.05.2015, 19:27
Re: cmd:admins - by Abagail - 12.05.2015, 19:29
Re: cmd:admins - by Yashas - 12.05.2015, 19:31
Re: cmd:admins - by J0sh... - 12.05.2015, 19:34
Re: cmd:admins - by Threshold - 13.05.2015, 04:34
Re: cmd:admins - by kalanerik99 - 13.05.2015, 16:07

Forum Jump:


Users browsing this thread: 2 Guest(s)