Jump to content
  • 0

sistem de setadmin eroare


Emilian

Question

RPG SERVER\gamemodes\emi.pwn(526) : error 029: invalid expression, assumed zero
RPG SERVER\gamemodes\emi.pwn(526) : warning 217: loose indentation
RPG SERVER\gamemodes\emi.pwn(526) : warning 215: expression has no effect
RPG SERVER\gamemodes\emi.pwn(526) : error 001: expected token: ";", but found ")"
RPG SERVER\gamemodes\emi.pwn(526) : error 029: invalid expression, assumed zero
RPG SERVER\gamemodes\emi.pwn(526) : fatal error 107: too many error messages on one line

Linie : 

YCMD:setadmin(playerid, params[], help)
{
    if(PlayerInfo[playerid][pAdmin] < 7)
        return SCM(playerid, COLOR_EROARE, "* Eroare: Nu esti autorizat sa folosesti aceasta comanda.");

    new userID, level;
    if(sscanf(params, "ud", userID, level))
        return SCM(playerid, COLOR_SERVER, "Syntax: {AFAFAF}/setadmin <ID/Nume> <Admin level>");

    if(!IsPlayerLogged(userID))
        return SCM(playerid, COLOR_EROARE, "* Eroare: Acest jucator nu este conectat.");

    if(level < 0 || level > 7)
        return SCM(playerid, COLOR_EROARE, "* Eroare: Acest nivel de admin este invalid (0-7).");

    if(PlayerInfo[userID][pAdmin] == level)
        return SCM(playerid, COLOR_EROARE, "* Eroare: Acest jucator are deja acest nivel de admin.");

    if(level == 0)
    {
        if(Iter_Contains(ServerAdmins, userID))
            Iter_Remove(ServerAdmins, userID);
    }
    else
    {
        if(!Iter_Contains(ServerAdmins, userID))
            Iter_Add(ServerAdmins, userID);
    }

    PlayerInfo[userID][pAdmin] = level;
    mysqlQuery("UPDATE `server_accounts` SET `Admin` = '%d' WHERE `ID` = '%d'", PlayerInfo[userID][pAdmin], PlayerInfo[userID][pSQLID]);

    SCM(playerid, COLOR_LIME, "Admin %s ti-a setat admin level %d.", GetPlayerNameEx(playerid), level);
    SendStaff(COLOR_LIME, "AdmCmd: {AFAFAF}Admin %s i-a setat admin %d lui %s.", GetPlayerName(playerid), level, GetPlayerNameEx(userID));
    return true;
}

Detalii: 
asa face mereu cand fac asa:
if(PlayerInfo[playerid][pAdmin])
     return SCM(playerid, COLOR_EROARE, "Mesaj");

ma chinui de ieri sa rezolv, va rog ajutati-ma.

Edited by Emilian
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
Acum 1 oră, Emilian a spus:

RPG SERVER\gamemodes\emi.pwn(526) : error 029: invalid expression, assumed zero
RPG SERVER\gamemodes\emi.pwn(526) : warning 217: loose indentation
RPG SERVER\gamemodes\emi.pwn(526) : warning 215: expression has no effect
RPG SERVER\gamemodes\emi.pwn(526) : error 001: expected token: ";", but found ")"
RPG SERVER\gamemodes\emi.pwn(526) : error 029: invalid expression, assumed zero
RPG SERVER\gamemodes\emi.pwn(526) : fatal error 107: too many error messages on one line

Linie : 

