Jump to content
  • 0

Adding char id to an array.


pajodex

Question


  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  436
  • Reputation:   167
  • Joined:  12/12/17
  • Last Seen:  

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

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  342
  • Reputation:   169
  • Joined:  02/25/12
  • Last Seen:  

.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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  436
  • Reputation:   167
  • Joined:  12/12/17
  • Last Seen:  

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

Link to comment
Share on other sites

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.

×
×
  • Create New...