[Ajuda] Como cria um comando de /aprender por 120min, para admin?
#1

Ai gente como eu crio o comando /aprender (id) (motivo) ai prende automaticamente por 120minutos? So para adms?
Alguem pode me ajudar? Pf
Reply
#2

No meu GM eu tenho o /carandiru que voce escolhe o player, tempo, motivo e o player fica preso !!

pawn Код:
if(strcmp(cmd, "/carandiru",true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new tempo[20],motivo[40];
            new tempo2;
            if(PlayerInfo[playerid][pAdmin] < 2)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo esta autorizado para usar este comando!");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            tempo = strtok(cmdtext, idx);
            motivo = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /carandiru [id] [ Tempo ] [ motivo ] ");
                return 1;
            }
            if(!strlen(tempo))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /carandiru [id] [ Tempo ] [ motivo ] ");
                return 1;
            }
            if(!strlen(tempo))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /carandiru [id] [ Tempo ] [ motivo ] ");
                return 1;
            }
            if(PlayerInfo[giveplayerid][pAdmin] >= 1339 && PlayerInfo[playerid][pAdmin] < 1338)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode dar carandiru para um Admin Dono !");
                return 1;
            }
            if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
                return 1;
            }
            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 Admin_Automбtico.");
                    }
                    else
                    {
                        format(string, sizeof(string), "* Vocк foi colocado no Carandiru Pelo Admin %s.", sendername);
                        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
                    new msgc[140];
                    format(msgc,sizeof(msgc),"[INFO] %s foi colocado no Carandiru por: %s   Tempo: %d    Motivo: %s", giveplayer, sendername, tempo2, motivo);
                    SendClientMessageToAll(COLOR_LIGHTRED,msgc);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   O jogador estб offline !");
                return 1;
            }
        }
        return 1;
    }
Reply
#3

Conseguiu ??
Reply
#4

Pera ai amigo, vo testa aki e ja.falo aki
Reply
#5

Deu esses erros.

PHP код:
C:\Users\Jonathan\Desktop\New Virtual Life\gamemodes\NVLRPG1.0.pwn(10765) : error 017undefined symbol "tmp"
C:\Users\Jonathan\Desktop\New Virtual Life\gamemodes\NVLRPG1.0.pwn(10766) : error 047: array sizes do not match, or destination array is too small
C
:\Users\Jonathan\Desktop\New Virtual Life\gamemodes\NVLRPG1.0.pwn(10767) : error 047: array sizes do not match, or destination array is too small
C
:\Users\Jonathan\Desktop\New Virtual Life\gamemodes\NVLRPG1.0.pwn(10768) : error 017undefined symbol "tmp"
C:\Users\Jonathan\Desktop\New Virtual Life\gamemodes\NVLRPG1.0.pwn(10788) : error 017undefined symbol "giveplayerid"
C:\Users\Jonathan\Desktop\New Virtual Life\gamemodes\NVLRPG1.0.pwn(10788) : error 017undefined symbol "ReturnUser"
C:\Users\Jonathan\Desktop\New Virtual Life\gamemodes\NVLRPG1.0.pwn(10790) : error 017undefined symbol "giveplayerid"
C:\Users\Jonathan\Desktop\New Virtual Life\gamemodes\NVLRPG1.0.pwn(10792) : error 017undefined symbol "giveplayerid"
C:\Users\Jonathan\Desktop\New Virtual Life\gamemodes\NVLRPG1.0.pwn(10794) : error 017undefined symbol "giveplayerid"
C:\Users\Jonathan\Desktop\New Virtual Life\gamemodes\NVLRPG1.0.pwn(10794) : error 017undefined symbol "giveplayer"
C:\Users\Jonathan\Desktop\New Virtual Life\gamemodes\NVLRPG1.0.pwn(10794) : error 029invalid expressionassumed zero
C
:\Users\Jonathan\Desktop\New Virtual Life\gamemodes\NVLRPG1.0.pwn(10794) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
12 Errors

Vo tenta solucionar, ai se conseguir eu posto aki
Reply
#6

Fiz uma pequena base pra vocк.

pawn Код:
#include A_SAMP   «
#include  ZCMD    «
#include SSCANF2  «

new PlayerPreso [ MAX_PLAYERS ] ;

stock yNome ( playerid ) {

    new Nome [ 21 ] ;
    GetPlayerName ( playerid, Nome, 21 ) ;
    return Nome ;
}

COMMAND:cadeia ( playerid, params[] ) {

    new yID, yTempo, yMotivo [ 30 ], Celulas [ 128 ] ;
   
    if ( sscanf ( params, "uds[30]", yID, yTempo, yMotivo ) )
        return SendClientMessage ( playerid, -1, "[ USE ]: /cadeia [ID] [Tempo] [Motivo]" ) ;
       
    if ( !IsPlayerConnected ( yID ) )
        return SendClientMessage ( playerid, -1, "[ ERRO ]: Jogador nгo estб conectado" ) ;
       
    format ( Celulas, 128, "[ CADEIA ]: %s Foi punido na cadeia por %d minutos pelo Admin: %s. Motivo: %s", yNome ( yID ), yTempo, yNome ( playerid ), yMotivo ) ;
    SendClientMessageToAll ( -1, Celulas ) ;
   
    SetPlayerPos ( yID, 107.2300, 1920.6311, 18.5208 ) ;
    SetPlayerInterior ( yID, 0 ) ;
    PlayerPreso [ yID ] = yTempo * 60 ;
    return true ;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)