Fix this thing
#1

When player is on bike the animation not stops.I need to fix it.

pawn Code:
#include <a_samp>

forward AntiDB(playerid);

public OnFilterScriptInit()
{
    print("- Anti Driveby -");
    print("- LOADED -");
    SetTimer("AntiDB",100,true);
    return 1;
}

public AntiDB(playerid)
{
    if (GetPlayerWeapon(playerid) == 28 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
    ApplyAnimation(playerid, "SILENCED", "Silence_reload", 3.0, 0, 0, 0, 0, 0);
    }
    if (GetPlayerWeapon(playerid) == 29 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
    ApplyAnimation(playerid, "SILENCED", "Silence_reload", 3.0, 0, 0, 0, 0, 0);
    }
    if (GetPlayerWeapon(playerid) == 32 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
    ApplyAnimation(playerid, "SILENCED", "Silence_reload", 3.0, 0, 0, 0, 0, 0);
    }
    return 1;
}
Reply
#2

that anti-db script doesnt looks very eficient, try this one:
pawn Code:
new
    PlayerWeapon[ MAX_PLAYERS ][ 13 ], // Variable  [ 1 ]
    PlayerAmmo  [ MAX_PLAYERS ][ 13 ]; // Variable  [ 2 ]

public OnPlayerStateChange( playerid, newstate, oldstate )
{
    if( newstate == PLAYER_STATE_DRIVER )
    {
        for( new i = false; i<13; i++ )
        {
            GetPlayerWeaponData( playerid, i, PlayerWeapon[ playerid ][ i ], PlayerAmmo[ playerid ][ i ] );
        }
        ResetPlayerWeapons     ( playerid );
       
    }
    if( oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT )
    {
        for( new i = false; i<13; i++ )
        {
            GivePlayerWeapon( playerid, PlayerWeapon[ playerid ][ i ],PlayerAmmo[ playerid ][ i] );
        }
    }
    return true;
}
Credits to: RenisiL
Reply
#3

I need only this anti drive by that i posted.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)