Jump to content

giveWeapon


Spice

Recommended Posts

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

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