Jump to content
  • 0

Adding char id to an array.


Question

Posted

Hi,

How do I add character id to an array.

Sample:

Array = .@char_id
If Player A click NPC A.
then Plaayer B clicks NPC A.


Player A <CHAR_ID> will attach to .@char_id[0]
  Player B <CHAR_ID> will attach to same .@char_id[0]

Thanks

2 answers to this question

Recommended Posts

  • 0
Posted
.char_id[getarraysize(.char_id)] = getcharid(0);

You can't use .@char_id, as @ means temporary bound to the npc variable. It'll be cleaned when the script will hit it's end, and won't be shared through two instances running the script.

On the other hand, with this method, you'll have to handle the cleaning manually.

  • 0
Posted
1 hour ago, Alayne said:

.char_id[getarraysize(.char_id)] = getcharid(0);

You can't use .@char_id, as @ means temporary bound to the npc variable. It'll be cleaned when the script will hit it's end, and won't be shared through two instances running the script.

On the other hand, with this method, you'll have to handle the cleaning manually.

sweet thanks! Now things have more sense :P

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...