[PEDIDO] Um Pequeno Cmd do carandiru
#1

Bom tenho o CMD de carandiru aki
e qeria q pra prendr ele tivesse motivo
EX: /carandiru [ID] [TEMPO] "[MOTIVO]"

e se a pessoa nao colocar o motivo nao da pra prender

O meu cmd esta aki
alguem pode colocar isso nele
Agradeзo Muito

pawn Код:
if(strcmp(cmd, "/carandiru",true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new tempo[20];
            new tempo2;
            if(PlayerInfo[playerid][pAdmin] < 3)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo esta autorizado para usar este comando!");
                return true;
            }
            tmp = strtok(cmdtext, idx);
            tempo = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /carandiru [id] [ Tempo ]");
                return true;
            }
            if(!strlen(tempo))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /carandiru [id] [ Tempo ]");
                return true;
            }
            if(PlayerInfo[giveplayerid][pAdmin] >= 1339 && PlayerInfo[playerid][pAdmin] < SUB_GERENTE)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode dar carandiru para um Admin Dono !");
                return true;
            }
   if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != DONO)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
                return true;
            }
            giveplayerid = ReturnUser(tmp);
            tempo2 = strval(tempo);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "* Vocк Colocou o(a) %s No Carandiru.", giveplayer);
                    SendClientMessage(playerid, COLOR_LIGHTRED, string);
                    if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
                    {
                        SendClientMessage(giveplayerid, COLOR_LIGHTRED, "* Vocк foi colocado no Carandiru Pelo Admin Homem_Aranha.");
                    }
                    else
                    {
                        format(string, sizeof(string), "* Vocк foi colocado no Carandiru Pelo Admin %s.", PlayerName(playerid));
                        SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
                    }
                    GameTextForPlayer(giveplayerid, "~b~Bem Vindo ao ~n~~r~Carandiru", 5000, 3);
                    ResetPlayerWeaponsEx(giveplayerid);
                    WantedPoints[giveplayerid] = 0;
                    SetPlayerWantedLevel(giveplayerid, 0);
                    PlayerInfo[giveplayerid][pJailed] = 2;
                    PlayerInfo[giveplayerid][pJailTime] = tempo2 * 60;
                    SetPlayerPos(giveplayerid, 107.2300,1920.6311,18.5208);
                    SetPlayerWorldBounds(giveplayerid, 337.5694,101.5826,1940.9759,1798.7453); //285.3481,96.9720,1940.9755,1799.0811
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   O jogador estб offline !");
                return true;
            }
        }
        return true;
    }
Reply
#2

pawn Код:
if(strcmp(cmd, "/carandiru",true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new tempo[20];
            new tempo2;
            if(PlayerInfo[playerid][pAdmin] < 3)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo esta autorizado para usar este comando!");
                return true;
            }
            tmp = strtok(cmdtext, idx);
            tempo = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /carandiru [id] [Tempo] [Motivo]");
                return true;
            }
            if(!strlen(tempo))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /carandiru [id] [Tempo] [Motivo]");
                return true;
            }
            if(PlayerInfo[giveplayerid][pAdmin] >= 1339 && PlayerInfo[playerid][pAdmin] < SUB_GERENTE)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode dar carandiru para um Admin Dono !");
                return true;
            }
            if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != DONO)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
                return true;
            }
            giveplayerid = ReturnUser(tmp);
            tempo2 = strval(tempo);
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
            idx++;
            }
            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))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /carandiru [id] [Tempo] [Motivo]");
                return 1;
            }
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "* Vocк Colocou o(a) %s No Carandiru.", giveplayer);
                    SendClientMessage(playerid, COLOR_LIGHTRED, string);
                    if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
                    {
                        SendClientMessage(giveplayerid, COLOR_LIGHTRED, "* Vocк foi colocado no Carandiru Pelo Admin Homem_Aranha.");
                        format(string, sizeof(string), "Admin Homem_Aranha colocou %s no Carandiru, por %s minutos, Motivo: %s",PlayerName(playerid), giveplayer, tempo, (result));
                        SendClientMessageToAll(0xF83100AA, string);
                    }
                    else
                    {
                        format(string, sizeof(string), "Admin %s colocou %s no Carandiru, por %s minutos, Motivo: %s",PlayerName(playerid), giveplayer, tempo, (result));
                        SendClientMessageToAll(0xF83100AA, string);
                        format(string, sizeof(string), "* Vocк foi colocado no Carandiru Pelo Admin %s.", PlayerName(playerid));
                        SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
                    }
                    GameTextForPlayer(giveplayerid, "~b~Bem Vindo ao ~n~~r~Carandiru", 5000, 3);
                    ResetPlayerWeaponsEx(giveplayerid);
                    WantedPoints[giveplayerid] = 0;
                    SetPlayerWantedLevel(giveplayerid, 0);
                    PlayerInfo[giveplayerid][pJailed] = 2;
                    PlayerInfo[giveplayerid][pJailTime] = tempo2 * 60;
                    SetPlayerPos(giveplayerid, 107.2300,1920.6311,18.5208);
                    SetPlayerWorldBounds(giveplayerid, 337.5694,101.5826,1940.9759,1798.7453); //285.3481,96.9720,1940.9755,1799.0811
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   O jogador estб offline !");
                return true;
            }
        }
        return true;
    }
