SA-MP Forums Archive
staff list - 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: staff list (/showthread.php?tid=638644)



staff list - mmostafa - 04.08.2017

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


Re: staff list - saffierr - 04.08.2017

Select all players with adminlevel higher than 0.


Re: staff list - mmostafa - 04.08.2017

Код:
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


Re: staff list - Hansrutger - 04.08.2017

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).


Re: staff list - Misiur - 04.08.2017

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)



Re: staff list - mmostafa - 04.08.2017

That's giving the online admins only


Re: staff list - Fratello - 04.08.2017

Well,

You are missing helper in your format. Try adding it


Re: staff list - mmostafa - 04.08.2017

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


Re: staff list - Fratello - 04.08.2017

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]);



Re: staff list - mmostafa - 04.08.2017

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