Help With Dialogs
#1

When I Type /admins it shows the names of online admins but i want to show then in a box here is my code for admins command.
Code:
CMD:admins(playerid,params[])
{

new count = 0, string[256], AdmRank[500];
	SendClientMessage(playerid,red,"");
	SendClientMessage(playerid,COLOR_ORANGE,"»»Online Admins»»");
	new ChangeColor;
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(PlayerInfo[i][Level] > 0)
			{
				if(PlayerInfo[i][Level] == 1)
				{
					AdmRank = "Junior Admin";
					ChangeColor = Color_Trial_Admin;

				}
				else if(PlayerInfo[i][Level] == 2)
				{
					AdmRank = "Senior Admin";
					ChangeColor = Color_Server_Admin;

				}
				else if(PlayerInfo[i][Level] == 3)
				{
					AdmRank = "Head Admin";
					ChangeColor = Color_Senior_Admin;

				}
				else if(PlayerInfo[i][Level] == 4)
				{
					AdmRank = "Management(Server Team)";
					ChangeColor = Color_Lead_Admin;

				}
				else if(PlayerInfo[i][Level] == 5)
				{
					AdmRank = "Server Owner(Rcon Admin)";
					ChangeColor = Color_Global_Admin;

				}
				else if(PlayerInfo[i][Level] == 6)
				{
					AdmRank = "Community Developer/Scripter";
					ChangeColor = Color_Server_Owner;

				}
				else if(PlayerInfo[i][Level] >= 7)
				{
					AdmRank = "Community Owner";
                    ChangeColor = Color_RCON_Administrator;
				}
				else if(PlayerInfo[i][Level] >= 8)
				{
					AdmRank = "Community Owner";
                    ChangeColor = Color_RCON_Administrator;
				}
				new Name[MAX_PLAYER_NAME];
				GetPlayerName(i,Name,sizeof(Name));

				{
					format(string, sizeof(string), "Level: %d | Name: %s (ID:%i) | Rank: %s", PlayerInfo[i][Level], Name, i, AdmRank);
					SendClientMessage(playerid,ChangeColor,string);
					count++;
				}
			}
		}
	}
	


	if(count == 0)
	SendClientMessage(playerid,red,"No Admins online!");
	SendClientMessage(playerid,COLOR_ORANGE,"________________________");
	return 1;
}
When I Type /vips it shows the names of online vips but i want to show then in a box here is my code for vips command.
Code:
CMD:vips(playerid, params[])
{
    #pragma unused params
    new
        count = 0,
        string[800];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            if(PlayerInfo[i][dRank] >= 1)
            {
                format(string, 500, "%s %s [ID:%i] | DonorLevel: %d\n", string, PlayerName2(i), i, PlayerInfo[i][dRank]);
                //We are appending the string, so put %s before any new data is added,
                //and that parameter actually refers to the string itself.
                count++;
            }
        }
	}
    if (count == 0) ShowPlayerDialog(playerid, 800, DIALOG_STYLE_MSGBOX, "{F81414}=Online Donators=", "{00FFEE}No Donators Online\n{00FF00}_____", "Close", "");
    else ShowPlayerDialog(playerid, 800, DIALOG_STYLE_MSGBOX, "{F81414}=Online Donators=", string, "Close", "");
    return 1;
}
When I Type /moderators it shows the names of online moderators but i want to show then in a box here is my code for moderators command.
Code:
CMD:moderators(playerid, params[])
{
   new count = 0, string[256];
   SendClientMessage(playerid, blue,"Current online moderators:");
   for(new i = 0; i < MAX_PLAYERS; i ++)
   {
	  if(IsPlayerConnected(i))
	  {
		  if(PlayerInfo[i][Helper] == 1)
		  {
             format(string, sizeof(string),"Moderator: [%d]%s", i, PlayerName2(i));
             SendClientMessage(playerid, blue, string);
             count++;
		  }
      }
   }
   if(count == 0)
   {
		  SendClientMessage(playerid, blue,"No moderators are online right now!");
   }
   return 1;
}
Please Help Me Fixing All There Three Errors.Remember That I Want That When A Person Type These Commands A Box Comes Up.
Reply
#2

Use strcat for that.

