Whats wrong with my cmd ?
#1

I make my three commands in dialog.. (/admini /gamemasteri and /vipove) But sometimes on gamemasters / admins
not show online administrators on servers ? Why ? and on /vipove not showing nothing btw im VIP.

Here is

/vipove (/vips)
pawn Код:
if (strcmp(cmd, "/vipove", true) == 0)
    {
        if(IsPlayerConnected(playerid))
     {
   for(new i = 0; i < MAX_PLAYERS; i++)
   {
    if(IsPlayerConnected(i))
    {
        if(PlayerInfo[i][pVIP] == 1)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 256, " {FF00E1}VIP[{87FF00}Faca{FFB400}]:{87FF00} %s\n\n", sendername);

     }
        if(PlayerInfo[i][pVIP] == 2)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 256, "%s {FF00E1}VIP[{87FF00}Veca Faca{FFB400}]:{87FF00} %s\n\n",string, sendername);

     }
        if(PlayerInfo[i][pVIP] == 3)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 256, "%s {FF00E1}VIP[{87FF00}Gazda{FFB400}]:{87FF00} %s\n\n",string, sendername);

     }
    if(PlayerInfo[i][pVIP] == 4)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 512, "%s {FF00E1}VIP[{87FF00}Lider{FFB400}]:{87FF00} %s\n\n", string,sendername);
      ShowPlayerDialog(playerid,197,DIALOG_STYLE_MSGBOX,"{FF3200}Online Vipove",string,"U redu", "Izadji");
                               }
                       }
               }
       }
               return 1;
}
/gamemasteri (/gamemasters)
pawn Код:
if (strcmp(cmd, "/gamemasteri", true) == 0)
    {
        if(IsPlayerConnected(playerid))
     {
   for(new i = 0; i < MAX_PLAYERS; i++)
   {
    if(IsPlayerConnected(i))
    {
        if(PlayerInfo[i][pGm] == 1)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 256, " {FFB400}GameMaster[{FF3200}Trial{FFB400}]:{009BFF} %s\n\n", sendername);

     }
        if(PlayerInfo[i][pGm] == 2)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 256, "%s {FFB400}GameMaster[{FF3200}Level 2{FFB400}]:{009BFF} %s\n\n",string, sendername);

     }
        if(PlayerInfo[i][pGm] == 3)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 256, "%s {FFB400}GameMaster[{FF3200}Level 3{FFB400}]:{009BFF} %s\n\n",string, sendername);

     }
    if(PlayerInfo[i][pGm] == 4)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 512, "%s {FFB400}GameMaster[{FF3200}Lider{FFB400}]:{009BFF} %s\n\n", string,sendername);
      ShowPlayerDialog(playerid,197,DIALOG_STYLE_MSGBOX,"{FF3200}Online GameMasteri",string,"U redu", "Izadji");
                               }
                       }
               }
       }
               return 1;
}
/admini (/admins)
pawn Код:
if (strcmp(cmd, "/admini", true) == 0)
    {
        if(IsPlayerConnected(playerid))
     {

   for(new i = 0; i < MAX_PLAYERS; i++)
   {
    if(IsPlayerConnected(i))
    {
        if(PlayerInfo[i][pAdmin] == 1)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 256, " {FFB400}Admin[{87FF00}Moderator{FFB400}]:{FF2800} %s\n\n", sendername);

     }
        if(PlayerInfo[i][pAdmin] == 2)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 256, "%s {FFB400}Admin[{87FF00}Level 2{FFB400}]:{FF2800} %s\n\n",string, sendername);

     }
        if(PlayerInfo[i][pAdmin] == 3)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 256, "%s {FFB400}Admin[{87FF00}Level 3{FFB400}]:{FF2800} %s\n\n",string, sendername);

     }
        if(PlayerInfo[i][pAdmin] == 4)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 256, "%s {FFB400}Admin[{87FF00}Level 4{FFB400}]:{FF2800} %s\n\n", string,sendername);

     }
     if(PlayerInfo[i][pAdmin] == 1337)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 256, "%s {FFB400}Admin[{87FF00}Skripter{FFB400}]:{FF2800} %s\n\n", string,sendername);

     }
     if(PlayerInfo[i][pAdmin] == 1338)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 256, "%s {FFB400}Admin[{87FF00}HeadAdmin{FFB400}]:{FF2800} %s\n\n", string,sendername);

     }
        if(PlayerInfo[i][pAdmin] == 1339)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 256, "%s {FFB400}Admin[{87FF00}HeadManager{FFB400}]:{FF2800} %s\n\n", string,sendername);

        }
               if(PlayerInfo[i][pAdmin] == 1340)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 512, "%s {FFB400}Admin[{87FF00}Vlasnik{FFB400}]:{FF2800} %s\n\n", string,sendername);
      ShowPlayerDialog(playerid,197,DIALOG_STYLE_MSGBOX,"{87FF00}Online Admini",string,"U redu", "Izadji");
                               }
                       }
               }
       }
               return 1;
}
Reply
#2

At the first
Код:
if(PlayerInfo[i][pVIP] == 1)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 256, " {FF00E1}VIP[{87FF00}Faca{FFB400}]:{87FF00} %s\n\n", sendername);

     }
// You should use
if(PlayerInfo[i][pVIP] == 1)
        {
      GetPlayerName(i, sendername, 50);
      format(string, 256, "%s {FF00E1}VIP[{87FF00}Faca{FFB400}]:{87FF00} %s\n\n",string, sendername);

     }
When two players are rank 1 the first player will not be showed because the string will get cleared if you doesn't use %s at this one.
You should use format(string,sizeof(string),""); above the loop so the string text you used before this function will get removed.
Reply
#3

Just my personal opinion...

before you get more depth into your commands...

I suggest you switch to ZCMD, its so much neater and easier.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)