[Ajuda] bug quando desalgema um player
#1

ae gente e o seguinte eu digito /algemar [id] algema certo mais quando digito /desalgemar [id] o player buga nao anda e ainda fica com a text na tela escrito algemado alquem pode me ajudar

comando

pawn Код:
if(strcmp(cmd, "/desalgemar", true) == 0)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, aname);
    if(dini_Int(file, "Profissao") == Policia_Militar || dini_Int(file, "Profissao") == Policia_Civil || dini_Int(file, "Profissao") == Policia_Federal || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "aAdmin") == 1)
    {
        new tmp[256];
        new plid;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "/desalgemar [id]");
            return 1;
        }
        plid = strval(tmp);
        if(plid == playerid)
        {
            SendClientMessage(playerid, Vermelho, "Vocк nгo pode fazer isto com si mesmo.");
            return 1 ;
        }
        if(!IsPlayerConnected(plid))
        {
            SendClientMessage(playerid, Vermelho, "O jogador nгo estб conectado");
            return 1;
        }
        else
        {
            if(GetDistanceBetweenPlayers(plid,playerid) < 10)
            {
                format(string, sizeof(string), "(INFO) O jogador %s te desalgemou.", aname);
                GameTextForPlayer(plid,"~w~Desalgemado", 2000, 0);
                SendClientMessage(plid, 0x8C8CFFAA, string);
                SendClientMessage(playerid, 0x8C8CFFAA, "(INFO) Desalgemado com sucesso.");
                algemado[plid] = 0;
                return 1;
            }
            else
            {
                SendClientMessage(playerid,Vermelho," Chegue mais perto para desalgemar.");
                return 1;
            }
        }
    }
    else
    {
        SendClientMessage(playerid,Vermelho,"(ERRO) Vocк nгo й um policial!");
        return 1;
    }
}
Reply
#2

alqeum ajuda pf?
Reply
#3

pawn Код:
if(strcmp(cmd, "/desalgemar", true) == 0)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, aname);
    if(dini_Int(file, "Profissao") == Policia_Militar || dini_Int(file, "Profissao") == Policia_Civil || dini_Int(file, "Profissao") == Policia_Federal || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "aAdmin") == 1)
    {
        new tmp[256];
        new plid;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "/desalgemar [id]");
            return 1;
        }
        plid = strval(tmp);
        if(plid == playerid)
        {
            SendClientMessage(playerid, Vermelho, "Vocк nгo pode fazer isto com si mesmo.");
            return 1 ;
        }
        if(!IsPlayerConnected(plid))
        {
            SendClientMessage(playerid, Vermelho, "O jogador nгo estб conectado");
            return 1;
        }
        else
        {
            if(GetDistanceBetweenPlayers(plid,playerid) < 10)
            {
                format(string, sizeof(string), "(INFO) O jogador %s te desalgemou.", aname);
                GameTextForPlayer(plid,"~w~Desalgemado", 2000, 0);
                SendClientMessage(plid, 0x8C8CFFAA, string);
                SendClientMessage(playerid, 0x8C8CFFAA, "(INFO) Desalgemado com sucesso.");
                algemado[plid] = 0;
                TogglePlayerControllable(playerid,1);
                return 1;
            }
            else
            {
                SendClientMessage(playerid,Vermelho," Chegue mais perto para desalgemar.");
                return 1;
            }
        }
    }
    else
    {
        SendClientMessage(playerid,Vermelho,"(ERRO) Vocк nгo й um policial!");
        return 1;
    }
}
Tenta ._.
Reply
#4

adianto nada tu me deu o mesmo codico D/:
Reply
#5

pawn Код:
if(strcmp(cmd, "/desalgemar", true) == 0)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, aname);
    if(dini_Int(file, "Profissao") == Policia_Militar || dini_Int(file, "Profissao") == Policia_Civil || dini_Int(file, "Profissao") == Policia_Federal || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "aAdmin") == 1)
    {
        new tmp[256];
        new plid;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "/desalgemar [id]");
            return 1;
        }
        plid = strval(tmp);
        if(plid == playerid)
        {
            SendClientMessage(playerid, Vermelho, "Vocк nгo pode fazer isto com si mesmo.");
            return 1 ;
        }
        if(!IsPlayerConnected(plid))
        {
            SendClientMessage(playerid, Vermelho, "O jogador nгo estб conectado");
            return 1;
        }
        else
        {
            if(GetDistanceBetweenPlayers(plid,playerid) < 10)
            {
                format(string, sizeof(string), "(INFO) O jogador %s te desalgemou.", aname);
                GameTextForPlayer(plid,"~w~Desalgemado", 2000, 0);
                SendClientMessage(plid, 0x8C8CFFAA, string);
                SendClientMessage(playerid, 0x8C8CFFAA, "(INFO) Desalgemado com sucesso.");
                SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
                algemado[plid] = 0;
                return 1;
            }
            else
            {
                SendClientMessage(playerid,Vermelho," Chegue mais perto para desalgemar.");
                return 1;
            }
        }
    }
    else
    {
        SendClientMessage(playerid,Vermelho,"(ERRO) Vocк nгo й um policial!");
        return 1;
    }
}
tenta isso
Reply
#6

