SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 18/09/2009, 09:03 PM   #1
Pawel2k9
Little Clucker
 
Join Date: Sep 2009
Posts: 40
Reputation: 0
Default /admins online command

Hello i have an admins online command:

Code:
	if (strcmp(cmd, "/admins online", true) == 0 || strcmp(cmd, "/admins", true) == 0)
	{
    if(IsPlayerConnected(playerid))
	  {
			SendClientMessage(playerid, COLOR_GRAD1, "Administrators Online:");
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i))
				{
				  if(PlayerInfo[playerid][pAdmin] >= 2000)
				  {
						GetPlayerName(i, sendername, sizeof(sendername));
						format(string, 256, "Head Admin: %s", sendername);
						SendClientMessage(playerid, COLOR_RED, string);
					}
				  else if(PlayerInfo[playerid][pAdmin] >= 1000 && PlayerInfo[playerid][pAdmin] < 2000)
				  {
						GetPlayerName(i, sendername, sizeof(sendername));
						format(string, 256, "Vice Admin: %s", sendername);
						SendClientMessage(playerid, COLOR_PINKER, string);
					}
				  else if(PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pAdmin] < 1000)
				  {
						GetPlayerName(i, sendername, sizeof(sendername));
						format(string, 256, "Admin: %s", sendername);
						SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
					}
				  else if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] < 2)
				  {
						GetPlayerName(i, sendername, sizeof(sendername));
						format(string, 256, "Admin Próbny: %s", sendername);
						SendClientMessage(playerid, COLOR_YELLOW, string);
					}
				}
			}
		}
		return 1;
	}
the problem is that it shows every admin as Vice Admin even if you lvl 2000 or 1 you are shown as a Vice admin, does any one know why ?? thx
Pawel2k9 is offline  
Old 18/09/2009, 09:15 PM   #2
EirikhO
Little Clucker
 
Join Date: Jul 2007
Posts: 19
Reputation: 0
Default Re: /admins online command

Could we see the script that sets the admin level aswell, please?
EirikhO is offline  
Old 18/09/2009, 09:27 PM   #3
coole210
Gangsta
 
Join Date: Jul 2008
Location: Canada
Posts: 995
Reputation: 84
Default Re: /admins online command

....

Last edited by coole210; 08/01/2012 at 07:53 AM.
coole210 is offline  
Old 19/09/2009, 09:03 AM   #4
Pawel2k9
Little Clucker
 
Join Date: Sep 2009
Posts: 40
Reputation: 0
Default Re: /admins online command

ok i found out what is wrong but still cant fix it if you are admin 2000( head admin )you see every admin as head admin, if you a vice admin you see everyadmin as a vice admin and if you are not an admin at all you dont see e any admins online :/ any one know why?
Pawel2k9 is offline  
Old 19/09/2009, 09:58 AM   #5
Sznupek
Little Clucker
 
Join Date: Aug 2009
Posts: 19
Reputation: 0
Default Re: /admins online command

Try to exchange each
pawn Code:
PlayerInfo[playerid][pAdmin]
...for
pawn Code:
PlayerInfo[i][pAdmin]
Sznupek is offline  
Old 19/09/2009, 02:39 PM   #6
Pawel2k9
Little Clucker
 
Join Date: Sep 2009
Posts: 40
Reputation: 0
Default Re: /admins online command

how will playerid changing to i will help ? i and playerid is basically thesame thing :/
Pawel2k9 is offline  
Old 19/09/2009, 02:42 PM   #7
ilikepie2221
Big Clucker
 
Join Date: Mar 2009
Posts: 152
Reputation: 0
Default Re: /admins online command

playerid is the player who typed the command. i loops through every player checking if their admins. Basically, if you use playerid, it will fail.
ilikepie2221 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
command /admins MrLeNy Help Archive 4 16/12/2009 04:46 PM
Admins command [TouchX]Ash Help Archive 2 24/06/2009 03:57 PM
Admins online. -eXo Help Archive 1 07/06/2009 01:54 PM


All times are GMT. The time now is 09:46 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.