Jump to content

Error Comanda.


ArTix.

Recommended Posts

Salut SA:MP romania, astazi am sa va rog daca ma puteti ajuta cu o comanda ( care nu functioneaza ).

Acest server este no mysql, mai multe detalii >>>>>>>>>

Am sa pun 2 videoclipuri :

#1 - 

 

#2 - 

Comanda este aici >>

CMD:makeadmin(playerid, params[])
{
    new adminlevel, targetid, numeT[24], numeP[24], string[150];
    if(sscanf(params, "ud", adminlevel, targetid)) return SCM(playerid,0xFFFFFFFF, "{FFFFFF}Syntax: {FFFFFF}/makeadmin <PlayerID> <Admin Level>");

    if(adminlevel < 0 || adminlevel > 8) return SCM(playerid, -1, "{008BC7}Eroare: {ffffff}Nivelul maxim ca admin este 7.");

    if (PlayerInfo[playerid][pAdmin] >= 6)
    {
        if(IsPlayerConnected(targetid))
        {
            if(targetid != INVALID_PLAYER_ID)
            {
                if(adminlevel > 0)
                {
                    GetPlayerName(targetid, numeT, sizeof(numeT));
                    GetPlayerName(playerid, numeP, sizeof(numeP));

                    PlayerInfo[targetid][pAdmin] = adminlevel;

                    printf("AdmCmd: %s l-a promovat pe %s la admin level %d.", numeP, numeT, adminlevel);

                    if(adminlevel > PlayerInfo[targetid][pAdmin])
                    {
                        format(string, sizeof(string), "Felicitari! Administratorul %s te-a promovat, iar acum esti administrator de nivel %d!",numeP, adminlevel);
                    }
                    else format(string, sizeof(string), "Administratorul %s te-a retrogradat in functie, iar acum esti administrator de nivel %d!",numeP, adminlevel);
                    SendClientMessage(targetid, COLOR_LIGHTBLUE, string);

                    format(string, sizeof(string), "Ai modificat functia detinuta de %s. Acum, %s are administrator de nivel %d.", numeT, numeT, adminlevel);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                }
                else
                {
                    GetPlayerName(targetid, numeT, sizeof(numeT));
                    GetPlayerName(playerid, numeP, sizeof(numeP));

                    PlayerInfo[targetid][pAdmin] = adminlevel;

                    printf("AdmCmd: %s i-a scos functia de admin lui %s.", numeP, numeT, adminlevel);

                    format(string, sizeof(string), "Din pacate, %s ti-a scos functia de administrator.", numeP);
                    SendClientMessage(targetid, COLOR_LIGHTBLUE, string);

                    format(string, sizeof(string), "I-ai scos functia de administrator lui %s.", numeT);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                }
            }
        }
        else SendClientMessage(playerid, -1, "{008BC7}Info: {ffffff}Jucatorul specificat nu este conectat.");
    }
    else SendClientMessage(playerid, -1, AdminOnly);
    return 1;
}

Edited by ArTix.
Link to comment
Share on other sites

10 hours ago, ArTix. said:

Salut SA:MP romania, astazi am sa va rog daca ma puteti ajuta cu o comanda ( care nu functioneaza ).

Acest server este no mysql, mai multe detalii >>>>>>>>>

Am sa pun 2 videoclipuri :

#1 - 

 

#2 - 

Comanda este aici >>

CMD:makeadmin(playerid, params[])
{
    new adminlevel, targetid, numeT[24], numeP[24], string[150];
    if(sscanf(params, "ud", adminlevel, targetid)) return SCM(playerid,0xFFFFFFFF, "{FFFFFF}Syntax: {FFFFFF}/makeadmin <PlayerID> <Admin Level>");

    if(adminlevel < 0 || adminlevel > 8) return SCM(playerid, -1, "{008BC7}Eroare: {ffffff}Nivelul maxim ca admin este 7.");

    if (PlayerInfo[playerid][pAdmin] >= 6)
    {
        if(IsPlayerConnected(targetid))
        {
            if(targetid != INVALID_PLAYER_ID)
            {
                if(adminlevel > 0)
                {
                    GetPlayerName(targetid, numeT, sizeof(numeT));
                    GetPlayerName(playerid, numeP, sizeof(numeP));

                    PlayerInfo[targetid][pAdmin] = adminlevel;

                    printf("AdmCmd: %s l-a promovat pe %s la admin level %d.", numeP, numeT, adminlevel);

                    if(adminlevel > PlayerInfo[targetid][pAdmin])
                    {
                        format(string, sizeof(string), "Felicitari! Administratorul %s te-a promovat, iar acum esti administrator de nivel %d!",numeP, adminlevel);
                    }
                    else format(string, sizeof(string), "Administratorul %s te-a retrogradat in functie, iar acum esti administrator de nivel %d!",numeP, adminlevel);
                    SendClientMessage(targetid, COLOR_LIGHTBLUE, string);

                    format(string, sizeof(string), "Ai modificat functia detinuta de %s. Acum, %s are administrator de nivel %d.", numeT, numeT, adminlevel);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                }
                else
                {
                    GetPlayerName(targetid, numeT, sizeof(numeT));
                    GetPlayerName(playerid, numeP, sizeof(numeP));

                    PlayerInfo[targetid][pAdmin] = adminlevel;

                    printf("AdmCmd: %s i-a scos functia de admin lui %s.", numeP, numeT, adminlevel);

                    format(string, sizeof(string), "Din pacate, %s ti-a scos functia de administrator.", numeP);
                    SendClientMessage(targetid, COLOR_LIGHTBLUE, string);

                    format(string, sizeof(string), "I-ai scos functia de administrator lui %s.", numeT);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                }
            }
        }
        else SendClientMessage(playerid, -1, "{008BC7}Info: {ffffff}Jucatorul specificat nu este conectat.");
    }
    else SendClientMessage(playerid, -1, AdminOnly);
    return 1;
}

Ai greșit parametri la sscanf, u reprezintă id.ul/numele playerului iar d, valoare de timp întreg, decimal, si tu ai pus adminlevel la u si targetid la d, trebuie inversate.

  • Upvote 1

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

Gata am rezolvat trebuia sa pun >>>> if(sscanf(params, "ud", targetid, adminlevel)) return SCM(playerid,0xFFFFFF, "{FFFFFF}Syntax: {FFFFFF}/makeadmin <PlayerID> <Admin Level>");

 

Dupa 2 min mi-am dat seama ce ai spus :)

Ai +1 la toate comentarile tale + postari .

Cer T/C

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.