remove weapon
#5

I tested and it works.
pawn Код:
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
pawn Код:
CMD:removeweap( playerid, params[ ] )
{
    new
        id, weapon;

    if( sscanf( params, "ri", id, weapon ) ) return SendClientMessage( playerid, -1, "Usage: /removeweap <ID/Part Of Name> <Weapon ID>" );
    if( id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "That player isn't connected!" );
    RemovePlayerWeapon( id, weapon );
    return 1;
}

stock RemovePlayerWeapon( playerid, weaponid )
{
    new
        plyWeapons[ 12 ], plyAmmo[ 12 ];

    for( new slot = 0; slot != 12; slot ++ )
    {
        new
            weap, ammo;
           
        GetPlayerWeaponData( playerid, slot, weap, ammo );
        if( weap != weaponid )
        {
            GetPlayerWeaponData( playerid, slot, plyWeapons[ slot ], plyAmmo[ slot ] );
        }
    }
    ResetPlayerWeapons( playerid );
    for( new slot = 0; slot != 12; slot ++ )
    {
        GivePlayerWeapon( playerid, plyWeapons[ slot ], plyAmmo[ slot ] );
    }
}
Reply


Messages In This Thread
remove weapon - by viosteaua98 - 25.01.2012, 16:17
Re: remove weapon - by Konstantinos - 25.01.2012, 16:28
Re: remove weapon - by viosteaua98 - 25.01.2012, 16:29
Re: remove weapon - by milanosie - 25.01.2012, 17:08
Re: remove weapon - by Konstantinos - 25.01.2012, 17:19
Re: remove weapon - by Oh - 25.01.2012, 17:51

Forum Jump:


Users browsing this thread: 2 Guest(s)