no admins dialog problem
#7

be careful when checking values in a loop and returning soon, if you need to break in, you can break it.

Код:
COMMAND:admins(playerid, params [] )
{
	new 
		on‌line=0,
		level[30],
		string[256], 
		lel[23]
	;
	for(new J = GetMaxPlayers(), i; i < J; i++ )
	{
	    if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin])
	    {  
	    	online ++;
	    	/*
                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\r", GetName(i), level, i);
	     }
	}
	if(!online)
	{
		//not found admins..
    	        ShowPlayerDialog(playerid, DIALOG_NOADMINS, DIALOG_STYLE_MSGBOX, "Online administrбtori", "Momentбlne na serveru nenн prнtomen ћбdnэ administrбtor", "Ok", "");
	}
	else
	{
		ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "Online administrбtoři", string, "Ok", "");
	}
	return 1;
}
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)