Example of code can be:
PHP Code:
strcat(string"bla..");
strcat(string"asdj");
if(
PlayerInfo[playerid][pAdmin] == 1)
{
               
AdmRank[playerid] = "Junior Admin";
          
ChangeColor[playerid] = Color_Trial_Admin;
            
strcat(string"{ChangeColor} %s %s \n",AdmRankGetPlayerName(playerid));

upto each Mod, Admin, VIP Rank you want to set and at end,
PHP Code:
ShowPlayerDialog(playeridDIALOG_IDDIALOG_STYLE_MSGBOX"Admins"string"OK"""); 
Make Sure to Save COLOR_TRIAL_ADMIN in HEX Colors not in RRGGBB format to us above line.
Also Make AdmRank and ChangeColor to Player Variables not Global.
PHP Code:
new AdmRank[MAX_PLAYERS];
new 
ChangeColor[MAX_PLAYERS]; 
Hope it helps.
Reply
#3

Quote:
Originally Posted by WatchDog
Hi Can You Do Changes In One Of The Code And Show Me

Here Is The Linkhttps://sampforum.blast.hk/showthread.php?tid=607842
Mods command look ok, now see and learn.
PHP Code:
CMD:moderators(playeridparams[])
{
   new 
count 0string[256];
   
//SendClientMessage(playerid, blue,"Current online moderators:");
   
for(new 0MAX_PLAYERS++)
   {
      if(
IsPlayerConnected(i))
      {
          if(
PlayerInfo[i][Helper] == 1)
          {
             
strcat(string,"Moderator: [%d]%s \n\r"iPlayerName2(i));
             
count++;
          }
          
ShowPlayerDialog(playerid542DIALOG_STYLE_MSGBOX"Current online Moderators: "string"OK""");
          
//ShowPlayerDialog(playerid, DIALOG ID, DIALOG STYLE, HEADING, MESSAGE, BUTTON 1, BUTTON 2);
      
}
   }
   if(
count == 0)
   {
          
ShowPlayerDialog(playerid542DIALOG_STYLE_MSGBOX"Current Online Moderators: ""No Mods Online!""OK""");
   }
   return 
1;

Reply
#4

Not Working
Reply
#5

What happens when you use /moderators?
Reply
#6

Try this:
PHP Code:
CMD:admins(playeridparams[])   // By CuervO_NegrO
    
{
        if(
IsPlayerConnected(playerid))
        {
            for(new 
0MAX_PLAYERSi++)
            {
                if(
IsPlayerConnected(i))
                {
                    if(
PlayerInfo[i][pAdmin] >= && PlayerInfo[i][pAdmin] <= 1338)
                    {
                        new 
admtext[64];
                       
                                                   if(
PlayerInfo[i][pAdmin] == 1338) { admtext "Raven's Roleplay Director"; }
                            else if(
PlayerInfo[i][pAdmin] == 1337) { admtext "Executive Director"; }
                            else if(
PlayerInfo[i][pAdmin] == 6)    { admtext "Head Administrator"; }
                            else if(
PlayerInfo[i][pAdmin] == 5) { admtext "Senior Administrator"; }
                            else if(
PlayerInfo[i][pAdmin] == 4) { admtext "Administrator"; }
                            else if(
PlayerInfo[i][pAdmin] == 3) { admtext "Senior Moderator"; }
                            else if(
PlayerInfo[i][pAdmin] == 2)    { admtext "Moderator"; }
                            else if(
PlayerInfo[i][pAdmin] == 1) { admtext "Administrative Assitant"; }
                            else { 
admtext "Undefined Rank"; }
                        }
                        
GetPlayerName(isendernamesizeof(sendername));
                        if(
PlayerInfo[i][pAdminDuty] == )
                        {
                            
strcat*string,  "%s - %s \n\r" admtextsendername);
                            
ShowPlayerDialog(playerid3652DIALOG_STYLE_MSGBOX"Online Admins:"string"OK"""); //Change Dialog Ids according to your server
                        
}
                        else if(
PlayerInfo[i][pAdminDuty] == 1)
                        {
                            
strcat(string,  "%s - %s (On Duty) \n\r"admtextsendername);
                            
ShowPlayerDialog(playerid3652DIALOG_STYLE_MSGBOX"Online Admins":, string"OK"""); // Change Dialog Ids According to your server.
                        
}
                }
            }
        }
        return 
1;
    } 
Courtesy: Raven's Roleplay Script by Cuervo and NoFear

I found Raven's Roleplay script and thats the code. i already converted it into ZCMD, you just have to change your variables in it to use.

Hope it helps.

EDIT: i fixed /mods command. here:
PHP Code:
CMD:moderators(playeridparams[])
{
   new 
count 0string[256];
   
//SendClientMessage(playerid, blue,"Current online moderators:");
   
for(new 0MAX_PLAYERS++)
   {
      if(
IsPlayerConnected(i))
      {
          if(
PlayerInfo[i][Helper] == 1)
          {
             
strcat(string,"Moderator: [%d]%s \n\r"iPlayerName2(i));
             
count++;
          }
          
      }
   }
  
ShowPlayerDialog(playerid542DIALOG_STYLE_MSGBOX"Current online Moderators: "string"OK""");
          
//ShowPlayerDialog(playerid, DIALOG ID, DIALOG STYLE, HEADING, MESSAGE, BUTTON 1, BUTTON 2);
   
if(count == 0)
   {
          
ShowPlayerDialog(playerid542DIALOG_STYLE_MSGBOX"Current Online Moderators: ""No Mods Online!""OK""");
   }
   return 
1;

Reply
#7

Quote:
Originally Posted by GTLS
View Post
Try this:
PHP Code:
CMD:admins(playeridparams[])   // By CuervO_NegrO
    
{
        if(
IsPlayerConnected(playerid))
        {
            for(new 
0MAX_PLAYERSi++)
            {
                if(
IsPlayerConnected(i))
                {
                    if(
PlayerInfo[i][pAdmin] >= && PlayerInfo[i][pAdmin] <= 1338)
                    {
                        new 
admtext[64];
                       
                                                   if(
PlayerInfo[i][pAdmin] == 1338) { admtext "Raven's Roleplay Director"; }
                            else if(
PlayerInfo[i][pAdmin] == 1337) { admtext "Executive Director"; }
                            else if(
PlayerInfo[i][pAdmin] == 6)    { admtext "Head Administrator"; }
                            else if(
PlayerInfo[i][pAdmin] == 5) { admtext "Senior Administrator"; }
                            else if(
PlayerInfo[i][pAdmin] == 4) { admtext "Administrator"; }
                            else if(
PlayerInfo[i][pAdmin] == 3) { admtext "Senior Moderator"; }
                            else if(
PlayerInfo[i][pAdmin] == 2)    { admtext "Moderator"; }
                            else if(
PlayerInfo[i][pAdmin] == 1) { admtext "Administrative Assitant"; }
                            else { 
admtext "Undefined Rank"; }
                        }
                        
GetPlayerName(isendernamesizeof(sendername));
                        if(
PlayerInfo[i][pAdminDuty] == )
                        {
                            
strcat*string,  "%s - %s \n\r" admtextsendername);
                            
ShowPlayerDialog(playerid3652DIALOG_STYLE_MSGBOX"Online Admins:"string"OK"""); //Change Dialog Ids according to your server
                        
}
                        else if(
PlayerInfo[i][pAdminDuty] == 1)
                        {
                            
strcat(string,  "%s - %s (On Duty) \n\r"admtextsendername);
                            
ShowPlayerDialog(playerid3652DIALOG_STYLE_MSGBOX"Online Admins":, string"OK"""); // Change Dialog Ids According to your server.
                        
}
                }
            }
        }
        return 
1;
    } 
Courtesy: Raven's Roleplay Script by Cuervo and NoFear

I found Raven's Roleplay script and thats the code. i already converted it into ZCMD, you just have to change your variables in it to use.

Hope it helps.

EDIT: i fixed /mods command. here:
PHP Code:
CMD:moderators(playeridparams[])
{
   new 
count 0string[256];
   
//SendClientMessage(playerid, blue,"Current online moderators:");
   
for(new 0MAX_PLAYERS++)
   {
      if(
IsPlayerConnected(i))
      {
          if(
PlayerInfo[i][Helper] == 1)
          {
             
strcat(string,"Moderator: [%d]%s \n\r"iPlayerName2(i));
             
count++;
          }
          
      }
   }
  
ShowPlayerDialog(playerid542DIALOG_STYLE_MSGBOX"Current online Moderators: "string"OK""");
          
//ShowPlayerDialog(playerid, DIALOG ID, DIALOG STYLE, HEADING, MESSAGE, BUTTON 1, BUTTON 2);
   
if(count == 0)
   {
          
ShowPlayerDialog(playerid542DIALOG_STYLE_MSGBOX"Current Online Moderators: ""No Mods Online!""OK""");
   }
   return 
1;

Hello, can you make this /admins command to Dialog Box?

Code:

PHP Code:
CMD:admins(playeridparams[])
{
    new 
string[128], bool:count falserank[35], status[15];
    
SendClientMessage(playeridCOLOR_ORANGE_RED" ");
    
LOOP_PLAYERS(i)
    {
        if(
IsPlayerGAdmin(i) || IsPlayerAdmin(i))
        {
            if(! 
countSendClientMessage(playeridCOLOR_ORANGE_RED"- Online Administrators -");
            if(
GetPVarType(playerid"GAdmin_Onduty") != PLAYER_VARTYPE_NONEstatus "On Duty";
            else 
status "Playing";
            if(! 
strcmp(ReturnPlayerName(i), "Frelan")) rank "Server Owner & Developer";
            else if(! 
strcmp(ReturnPlayerName(i), "_zionis_")) rank "Server Co - Owner";
            else if(
IsPlayerAdmin(i)) rank "RCON Admin";
            else
            {
                switch(
GetPlayerGAdminLevel(i))
                {
                    case 
1rank "Newbie Admin";
                    case 
2rank "Junior Admin";
                    case 
3rank "Pro Admin";
                    case 
4rank "Lead Admin";
                    case 
5rank "Master Admin";
                    case 
6rank "Senior Admin";
                    default: 
rank "Server Owner";
                }
               }
            
format(stringsizeof(string), "%s [%i] | Rank: %s | Level %i | Status: %s"ReturnPlayerName(i), irankGetPlayerGAdminLevel(i), status);
            
SendClientMessage(playeridCOLOR_ORANGE_REDstring);
            
count true;
        }
    }
    if(! 
count) return SendClientMessage(playeridCOLOR_FIREBRICK"ERROR: No admin on-duty currently.");
    return 
1;

Reply
#8

Sure but wait for some time i am not at my house...
Reply
#9

Quote:
Originally Posted by TheseMan
View Post
Hello, can you make this /admins command to Dialog Box?

Code:

PHP Code:
CMD:admins(playeridparams[])
{
    new 
string[128], bool:count falserank[35], status[15];
    
SendClientMessage(playeridCOLOR_ORANGE_RED" ");
    
LOOP_PLAYERS(i)
    {
        if(
IsPlayerGAdmin(i) || IsPlayerAdmin(i))
        {
            if(! 
countSendClientMessage(playeridCOLOR_ORANGE_RED"- Online Administrators -");
            if(
GetPVarType(playerid"GAdmin_Onduty") != PLAYER_VARTYPE_NONEstatus "On Duty";
            else 
status "Playing";
            if(! 
strcmp(ReturnPlayerName(i), "Frelan")) rank "Server Owner & Developer";
            else if(! 
strcmp(ReturnPlayerName(i), "_zionis_")) rank "Server Co - Owner";
            else if(
IsPlayerAdmin(i)) rank "RCON Admin";
            else
            {
                switch(
GetPlayerGAdminLevel(i))
                {
                    case 
1rank "Newbie Admin";
                    case 
2rank "Junior Admin";
                    case 
3rank "Pro Admin";
                    case 
4rank "Lead Admin";
                    case 
5rank "Master Admin";
                    case 
6rank "Senior Admin";
                    default: 
rank "Server Owner";
                }
               }
            
format(stringsizeof(string), "%s [%i] | Rank: %s | Level %i | Status: %s"ReturnPlayerName(i), irankGetPlayerGAdminLevel(i), status);
            
SendClientMessage(playeridCOLOR_ORANGE_REDstring);
            
count true;
        }
    }
    if(! 
count) return SendClientMessage(playeridCOLOR_FIREBRICK"ERROR: No admin on-duty currently.");
    return 
1;

There you go.
PHP Code:
CMD:admins(playeridparams[])
{
    new 
string[128], bool:count falserank[35], status[15], diastring[1500];
    
SendClientMessage(playeridCOLOR_ORANGE_RED" ");
    
LOOP_PLAYERS(i)
    {
        if(
IsPlayerGAdmin(i) || IsPlayerAdmin(i))
        {
            if(! 
countSendClientMessage(playeridCOLOR_ORANGE_RED"- Online Administrators -");
            if(
GetPVarType(playerid"GAdmin_Onduty") != PLAYER_VARTYPE_NONEstatus "On Duty";
            else 
status "Playing";
            if(! 
strcmp(ReturnPlayerName(i), "Frelan")) rank "Server Owner & Developer";
            else if(! 
strcmp(ReturnPlayerName(i), "_zionis_")) rank "Server Co - Owner";
            else if(
IsPlayerAdmin(i)) rank "RCON Admin";
            else
            {
                switch(
GetPlayerGAdminLevel(i))
                {
                    case 
1rank "Newbie Admin";
                    case 
2rank "Junior Admin";
                    case 
3rank "Pro Admin";
                    case 
4rank "Lead Admin";
                    case 
5rank "Master Admin";
                    case 
6rank "Senior Admin";
                    default: 
rank "Server Owner";
                }
               }
            
format(stringsizeof(string), "%s [%i] | Rank: %s | Level %i | Status: %s\n"ReturnPlayerName(i), irankGetPlayerGAdminLevel(i), status);
            
strcat(diastringstring);
            
ShowPlayerDialog(playerid5689DIALOG_STYLE_MSGBOX"- Online Administrators -"diastring"Ok""");//lol rand id change if you already have that one
            
count true;
        }
    }
    if(! 
count) return SendClientMessage(playeridCOLOR_FIREBRICK"ERROR: No admin on-duty currently.");
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)