bruno ddeu tabem nao com ese code ae sumil o algemado mais o player fica parado bugado sem da pra andar!
Reply
#7

posta o /algemar ai
Reply
#8

pode ver que nen tem aquela treta do algemar con as maos para tras

/algemar
pawn Код:
if(strcmp(cmd, "/algemar", true) == 0)
{
    if(algemou[playerid] == 1) return SendClientMessage(playerid, Vermelho, "(ERRO) Aguarde 1 minuto para algemar novamente!");
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, aname);
    if(dini_Int(file, "Profissao") == Policia_Militar || dini_Int(file, "Profissao") == Policia_Civil || dini_Int(file, "Profissao") == Policia_Federal || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "aAdmin") == 1)
    {
        new tmp[256];
        new plid;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, " /algemar [id]");
            return 1;
        }
        plid = strval(tmp);
        if(plid == playerid)
        {
            SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo pode usar este comando em vocк mesmo.");
            return 1 ;
        }
        if(!IsPlayerConnected(plid))
        {
            SendClientMessage(playerid, Vermelho, "(ERRO) Jogador nгo conectado.");
            return 1;
        }
        else
        {
            if(GetDistanceBetweenPlayers(plid,playerid) < 10)
            {
                format(string, sizeof(string), "(INFO) Vocк foi algemado por %s.", aname);
                GameTextForPlayer(plid,"~w~Algemado", 58000, 0);
                SendClientMessage(plid, 0x8C8CFFAA, string);
                TogglePlayerControllable(plid, 0);
                SendClientMessage(playerid, 0x8C8CFFAA, "(INFO) Algemado com sucesso.");
                algemado[plid] = 1;
                algemou[playerid] = 1;
                return 1;
            }
            else
            {
                SendClientMessage(playerid,Vermelho," Chegue mais perto para algemar.");
                return 1;
            }
        }
    }
    else
    {
        SendClientMessage(playerid,Vermelho,"(ERRO) Vocк nгo й um policial!");
        return 1;
    }
}
Reply
#9

pawn Код:
if(strcmp(cmd, "/desalgemar", true) == 0)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, aname);
    if(dini_Int(file, "Profissao") == Policia_Militar || dini_Int(file, "Profissao") == Policia_Civil || dini_Int(file, "Profissao") == Policia_Federal || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "aAdmin") == 1)
    {
        new tmp[256];
        new plid;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "/desalgemar [id]");
            return 1;
        }
        plid = strval(tmp);
        if(plid == playerid)
        {
            SendClientMessage(playerid, Vermelho, "Vocк nгo pode fazer isto com si mesmo.");
            return 1 ;
        }
        if(!IsPlayerConnected(plid))
        {
            SendClientMessage(playerid, Vermelho, "O jogador nгo estб conectado");
            return 1;
        }
        else
        {
            if(GetDistanceBetweenPlayers(plid,playerid) < 10)
            {
                format(string, sizeof(string), "(INFO) O jogador %s te desalgemou.", aname);
                GameTextForPlayer(plid,"~w~Desalgemado", 2000, 0);
                SendClientMessage(plid, 0x8C8CFFAA, string);
                SendClientMessage(playerid, 0x8C8CFFAA, "(INFO) Desalgemado com sucesso.");
                algemado[plid] = 0;
                TogglePlayerControllable(plid,1);
                return 1;
            }
            else
            {
                SendClientMessage(playerid,Vermelho," Chegue mais perto para desalgemar.");
                return 1;
            }
        }
    }
    else
    {
        SendClientMessage(playerid,Vermelho,"(ERRO) Vocк nгo й um policial!");
        return 1;
    }
}
se for oque eu to pensando vocк so colocou pra desbloquear voce mesmo nao o cara que estava algemado

tenta assim
Reply
#10

bruno vlw mermo deu aproveitando o topico aki

tem como ajeitar o player algemado com a mao pra tras nele pra min pq aki nao consgui! se poder!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)