Malicious Hero.

[REL] HeroInventory - Inventory System [Groups + More]

Recommended Posts

Try it add item to your inventory and then drag it away and you can drag how much you want lol.

I've tested that before I even released it. Worked perfectly fine. The others who I also tested it with didn't notice it either.

Share this post


Link to post
-- exportando inventario 
  
--exports [ "heroinventory" ]:addInventoryGroup( "Armas", "Armas.png" ) 
--exports [ "heroinventory" ]:addInventoryGroup( "Itens", "Itens.png" ) 
  
  
function InventarioSpawn() 
exports [ "heroinventory" ]:addPlayerItem(source,1,1) 
exports [ "heroinventory" ]:addPlayerItem(source,2,1) 
exports [ "heroinventory" ]:addPlayerItem(source,3,1) 
exports [ "heroinventory" ]:addPlayerItem(source,4,1) 
end 
addEventHandler("onPlayerSpawn",getRootElement(),InventarioSpawn) 
  
function UsarItemInventario(ID,qu) 
  if ID == 1 and  getPedWeapon (source) == 22 and getPedTotalAmmo(source)>0 then 
  exports [ "heroinventory" ]:removeItemFromPlayer(source,1,1) 
  setWeaponAmmo(source,22,getPedTotalAmmo(source)+17) 
setPedAnimation( source, "COLT45", "colt45_reload",-1000,false) 
AnimacaoNula(source,1000) 
   elseif ID == 2 and  getPedWeapon (source) == 25 and getPedTotalAmmo(source)>0 then 
  exports [ "heroinventory" ]:removeItemFromPlayer(source,2,1) 
  setWeaponAmmo(source,25,getPedTotalAmmo(source)+7) 
setPedAnimation( source, "BUDDY", "buddy_reload",-1700,false) 
AnimacaoNula(source,1700) 
elseif ID == 3 and  getPedWeapon (source) == 34 and getPedTotalAmmo(source)>0 then 
  exports [ "heroinventory" ]:removeItemFromPlayer(source,3,1) 
  setWeaponAmmo(source,34,getPedTotalAmmo(source)+5) 
setPedAnimation( source, "BUDDY", "buddy_reload",-1700,false) 
AnimacaoNula(source,1700) 
  
elseif ID == 4 and  getPedWeapon (source) == 29 or getPedWeapon (source) == 28 or getPedWeapon (source) == 32  and getPedTotalAmmo(source)>0 then 
  exports [ "heroinventory" ]:removeItemFromPlayer(source,4,1) 
local Wid = getPedWeapon (source) 
  setWeaponAmmo(source,Wid,getPedTotalAmmo(source)+math.random(10,20)) 
setPedAnimation( source, "UZI", "UZI_reload",-1500,false) 
AnimacaoNula(source,1500) 
  end 
   end 
 addEvent("onPlayerUseItem",true) 
addEventHandler("onPlayerUseItem",getRootElement(),UsarItemInventario) 
  
function AnimacaoNula(source,Tempo) 
setTimer(setPedAnimation,Tempo,1,source,nil) 
end 

I have a problem. Even after the item away (vanish), the player can still click and get more.

obs: I added the group "armas" in inventories (heroinventory).

Share this post


Link to post

ERROR: HeroInventory\server\s_exports.lua:81: attempt to index field '?' <a nil value> 

I cannot add vehicles or anything I use.

Share this post


Link to post

if i add group and then restart server writes server triggered clientside event updateInventoryGroups, but event is not added clientside

Share this post


Link to post

how to let players use it? because i have instal the script and it works, but how about when they buy a skin?

(sorry i am a Starter with Scripts and Scripting)

Share this post


Link to post

I will ask quetion from where you get those nice pictures ? Plz help if you made them so how and which software u use ?

Share this post


Link to post

can any one help me how to create ped sell that items? because i try 3 day about that but usesless

Share this post


Link to post

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.