Jump to content
  • 0

setting instance var, right at the creation


Sting0r

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   1
  • Joined:  03/08/19
  • Last Seen:  

Hi, i'm trying to have a var initialised right at the instance creation, so all instance script can relate on it, event before OnInstanceInit: and i don't want to use a global var like $var

i tryed 
    strdb_iput( entry->regs.vars, "somevar", 10 );

just after 
    entry->regs.vars = i64db_alloc(DB_OPT_RELEASE_DATA);

in instance_create() function, but when i put a simple "announce "somevar: " + 'somevar,bc_all;

it just output 0 instead of 10, so i guess it's not that simple ?

 

i got it with
    i64db_i64put( entry->regs.vars, reference_uid(add_str("'somevar"), 0), 10);

 

Edited by Sting0r
for sharing purpose!
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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