Dante94 Posted May 5, 2013 Posted May 5, 2013 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?
iPrestege Posted May 5, 2013 Posted May 5, 2013 Use this function : getPlayerFromName Please next time use lua / lua tag .
manawydan Posted May 5, 2013 Posted May 5, 2013 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 )
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