Pomoc

Započeo Fr0z3n, April 28, 2020, 02:18:58 PRE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Problem(error/warning): E ovako, kako da napravim da kada se daju oglasi sa mora da prodje 1 minut jer ovako spamaju non stop sa oglasima?
Deo skripte:[pawn]YCMD:smsadvertise(playerid,params[],help)
{
   #pragma unused help
   if(UlogovanIgrac[playerid] == 0 || PI[playerid][pReg] == 0) return Error(playerid, "Nisi ulogovan/a ili nisi registrovan/a!");
    if(PI[playerid][pAdmin] < 1 && ACCmd[playerid] == 1) return Error(playerid, "Radi spama, komande se mogu pisati svake dvije sekunde.");
   ACCmd[playerid] = gettime()+2;
   #pragma unused params
    if(IsPlayerAFK(playerid)) return Error(playerid, "Ne mozete dok ste afk!");
   if(IsPlayerConnected(playerid))
     {
         new string[500], string2[500], string3[500];
         if(UlogovanIgrac[playerid] == 0) return Error(playerid, "{FF584C}[BE-AC]: Nisi ulogovan.");
         if(PI[playerid][pJailed] > 0) return Error(playerid, "{FF584C}[BE-AC]: Ne mozes to!");
         if(PI[playerid][pMute] == 1) return Error(playerid, "{FF584C}[BE-AC]: Ne mozes to, ucutkan si.");
         if(PI[playerid][pTogPhone] == 1) return Error(playerid, "{FF584C}[BE-AC]: Prvo upali telefon!");
         if(Zavezan[playerid] > 0 || Tazovan[playerid] > 0 || Tie[playerid] > 0) return Error(playerid, "{FF584C}[BE-AC]: Ne mozete to dok ste zavezani/sokirani! (zbog psovanja)");
       if(kLol[playerid] > 0) return Error(playerid, "{FF584C}[BE-AC]: Ne mozete to!");
         if(TV[playerid] == 1) return Error(playerid, "{FF584C}[BE-AC]: Gledas tv, ne mozes to!");
         if(AM[0][amAdvert] == 0) return Error(playerid, "{FF584C}[BE-AC]: Oglasi su trenutno onemoguceni.");
        if(PI[playerid][pLevel] < 4) return Error(playerid, "{FF584C}[BE-AC]: Moras biti level 4+.");
        if(PI[playerid][pMobilni] < 1) return Error(playerid, "{FF584C}[BE-AC]: Nemas mobilni telefon.");
      if(PI[playerid][pAdBlock] == 1)
      {
          new eeks[128];
          format(eeks, 128, "Imas zabranu oglasa jos %s!", KonvertujVremeAB(PI[playerid][pABTime]));
          Error(playerid, eeks);
          return true;
      }
      new text[256];
      if(sscanf(params, "s[256]", text)) return Cmd(playerid, "(/smsad)vertise - /smsoglas (tekst)");
      if(strlen(text) < 5) return Error(playerid, "Ne moze manje od 5 ili vise od 128 slova!");
      if(strlen(text) > 128) return Error(playerid, "Ne moze manje od 5 ili vise od 128 slova!");
      new is1=0;
      new r=0;
      while(strlen(text[is1]))
      {
         if('0'<=text[is1]<='9')
         {
            new is2=is1+1;
            new p=0;
            while(p==0)
            {
               if('0'<=text[is2]<='9'&&strlen(text[is2])) is2++;
               else
               {
                  strmid(strR[r],text,is1,is2,255);
                  if(strval(strR[r])<255) r++;
                  is1=is2;
                  p=1;
               }
            }
         }
         is1++;
      }
      if(r>=4)
      {
         new spamstr[200];
         new namespamer[MPN];
         GetPlayerName(playerid, namespamer, sizeof(namespamer));
         format(spamstr,sizeof(spamstr), "{1A94E6}[WARNING] AD: %s (ID: %d), %s", namespamer, playerid, text);
         LVACW(ZUTA, spamstr, 1);
         for(new z=0;z<r;z++)
         {
            new pr2;
            while((pr2=strfind(text,strR[z],true))!=-1) for(new i=pr2,j=pr2+strlen(strR[z]);i<j;i++) text='*';
            SCM(playerid, SIVA, "{1A94E6}ADVERTISING[?]: {FFFFFF}Pokusao si da reklamiras, prijavljen si svim online Admin-ima!");
            return true;
         }
      }
      if( strfind( text, "kurac", true ) != -1 || strfind( text, "picka", true ) != -1 || strfind( text, "pièka", true ) != -1 ||
      strfind( text, "sranje", true ) != -1 || strfind( text, "govno", true ) != -1 || strfind( text, "balavac", true ) != -1 ||
      strfind( text, "isus", true ) != -1 || strfind( text, "jebem", true ) != -1)
      {
          Error(playerid, "Ne smes koristiti pogrdne reci!");
          return true;
      }
      new tmphour;
      gettime(tmphour);
       if(((tmphour >= 03) && (tmphour <= 08)) && PI[playerid][pAdmin] < 6) return Error(playerid, "Ne mozete tokom ovog doba stavljati oglas!");
       //if(FI[UsaoFirma[playerid]][fProizvodi] <= 0) return Error(playerid, "Nema vise proizvoda u ovoj firmi!");
      //if(FI[UsaoFirma[playerid]][fImaVlasnika] == 1) if(PI[playerid][pLevel] > 1) FI[UsaoFirma[playerid]][fProizvodi]--;
      PI[playerid][pMobKredit] -= 1000;
      /*SCMTA(ZUTA, "============= OGLAS =============");
      format(string, sizeof(string), "{00CED1}Napisao: {C3C3C3}%s {FFFFFF}| {00CED1}Kontakt: {C3C3C3}%d", GetName(playerid), PI[playerid][pMobilni]);
      SCMTA(ZUTA,string);
      format(string, sizeof(string), "{00CED1}Tekst: {C3C3C3}%s", text);
      SCMTA(ZUTA,string);
      SCMTA(ZUTA,"=================================");*/
      if(strlen(text) > 64)
         {
         new result2[500];
            strmid(result2, text, 64, strlen(text));
            strdel(text, 64, strlen(text));
            format(string, sizeof(string), "{498C12}[OGLAS] {4588F5}%s ...", text);
            format(string2, sizeof(string2), "{4588F5}... %s", result2);
            format(string3, sizeof(string3), "{498C12}- Kontakt: {4588F5}%s {498C12}/ Telefon: {4588F5}%d", GetName(playerid), PI[playerid][pMobilni]);
         SCMTAAD(0x00CED1FF,string);
         SCMTAAD(0x21DD00FF,string2);
         SCMTAAD(0x00CED1FF,string3);
      }
      else
      {
         format(string, sizeof(string), "{498C12}[OGLAS] {4588F5}%s", text);
            format(string3, sizeof(string3), "{498C12}- Kontakt: {4588F5}%s {498C12}/ Telefon: {4588F5}%d", GetName(playerid), PI[playerid][pMobilni]);
         SCMTAAD(0x00CED1FF,string);
            SCMTAAD(0x00CED1FF,string3);
      }
      new bond[128];
      format(bond, sizeof(bond), "~r~-400 kredita~n~~b~%d slova", strlen(text));
      GameTextForPlayer(playerid, bond, 5000, 1);
      if (PI[playerid][pAdmin] < 1 && PI[playerid][pGM] < 1 && PI[playerid][pHelper] < 1)
      {
         SetTimer("AdOpet", 60000, 0);
         ad = 1;
      }
      new krki[128];
      format(krki, 128, "[sms] %s, %s, %d", text, GetName(playerid), PI[playerid][pMobilni]);
      OglasnikUpdate(krki);
   }
   return true;
}[/pawn]
Poslednja Izmena: April 28, 2020, 03:16:01 PRE PODNE od daddy.

