SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 02/11/2010, 12:35 PM   #1
ZamaXor
Big Clucker
 
Join Date: Jul 2010
Posts: 109
Reputation: 0
Default Fix this thing

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;
}
ZamaXor is offline  
Old 02/11/2010, 12:46 PM   #2
OldDirtyBastard
Huge Clucker
 
OldDirtyBastard's Avatar
 
Join Date: Jan 2010
Posts: 296
Reputation: 0
Default Re: Fix this thing

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
OldDirtyBastard is offline  
Old 02/11/2010, 12:47 PM   #3
ZamaXor
Big Clucker
 
Join Date: Jul 2010
Posts: 109
Reputation: 0
Default Re: Fix this thing

I need only this anti drive by that i posted.
ZamaXor is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vehicle respawn thing thing velkarumpali Help Archive 5 28/07/2009 07:29 PM
is there such a thing. BP13 Help Archive 8 09/07/2009 09:27 AM
One thing, someone help. Dreftas Help Archive 3 25/06/2009 07:37 PM


All times are GMT. The time now is 05:27 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.