Jump to content
  • 0

correct use of getd


Question

Posted

could someone help me with getd? i have this:

explode(.@opcoes$,getd(".@"+"enchantgroup"+(atoi(getarg(1))+1)+"$")[(rand(1,getarraysize(getd(".@"+"enchantgroup"+(atoi(getarg(1))+1)+"$")))-1)],",");


and i'm getting this error:

Quote

[Error]:  Loading NPC file: npc/inq.txt
script error on npc/inq.txt line 137
    parse_callfunc: not enough arguments, expected ','

 

3 answers to this question

Recommended Posts

  • 0
Posted
6 minutes ago, luan122 said:

could someone help me with getd? i have this:


explode(.@opcoes$,getd(".@"+"enchantgroup"+(atoi(getarg(1))+1)+"$")[(rand(1,getarraysize(getd(".@"+"enchantgroup"+(atoi(getarg(1))+1)+"$")))-1)],",");


and i'm getting this error:

 

Hi, 

You could try searching at trunk/doc/script_command.txt

---------------------------------------



*getd("<variable name>")



Returns a reference to a variable, the name can be constructed dynamically.

Refer to 'setd' for usage.



This can also be used to set an array dynamically:

	setarray getd(".array[0]"), 1, 2, 3, 4, 5;



Examples:



	set getd("$varRefence"), 1;

	set @i, getd("$" + "pikachu");



---------------------------------------

 

  • 0
Posted
Just now, pajodex said:

Hi, 

You could try searching at trunk/doc/script_command.txt


---------------------------------------



*getd("<variable name>")



Returns a reference to a variable, the name can be constructed dynamically.

Refer to 'setd' for usage.



This can also be used to set an array dynamically:

	setarray getd(".array[0]"), 1, 2, 3, 4, 5;



Examples:



	set getd("$varRefence"), 1;

	set @i, getd("$" + "pikachu");



---------------------------------------

 

I know that, was there where i tried to learn but looks like i failed

  • 0
Posted
19 minutes ago, luan122 said:

explode(.@opcoes$,getd(".@"+"enchantgroup"+(atoi(getarg(1))+1)+"$")[(rand(1,getarraysize(getd(".@"+"enchantgroup"+(atoi(getarg(1))+1)+"$")))-1)],",");

try this

explode(.@opcoes$,getd(".@"+"enchantgroup"+(atoi(getarg(1))+1)+"$"),[(rand(1,getarraysize(getd(".@"+"enchantgroup"+(atoi(getarg(1))+1)+"$")))-1)]);

 

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