SA-MP Forums Archive
combine dialog vip and admins - 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: combine dialog vip and admins (/showthread.php?tid=468467)



combine dialog vip and admins - gotwarzone - 08.10.2013

Hi I would like to ask for a help. How do I combine this two dialog, when I do /admins it will show Admins and Vips online in 1 dialog box?


Here's the code below for admins and vips online..

Код:
CMD:admins(playerid,params[])
{
   new IsOnline = 0;
   strdel(JLstring,0,500);
   foreach(Player, i)
   {
      if (pInfo[i][pLevel] >= 1 && pInfo[i][AHide] == 0)
          {
                      switch(pInfo[i][pLevel])
              {
                              case 1: {
                                  LevelName = ADMIN_LEVEL_1;
                                  LevelColor = LEVEL_1_COLOR;
                                  }
                                  case 2: {
                                  LevelName = ADMIN_LEVEL_2;
                                  LevelColor = LEVEL_2_COLOR;
                                  }
                                  case 3: {
                                  LevelName = ADMIN_LEVEL_4;
                                  LevelColor = LEVEL_3_COLOR;
                                  }
                                  case 4: {
                                  LevelName = ADMIN_LEVEL_3;
                                  LevelColor = LEVEL_4_COLOR;
                                  }
                                  case 5: {
                                  LevelName = ADMIN_LEVEL_5;
                                  LevelColor = LEVEL_5_COLOR;
                                  }
                                  default: {
                                  LevelName = ADMIN_LEVEL_6;
                                  LevelColor = LEVEL_6_COLOR;
                                  }
                  }
                  if (IsPlayerAdmin(i)) format(Jstring, 128, "%s - Level: %d (RCON Administrator)\n",GetName(i),pInfo[i][pLevel]);
                  else format(Jstring, 128, "%s%s - Level: %d (%s)\n",LevelColor,GetName(i),pInfo[i][pLevel],LevelName);
                          strcat(JLstring, Jstring, sizeof(JLstring));
                          IsOnline++;
                }
   }
   if (IsOnline == 0)
   ShowPlayerDialog(playerid,JDIALOGS+165,DIALOG_STYLE_MSGBOX,"{09F7DF}Online Admins","{ffd700}There are currently no admin online" ,"Close","");
   else
   {
       if(IsOnline == 1) ShowPlayerDialog(playerid,JDIALOGS+165,DIALOG_STYLE_MSGBOX,"{09F7DF}Online Admins",JLstring ,"Close","");
           else format(Jstring, 128, "%d admins online",IsOnline), ShowPlayerDialog(playerid,JDIALOGS+165,DIALOG_STYLE_MSGBOX,Jstring,JLstring ,"Close","");
   }
   strdel(JLstring,0,500);
   return 1;
}
Код:
CMD:vips(playerid,params[])
{
   new IsOnline = 0;
   strdel(JLstring,0,500);
   foreach(Player, i)
   {
      if (pInfo[i][Donator] >= 1)
          {
                      switch(pInfo[i][Donator])
              {
                              case 1:
                                  {
                                          LevelName = VIP_LEVEL_1;
                                          LevelColor = VIP_1_COLOR;
                                  }
                                  case 2:
                                  {
                                          LevelName = VIP_LEVEL_2;
                                          LevelColor = VIP_2_COLOR;
                                  }
                                  default:
                                  {
                                          LevelName = VIP_LEVEL_3;
                                          LevelColor = VIP_3_COLOR;
                                  }
                  }
                          format(Jstring, 128, "%s%s - Level: %d (%s)\n",LevelColor,GetName(i),pInfo[i][Donator],LevelName);
                          strcat(JLstring, Jstring, sizeof(JLstring));
                          IsOnline++;
                }
   }
   if (IsOnline == 0)
   ShowPlayerDialog(playerid,JDIALOGS+165,DIALOG_STYLE_MSGBOX,"Online V.I.P Members","No V.I.P members online" ,"Close","");
   else
   {
       if(IsOnline == 1) ShowPlayerDialog(playerid,JDIALOGS+165,DIALOG_STYLE_MSGBOX,"Online V.I.P Members",JLstring ,"Close","");
           else format(Jstring, 128, "%d V.I.P members online",IsOnline), ShowPlayerDialog(playerid,JDIALOGS+165,DIALOG_STYLE_MSGBOX,Jstring,JLstring ,"Close","");
   }
   strdel(JLstring,0,500);
   return 1;
}



Re: combine dialog vip and admins - theYiin - 09.10.2013

isnt it wrong category? http://forum.sa-mp.com/forumdisplay.php?f=12


Re: combine dialog vip and admins - Mattakil - 10.10.2013

add
pawn Код:
case 1:
                                  {
                                          LevelName = VIP_LEVEL_1;
                                          LevelColor = VIP_1_COLOR;
                                  }
                                  case 2:
                                  {
                                          LevelName = VIP_LEVEL_2;
                                          LevelColor = VIP_2_COLOR;
                                  }
                                  default:
                                  {
                                          LevelName = VIP_LEVEL_3;
                                          LevelColor = VIP_3_COLOR;
                                  }
to the /admins dialog, under a different case ofc


Re: combine dialog vip and admins - gotwarzone - 10.10.2013

Quote:
Originally Posted by Mattakil
Посмотреть сообщение
add
pawn Код:
case 1:
                                  {
                                          LevelName = VIP_LEVEL_1;
                                          LevelColor = VIP_1_COLOR;
                                  }
                                  case 2:
                                  {
                                          LevelName = VIP_LEVEL_2;
                                          LevelColor = VIP_2_COLOR;
                                  }
                                  default:
                                  {
                                          LevelName = VIP_LEVEL_3;
                                          LevelColor = VIP_3_COLOR;
                                  }
to the /admins dialog, under a different case ofc
Can you please arrange this for me? or someone? please thank you!