Jump to content
  • 0

Problema billboards (la expirarea billboard-ului nu seteaza variabila Billboard 0 jucatorului offline)


Question

Posted (edited)

salutare,

Cine ma poate ajuta si pe mine, cand expira billboard-ul nu seteaza jucatorului offline variabila Billboard pe 0

 

Cod: 

function ScadeTimpBillboard() {
    new query[248];
    for(new i = 0; i < MAX_BILLBOARDS; i++) {
        if(Billboard[i][blOwned] > 0) {
            if(Billboard[i][blExpire] > 0) {
                Billboard[i][blExpire] -= 60;
                UpdateLabelBillboard(i);

                mysql_format(SQL, query, sizeof(query), "UPDATE `billboards` SET `expire`='%d' WHERE `ID`='%d'", Billboard[i][blExpire], i);
                mysql_tquery(SQL, query, "", "");
                
                if(Billboard[i][blExpire] <= 0) {

                  

                    ---- > AICI (la ownerbill) <---

                     new ownerbill[64];
                    cache_get_field_content( 0, "blOwner", ownerbill, SQL, 64);
                    mysql_format(SQL, query, sizeof query, "UPDATE `users` SET `Billboard` = '0' WHERE `Username` = '%s'", ownerbill);
                    mysql_tquery(SQL, query, "", "" );

                    Billboard[i][blOwned] = 0;
                    Billboard[i][blPhone] = 0;
                    Billboard[i][blExpire] = 0;
                    format(Billboard[i][blOwner],25,"AdmBot");
                    format(Billboard[i][blFont],25,"Arial");
                    format(Billboard[i][blMessage],32,"Your advertisment here!");
                    mysql_format(SQL,query,248,"UPDATE `billboards` SET `blFont`='Arial',`blOwned`='0',`blOwner`='AdmBot',`blPhone`='0',`blMessage`='Your advertisment here!',`expire`='0' WHERE `ID` = '%d' LIMIT 1",Billboard[i][blID]);
                    mysql_tquery(SQL,query,"","");
                    SetDynamicObjectMaterialText(Billboard[i][blObjectID],0,Billboard[i][blMessage], OBJECT_MATERIAL_SIZE_256x128,Billboard[i][blFont], 18, 0, 0xFF000000, 0xFFFFFFFF, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
                    UpdateLabelBillboard(i);
                } 
            }
        }
    }
    return 1;
}

Edited by cstef4n

2 answers to this question

Recommended Posts

  • 0
Posted
function ScadeTimpBillboard() {
    new query[248];
    for(new i = 0; i < MAX_BILLBOARDS; i++) {
        if(Billboard[i][blOwned] > 0) {
            if(Billboard[i][blExpire] > 0) {
                Billboard[i][blExpire] -= 60;
                UpdateLabelBillboard(i);

                mysql_format(SQL, query, sizeof(query), "UPDATE `billboards` SET `expire`='%d' WHERE `ID`='%d'", Billboard[i][blExpire], i);
                mysql_tquery(SQL, query, "", "");
                
                if(Billboard[i][blExpire] <= 0) {

                    mysql_format(SQL, query, sizeof(query), "UPDATE `users` SET `Billboard` = '0' WHERE `Username` = '%s'", Billboard[i][blOwner]);
                    mysql_tquery(SQL, query, "", "" );

                    Billboard[i][blOwned] = 0;
                    Billboard[i][blPhone] = 0;
                    Billboard[i][blExpire] = 0;
                    format(Billboard[i][blOwner],25,"AdmBot");
                    format(Billboard[i][blFont],25,"Arial");
                    format(Billboard[i][blMessage],32,"Your advertisement here!");
                    mysql_format(SQL,query,248,"UPDATE `billboards` SET `blFont`='Arial',`blOwned`='0',`blOwner`='AdmBot',`blPhone`='0',`blMessage`='Your advertisement here!',`expire`='0' WHERE `ID` = '%d' LIMIT 1",Billboard[i][blID]);
                    mysql_tquery(SQL,query,"","");
                    SetDynamicObjectMaterialText(Billboard[i][blObjectID],0,Billboard[i][blMessage], OBJECT_MATERIAL_SIZE_256x128,Billboard[i][blFont], 18, 0, 0xFF000000, 0xFFFFFFFF, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
                    UpdateLabelBillboard(i);
                } 
            }
        }
    }
    return 1;
}

Poftim

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.