12.05.2012, 03:48
Is there a function for that? Where it only removes the player's current armed weapon, and not the other ones?
OMFG What the hell.
Here is the Function. pawn Код:
|
OMFG What the hell.
Here is the Function. pawn Код:
|
That would indeed just set them to hold fists.
You can always just loop through all the weapon data, remove all the weapons, and give all the weapons excluding the desired weapon |
stock RemoveWeapon(playerid, weaponid) SetPlayerAmmo(playerid, weaponid, 0);
stock SetPlayerAmmo(playerid, weaponid, ammo)
{
new weapon[13][2];
for(new i=0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, weapon[i][0], weapon[i][1]);
if(weapon[i][0] == weaponid)
{
GivePlayerWeapon(playerid, weaponid, -(weapon[i][1]*2));
break;
}
}
GivePlayerWeapon(playerid, weaponid, ammo);
return 1;
}
RemovePlayerWeapon
stock RemovePlayerWeapon(playerid, weaponid)
{
new plyWeapons[12];
new plyAmmo[12];
for(new slot = 0; slot != 12; slot++)
{
new wep, ammo;
GetPlayerWeaponData(playerid, slot, wep, ammo);
if(wep != weaponid)
{
GetPlayerWeaponData(playerid, slot, plyWeapons[slot], plyAmmo[slot]);
}
}
ResetPlayerWeapons(playerid);
for(new slot = 0; slot != 12; slot++)
{
GivePlayerWeapon(playerid, plyWeapons[slot], plyAmmo[slot]);
}
}