Jump to content

giveammo


alcholistu

Recommended Posts

I should do something like :

function giveammo 
local setWeaponAmmo ( mp5 theWeapon, 100 Ammo ) 
end 
addCommandHandler ( giveammo, giveammo) 

???

or someting like :

function giveammo( thePlayer, commandName, weaponID, ammo ) 
    local status = giveWeapon ( thePlayer, weaponID, ammo, true ) 
    if ( not status ) then 
        outputConsole ( "Failed to give weapon.", thePlayer ) 
    end 
end 
addCommandHandler ( giveammo, giveammo) 

Link to comment
I should do something like :
function giveammo 
local setWeaponAmmo ( mp5 theWeapon, 100 Ammo ) 
end 
addCommandHandler ( giveammo, giveammo) 

???

or someting like :

function giveammo( thePlayer, commandName, weaponID, ammo ) 
    local status = giveWeapon ( thePlayer, weaponID, ammo, true ) 
    if ( not status ) then 
        outputConsole ( "Failed to give weapon.", thePlayer ) 
    end 
end 
addCommandHandler ( giveammo, giveammo) 

wiki copy past -_-"

Link to comment
  • Moderators
function giveammo(thePlayer, commandName, ammo) 
    if ammo then 
        local weapon = getPedWeapon(thePlayer) 
        if weapon == 0 then return end 
        local totalAmmo = getPedTotalAmmo(thePlayer) 
        setWeaponAmmo(thePlayer, weapon, totalAmmo+tonumber(ammo)) 
    end 
end 
addCommandHandler( "giveammo", giveammo ) 

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