staff list
#1

I've CZCNR by shourya
I wanna make a command that see you the players that have admin level but not online
What to do?
if(playerData[playerid][playerLevel])
this is the admin level check but i want the server to check the players that admins in mysql
Reply
#2

Select all players with adminlevel higher than 0.
Reply
#3

Код:
COMMAND:stafflist(playerid, params[])
{
	    new string[828];
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(playerData[i][playerLevel] >= 1 && playerData[i][playerLevel] <= 7 && playerData[i][playerHelper] >= 1)
			{
				format(string, sizeof(string), "%s%s - Level: %i\n", string, playerData[i][tempAdminName], i, playerData[i][playerLevel]);
			}
		}

		{
			ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, "Staff list", string, "OK", "");
		}

	return 1;
}
Like this? it's not listing any thing in the server
Reply
#4

Too many parameters in the format, you only have 3 specifiers but 4 variables.

Any way best way is just to debug these sort of things if you don't see it from first look (use prints for instance).
Reply
#5

Almost good, just 2 things:
1. You don't need to wrap ShowPlayerDialog in brackets "{}"
2. Your condition in the if checks if user is an admin between 1 and 7 level AND if his playerHelper stat is greater than 1. So, this way only admins who are player helpers will get displayed. You need to add to list either admins OR playerhelpers. Long story short:
pawn Код:
if((playerData[i][playerLevel] >= 1 && playerData[i][playerLevel] <= 7) || playerData[i][playerHelper] >= 1)
Reply
#6

That's giving the online admins only
Reply
#7

Well,

You are missing helper in your format. Try adding it
Reply
#8

More explanition please?
i have it like this
if((playerData[i][playerLevel] >= 1 && playerData[i][playerLevel] <= 7) || playerData[i][playerHelper] >= 1)
Reply
#9

Not there. I don't see anything within playerHelper here.

Код HTML:
format(string, sizeof(string), "%s%s - Level: %i\n", string, playerData[i][tempAdminName], i, playerData[i][playerLevel]);
Reply
#10

It's not the problem now
I've some admins in my server
But not online
I wanna the server display it using any mysql query
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)