[Pedido] New Comando
#1

Bom estava querendo um comando /agendarcadeia que quando um cara fosse denunciado um ADM entrasse no jogo e desse /agendarcadeia [ID] [TEMPO] [MOTIVO]... Bom estou querendo um NOVO COMANDO
Vou deixar o comando /cadeia aqui sу para ajudar...
OBS: Sу para reforзar quero um comando novo...
pawn Код:
if(strcmp(cmd, "/cadeia",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: /cadeia [id] [Tempo] [Motivo]");
                return true;
            }
            if(!strlen(tempo))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /cadeia [id] [Tempo] [Motivo]");
                return true;
            }
            if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1341)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/jogar)");
                return true;
            }
            giveplayerid = ReturnUser(tmp);
            tempo2 = strval(tempo);
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
            idx++;
            }
            new offset = idx;
            new result[100];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
            result[idx - offset] = cmdtext[idx];
            idx++;
            }
            result[idx - offset] = EOS;
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "Admin %s colocou %s na Cadeia, por %s minutos, Motivo: %s",PlayerName(playerid), giveplayer, tempo, (result));
                    SendClientMessageToAll(COLOR_LIGHTRED, string);
                    ResetPlayerWeaponsEx(giveplayerid);
                    OnPlayerUpdate(giveplayerid);
                    PlayerInfo[giveplayerid][pJailed] = 6;
                    PlayerInfo[giveplayerid][pJailTime] = tempo2 * 60;
                    SetPlayerInterior(giveplayerid, 5);
                    SetPlayerPos(giveplayerid, 318.5804,316.9043,999.1484);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   O jogador estб offline !");
                return true;
            }
        }
        return true;
    }
Reply
#2

Nгo entendi sua duvida mano..
Reply
#3

Queria um comando novo para que quando um player entrasse jб fosse automaticamente para a prisгo de ADM
Reply
#4

Tens de usar um sistema de salvamento para guardar o nick do player e o tempo em um arquivo, assim toda vez que ele relogar ele nгo irб pro spawn atй que seu tempo acabe.
Reply
#5

Vк esse tutorial do DraKiNs
https://sampforum.blast.hk/showthread.php?tid=180237
Reply
#6

faz para mim *_*
Reply
#7

pawn Код:
// No comando


stock agendarCadeia( id, nome[], tempo, motivo[] ){
    new string[128], nome[24]; GetPlayerName(id, nome, 24);
    format(string, 128, "Agendamento/%s.ini", nome);
    if(!dini_Exists(string)) dini_Create(string);
    dini_IntSet(string, "Tempo", tempo);
    dini_Set(string, "Motivo", motivo);
    // Feito
    return 1;
}

// Ao logar
stock verificarCadeia(playerid){
    new string[128], nome[24]; GetPlayerName(playerid, nome, 24);
    format(string, 128, "Agendamento/%s.ini", nome);
    if(!dini_Exists(string)) return 1;
    PlayerInfo[playerid][pJailTime] = dini_Int(string, "Tempo"); // Modifique, acrescente as coordenadas da sua prisгo, as suas variбveis, etc.
    SendClientMessage(playerid, -1, dini_Get(string, "Motivo"));
    fremove(string);
    return 1;
}

Boa sorte
Reply
#8

Nвo consegui nгo.. me ajudemmmm. URGENTE!
Reply
#9

Cara velho й нncrivel o Ricop ja fez e so vocк adicionar
pawn Код:
verificarCadeia(playerid);
No OnPlayerSpawn
pawn Код:
agendarCadeia( id, nome[], tempo, motivo[] );
No onplayerdisconnect ou no comando.
Reply
#10

ahh desisto se alguйm quiser em ajudar me passa o comando porque sou muito noob!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)