Jump to content
  • 0

problema comanda /ad


Mihai94TDI

Question

va salut, care este problema la aceasta 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[14][bEntranceX], BizzInfo[14][bEntranceY], BizzInfo[14][bEntranceZ])) {
        if(!strlen(result)) return SCM(playerid, COLOR_GREY, "Syntax: {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), "(Preview ad) %s ({FFFFFF}%d{00D900}): %s", GetName(playerid), playerid, result);
        SendStaffMessage(0x00D900FF, 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;
}

 

nu pot plasa nici un anunt la cnn,  ma duc la cnn si dau /ad text si imi zice Nu esti la CNN.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Coordonatele nu sunt puse bine, din cate vad eu aici CNN-ul este la Biz-ul 14, daca nu este acesta CNN-ul modifica ID-ul  mysql_format(SQL,str,128,"UPDATE bizz SET `Till`='%d',`Products`='%d' WHERE `ID`='1'",BizzInfo         [14        ] [bBalance],BizzInfo[                                       14                              ][bProducts]); cu alt biz de tip CNN.

Link to comment
Share on other sites

  • 0
Acum 1 oră, Mihai94TDI a spus:

va salut, care este problema la aceasta 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[14][bEntranceX], BizzInfo[14][bEntranceY], BizzInfo[14][bEntranceZ])) {
        if(!strlen(result)) return SCM(playerid, COLOR_GREY, "Syntax: {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), "(Preview ad) %s ({FFFFFF}%d{00D900}): %s", GetName(playerid), playerid, result);
        SendStaffMessage(0x00D900FF, 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;
}

 

nu pot plasa nici un anunt la cnn,  ma duc la cnn si dau /ad text si imi zice Nu esti la CNN.

Comanda este facuta sa fie folosita la biz-ul de tip CNN, adica biz cu id 14.

Probabil tu ai incercat sa creezi alt biz, si nu ai specificat si lucrul asta.

Link to comment
Share on other sites

  • 0

asta e comanda de /createbiz direct din joc

YCMD:createbiz(playerid, params[], help) {
    if(PlayerInfo[playerid][pScripter] < 1) return true;
    new type, value, level;
    if(sscanf(params, "iii", type, value, level)) {
        SCM(playerid, COLOR_GREY, "Syntax: {FFFFFF}/createbiz <type> <value> <level>");
        SCM(playerid, -1, "Types: Banca (1), Gun Shop (2), Club (3), Restaurant (4), Sex shop (5), 24/7 (6), Binco (7), Burger (8), Casino (9)");
        SCM(playerid, -1, "CNN (10), Rent Car (11), Gas Station (17), PNS (19), Pizza (21), Shop Fish (23)");
        return true;
    }
    if(type > 10 && type < 17 || type == 20 || type == 22 || type > 23 || type < 1) return SCM(playerid, COLOR_GREY, "Invalid type!");
    GetPlayerPos(playerid, pPos[playerid][0], pPos[playerid][1], pPos[playerid][2]);

    new biz = BizWithType(type);
    gQuery[0] = EOS;
    mysql_format(SQL, gQuery, sizeof(gQuery), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`, `Static`) VALUES ('%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d', '%d', '%d', '%d')",
    pPos[playerid][0], pPos[playerid][1], pPos[playerid][2], BizzInfo[biz][bExitX], BizzInfo[biz][bExitY], BizzInfo[biz][bExitZ], level, value, type, BizzInfo[biz][bInterior], BizzInfo[biz][bStatic]);
    mysql_tquery(SQL, gQuery, "InsertBizz", "iiiii", playerid, biz, level, value, type);
    bussines++;
    return true;
}

 

eu doar aleg locatia  dau /createbiz in jos si se face automat.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.