add items in inventory

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

xiongmao

New Member
Sep 14, 2004
2
0
0
Hi,
i would like to add items to the pawn's inventory.
I m making an interface. With one of this button you will able for example to add night vision goggles to the inventory of the player selected.
i ve got no problem to select the pawn.
so i use the fonction
Pawn.addinventory(additems(0));

additems is a function which takes an index and returns an inventory
Code:
inventory additems(int index)
{
local inventory item
item makeitem(additemstring(index))
return item
}
the function additemstring returns the string of the class
Code:
string additemstring(int index)
{
local string itemname
 switch(index)
   {
     case 0: itemname = "AGP_Inventory.NightOpticsDevice";break;
   }
return itemname
}
makeitem is a function found in the package AGP_Itemlist

but when i use Pawn.addinventory(additems(0));
we should see the picture of the nightvisiongoggles on the right of the screen
and nothing appeared and i can't use it
tell me if you know something about adding items.
thanks
 
Last edited by a moderator:

Rythmix

New Member
Sep 1, 2004
84
0
0
if you are using the nightvision mut with this, i dont think the nightvision goggles have an actor to sit in the corner. they are just mutating the texture overlay. try something like ammo
 
Last edited by a moderator: