Aller au contenu

Photo

Get Is Item Worn?


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

#1
Genisys

Genisys
  • Members
  • 525 messages
I need to know if someone has a function that can return if the ActivatedItemTarget()  of a tagbased item, is targeting an Item the PC is wearing...

Thanks for the help...

I get an error when I try to get the object type of the activated target, anyone know why or how to get the type of the target?

#2
Shadooow

Shadooow
  • Members
  • 4 468 messages
LINK - look for int GetSlotByItem, if this will return -1 player dont have item equipped.

#3
Genisys

Genisys
  • Members
  • 525 messages
I don't see GetSlotByItem in your link...

could you post it here?

Also, how do you use -1?  (Is this correct? if(nInt == -1)  ?

What about the error I was getting, did you read about that?

Modifié par Genisys, 08 août 2010 - 11:26 .


#4
Shadooow

Shadooow
  • Members
  • 4 468 messages

int GetSlotByItem(object oItem, object oCreature=OBJECT_SELF)
{
int nTh;
 for(;nTh < NUM_INVENTORY_SLOTS;nTh++)
 {
 object oitem = GetItemInSlot(nTh,oCreature);
  if(oitem == oItem)
  {
  return nTh;
  }
 }
return -1;
}

example

 if(GetSlotByItem(oItem,oPC) < 0)//or == -1 like you wrote
 {
  //PC dont have item in any slot/worn
 }


next time, try CTRL+F in your browser ;)

Modifié par ShaDoOoW, 08 août 2010 - 12:11 .


#5
Genisys

Genisys
  • Members
  • 525 messages
tanks a lot XD