Jump to content

Need Help with Replacing Satchel with grenades


DonOmar

Recommended Posts

Posted

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.

560x95_FFFFFF_FF9900_000000_000000.png

Posted

You could probably store it in play account data, if you have satchels, but you buy a grandade you can run a check if you have sctchles store the amount you have then give you a grande. But you would have to have a command or key bound to switch between those to.

Wolf Inc Discord

Youtube channel
Github

Posted

all what you need is:

getSlotFromWeapon() 
getPedTotalAmmo() 
giveWeapon() 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
pfffffffffffff of course u know guys i cant create it iam requesting it.

:fp: don't ask for ready codes , do it by yourself then post your code here.

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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

so why i requested it because i cant make it or make any code.

560x95_FFFFFF_FF9900_000000_000000.png

Posted

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 

560x95_FFFFFF_FF9900_000000_000000.png

Posted

  • 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.

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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...