[AJUDA] Comando /prender
#1

Boa tarde pessoal, estava tentando fazer um comando para os Admin poderem prender os players, mas nгo obtive muito sucesso. Tentei fazer usando como base o comando /deter da minha GM, mas dessa vez tentei adicionar o "MOTIVO" para ser apresentado a todos os players, mas toda a vez que eu digito corretamente o comando, ele nгo funciona, ele me retorna a mensagem "USE: /prender [id] [tempo] [motivo]". Alguem ai poderia me ajudar a colocar este comando para funcionar?

Aqui esta ele:
pawn Код:
if(strcmp(cmd, "/prender", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    MSGPLAYER(playerid, COLOR_GRAD2, "USE: /prender [id] [tempo (minutos)] [motivo]");
                    return 1;
                }
                giveplayerid = ReturnUser(tmp);
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    MSGPLAYER(playerid, COLOR_GRAD2, "USE: /prender [id] [tempo (minutos)] [motivo]");
                    return 1;
                }
                new time = strval(tmp);
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    MSGPLAYER(playerid, COLOR_GRAD2, "USE: /prender [id] [tempo (minutos)] [motivo]");
                    return 1;
                }
                new length = strlen(cmdtext);
                new offset = idx;
                new result[64];
                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                {
                    result[idx - offset] = cmdtext[idx];
                    idx++;
                }
                result[idx - offset] = EOS;
                if(!strlen(result))
                {
                    MSGPLAYER(playerid, COLOR_GRAD2, "USE: /prender [id] [tempo (minutos)] [motivo]");
                    return 1;
                }
                new suspect = giveplayerid;
                if(IsPlayerConnected(suspect))
                {
                    if(GetDistanceBetweenPlayers(playerid,suspect) < 15)
                    {
                        GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* Vocк Prendeu %s !", giveplayer);
                        MSGPLAYER(playerid, COLOR_LIGHTBLUE, string);
                        //GivePlayerMoney(suspect, -moneys);
                        format(string, sizeof(string), "Preso por %s", sendername);
                        GameTextForPlayer(suspect, string, 5000, 5);
                        ResetPlayerWeaponsEx(suspect);
                        if(PlayerInfo[playerid][pMembro]==1||PlayerInfo[playerid][pLider]==1)
                        {
                            format(string, sizeof(string), "[PRESO] O Admin %s prendeu o(a) %s ||MOTIVO: %s", sendername, giveplayer, (result));
                            OOCNews(0xFF8000AA, string);
                        }
                        SetPlayerInterior(suspect, 6);
                        SetPlayerPos(suspect,264.6288,77.5742,1001.0391);
                        PlayerInfo[suspect][pJailTime] = time * 60;
                        PlayerInfo[suspect][pJailed] = 1;
                        SetPlayerFree(suspect,playerid, "Foi Preso");
                        PlayerInfo[suspect][pMuted] = 0;
                        Controle(suspect, 1);
                        PlayerCuffed[suspect] = 0;
                        PlayerInfo[suspect][pDrogas] = 0;
                        PlayerInfo[suspect][pDrogas2] = 0;
                        PlayerInfo[suspect][pDrogas3] = 0;
                        PlayerInfo[suspect][pMats] = 0;
                        return 1;
                    }//distance
                }//not connected
                else
                {
                    MSGPLAYER(playerid, COLOR_GREY, "   Esse nгo й um jogador ativo.");
                    return 1;
                }
            }
            else
            {
                MSGPLAYER(playerid, COLOR_GREY, "   Vocк nгo й um Administrador!");
                return 1;
            }
        }//not connected
        return 1;
    }
Reply


Messages In This Thread
[AJUDA] Comando /prender - by marcelodell - 12.12.2011, 16:41
Re: [AJUDA] Comando /prender - by Cristhian - 12.12.2011, 22:06
Re: [AJUDA] Comando /prender - by marcelodell - 13.12.2011, 19:30
Re: [AJUDA] Comando /prender - by Cristhian - 13.12.2011, 21:36
Re: [AJUDA] Comando /prender - by marcelodell - 13.12.2011, 22:28

Forum Jump:


Users browsing this thread: 3 Guest(s)