03.11.2011, 00:57
This is very annoyning: for example, I have a shotgun with 500 bullets. Then, I get 1 sawn-off bullet et voila - I have 501 sawn off bullets. Any solutions? I think its something to do with weap slots :3
{ ResetPlayerWeapons(playerid); return 1; } { AC_GivePlayerWeapon(playerid, 26, 500); return 1; }
Well, if you mean that you are wanting 500 spawn off bullets after switching from a standard shotgun, it is rather simple...
This should work, although I have no tested it... Код:
{ ResetPlayerWeapons(playerid); return 1; } { AC_GivePlayerWeapon(playerid, 26, 500); return 1; } |
Real_GivePlayerWeapon(playerid, weaponid, ammo)
{
new weapons[2][13];
for(new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, weapons[0][i], weapons[1][i]);
if(weapons[0][i] == weaponid)
{
GivePlayerWeapon(playerid, weaponid, -weapons[1][i]);
GivePlayerWeapon(playerid, weaponid, ammo);
return 1;
}
}
GivePlayerWeapon(playerid, weaponid, ammo);
return 1;
}