[pawn]new OglasVreme[MAX_PLAYERS];
   
// OnPlayerConnect:
OglasVreme[playerid] = 0;

// U komandi:
if(gettime() - OglasVreme[playerid] < 60) return SendClientMessage(playerid, -1, "Oglase mozes davati na svakih 1min!");
// Nakon sto da oglas:
OglasVreme[playerid] = gettime();[/pawn]

Citat: V01D poslato April 28, 2020, 02:21:49 PRE PODNE
[pawn]new OglasVreme[MAX_PLAYERS];
   
// OnPlayerConnect:
OglasVreme[playerid] = 0;

// U komandi:
if(gettime() - OglasVreme[playerid] < 60) return SendClientMessage(playerid, -1, "Oglase mozes davati na svakih 1min!");
// Nakon sto da oglas:
OglasVreme[playerid] = gettime();[/pawn]

Gde tacno da stavim ovo
[pawn]// Nakon sto da oglas:
OglasVreme[playerid] = gettime();[/pawn]

Citat: Fr0z3n poslato April 28, 2020, 02:27:49 PRE PODNE
Gde tacno da stavim ovo
[pawn]// Nakon sto da oglas:
OglasVreme[playerid] = gettime();[/pawn]
Iznad ovog
if(strlen(text) > 64)