Szerző Téma: /makeadmin  (Megtekintve 642 alkalommal)

Nem elérhető KrisT

  • 106
    • Profil megtekintése
/makeadmin
« Dátum: 2014. Augusztus 28. - 14:49:04 »
0 Show voters
Sziasztok! A problémám az lenne, ha beirom /makeadmin X(ID) Y(adminszint), és teljesen helyesen, akkor kiirja, hogy Az adminszint csak 1,2,3.. stb lehet. Nemtudom mi a hiba, de szerintem az if(sscanf(params,\"\" -ba lehet.
 
CMD:makeadmin(playerid,params[])
{
if(Belepve[playerid])
{
    if(IsPlayerAdmin(playerid) || JatekosInfo[playerid][Tulaj])
    {
        new id,param1[128],neve[MAX_PLAYER_NAME];
            if(sscanf(params,\"ui[4]\",id,param1)) return SendClientMessage(playerid,COLOR_LIGHTRED,\"Használat: /makeadmin [Player ID] [AdminSzint]\");
   {
       if(IsPlayerConnected(id))
      {
                GetPlayerName(playerid,nev,sizeof(nev));
             GetPlayerName(id,neve,sizeof(neve));
          new uzenet[128];
          if(!strcmp(param1, \"0\", true))
          {
              if(JatekosInfo[playerid][AdminSzint] > 0)
              {
                format(uzenet,sizeof(uzenet),\"%s elvette %s adminját!\",nev,neve);
               SendClientMessageToAll(COLOR_ORANGE,uzenet);
               MSG(id,COLOR_LIGHTGREEN,\"Elvették az Adminodat!\");
               JatekosInfo[id][AdminSzint] = 0;
               printf(\"uzenet\");
               TextDrawShowForPlayer(playerid,infovonal[playerid]);
               new szoveg[128];
               format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
               TextDrawSetString(infovonal[playerid],szoveg);
               TextDrawShowForPlayer(playerid, Box[playerid]);
               TextDrawShowForPlayer(playerid, Ft[playerid]);
            }
            else MSG(playerid,COLOR_LIGHTRED,\"Mégis mit akarsz elvenni szegénytõl? Nem admin..\");
         }
         else if(!strcmp(param1, \"1\", true))
          {
              if(JatekosInfo[playerid][AdminSzint] != 1)
              {
                  if(JatekosInfo[playerid][AdminSzint] < 1)
                  {
                              TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s kinevezte %s -t 1-es szintû adminná! %s mától fogva GameAdmin! Gratulálunk!!\",nev,neve,nev);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_LIGHTGREEN,\"Kineveztek 1-es szintû adminná!\");
                  JatekosInfo[id][AdminSzint] = 1;
                  printf(\"uzenet\");
               }
               else if(JatekosInfo[playerid][AdminSzint] > 1)
                  {
                  TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s lefokozta %s -t 1-es szintû Adminná!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_LIGHTGREEN,\"Lefokoztak 1-es szintû adminná!\");
                  JatekosInfo[id][AdminSzint] = 1;
                  printf(\"uzenet\");
               }
            }
            else MSG(playerid,COLOR_LIGHTRED,\"Õ most is egyes szintû admin.. Mi értelme lenne megint kinevezni õt egyesre? Ejj te fiú :D\");
         }
         else if(!strcmp(param1, \"2\", true))
          {
              if(JatekosInfo[playerid][AdminSzint] != 2)
              {
                  if(JatekosInfo[playerid][AdminSzint] < 2)
                  {
                        TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s kinevezte %s -t 2-es szintû adminná! Gratulálunk!!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_LIGHTGREEN,\"Kineveztek 2-es szintû adminná!\");
                  JatekosInfo[id][AdminSzint] = 2;
                  printf(\"uzenet\");
               }
               else if(JatekosInfo[playerid][AdminSzint] > 2)
                  {
                   format(uzenet,sizeof(uzenet),\"%s lefokozta %s -t 2-es szintû Adminná!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_LIGHTGREEN,\"Lefokoztak 2-es szintû adminná!\");
                  JatekosInfo[id][AdminSzint] = 2;
                  printf(\"uzenet\");
                            TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
               }
            }
            else MSG(playerid,COLOR_LIGHTRED,\"Õ most is kettes szintû admin.. Mi értelme lenne megint kinevezni õt kettesre? Ejj te fiú :D\");
         }
         else if(!strcmp(param1, \"3\", true))
          {
              if(JatekosInfo[playerid][AdminSzint] != 3)
              {
                  if(JatekosInfo[playerid][AdminSzint] < 3)
                  {
                            TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s kinevezte %s -t 3-es szintû adminná! Gratulálunk!!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_LIGHTGREEN,\"Kineveztek 3-es szintû adminná!\");
                  JatekosInfo[id][AdminSzint] = 3;
                  printf(\"uzenet\");
               }
               else if(JatekosInfo[playerid][AdminSzint] > 3)
                  {
                              TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s lefokozta %s -t 3-es szintû Adminná!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_LIGHTGREEN,\"Lefokoztak 3-es szintû adminná!\");
                  JatekosInfo[id][AdminSzint] = 3;
                  printf(\"uzenet\");
               }
            }
            else MSG(playerid,COLOR_LIGHTRED,\"Õ most is hármas szintû admin.. Mi értelme lenne megint kinevezni õt hármasra? Ejj te fiú :D\");
         }
         else if(!strcmp(param1, \"4\", true))
          {
              if(JatekosInfo[playerid][AdminSzint] != 4)
              {
                  if(JatekosInfo[playerid][AdminSzint] < 4)
                  {
                              TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s kinevezte %s -t 4-es szintû adminná! Gratulálunk!!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_LIGHTGREEN,\"Kineveztek 4-es szintû adminná!\");
                  JatekosInfo[id][AdminSzint] = 4;
                  printf(\"uzenet\");
               }
               else if(JatekosInfo[playerid][AdminSzint] > 4)
                  {
                              TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s lefokozta %s -t 4-es szintû Adminná!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_LIGHTGREEN,\"Lefokoztak 4-es szintû adminná!\");
                  JatekosInfo[id][AdminSzint] = 4;
                  printf(\"uzenet\");
               }
            }
            else MSG(playerid,COLOR_LIGHTRED,\"Õ most is négyes szintû admin.. Mi értelme lenne megint kinevezni õt négyesre? Ejj te fiú :D\");
         }
         else if(!strcmp(param1, \"5\", true))
          {
              if(JatekosInfo[playerid][AdminSzint] != 5)
              {
                  if(JatekosInfo[playerid][AdminSzint] < 5)
                  {
                              TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s kinevezte %s -t 5-ös szintû adminná! Gratulálunk!!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_LIGHTGREEN,\"Kineveztek 5-ös szintû adminná!\");
                  JatekosInfo[id][AdminSzint] = 5;
                  printf(\"uzenet\");
               }
               else if(JatekosInfo[playerid][AdminSzint] > 5)
                  {
                              TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s lefokozta %s -t 5-ös szintû Adminná!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_LIGHTGREEN,\"Lefokoztak 5-ös szintû adminná!\");
                  JatekosInfo[id][AdminSzint] = 5;
                  printf(\"uzenet\");
               }
            }
            else MSG(playerid,COLOR_LIGHTRED,\"Õ most is ötös szintû admin.. Mi értelme lenne megint kinevezni õt ötösre? Ejj te fiú :D\");
         }
         else if(!strcmp(param1, \"6\", true))
          {
              if(JatekosInfo[playerid][AdminSzint] != 6)
              {
                  if(JatekosInfo[playerid][AdminSzint] < 6)
                  {
                      TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s kinevezte %s -t FõadminSegédre! Gratulálunk!!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_LIGHTBLUE,\"Kineveztek 6-os szintû adminná!\");
                  JatekosInfo[id][AdminSzint] = 6;
                  printf(\"uzenet\");
               }
               else if(JatekosInfo[playerid][AdminSzint] > 6)
                  {
                      TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s lefokozta %s -t FõadminSegédre\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_LIGHTBLUE,\"Lefokoztak FõadminSegédre\");
                  JatekosInfo[id][AdminSzint] = 6;
                  printf(\"uzenet\");
               }
            }
            else MSG(playerid,COLOR_LIGHTRED,\"Õ most is FõadminSegéd.. Mi értelme lenne megint kinevezni õt ötösre? Ejj te fiú :D\");
         }
         else if(!strcmp(param1, \"1337\", true))
          {
              if(JatekosInfo[playerid][AdminSzint] != 1337)
              {
                  if(JatekosInfo[playerid][AdminSzint] < 1337)
                  {
                              TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s kinevezte %s -t FõAdminra! Gratulálunk!!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_BLUE,\"Kineveztek FõAdminra!\");
                  JatekosInfo[id][AdminSzint] = 1337;
                  printf(\"uzenet\");
               }
               else if(JatekosInfo[playerid][AdminSzint] > 1337)
                  {
                              TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s lefokozta %s -t FõAdminra!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_BLUE,\"Lefokoztak FõAdminra!\");
                  JatekosInfo[id][AdminSzint] = 1337;
                  printf(\"uzenet\");
               }
            }
            else MSG(playerid,COLOR_LIGHTRED,\"Õ most is FõAdmin.. Mi értelme lenne megint kinevezni õt FõAdminra? Ejj te fiú :D\");
         }
         else if(!strcmp(param1, \"1338\", true))
          {
              if(JatekosInfo[playerid][AdminSzint] != 1338)
              {
                  if(JatekosInfo[playerid][AdminSzint] < 1338)
                  {
                              TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s kinevezte %s -t SuperAdminná! Gratulálunk!!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_YELLOW,\"Kineveztek SuperAdminná\");
                  JatekosInfo[id][AdminSzint] = 1338;
                  printf(\"uzenet\");
               }
               else if(JatekosInfo[playerid][AdminSzint] > 1338)
                  {
                              TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s lefokozta %s -t SuperAdminná\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_YELLOW,\"Lefokoztak SuperAdminná\");
                  JatekosInfo[id][AdminSzint] = 1338;
                  printf(\"uzenet\");
               }
            }
            else MSG(playerid,COLOR_LIGHTRED,\"Õ most is SuperAdmin.. Mi értelme lenne megint kinevezni õt SuperAdminra? Ejj te fiú :D\");
         }
         else if(!strcmp(param1, \"4096\", true))
          {
              if(JatekosInfo[playerid][AdminSzint] != 4096)
              {
                  if(JatekosInfo[playerid][AdminSzint] < 4096)
                  {
                      TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s kinevezte %s AdminControllerSegéddé! Gratulálunk!!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_RED,\"Kineveztek AdminControllerSegéddé\");
                  JatekosInfo[id][AdminSzint] = 4096;
                  printf(\"uzenet\");
               }
               else if(JatekosInfo[playerid][AdminSzint] > 4096)
                  {
                            TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s lefokozta %s -t AdminControllerSegéddé!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_RED,\"Lefokoztak AdminControllerSegéddé!\");
                  JatekosInfo[id][AdminSzint] = 4096;
                  printf(\"uzenet\");
               }
            }
            else MSG(playerid,COLOR_LIGHTRED,\"Õ most is AdminControllerSegéd.. Mi értelme lenne megint kinevezni õt AdminControllerSegéddé? Ejj te fiú :D\");
         }
         else if(!strcmp(param1, \"4100\", true))
          {
              if(JatekosInfo[playerid][AdminSzint] != 4100)
              {
                  if(JatekosInfo[playerid][AdminSzint] < 4100)
                  {
                      TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s kinevezte %s -t AdminControllerré! Gratulálunk!!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_RED,\"Kineveztek AdminCOntrollerré!\");
                  JatekosInfo[id][AdminSzint] = 4100;
                  printf(\"uzenet\");
               }
               else if(JatekosInfo[playerid][AdminSzint] > 4100)
                  {
                      TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s lefokozta %s -t AdminControllerré\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_RED,\"Lefokoztak AdminControllerré\");
                  JatekosInfo[id][AdminSzint] = 4100;
                  printf(\"uzenet\");
               }
            }
            else MSG(playerid,COLOR_LIGHTRED,\"Õ most is AdminController.. Mi értelme lenne megint kinevezni õt AdminControllerré? Ejj te fiú :D\");
         }
         else if(!strcmp(param1, \"4555\", true))
          {
              if(JatekosInfo[playerid][AdminSzint] != 4555)
              {
                  if(JatekosInfo[playerid][AdminSzint] < 4555)
                  {
                              TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s kinevezte %s -t SzerverFelügyelõnek! Gratulálunk!!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_SZERVERFELUGYELO,\"Kineveztek SzerverFelügyelõ-nek\");
                  JatekosInfo[id][AdminSzint] = 4555;
                  printf(\"uzenet\");
               }
               else if(JatekosInfo[playerid][AdminSzint] > 4555)
                  {
                            TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s lefokozta %s -t SzerverFelügyelõvé\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_SZERVERFELUGYELO,\"Lefokoztak SzerverFelügyõnek\");
                  JatekosInfo[id][AdminSzint] = 4555;
                  printf(\"uzenet\");
               }
            }
            else MSG(playerid,COLOR_LIGHTRED,\"Õ monst is SzerverFelügyelõ.. Mi értelme lenne megint kinevezni õt SzerverFelügyelõvé? Ejj te fiú :D\");
         }
         else if(!strcmp(param1, \"5555\", true))
          {
              if(JatekosInfo[playerid][AdminSzint] != 5555)
              {
                  if(JatekosInfo[playerid][AdminSzint] < 5555)
                  {
                      TextDrawShowForPlayer(playerid,infovonal[playerid]);
                  new szoveg[128];
                  format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], JatekosInfo[playerid] [AdminSzint]);
                  TextDrawSetString(infovonal[playerid],szoveg);
                  TextDrawShowForPlayer(playerid, Box[playerid]);
                  TextDrawShowForPlayer(playerid, Ft[playerid]);
                   format(uzenet,sizeof(uzenet),\"%s kinevezte %s -t GameDiktátorrá! Gratulálunk!!\",nev,neve);
                  SendClientMessageToAll(COLOR_ORANGE,uzenet);
                  MSG(id,COLOR_GAMEDIKTATOR,\"Kineveztek GameDiktátorrá\");
                  JatekosInfo[id][AdminSzint] = 5555;
                  printf(\"uzenet\");
               }
            }
            else MSG(playerid,COLOR_LIGHTRED,\"Õ monst is GameDiktátor.. Mi értelme lenne megint kinevezni õt GameDiktátorrá? Ejj te fiú :D\");
         }
         else SendClientMessage(playerid,COLOR_LIGHTRED,\"Az adminszint csak <1,2,3,4,5,6,1337,1338,4096,4100,4555,5555> lehet!\");
      }
      else MSG(playerid,COLOR_LIGHTRED,\"Nincs ilyen játékos!\");
        }
    }
    else SendClientMessage(playerid,COLOR_LIGHTRED,\"Nem vagy rcon admin/Tulaj!\");
}
else SendClientMessage(playerid,COLOR_LIGHTRED,\"Nem vagy bejelentkezve!\");
return 1;
}
« Utoljára szerkesztve: 2014. Augusztus 28. - 19:11:49 írta Dfoglalo »

/makeadmin
« Válasz #1 Dátum: 2014. Augusztus 28. - 15:43:02 »
0 Show voters
Rengeteg, RENGETEG benne a pazarlás! Semmi dinamika...
Elvileg ha jól néztem ha \"5555\"ös adminszintet adsz neki, akkor jónak kell lennie. A baj az valószínûleg (lehet hogy csak elvannak csúszva a sorok és nem jól láttam) hogy rossz helyen van az
else return SendClientM.......

 tehát az üzenet kiírása..
Amúgy az RCONként való admin adást hülyeségnek tartom.. Mellesleg ezeket az extrém admin szinteket is -.- (5555)
Újraírtam az egészet, szerintem jóval átláthatóbb. SAMP-om jelenleg nincs, nem otthon vagyok, de a PAWNO nem jelzett rá hibát
Nagyon terjedelmes, de jóval átláthatóbb, kevesebb benne a pazarlás..
Javítottam a hibát, miszerint az infó vonalt a szintet adó játékosnak frissítette.. Remélem jó, mert nem 2perc volt.
Spoiler for Kód:


CMD:makeadmin(playerid,params[]) {
if(!Belepve(playerid)) return SendClientMessage(playerid,COLOR_LIGHTRED,\"Nem vagy bejelentkezve!\");
if(!IsPlayerAdmin(playerid) || !JatekosInfo[playerid][Tulaj]) return SendClientMessage(playerid,COLOR_LIGHTRED,\"Nem vagy rcon admin/Tulaj!\");
new kit,szint,n[24],n2[24],msg[128],rang[64];
if(sscanf(params,\"ui\",kit,szint)) return SendClientMessage(playerid,COLOR_LIGHTRED,\"Használat: /makeadmin [Player ID] [AdminSzint]\");
if(!IsPlayerConnected(kit)) return MSG(playerid,COLOR_LIGHTRED,\"Nincs ilyen játékos!\");
if(szint != 0 && szint != 1 &&szint != 0 && szint != 1 && szint != 2 && szint != 3 &&szint != 4 && szint != 5 &&szint != 6 && szint != 1337 && szint != 1338 && szint != 4096 && szint != 4100 && szint != 4555 && szint != 5555)
return SendClientMessage(playerid,COLOR_LIGHTRED,\"Az adminszint csak <0,1,2,3,4,5,6,1337,1338,4096,4100,4555,5555> lehet!\");
GetPlayerName(playerid,n,24);
GetPlayerName(kit,n2,24);
if(szint == JatekosInfo[playerid][AdminSzint]) {
    format(msg,128,\"Õ most is %d szintû!\",szint);
    return MSG(playerid,COLOR_LIGHTRED,msg);
}
switch(szint) {
    case 0: rang = \"Játékos\";
    case 1: rang = \"1-es szintû admin\";
    case 2: rang = \"2-es szintû admin\";
    case 3: rang = \"3-es szintû admin\";
    case 4: rang = \"4-es szintû admin\";
    case 5: rang = \"5-es szintû admin\";
case 6: rang = \"FõAdminSegéd\";
case 1337: rang = \"FõAdmin\";
case 1338: rang = \"SuperAdmin\";
case 4096: rang = \"AdminControllerSegéd\";
case 4100: rang = \"AdminController\";
case 4555: rang = \"SzerverFelügyelõ\";
case 5555: rang = \"GameDiktátor\"; //WTF??!
}
if(szint > JatekosInfo[kit][AdminSzint]) { // Kinevezés
    format(msg,128,\"%s kinevezte %s játékost. Rangja: %s\",n,n2,rang);
    SendClientMessageToAll(COLOR_ORANGE,msg);
        print(msg);
        format(msg,128,\"Bekerültél az AdminTeambe! Új rangod: %s. Gratulálok!\",rang);
        MSG(kit,COLOR_ORANGE,msg);
} else { // Lefokozás
format(msg,128,\"%s lefokozta %s játékost. Rangja: %s\",n,n2,rang);
    SendClientMessageToAll(COLOR_ORANGE,msg);
        print(msg);
        format(msg,128,\"Lefokoztak! Új rangod: %s\",rang);
        MSG(kit,COLOR_ORANGE,msg);
}
format(msg,128,\"Bank: %d | Szint: %d | Adminszint: %d\",JatekosInfo[kit][bank],JatekosInfo[kit][szint], JatekosInfo[kit][AdminSzint]);
    TextDrawSetString(infovonal[kit],msg);
        JatekosInfo[kit][AdminSzint] = szint;
return 1;
}
« Utoljára szerkesztve: 2014. Augusztus 28. - 19:14:37 írta Nukerdog »

Nem elérhető Erik3333

  • 945
  • SMF | phpBB | TS3 | PHP | HTML | CSS | JS | PAWN | JAVA
    • Profil megtekintése
/makeadmin
« Válasz #2 Dátum: 2014. Augusztus 28. - 18:55:43 »
0 Show voters
Nukerdog, szerintem az adminszint módosítását a kiírás után kellene rakni, mivel így elõtte frissíti és nem lesz kinevezés, csak lefokozás.

/makeadmin
« Válasz #3 Dátum: 2014. Augusztus 28. - 19:13:22 »
0 Show voters
Valóban. :D Ezért írtam, hogy nem teszteltem.
E: szerkesztettem
« Utoljára szerkesztve: 2014. Augusztus 28. - 19:14:59 írta Nukerdog »

Nem elérhető KrisT

  • 106
    • Profil megtekintése
/makeadmin
« Válasz #4 Dátum: 2014. Augusztus 29. - 12:20:58 »
0 Show voters
Hiba megvan.:

sscanf-nál nem kell hosszúságot megadni, így a változó param1-nek sem.


és if(param == 1) mûvelettel csináljuk, nem strcmp

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal