Spice Posted July 5, 2015 Share Posted July 5, 2015 addEvent("givepistol",true) addEventHandler("givepistol",root, function () local moneyammount = 10000 local money = getPlayerMoney (source) >= moneyammount if not getSlotFromWeapon ( 16 ) then if money then local tk = takePlayerMoney (source, 10000) if tk then giveWeapon (source, 16, 1, true) end else outputChatBox ("You need to have atleast 10000 $ to buy this weapon") end else outputChatBox ("You already got this weapon") end end ) I want that if the player have the wep this out put to him "You already got this weapon" Link to comment
TAPL Posted July 5, 2015 Share Posted July 5, 2015 if getPedWeapon(source, getSlotFromWeapon(16)) ~= 16 then Link to comment
Spice Posted July 5, 2015 Author Share Posted July 5, 2015 if getPedWeapon(source, getSlotFromWeapon(16)) ~= 16 then thanks, another small help please piscurrammo = getPedTotalAmmo ( source, 22 ) setWeaponAmmo ( source, 22, piscurrammo+amm, 17 ) why this isn't working, amm is guigettext from a editbox Link to comment
Spice Posted July 5, 2015 Author Share Posted July 5, 2015 try amm = tonumber(amm) not working debug : [11:56:28] ERROR: ammoshop\server.lua:29: attempt to perform arithmetic on globa l 'piscurrammo' (a boolean value) Link to comment
Tomas Posted July 6, 2015 Share Posted July 6, 2015 piscurrammo = getPedTotalAmmo ( source, getSlotFromWeapon ( 22 ) ) Link to comment
Spice Posted July 6, 2015 Author Share Posted July 6, 2015 piscurrammo = getPedTotalAmmo ( source, getSlotFromWeapon ( 22 ) ) Thanks <3 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