The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Using the GiveItem function?
Shadowfied Offline
Senior Member

Posts: 261
Threads: 34
Joined: Jul 2010
Reputation: 5
#1
Using the GiveItem function?

Been searching a bit and I can't find out how to get it to work.

void GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount);
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.
asName - internal name
asType - item to give
asSubTypeName - item name for .lang file
asImageName -
afAmount - amount to give
(from the FG wiki)
PHP Code: (Select All)
void FillContFunc (string &in asItemstring &in asEntity)
{
    
RemoveItem(asItem);
    
GiveItem("FullCont""glass_container_mix_done""glasscontainer_full"""1);

What's wrong with this? It removes the empty glass container but it doesn't give me the filled one.

I know how to use GiveItemFromFile but then I don't get my custom set name and description, besides it says on the FG wiki that script is mostly for debug purposes. (I do use the GiveItemFromFile function to get the items otherwise when In debug mode)



Current - Castle Darkuan
Other - F*cked Map
01-26-2012, 02:34 PM
Find


Messages In This Thread
Using the GiveItem function? - by Shadowfied - 01-26-2012, 02:34 PM
RE: Using the GiveItem function? - by palistov - 01-26-2012, 03:10 PM
RE: Using the GiveItem function? - by Shadowfied - 01-26-2012, 03:12 PM
RE: Using the GiveItem function? - by palistov - 01-26-2012, 03:15 PM
RE: Using the GiveItem function? - by Shadowfied - 01-26-2012, 03:15 PM
RE: Using the GiveItem function? - by palistov - 01-26-2012, 03:22 PM
RE: Using the GiveItem function? - by Shadowfied - 04-20-2012, 09:36 PM
RE: Using the GiveItem function? - by palistov - 04-20-2012, 10:58 PM
RE: Using the GiveItem function? - by DnALANGE - 07-23-2013, 02:28 AM



Users browsing this thread: 2 Guest(s)