SA-MP Forums Archive
[Ajuda]Comando /arrastar bugado. - 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]Comando /arrastar bugado. (/showthread.php?tid=333508)



[Ajuda]Comando /arrastar bugado. - Matheus_Ecko - 11.04.2012

Ei gente alguem poderia me ajudar com o codigo abaixo, pois eu digito /arrastar e id e ele nгo arrasta o player para dentro do carro, se puderem me ajudar eu agradeзo, pois os cops do meu servidor estгo enfrentando problemas na hora de prender os meliantes obrigado para quem ajudar.

Cуdigo:

//>-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
pawn Код:
if(strcmp(cmd, "/arrastar", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(!IsACop(playerid))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo й um Cop!");
                return 0x01;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /arrastar [ID/ParteDoNome]");
                return 0x01;
            }
            new newcar = GetPlayerVehicleID(playerid);
            new playa;
            playa = ReturnUser(tmp);
            if(IsAPoliciaCivilCar(newcar) || IsAROTAMsCar(newcar) || IsAPFCar(newcar) || IsAExCar(newcar) || IsACopCar(newcar))
            {
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        new Float:x, Float:y, Float:z;
                        GetPlayerPos(playa,x,y,z);
                        if(IsPlayerInRangeOfPoint(playerid, 5, x, y, z))
                        {
                            PutPlayerInVehicle(playa,newcar,2);
                            GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                            format(string, sizeof(string), "%s colocou %s no camburгo.", sendername ,giveplayer);
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "Jogador nгo estб prуximo a vocк.");
                        }
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб em um veнculo policial!");
            }
        }
        return 0x01;
    }
//>-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



Re: [Ajuda]Comando /arrastar bugado. - CidadeNovaRP - 11.04.2012

Veja o meu:
pawn Код:
if (strcmp(cmd, "/arrastar", true) == 0)
    {
        new car;
        if(IsPlayerConnected(playerid))
        {
            if(IsACop(playerid))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "USE: /arrastar [id]");
                    return true;
                }
                if(!IsPlayerInAnyVehicle(playerid))
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo estб em um Veiculo !");
                    return true;
                }
                //giveplayerid = strval(tmp);
                giveplayerid = ReturnUser(tmp);
                if(!IsPlayerInAnyVehicle(giveplayerid))
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "   O Jogador estб em um Veiculo !");
                    return 1;
                }
                if(PlayerCuffedTime[giveplayerid] <= 0)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo pode arrastar e algemar pessoas que nгo estгo Imobilizadas!");
                    return 1;
                }
                if(giveplayerid == playerid)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo pode se arrastar e algemar!");
                    return 1;
                }
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        car = GetPlayerVehicleID(playerid);
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* Vocк foi arrastado e algemado pelo: %s.", sendername);
                        SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* Vocк arrastou e algemou %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* %s arrastou e algemou %s, para nao fugir.", sendername ,giveplayer);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        GameTextForPlayer(giveplayerid, "~r~Algemado", 2500, 3);
                        PutPlayerInVehicle(giveplayerid, car, 3);
                        TogglePlayerControllable(giveplayerid, 0);
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "   Este Jogador nгo estб ativo !");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo й Policial !");
            }
        }
        return true;
    }
Use como base


Re: [Ajuda]Comando /arrastar bugado. - Matheus_Ecko - 11.04.2012

vlw +rep para tu.


Re: [Ajuda]Comando /arrastar bugado. - CidadeNovaRP - 11.04.2012

Quote:
Originally Posted by Matheus_Ecko
Посмотреть сообщение
vlw +rep para tu.
Disponha


Re: [Ajuda]Comando /arrastar bugado. - Matheus_Ecko - 11.04.2012

mano eu tentei mais ta bug o sistema de arrastar. sera que o problema nгo й em algum sistema meu.


Re: [Ajuda]Comando /arrastar bugado. - CidadeNovaRP - 11.04.2012

Quote:
Originally Posted by Matheus_Ecko
Посмотреть сообщение
mano eu tentei mais ta bug o sistema de arrastar. sera que o problema nгo й em algum sistema meu.
Deve ser, pois eu uso este Sistema num GM aqui e funciona perfeitamente =S O que acontece?


Re: [Ajuda]Comando /arrastar bugado. - Matheus_Ecko - 11.04.2012

tipo n arrasta o player para o carro, se vc quiser testar cmg o meu gm й sу adicionar no hamachi:

sala: BULRPG
senha: 123
ip: 5.164.53.209:7777


Re: [Ajuda]Comando /arrastar bugado. - CidadeNovaRP - 11.04.2012

Fiz um erro banal xD, ta ae :
pawn Код:
if (strcmp(cmd, "/arrastar", true) == 0)
    {
        new car;
        if(IsPlayerConnected(playerid))
        {
            if(IsACop(playerid))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "USE: /arrastar [id]");
                    return true;
                }
                if(!IsPlayerInAnyVehicle(playerid))
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo estб em um Veiculo !");
                    return true;
                }
                //giveplayerid = strval(tmp);
                giveplayerid = ReturnUser(tmp);
                if(IsPlayerInAnyVehicle(giveplayerid))
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "   O Jogador estб em um Veiculo !");
                    return 1;
                }
                if(PlayerCuffedTime[giveplayerid] <= 0)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo pode arrastar e algemar pessoas que nгo estгo Imobilizadas!");
                    return 1;
                }
                if(giveplayerid == playerid)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo pode se arrastar e algemar!");
                    return 1;
                }
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        car = GetPlayerVehicleID(playerid);
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* Vocк foi arrastado e algemado pelo: %s.", sendername);
                        SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* Vocк arrastou e algemou %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* %s arrastou e algemou %s, para nao fugir.", sendername ,giveplayer);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        GameTextForPlayer(giveplayerid, "~r~Algemado", 2500, 3);
                        PutPlayerInVehicle(giveplayerid, car, 3);
                        TogglePlayerControllable(giveplayerid, 0);
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "   Este Jogador nгo estб ativo !");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo й Policial !");
            }
        }
        return true;
    }