SA-MP Forums Archive
[Ajuda] BUG ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] BUG ? (/showthread.php?tid=401775)



BUG ? - Alisson Silva Alves - 24.12.2012

Eu Estou como admin level (1342) mais fala que eu nao tenho permiзгo de usar o comando
Esse sгo os 2 /darsocio que eu achei no meu gm

pawn Код:
if(strcmp(cmd, "/darsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");
                return true;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            GetPlayerName(playerid, sendername, 256);
            if (strcmp(sendername,"Alien_CarboN",true)==0)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 1;
                        format(string, sizeof(string), "Vocк ganhou Sуcio do admin %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк deu VIP socio para %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return true;
    }
    if(strcmp(cmd, "/retirarsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /retirarsocio [id]");
                return true;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            GetPlayerName(playerid, sendername, 256);
            if (strcmp(sendername,"Alien_CarboN",true)==0)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 0;
                        format(string, sizeof(string), "Seu Socio Foi retirado pelo adm %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк retirou o Socio de %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return true;
    }


pawn Код:
/*if(strcmp(cmd, "/darsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");
                return true;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if (PlayerInfo[playerid][pAdmin] >= SUB_GERENTE)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 1;
                        format(string, sizeof(string), "   Vocк ganhou VIP socio do admin %s", PlayerName(playerid));
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "   Vocк deu VIP socio para %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return true;
    }
    if(strcmp(cmd, "/retirarsocio", true) == 0)
    {
        SendClientMessage(playerid, COLOR_GRAD1, "   Vocк deve usar /retirarvip!");
        return true;
    }*/



Re: BUG ? - Micael.Nees - 24.12.2012

Outro tуpico?
vou reportar jб#
-zoa, odeio prejudicar os outros..
sabe ali onde tб escrito Alien_CarboN ?
substitui pelo seu nome


Re: BUG ? - Alisson Silva Alves - 24.12.2012

aa desculpa nгo sabia que nao podia criar outro top



o CarboN e meu mesmo so deixei o Alien mais ja mudei xD



Re: BUG ? - Micael.Nees - 24.12.2012

Gamemode do halls neh.. nгo tirou os crйditos neh?
vc podia substituir essa linha para uma linha pedindo lvl de adm 1339+


Re: BUG ? - Alisson Silva Alves - 24.12.2012

KK


VO LA TESTAR VLW ME AJUDO MUITO OMICAEL



Re: BUG ? - rjjj - 24.12.2012

Nas chamadas da funзгo strcmp efetuadas para comparar o nome do jogador com determinado nome, passe false como terceiro argumento em vez de true .



Espero ter ajudado .


Re: BUG ? - Alisson Silva Alves - 24.12.2012

Nao mudo ta o mesmo erro


vc nao pode usar esse comando


Re: BUG ? - Micael.Nees - 24.12.2012

Alisson,
1 verifique se vocк tem 2 /darsocio
2 subistitua a linha com o nome la, bote if (PlayerInfo[playerid][pAdmin] >= 1341)


se n der certo, substitua seu comando por este:
pawn Код:
if(strcmp(cmd, "/darsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");
                return true;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            GetPlayerName(playerid, sendername, 256);
            if (PlayerInfo[playerid][pAdmin] >= 1341)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 1;
                        format(string, sizeof(string), "Vocк ganhou Sуcio do admin %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк deu VIP socio para %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return true;
    }
Se ainda n der, delete o seu .amx e mande compilar dnv.


Re: BUG ? - Alisson Silva Alves - 24.12.2012

Tenho 2 CMD /Darsocio

pawn Код:
if(strcmp(cmd, "/darsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");
                return true;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            GetPlayerName(playerid, sendername, 256);
            if (strcmp(sendername,"Alien_CarboN",true)==0)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 1;
                        format(string, sizeof(string), "Vocк ganhou Sуcio do admin %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк deu VIP socio para %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return true;
    }
    if(strcmp(cmd, "/retirarsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /retirarsocio [id]");
                return true;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            GetPlayerName(playerid, sendername, 256);
            if (strcmp(sendername,"Alien_CarboN",true)==0)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 0;
                        format(string, sizeof(string), "Seu Socio Foi retirado pelo adm %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк retirou o Socio de %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return true;
    }


pawn Код:
//----------------------------------[MAKEADMIN]------------------------------------------------
if(strcmp(cmd, "/darsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [ ID ] [LEVEL ( 1 ~ 3000 )]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            printf("Level de Administrador: %d", PlayerInfo[playerid][pAdmin]);
            if (PlayerInfo[playerid][pAdmin] >= 1339)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pVip] = level;
                        printf("ADMIN CMD: %s promoveu %s para level %d de socio.", sendername, giveplayer, level);
                        format(string, sizeof(string), "   Vocк foi promovido para level %d de socio - Por %s", level, sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "   Vocк promoveu o(a) %s Para o level %d de Socio.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
    }
    if(strcmp(cmd, "/retirarsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");
                return 1;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if (PlayerInfo[playerid][pAdmin] >= 1339)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 0;
                        format(string, sizeof(string), "Seu Socio Foi retirado pelo adm %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк retirou o Socio de %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
{



Re: BUG ? - Micael.Nees - 24.12.2012

Vocк mandou o /dar e /retirar juntos no primeiro cуdigo.
Apague o segundo e substitua o primeiro pelo comando que mandei neste mesmo tуpico.