Jump to content

Need Help with Replacing Satchel with grenades


DonOmar

Recommended Posts

Hi iam asking anyone for a code that if i have satchel and wanna buy Grenades the satchels will be replaced to Grenades.

in my server if i have [EXAMPLE:] 80 satchels and bought 1 grenade i will lose satchel . so i wanna make it when i buy 1 grenade and i have 80 satchel it will be changed to 81 grenades.

Link to comment

so please can u check this ?

  
function purchaseAmmo() 
    local weapons = getPlayerWeapons( player, weaponSlot) 
    local currentWeaponAmmo = getPedTotalAmmo( player, getSlotFromWeapon(weaponID)) 
    local totalAmmo = currentWeaponAmmo+weaponAmmo 
    if ammoType == "magazine" then 
        if currentWeaponAmmo then 
        setWeaponAmmo( player, weaponID, currentWeaponAmmo+weaponAmmo) 
        end 

Link to comment

  • getPlayerWeapons(): There is no function called getPlayerWeapons.
  • player: it's not defined in your code.
  • weaponID: it's not defined in your code.
  • weaponAmmo: Also it's not defined in your code.
  • Same thing with ammotype.
  • end expected to close the function at line 10 and 11.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...