27.07.2012, 09:30
Hello. Well, looking Armed Body script that someone made, i arranged to move it into my script and put it how i wanted, but now a clue comes.. It actualy attaches groups(The gun slots, for example slot 5 is M4 and AK47), but i want it to only attach Katana, that is from group 1.
This is part of the code, to attach all the group 1 of weapons, where is Katana, Knife, Police NiteStick, and these.
I want to only attach katana...
If somebody can help me, i would be thankful cos i am not very familiar with attachments yet.
This is part of the code, to attach all the group 1 of weapons, where is Katana, Knife, Police NiteStick, and these.
I want to only attach katana...
If somebody can help me, i would be thankful cos i am not very familiar with attachments yet.
pawn Код:
new
weaponid[13],weaponammo[13],pArmedWeapon;
pArmedWeapon = GetPlayerWeapon(playerid);
GetPlayerWeaponData(playerid,1,weaponid[1],weaponammo[1]);
if(weaponid[1] && weaponammo[1] > 0)
{
if(pArmedWeapon != weaponid[1])
{
if(!IsPlayerAttachedObjectSlotUsed(playerid,9))
{
SetPlayerAttachedObject(playerid,9,GetWeaponModel(weaponid[1]),1, 0.200000, -0.129999, -0.009999, 0.000000, 240.000000, 0.000000, 1.000000, 1.000000, 1.000000);
}
}
else
{
if(IsPlayerAttachedObjectSlotUsed(playerid,9))
{
RemovePlayerAttachedObject(playerid,9);
}
}
}