Jump to content

Tutorial text lung


AGaaA

Recommended Posts

    if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You havent logged in yet !");
                return 1;
            }
            if(PlayerInfo[playerid][pLevel] < 2)
            {
                SendClientMessage(playerid, COLOR_GREY, "[Eroare]: Trebuie sa ai level 2 pentru a putea folosi comanda! !");
                return 1;
            }
            if(!PlayerToPoint(3.0,playerid,27.9149,33.9727,1000.0859))
            {
                SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at Advertise studio !");
                return 1;
            }
            if(PlayerInfo[playerid][pAD] == 1)
            {
                SendClientMessage(playerid, TEAM_CYAN_COLOR, "[Eroare]: Esti banat pe /ad , data viitoare ai grija ce /ad dai.");
                return 1;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(DetectSPAM(result)) /// Anti-Reclama2
            {
                new advertiser[MAX_PLAYER_NAME];
                GetPlayerName(playerid, advertiser, sizeof(advertiser));
                format(string, sizeof(string), "[i-Bot]: %s was silenced 10 minute(s), reason: [Server Advertising]",advertiser);
                SendClientMessageToAll(COLOR_LIGHTRED,string);
                PlayerInfo[playerid][pMuted] = 1;
                PlayerInfo[playerid][pMuteTime] = 10*60;
                KickLog(string);
                 return 1;
             }
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: (/ad)vertise [advert text]");
                return 1;
                }
            if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
            {
                format(string, sizeof(string), "[ERROR]: Please try again later %d seconds between Advertisements !",  (addtimer/1000));
                SendClientMessage(playerid, COLOR_GRAD2, string);
                return 1;
                
            }
            new payout = idx * 500;
            if(GetPlayerMoney(playerid) < payout)
            {
                format(string, sizeof(string), "[Eroare]: You used %d characters which cost %s, you don't have enough.", offset, DecimalPoint(payout));
                SendClientMessage(playerid, COLOR_WHITE, string);
                return 1;
            }
            GivePlayerMoney(playerid, - payout);
            SBizzInfo[7][sbTill] += payout;
            ExtortionSBiz(7, payout/2);
            format(string, sizeof(string), "[Advert] %s, Phone: %d, Name: %s",  result, PlayerInfo[playerid][pPnumber], sendername);
            OOCNews(TEAM_GROVE_COLOR,string);
            format(string, sizeof(string), "~r~Paid %s~n~~w~Message contained: %d Characters", DecimalPoint(payout), idx);
            GameTextForPlayer(playerid, string, 5000, 1);
            if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
        }
        return 1;
    }

Link to comment
Share on other sites

incearca sa pui mai mult la  new result[64];

De exemplu, la mine am pus 112, pentru ca adunat cu ce caractere mai vin inainte de anunt, se fac cat e maximul de caractere pe un rand(144).

Nu mai deschideti in pu*a mea servere de SA:MP !

Jucati-va pe cele care sunt !   Sunt suficiente !

Reguli de bun simt:

1. Nu faceti reclama unde nu trebuie !

2. Nu injurati ca la usa cortului !

3. Daca esti analfabeti, taci din gura !

4. Nu abuza de 'scuze', 'din greseala' !

 

My work ::: http://pastebin.com/VRNRcaAs

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.