[Pomoc] /unban


Započeo Woo, Januar 24, 2012, 23:26:41 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Woo

*

Skripta: CL
Problem: Ne znam kako namjestiti unban.. imaju dvije komande unban i aunlock ni jedna ne radi... jel imo neko isti problem??????

dio skripte:
Citatif(strcmp(cmd, "/ban", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
           new playersip[64];
          tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /ban [ID Igraca/Dio Imena] [razlog]");
            return 1;
         }
         giveplayerid = ReturnUser(tmp);
         if (PlayerInfo[playerid][pAdmin] >= 1)
         {
             if(IsPlayerConnected(giveplayerid))
             {
               if(PlayerInfo[giveplayerid][pAdmin] >= 1338)
               {
                  SendClientMessage(playerid, COLOR_WHITE, ""COL_RED" Pokusaj Bana Admina veceg levela nije uspjelo!");
                  return 1;
               }
                 if(giveplayerid != INVALID_PLAYER_ID)
                 {
                   GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                  GetPlayerName(playerid, sendername, sizeof(sendername));
                  GetPlayerIp(giveplayerid,playersip,sizeof(playersip));
                  new length = strlen(cmdtext);
                  while ((idx < length) && (cmdtext[idx] <= ' '))
                  {
                     idx++;
                  }
                  new offset = idx;
                  new result[128];
                  while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                  {
                     result[idx - offset] = cmdtext[idx];
                     idx++;
                  }
                  result[idx - offset] = EOS;
                  if(!strlen(result))
                  {
                     SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /ban [ID Igraca/Dio Imena] [razlog]");
                     return 1;
                  }
                  new y, m, d;
                  new h,mi,s;
                  getdate(y,m,d);
                  gettime(h,mi,s);
                  SendClientMessage(giveplayerid,COLOR_NICERED, "{DB1414}____________________________________________________________________________________");
                  SendClientMessage(giveplayerid,COLOR_NICERED, "{DB1414}____________________________________________________________________________________");
                  |",giveplayer,giveplayerid,PlayerInfo[giveplayerid][pLevel],d,m,y,result);
                  PorukaAdminima(NICERED,string,1);
                  format(string, sizeof(string), "{DB1414}Ban | %s | Admin: %s", giveplayer, sendername);
                  SendClientMessageToAll(NICERED, string);
                  PlayerInfo[giveplayerid][pLocked] = 1;
                  Kick(giveplayerid);
                  return 1;
               }
            }//not connected
         }
         else
         {
            format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
            SendClientMessage(playerid, COLOR_GRAD1, string);
         }
      }
      return 1;
   }
Ovo je znaci komanda bana... i ona zakljuca accc neciji...

Unban:
Citatif (strcmp(cmd, "/unban", true)==0)
   {
       if((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] == 1338)
       {
           tmp = strtok(cmdtext, idx);
           if(!strlen(tmp))
         {
              SendClientMessage(playerid, COLOR_WHITE, "Koristi: /unban [Ime_Prezime]");
               return 1;
          }
          GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
          GetPlayerName(playerid, sendername, sizeof(giveplayer));
          format(string, 256, "|UnBan| %s je unbanovao %s-a", sendername, tmp);
          PorukaAdminima(COLOR_YELLOW,string,1);
         format(string,sizeof(string),"%s.ini",tmp);
         fremove(string);
         SendClientMessage(playerid, COLOR_WHITE, "Igrac uspjesno je unbanovan!");
         SendRconCommand(string);
         SendRconCommand("reloadbans");
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
         GetPlayerName(playerid, sendername, sizeof(sendername));
         PlayerInfo[giveplayerid][pLocked] = 0;
      }
      return 1;
   }

/aunlock:
Citatif(strcmp(cmd, "/aunlock", true) == 0)
   {
      if (PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pGameSage] >= 4)
      {
         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /aunlock [ID Igraca/Dio Imena]");
            return 1;
         }
         giveplayerid = ReturnUser(tmp);
         if(IsPlayerConnected(giveplayerid))
         {
             if(giveplayerid != INVALID_PLAYER_ID)
             {
                 if(PlayerInfo[giveplayerid][pLocked] == 1)
                 {
                     PlayerInfo[giveplayerid][pLocked] = 0;
                     TogglePlayerControllable(giveplayerid, 1);
                     SendClientMessage(playerid, COLOR_YELLOW, "Account je uspjesno otkljucan.");

                 }
             }
         }
      }
      else
      {
         SendClientMessage(playerid, COLOR_GRAD1, "Morate biti barem admin lvl 3 za Koristi ove komande.");
      }
      return 1;
   }

pa nemoj koristiti PlayerInfo[giveplayerid][pLocked] ako poslje brises datoteku sa banom :D
Europe Gaming Rol3Play
IP: 176.57.128.4:7793

Woo

*


format(string,sizeof(string),"%s.ini",tmp);
         fremove(string);


Koliko se ja kuzim on tebi obrise cijeli acc xD Samo commaj ili obrisi ovo gore navedeno..
Izrada web aplikacija/desktop aplikacija, kontakt PM.
VPS/Dedi managment 'n' hosting @pm also.

Woo

*

pa kako da napravim da mi ga samo zakljuca?????