Jump to content

Question

Posted

cand dau /ad pe server scriu acolo /ad Recrutez in clanul .... nu apare ad pe server apare la staff Preview ad dar pe server la playerii nu apare
Aceasta este comanda

YCMD:ad(playerid, params[], help) {
    if(AdTimer[playerid] != 0) return SCM(playerid, COLOR_LGREEN, "Ai pus un anunt recent. Foloseste comanda /myad pentru a-l vedea.");
    new string[264],idx;
    if(!PlayerInfo[playerid][pPhone]) return SCM(playerid, COLOR_LGREEN, "Nu ai un telefon.");
    if(PlayerInfo[playerid][pMuted] == 1) {
        format(string, sizeof(string), "You can't talk right now! You are muted. (%d seconds)",PlayerInfo[playerid][pMuteTime]);
        SCM(playerid, COLOR_GREY, string);
        return true;
    }
    if(PlayerInfo[playerid][pLevel] < 5) return SCM(playerid, COLOR_GREY, "Ai nevoie de nivel 5 pentru a da un anunt!");
    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, playerid, BizzInfo[11][bEntranceX], BizzInfo[11][bEntranceY], BizzInfo[11][bEntranceZ])) {
        if(!strlen(result)) return SCM(playerid, COLOR_GREY, "Usage:{FFFFFF}/ad <Text>");
        if(FaceReclama(result)) return Reclama(playerid, result);
        new payout = BizzInfo[14][bFee];
        if(PlayerMoney(playerid, payout)) {
            format(string, sizeof(string), "* Ai folosit %d caractere si anuntul costa $%s, Nu ai banii necesari", offset, FormatNumbers(payout));
            SCM(playerid, COLOR_WHITE, string);
            return true;
        }
        GivePlayerCash(playerid, 0, 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), "[PREV AD] %s ({FFFFFF}%d{00D900}): %s", GetName(playerid), playerid, result);
        SendStaffMessage(0xDE1414FF, 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]);
        SCM(playerid, -1, string);
        BizzInfo[14][bBalance] += payout;
        new str[128];
        mysql_format(SQL,str,128,"UPDATE bizz SET `Till`='%d',`Products`='%d' WHERE `ID`='1'",BizzInfo[14][bBalance],BizzInfo[14][bProducts]);
        mysql_tquery(SQL,str, "", "");
    }
    else SCM(playerid, -1, "Nu esti la CNN.");
    return true;
}

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

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

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.