Jump to content

Give weapon problem (silly question)


Recommended Posts

Yo guys :)

I'm using this

function consoleGive ( thePlayer, commandName, weaponID, ammo ) 
    local status = giveWeapon ( thePlayer, weaponID, ammo, true )   -- attempt to give the weapon, forcing it as selected weapon 
    if ( not status ) then                                          -- if it was unsuccessful 
        outputConsole ( "Failed to give weapon.", thePlayer )   -- tell the player 
    end 
end 
addCommandHandler ( "give", consoleGive ) 

but i want the possibility to give weapons not to me but to an indicated player! What i have to add to make it work like that?

Link to comment
function consoleGive ( thePlayer, commandName, weaponID, ammo ) 
local weaponID = tonumber(weaponID) 
local ammo = tonumber(ammo) 
if weaponID and ammo then 
    local status = giveWeapon ( thePlayer, weaponID, ammo, true )    
    else                                           
        outputConsole ( "Failed to give weapon.", thePlayer )    
    end 
end 
addCommandHandler ( "give", consoleGive ) 

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