Aller au contenu

Photo

Need help with script


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Incognito JC

Incognito JC
  • Members
  • 693 messages
This:

int nHas = CountItemsByTag(oPC, "item_whatever");

if ( nHas == 0 )
                    UT_AddItemToInventory(R"item_whatever");

is for one item, yes? So if I want to add more than one item, what do I change?

Is it:
int nHas = CountItemsByTag(oPC, "item_whatever", "Item_whatever2")

?

#2
Incognito JC

Incognito JC
  • Members
  • 693 messages
Oh wait, found my answer =P

#3
tribal15111

tribal15111
  • Members
  • 22 messages
for help to others post your answer plz it would help to know how you worked it out

#4
Rithwald

Rithwald
  • Members
  • 7 messages
you just do the UT_AddItemtoInventory(R"ITEMNAME"); multiple times

#5
Talian Kross

Talian Kross
  • Members
  • 239 messages

Rithwald wrote...

you just do the UT_AddItemtoInventory(R"ITEMNAME"); multiple times

Why?  You can include a count as a second parameter, you know. ;)

From the toolset help:

object UT_AddItemToInventory (
                              resource rItem,
                              int nNumToAdd = 1,
                              object oInvOwner = OBJECT_INVALID,
                              string sTag = "",
                              int bSuppressNote = FALSE,
                              int bDroppable = TRUE
                             )

Modifié par Talian Kross, 12 novembre 2009 - 11:01 .