DonOmar Posted July 5, 2016 Share Posted July 5, 2016 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
Captain Cody Posted July 5, 2016 Share Posted July 5, 2016 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. Link to comment
Walid Posted July 5, 2016 Share Posted July 5, 2016 all what you need is: getSlotFromWeapon() getPedTotalAmmo() giveWeapon() Link to comment
DonOmar Posted July 6, 2016 Author Share Posted July 6, 2016 pfffffffffffff of course u know guys i cant create it iam requesting it. Link to comment
Walid Posted July 6, 2016 Share Posted July 6, 2016 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. Link to comment
DonOmar Posted July 6, 2016 Author Share Posted July 6, 2016 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. Link to comment
DonOmar Posted July 6, 2016 Author Share Posted July 6, 2016 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
Walid Posted July 6, 2016 Share Posted July 6, 2016 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now