Jump to content
  • 0

sistem de setadmin eroare


Question

Posted (edited)

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

5 answers to this question

Recommended Posts

  • 0
Posted (edited)

Da, am sters din greseala culoare 'COLOR_EROARE' si d-asta nu mergea, adica era #define COLOR_EROARE si atat. (Dupa 1 zi, mi-am dat seama :))).

Edited by Emilian
  • 0
Posted
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.

  • 0
Posted
Acum 2 ore, StrikerM a spus:

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[]

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

  • 0
Posted
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.

  • 0
Posted

Uneori eroarea nu e exact la linia care ti-o spune, poate fi mai sus sau mai jos deci refa codul si salveaza ce ai facut acum si uite-te la diferente.

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.