[Ajuda] Bug Prisao
#1

Galera tou com um bug na prisao !
Quando um player faz DB ou E Preso por algum policial
Os minutos dele da cadeia nao conta !
Exemplo : Foi preso por 10 Minutos,
ele pode cumprir 30 minutos de prisao,que vai continuar preso por 10 Minutos !
Concordando : O Tempo nao sai dos 10 Minutos
Reply
#2

Você está Usando o GameMode da NWD certo?
Se sim, Esse GM é hackeado,E você tem de ter o Trabalho de Aprender a Fazer sozinho!

Funções:
https://sampwiki.blast.hk/wiki/SetPlayerPos
Reply
#3

Ungreli,eu pedi ajuda,e nao para eu vim aprender !
Reply
#4

Quote:
Originally Posted by leonardoaparecido
Посмотреть сообщение
Ungreli,eu pedi ajuda,e nao para eu vim aprender !
ue, vc n qr aprender ? simplesmente qr ficar sempre nas abas dos outros ?
Reply
#5

Procure no GM (Ctrl + F) isso:

pawn Код:
forward LiberarPrisao( playerid );
E/ou Ativa o Code que está Bloqueado

Que ira ficar assim:

pawn Код:
forward LiberarPrisao( playerid );
public LiberarPrisao( playerid )
{
    if( pInfo[ playerid ][ Preso ] <= 0 )
    {
        KillTimer( T_Preso[ playerid ] );
        TextDrawHideForPlayer( playerid, p_TextPreso[ playerid ] );
        SendClientMessage( playerid, 0xA9C4E4AA, "[ x ] Você cumpriu sua pena e está livre novamente !" );
        SetPlayerPos( playerid, 265.9714, 83.1550, 1001.0391 );
        SetPlayerInterior( playerid, 6 );
        SetPlayerWantedLevel( playerid, 0 );
        pInfo[ playerid ][ EntrouL ] = true;
        pInfo[ playerid ][ Preso ] = 0;
        SetPlayerHealth( playerid, 100.0 );
        GameTextForPlayer( playerid, "~w~SOLTO!", 3000, 0 );
        format( gFile, sizeof( gFile ), "Contas/%s.ini", PlayerName( playerid ));
        dini_IntSet( gFile, "Abuser", 0 );
        pInfo[ playerid ][ entrouDEL ] = 1;
        return 1;
    }
    if( pInfo[ playerid ][ Preso ] >= 1 )
    {
        pInfo[ playerid ][ Preso ] --;
        T_Preso[ playerid ] = SetTimerEx( "LiberarPrisao", 1000, false, "d", playerid );
        new
            d_Horas1,
            d_Minut1,
            d_Segun1
        ;
        formatSeconds( pInfo[ playerid ][ Preso ], d_Horas1, d_Minut1, d_Segun1 );
        if( d_Horas1 > 0 )
        {
            format( gstring, sizeof( gstring ), "~r~~h~Tempo de Prisao~n~~g~~h~Hora(s): %d~n~~p~~h~Minutos: ~w~%d~n~~b~~h~Segundos: ~w~%d", d_Horas1, d_Minut1, d_Segun1 );
            TextDrawSetString( p_TextPreso[ playerid ], gstring );
        }
        else if( d_Horas1 <= 0 && d_Minut1 > 0 )
        {
            format( gStr, sizeof( gStr ), "~r~~h~Tempo de Prisao~n~~n~~p~~h~Minutos: ~w~%d~n~~b~~h~Segundos: ~w~%d", d_Minut1, d_Segun1 );
            TextDrawSetString( p_TextPreso[ playerid ], gStr );
        }
        else if( d_Horas1 <= 0 && d_Minut1 <= 0 && d_Segun1 > 0 )
        {
            format( gStr, sizeof( gStr ), "~r~~h~Tempo de Prisao~n~~n~~b~~h~Segundos: ~w~%d", d_Segun1 );
            TextDrawSetString( p_TextPreso[ playerid ], gStr );
        }
        TextDrawShowForPlayer( playerid, p_TextPreso[ playerid ] );
    }
    return 1;
}

