alcholistu Posted February 22, 2013 Share Posted February 22, 2013 How to create the command /giveammo ? Link to comment
PaiN^ Posted February 22, 2013 Share Posted February 22, 2013 setWeaponAmmo Or setWeaponProperty Link to comment
TAPL Posted February 22, 2013 Share Posted February 22, 2013 addCommandHandler giveWeapon Link to comment
alcholistu Posted February 22, 2013 Author Share 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) Link to comment
PaiN^ Posted February 22, 2013 Share 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 -_-" Link to comment
alcholistu Posted February 22, 2013 Author Share Posted February 22, 2013 And how should i do ? Link to comment
DNL291 Posted February 22, 2013 Share 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 ) Link to comment
iPrestege Posted February 22, 2013 Share Posted February 22, 2013 You Should To Read it And Learn How To Do it . Link to comment
PaiN^ Posted February 22, 2013 Share Posted February 22, 2013 You Should To Read it And Learn How To Do it . Not only copy past Link to comment
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