25.01.2012, 17:19
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 ] );
}
}