Jump to content
  • 0

ajutor?


Shad0wdpbgd

Question

am o comanda de banoffline si daca o folosesc efectiv imi zice server unknown command, nu mai inteleg nimic, am incercat tot ce se putea incerca...

YCMD:banoffline(playerid, params[], help)
{
    if(!PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_LGREEN, "You are not an admin!");

    if(GetPVarInt(playerid, "ban_cooldown") > gettime()) return va_SendClientMessage(playerid, COLOR_WHITE, "* Mai trebuie sa astepti %d secunde pentru a folosi iar aceasta comanda.", (GetPVarInt(playerid, "ban_cooldown") - gettime()));

    new name[MAX_PLAYER_NAME], days, reason[64];
    if(sscanf(params, "s[24]ds[64]", name, days, reason)) return SendClientMessage(playerid, COLOR_WHITE, "{CECECE}USAGE: {FFFFFF}/banoffline <name> <days (0 = permanent)> <reason>");

    foreach(new i : Player)
    {
        if(strmatch(GetNameEx(i), name))
        {
            return SendClientMessage(playerid, COLOR_GREY, "This player is online.");
        }
    }

    gQuery[0] = (EOS);
    inline banofflinePlayer()
    {
        if(!cache_num_rows()) return SendClientMessage(playerid, COLOR_GREY, "Nu exista un cont in baza de date cu acest nume.");

        new playerID = cache_get_value_name(0, "ID", gQuery); (cred ca aici e problema, am r41-4 si nu prea ma pricep)

        inline altinline()
        {
            if(cache_num_rows()) return SendClientMessage(playerid, COLOR_GREY, "Acest jucator este deja banat.");

            if(days > 0)
            {
                va_SendClientMessageToAll(COLOR_LIGHTRED, "AdmCmd: %s (offline) has been banned for %d days by admin %s, reason: %s", name, days, GetNameEx(playerid), reason);
            }
            else
            {
                va_SendClientMessageToAll(COLOR_LIGHTRED, "AdmCmd: %s (offline) has been permanently banned by admin %s, reason: %s", name, GetNameEx(playerid), reason);
            }

            gQuery[0] = (EOS);
            mysql_format(SQL, gQuery, 256, "INSERT INTO `server_bans` (PlayerName, PlayerID, AdminName, AdminID, Reason, Date, Days, Permanent) VALUES ('%s', '%d', '%s', '%d', '%s', '%s', '%d', '%d')", name, playerID, GetNameEx(playerid), PlayerInfo[playerid][pSQLID], reason, GetDateTime(), (days == 0) ? (0) : (gettime() + (days * 86400)), (days == 0) ? (1) : (0));
            mysql_pquery(SQL, gQuery);

            SetPVarInt(playerid, "ban_cooldown", (gettime() + 60));
            return 1;            
        }
        mysql_format(SQL, gQuery, 256, "SELECT * FROM `server_bans` WHERE `PlayerName` = '%s' AND `Active` = '1' LIMIT 1", name);
        MySQL_PQueryInline(SQL, using inline altinline, gQuery, "");
        return 1;
    }

    mysql_format(SQL, gQuery, 256, "SELECT * FROM `users` WHERE `Name` = '%s' LIMIT 1", name);
    MySQL_PQueryInline(SQL, banofflinePlayer, gQuery, "");    
    return 1;
}
 

daca poate sa ma ajute cineva, multumesc

Link to comment
Share on other sites

Recommended Posts

  • 0

In acest caz vin cu propunerea de a reface comanda bucatica cu bucatica. Acel if pentru admin level? O bucatica , acel ban cooldown o alta. Si testezi dupa fiecare adaugare si vezi eventual dupa ce bucatica de cod iti da unknown command , alta idee nu mai am

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.