Espero Ter ajudado!
Reply
#3

Vlw
mas agr alguns admin pra baixo de sub gerente nao consegue usar o cmd sendo q ta lvl 3 '--
Tipo o admin lvl 3 usa o cmd e fala q ele nao pode prender Admin Dono sendo q ele ta tentando prender players

ME AJUDA AE
Reply
#4

pawn Код:
if(strcmp(cmd, "/carandiru",true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new tempo[20];
            new tempo2;
            if(PlayerInfo[playerid][pAdmin] < 1)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo esta autorizado para usar este comando!");
                return true;
            }
            tmp = strtok(cmdtext, idx);
            tempo = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /carandiru [id] [Tempo] [Motivo]");
                return true;
            }
            if(!strlen(tempo))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /carandiru [id] [Tempo] [Motivo]");
                return true;
            }
            if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != DONO)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
                return true;
            }
            giveplayerid = ReturnUser(tmp);
            tempo2 = strval(tempo);
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
            idx++;
            }
            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))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /carandiru [id] [Tempo] [Motivo]");
                return 1;
            }
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "* Vocк Colocou o(a) %s No Carandiru.", giveplayer);
                    SendClientMessage(playerid, COLOR_LIGHTRED, string);
                    if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
                    {
                        SendClientMessage(giveplayerid, COLOR_LIGHTRED, "* Vocк foi colocado no Carandiru Pelo Admin Homem_Aranha.");
                        format(string, sizeof(string), "Admin Homem_Aranha colocou %s no Carandiru, por %s minutos, Motivo: %s",PlayerName(playerid), giveplayer, tempo, (result));
                        SendClientMessageToAll(0xF83100AA, string);
                    }
                    else
                    {
                        format(string, sizeof(string), "Admin %s colocou %s no Carandiru, por %s minutos, Motivo: %s",PlayerName(playerid), giveplayer, tempo, (result));
                        SendClientMessageToAll(0xF83100AA, string);
                        format(string, sizeof(string), "* Vocк foi colocado no Carandiru Pelo Admin %s.", PlayerName(playerid));
                        SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
                    }
                    GameTextForPlayer(giveplayerid, "~b~Bem Vindo ao ~n~~r~Carandiru", 5000, 3);
                    ResetPlayerWeaponsEx(giveplayerid);
                    WantedPoints[giveplayerid] = 0;
                    SetPlayerWantedLevel(giveplayerid, 0);
                    PlayerInfo[giveplayerid][pJailed] = 2;
                    PlayerInfo[giveplayerid][pJailTime] = tempo2 * 60;
                    SetPlayerPos(giveplayerid, 107.2300,1920.6311,18.5208);
                    SetPlayerWorldBounds(giveplayerid, 337.5694,101.5826,1940.9759,1798.7453); //285.3481,96.9720,1940.9755,1799.0811
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   O jogador estб offline !");
                return true;
            }
        }
        return true;
    }
Reply
#5

Ja Arrumei Brigado a todos !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)