08.05.2012, 22:40
Quote:
awe vlw deu certo, sу q tem como, quando ele tiver com a dina, e digitar /roubar, a dinamite some, esу se ele tivier 2 ai ele fica com 1?
|
pawn Код:
new ammo = GetPlayerAmmo(playerid);
RemovePlayerWeapon(playerid, 39);
GivePlayerWeapon(playerid, 39, ammo-1);
pawn Код:
stock RemovePlayerWeapon(playerid, weaponid)
{
if(!IsPlayerConnected(playerid) || weaponid < 0 || weaponid > 50)
return;
new
saveweapon[13],
saveammo[13];
for(new slot = 0; slot < 13; slot++)
GetPlayerWeaponData(playerid, slot, saveweapon[slot], saveammo[slot]);
ResetPlayerWeapons(playerid);
for(new slot; slot < 13; slot++)
{
if(saveweapon[slot] == weaponid || saveammo[slot] == 0)
continue;
GivePlayerWeapon(playerid, saveweapon[slot], saveammo[slot]);
}
GivePlayerWeapon(playerid, 0, 1);
}