SA-MP Forums Archive
/admins Command Assistance. - 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: /admins Command Assistance. (/showthread.php?tid=643505)



/admins Command Assistance. - AlexCooper - 21.10.2017

Hey Guys.

So I'm in the process of changing a lot of my info commands to dialogue menus.
I've managed without issue to create an online /mods dialogue box, however I cant seem to figure it out with Admins.

Please see my code attached below.
Code:
	if(!strcmp(cmd, "/admins2", true))
    {
    	new string[450], rank[21], count; // if "200" is not enough and cut the text out in case you have many admins online, increase it.
		for(new i; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i)) //foreach(new i : Player)
    	{
        	switch (PlayerInfo[i][pAdmin])
        	{
            	case 0: continue;
            	case 1: rank = "Trial Administrator";
            	case 2: rank = "Junior Administrator";
            	case 3: rank = "General Administrator";
            	case 4: rank = "Senior Administrator";
            	case 1337: rank = "Shift Supervisor";
            	case 1339: rank = "Shift Manager";
            	case 99999: rank = "Development Director";
            	case 100000: rank = "Operations Director";
            	case 100001: rank = "Executive Director";
    		}
        	format(string, sizeof(string), "%s{FFFFFF}%s: {FFFFFF}%s", string, rank, RemoveUnderScore(playerid));
        	++count;
    	}
    	if (!count) return SendClientMessage(playerid, -1, "No Administrators Currently Online");
    	else ShowPlayerDialog(playerid, 364, DIALOG_STYLE_MSGBOX, "{008000}Online Administrators:", string, "Close", "");
    	return 1;
    }
so "case 3: rank = "General Administrator";" keeps delivering error 047: array sizes do not match, or destination array is too small. It doesn't happen with any of the other ranks and when I remove it there isn't an issue. Problem is I don't want to remove it lol. Anyone able to tell me what's going on?


Re: /admins Command Assistance. - maksicnm - 21.10.2017

From rank[21]
to rank[22] ? try that..


Re: /admins Command Assistance. - AlexCooper - 21.10.2017

Quote:
Originally Posted by maksicnm
View Post
From rank[21]
to rank[22] ? try that..
Worked! Thanks