Jump to content

Recommended Posts

Posted

CMD:ad(playerid,params[]) {
    if(AdTimer[playerid] != 0) return SCM(playerid, COLOR_LGREEN, "Ai pus un anunt recent. Foloseste comanda /myad pentru a-l vedea.");
    new string[264],sendername[25],idx;
    if(PlayerInfo[playerid][pMuted] == 1) {
        format(string, sizeof(string), "You can't talk right now! You are muted. (%d seconds)",PlayerInfo[playerid][pMuteTime]);
        SendClientMessage(playerid, COLOR_GREY, string);
        return 1;
    }
    if(PlayerInfo[playerid][pLevel] < 5) return SendClientMessage(playerid, COLOR_GREY, "Ai nevoie de nivel 5 pentru a da un anunt!");
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new length = strlen(params);
    while ((idx < length) && (params[idx] <= ' ')) idx++;
    new offset = idx, result[264];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
        result[idx - offset] = params[idx];
        idx++;
    }
    result[idx - offset] = EOS;
    new totalads = TotalAds()+1;
    if(PlayerToPoint(10.0, playerid, 648.3226,-1357.3953,13.5709)) {
        if(!strlen(result)) return SendClientMessage(playerid, COLOR_GREY, "Usage: {FFFFFF}/ad <Text>");
        if(FaceReclama(result)) return Reclama(playerid, result);
        new payout = BizzInfo[14][bFee];
        if(GetPlayerCash(playerid) < payout) {
            format(string, sizeof(string), "* Ai folosit %d caractere si anuntul costa $%s, Nu ai banii necesari", offset, FormatNumber(payout));
            SendClientMessage(playerid, COLOR_WHITE, string);
            return 1;
        }
        GivePlayerCash(playerid, - payout);
        format(string, sizeof(string), "~r~Ai platit $%d~n~~w~Mesajul contine: %d caractere", payout, idx);
        GameTextForPlayer(playerid, string, 5000, 5);
        format(AdText[playerid], 256, result);

        format(string, sizeof(string), "Ad by %s ({FFFFFF}%d{00FF00}): %s", GetName(playerid), playerid, result);
        SendStaffMessage(0x00FF00FF, string);
        AdTimer[playerid] = totalads*60;
        new timer;
        timer = SetTimerEx("Advertisment", totalads*60000, 0, "d", playerid);
        SetPVarInt(playerid, "AdTimer", timer);
        format(string, sizeof(string), "Anuntul tau va fi afisat in %d minute (%d secunde).", AdTimer[playerid]/60, AdTimer[playerid]);
        SendClientMessage(playerid, -1, string);
        BizzInfo[14][bBalance] += payout;
        new str[128];
        format(str,128,"UPDATE bizz SET `Till`='%d',`Products`='%d' WHERE `ID`='1'",BizzInfo[14][bBalance],BizzInfo[14][bProducts]);
        mysql_query(SQL,str);
    }
    else SCM(playerid, -1, "Nu esti la CNN.");
    return 1;
}

function Advertisment(playerid) {
    if(IsPlayerConnected(playerid) && AdTimer[playerid] != 0) {
        new string[1024];
        format(string, sizeof(string), "Ad by %s (phone: {FFFFFF}%d{00FF00}): %s",GetName(playerid),PlayerInfo[playerid][pPhone],AdText[playerid]);
        SendMessage(0x00FF00FF, string);
        AdTimer[playerid] = 0;
    }
    return 1;
}

function TotalAds() {
    new x;
    foreach(Player, i) {
        if(IsPlayerConnected(i) && AdTimer != 0) x++;
    }
    return x;
}

 

Cand dau /ad imi scrie nu esti la cnn

sa-mp-000.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.