alcholistu Posted February 22, 2013 Author Posted February 22, 2013 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)
PaiN^ Posted February 22, 2013 Posted February 22, 2013 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 -_-"
DNL291 Posted February 22, 2013 Posted February 22, 2013 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 )
iPrestege Posted February 22, 2013 Posted February 22, 2013 You Should To Read it And Learn How To Do it .
PaiN^ Posted February 22, 2013 Posted February 22, 2013 You Should To Read it And Learn How To Do it . Not only copy past
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