GiveInventory: Difference between revisions
(Created page with "{{ACSFunction|description=Gives inventory items to player activator. |usage=''void'' '''GiveInventory'''(''str itemname'', ''int amount'') |parameters= *''itemname'': name of item or power to give. *''amount'': how much to give. If -1, then give maximum possible. |notes= |id=ACC internal}}") |
No edit summary |
||
| Line 3: | Line 3: | ||
|parameters= | |parameters= | ||
*''itemname'': name of [[item]] or [[power]] to give. | *''itemname'': name of [[item]] or [[power]] to give. | ||
*''amount'': how much to give. If | *''amount'': how much to give. If negative value, then give maximum possible. | ||
|notes= | |notes= | ||
If ''amount'' is 0, this will do nothing. | |||
If name is a '''Power...''' name, then it gives the player extra ''amount'' tics of power, which can add if the player already has this power. Important exception is with '''PowerStrength''', which is always infinite (but adding to the number will speed up "recovering" from the red tint). With negative amount, the power will last forever. | |||
For any item that is not a direct power name, it will grant the same amount as if player picked up ''amount'' items, if the value is positive, or the maximum possible for that item, if negative. | |||
|id=ACC internal}} | |id=ACC internal}} | ||
Latest revision as of 02:26, 10 May 2026
Description[edit]
This is an ACS built-in function.
Gives inventory items to player activator.
Usage[edit]
void GiveInventory(str itemname, int amount)
Parameters[edit]
- itemname: name of item or power to give.
- amount: how much to give. If negative value, then give maximum possible.
Return value[edit]
Examples[edit]
No examples given.
Notes[edit]
If amount is 0, this will do nothing.
If name is a Power... name, then it gives the player extra amount tics of power, which can add if the player already has this power. Important exception is with PowerStrength, which is always infinite (but adding to the number will speed up "recovering" from the red tint). With negative amount, the power will last forever.
For any item that is not a direct power name, it will grant the same amount as if player picked up amount items, if the value is positive, or the maximum possible for that item, if negative.
This function's identification in zspecial.acs is: ACC internal.