28.06.2013, 01:31
Something like that in OnPlayerUpdate or your own Timer
pawn Код:
new CurrentWeapon = GetPlayerWeapon(playerid);
if(CurrentWeapon == WEAPON_M4)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, YOUR_SLOT_FOR_M4))
RemovePlayerAttachedObject(playerid, YOUR_SLOT_FOR_M4);
}else{
if(!IsPlayerAttachedObjectSlotUsed(playerid, YOUR_SLOT_FOR_M4))
SetPlayerAttachedObject( playerid, YOUR_SLOT_FOR_M4, 356, 1, -0.236845, -0.152927, 0.067450, 355.142028, 17.515201, 8.209364, 0.875876, 1.053802, 0.757611 ); // m4 -
}