YCMD:setadmin(playerid, params[], help)
{
    if(PlayerInfo[playerid][pAdmin] < 7)
        return SCM(playerid, COLOR_EROARE, "* Eroare: Nu esti autorizat sa folosesti aceasta comanda.");

    new userID, level;
    if(sscanf(params, "ud", userID, level))
        return SCM(playerid, COLOR_SERVER, "Syntax: {AFAFAF}/setadmin <ID/Nume> <Admin level>");

    if(!IsPlayerLogged(userID))
        return SCM(playerid, COLOR_EROARE, "* Eroare: Acest jucator nu este conectat.");

    if(level < 0 || level > 7)
        return SCM(playerid, COLOR_EROARE, "* Eroare: Acest nivel de admin este invalid (0-7).");

    if(PlayerInfo[userID][pAdmin] == level)
        return SCM(playerid, COLOR_EROARE, "* Eroare: Acest jucator are deja acest nivel de admin.");

    if(level == 0)
    {
        if(Iter_Contains(ServerAdmins, userID))
            Iter_Remove(ServerAdmins, userID);
    }
    else
    {
        if(!Iter_Contains(ServerAdmins, userID))
            Iter_Add(ServerAdmins, userID);
    }

    PlayerInfo[userID][pAdmin] = level;
    mysqlQuery("UPDATE `server_accounts` SET `Admin` = '%d' WHERE `ID` = '%d'", PlayerInfo[userID][pAdmin], PlayerInfo[userID][pSQLID]);

    SCM(playerid, COLOR_LIME, "Admin %s ti-a setat admin level %d.", GetPlayerNameEx(playerid), level);
    SendStaff(COLOR_LIME, "AdmCmd: {AFAFAF}Admin %s i-a setat admin %d lui %s.", GetPlayerName(playerid), level, GetPlayerNameEx(userID));
    return true;
}

Detalii: 
asa face mereu cand fac asa:
if(PlayerInfo[playerid][pAdmin])
     return SCM(playerid, COLOR_EROARE, "Mesaj");

ma chinui de ieri sa rezolv, va rog ajutati-ma.

Mie imi compileaza perfect, fi sigur ca folosesti YCMD si nu CMD, daca folosesti CMD schimba din YCMD in CMD si mai in fata scoate virgula si help, lasi pana la params[]

Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte.

Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net.

Aveti grija pe cine ajutati, majoritatea sunt caini.

Link to comment
Share on other sites

  • 0
Acum 2 ore, Emilian a spus:

Eu folosesc YSI iar la cmd-uri de ysi trb sa scrie YCMD:comanda(playerid, params[], help).

Incearca asa

CMD:setadmin(playerid, params[], help)
{
    if(PlayerInfo[playerid][pAdmin] < 7) return SCM(playerid, COLOR_EROARE, "* Eroare: Nu esti autorizat sa folosesti aceasta comanda.");

    new userID, level;
    if(sscanf(params, "ud", userID, level))
        return SCM(playerid, COLOR_SERVER, "Syntax: {AFAFAF}/setadmin <ID/Nume> <Admin level>");

    if(!IsPlayerLogged(userID))
        return SCM(playerid, COLOR_EROARE, "* Eroare: Acest jucator nu este conectat.");

    if(level < 0 || level > 7)
        return SCM(playerid, COLOR_EROARE, "* Eroare: Acest nivel de admin este invalid (0-7).");

    if(PlayerInfo[userID][pAdmin] == level)
        return SCM(playerid, COLOR_EROARE, "* Eroare: Acest jucator are deja acest nivel de admin.");

    if(level == 0)
    {
        if(Iter_Contains(ServerAdmins, userID))
            Iter_Remove(ServerAdmins, userID);
    }
    else
    {
        if(!Iter_Contains(ServerAdmins, userID))
            Iter_Add(ServerAdmins, userID);
    }

    PlayerInfo[userID][pAdmin] = level;
    mysqlQuery("UPDATE `server_accounts` SET `Admin` = '%d' WHERE `ID` = '%d'", PlayerInfo[userID][pAdmin], PlayerInfo[userID][pSQLID]);

    SCM(playerid, COLOR_LIME, "Admin %s ti-a setat admin level %d.", GetPlayerNameEx(playerid), level);
    SendStaff(COLOR_LIME, "AdmCmd: {AFAFAF}Admin %s i-a setat admin %d lui %s.", GetPlayerName(playerid), level, GetPlayerNameEx(userID));
    return true;
}

 

Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte.

Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net.

Aveti grija pe cine ajutati, majoritatea sunt caini.

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.