Only 1 BAN within 5 seconds
#1

Hey could someone help me out? Could someone remake this code so an administrator could ban only once per 5 seconds?

Код:
if(!strcmp(cmdtext, "/ban", true,4))
  {
    new vardas[MAX_PLAYER_NAME],prz[128];
   strmid(vardas,GetArgument(1, cmdtext,0),0,MAX_PLAYER_NAME);
   if(!strcmp(vardas, "0", true) ){SendClientMessage(playerid, BLUE, "* Baninti zaideja: /ban [dalis vardo] [priezastis]"); return 1;}
   new id = GetPlayeridMid(vardas);
   if (id == INVALID_PLAYER_ID){ SendClientMessage(playerid, RED, "* Tokio zaidejo nera"); return 1;}
   if (playerDB[id][superadmin]){ SendClientMessage(playerid, RED, "* Administratoriaus uzbaninti negalima."); return 1;}
   if(playerDB[id][authstate]==0){SendClientMessage(playerid,GREY,"* MPG: Tokio zaidejo Nera"); return 1;}

            strmid(prz,GetArgument(2, cmdtext,true),0,128);
   if(!strcmp(prz, "0", true) ){SendClientMessage(playerid, RED, "* Pamirsote nurodyti priezasti."); return 1;}

            new msg[128],adminname[MAX_PLAYER_NAME];
      GetPlayerName(id,vardas,sizeof(vardas));
      GetPlayerName(playerid,adminname,sizeof(adminname));

           format(msg,sizeof(msg),"[BAN] %s uzblokavo jus: %s",adminname,prz);
      SendClientMessage(id,BLUE,msg);
   BanEx(id,prz);
   dini_Set(banfailas, vardas, prz);
      format(msg,sizeof(msg),"[BAN] %s uzblokavo %s serveryje (%s).",adminname,vardas,prz);
   SendClientMessageToAll(BLUE,msg);
   return 1;
  }
Reply
#2

Look at this topic https://sampforum.blast.hk/showthread.php?tid=200331, he had the same problem But you will find the information there. If not, pm me and i will help you
Reply
#3

Ok it worked, thanks.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)