#EDIT:

Acrescente no Code:

pawn Код:
SetPlayerPos( playerid, 265.9714, 83.1550, 1001.0391 );
            SetPlayerInterior( playerid, 6 );
Se não ele não ira sair da Prisão,Sera solto apenas por Mensagem!
Reply
#6

Quote:

SetPlayerPos( playerid, 265.9714, 83.1550, 1001.0391 );
SetPlayerInterior( playerid, 6 );

Acrescento isso no final do cod neh ?
Reply
#7

Não, Isso se Acrescenta no Meio, Vou lhe mostrar como Fica!

pawn Код:
forward LiberarPrisao( playerid );
public LiberarPrisao( playerid )
{
    if( pInfo[ playerid ][ Preso ] <= 0 )
    {
        KillTimer( T_Preso[ playerid ] );
        TextDrawHideForPlayer( playerid, p_TextPreso[ playerid ] );
        SendClientMessage( playerid, 0xA9C4E4AA, "[ x ] Você cumpriu sua pena e está livre novamente !" );
        SetPlayerPos( playerid, 265.9714, 83.1550, 1001.0391 );
        SetPlayerInterior( playerid, 6 );
        SetPlayerWantedLevel( playerid, 0 );
        pInfo[ playerid ][ EntrouL ] = true;
        pInfo[ playerid ][ Preso ] = 0;
        SetPlayerHealth( playerid, 100.0 );
        GameTextForPlayer( playerid, "~w~SOLTO!", 3000, 0 );
        format( gFile, sizeof( gFile ), "Contas/%s.ini", PlayerName( playerid ));
        dini_IntSet( gFile, "Abuser", 0 );
        SetPlayerPos( playerid, 265.9714, 83.1550, 1001.0391 );
        SetPlayerInterior( playerid, 6 );
        pInfo[ playerid ][ entrouDEL ] = 1;
        return 1;
    }
    if( pInfo[ playerid ][ Preso ] >= 1 )
    {
        pInfo[ playerid ][ Preso ] --;
        T_Preso[ playerid ] = SetTimerEx( "LiberarPrisao", 1000, false, "d", playerid );
        new
            d_Horas1,
            d_Minut1,
            d_Segun1
        ;
        formatSeconds( pInfo[ playerid ][ Preso ], d_Horas1, d_Minut1, d_Segun1 );
        if( d_Horas1 > 0 )
        {
            format( gstring, sizeof( gstring ), "~r~~h~Tempo de Prisao~n~~g~~h~Hora(s): %d~n~~p~~h~Minutos: ~w~%d~n~~b~~h~Segundos: ~w~%d", d_Horas1, d_Minut1, d_Segun1 );
            TextDrawSetString( p_TextPreso[ playerid ], gstring );
        }
        else if( d_Horas1 <= 0 && d_Minut1 > 0 )
        {
            format( gStr, sizeof( gStr ), "~r~~h~Tempo de Prisao~n~~n~~p~~h~Minutos: ~w~%d~n~~b~~h~Segundos: ~w~%d", d_Minut1, d_Segun1 );
            TextDrawSetString( p_TextPreso[ playerid ], gStr );
        }
        else if( d_Horas1 <= 0 && d_Minut1 <= 0 && d_Segun1 > 0 )
        {
            format( gStr, sizeof( gStr ), "~r~~h~Tempo de Prisao~n~~n~~b~~h~Segundos: ~w~%d", d_Segun1 );
            TextDrawSetString( p_TextPreso[ playerid ], gStr );
        }
        TextDrawShowForPlayer( playerid, p_TextPreso[ playerid ] );
    }
    return 1;
}
Só uma Duvida, Você que me deu -REP ? .-.
Reply
#8

Nao,eu vou dar +Rep Agora !
Edit- Pode ver,nao foi eu que dei Rep - Nao !
Eu coloquei + Agora !
Reply
#9

/\ Como se adiantasse, vocк tem Rep negativa hu3

Cara que quer tudo na mгo й fod.a
Reply
#10

Sti,nao funciono nao !
Alguem me ajuda Porfavor !
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)