no admins dialog problem
#1

Hello everybody, I am having here a little problem with my /admins command, first of all, I will throw my code:

Код:
CMD:admins(playerid, params[])
{
	new online;
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	    online ++;
	    new level[512], string[256], lel[23];
	    if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] > 0)
	    {
	        if(online == 0) return ShowPlayerDialog(playerid, DIALOG_NOADMINS, DIALOG_STYLE_MSGBOX, "Online administrбtoři", "Momentбlně na serveru nenн přнtomen ћбdnэ administrбtor", "Ok", "");
	        format(lel, sizeof(lel), "%d", online);
	        SendClientMessageToAll(ADMIN, lel);
	        switch(PlayerInfo[i][pAdmin])
	        {
	            case 1: level = "Administrбtor-kandidбt";
	            case 2: level = "Administrбtor";
	            case 3: level = "Vedoucн Administrбtor";
	            case 4: level = "Hlavnн Administrбtor";
	            case 5: level = "Sprбvce serveru";
			}
  			format(string, sizeof(string), "%s %s {FFCC00}/pm %d <sem vpiљte vбљ dotaz>\n", GetName(i), level, i);
			ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "Online administrбtoři", string, "Ok", "");
		}
	}
	return 1;
}
So, and the thing is. I want, so when there is no player with pAdmin higher than 0 online, it will simply just show dialog, that there is no admin online.

What i did, i created a variable storing value in it, which the value increased by script finding out, that there is admin available.

I am not sure if what i am saying actually makes sense, or the script is total bullshit, however if any of you guys understand what I mean and could throw some solution on me, i would appreciate it more than anything. If best with explanation.
Reply


Messages In This Thread
no admins dialog problem - by MrakBuster - 02.02.2018, 11:19
Re: no admins dialog problem - by DelK - 02.02.2018, 11:23
Re: no admins dialog problem - by MrakBuster - 02.02.2018, 11:28
Re: no admins dialog problem - by Mugala - 02.02.2018, 11:33
Re: no admins dialog problem - by jasperschellekens - 02.02.2018, 11:37
Re: no admins dialog problem - by Mugala - 02.02.2018, 11:47
Re: no admins dialog problem - by DarkBr - 02.02.2018, 11:53

Forum Jump:


Users browsing this thread: 1 Guest(s)