Jump to content
  • 0

Overwriting user function


Question

Posted (edited)

How to solve? it worked before why is not working now o.o, 

//this is the function 
script    D_huntermark    {
    return (countitem(1004) > 0 || countitem(1006) > 0);
}

//And I used this to call the function
if (!callfunc("D_huntermark")) {

 

 

eeeeeee.png

Edited by Noctis

21 answers to this question

Recommended Posts

  • 0
Posted
2 minutes ago, n0tttt said:

You have that function two times. Search in a file you are suspicious about or use the search in multiple files function in Sublime Text or Notepad++.

I have another file that call that function, its because of that? 

  • 0
Posted
2 hours ago, Noctis said:

I have another file that call that function, its because of that? 

No, I mean you have another function script with that name. Calling doesn't resolve in the message you shown.

  • 0
Posted
8 hours ago, n0tttt said:

No, I mean you have another function script with that name. Calling doesn't resolve in the message you shown.

I have only 1 file with that function, thats why its weird

  • 0
Posted (edited)
On 6/27/2017 at 5:36 AM, Noctis said:

How to solve? it worked before why is not working now o.o, 


//this is the function 
script    D_huntermark    {
    return (countitem(1004) > 0 || countitem(1006) > 0);
}

//And I used this to call the function
if (!callfunc("D_huntermark")) {

 

 

try closing the function script with "end;"

 

function	script	D_huntermark    {
    return (countitem(1004) > 0 || countitem(1006) > 0);
end;
}

 

Edited by Keitenai
  • 0
Posted
3 minutes ago, Keitenai said:

 

try closing the function script with "end;"

 


script    D_huntermark    {
    return (countitem(1004) > 0 || countitem(1006) > 0);
end;
}

 

still says overwriting, so weird...

  • 0
Posted
1 minute ago, Keitenai said:

function	script	D_huntermark    {
    return (countitem(1004) > 0 || countitem(1006) > 0);
end;
}

 

add the "function" on your script

Ye I added

  • 0
Posted
4 minutes ago, Keitenai said:

try check all your custom scripts and see if there's a duplicated function as @n0tttt suggests 

I dont think so, already checked, I even tried to change the function name :/ 

  • 0
Posted (edited)

but now the 

function	script	D_huntermark  is gone xD
 [EDIT]
it worked, but cant find the function in the script o.O, how can it work without the function lol @Keitenai
Edited by Noctis
  • 0
Posted (edited)

or try to remove the "||" on your function:

 

function	script	D_huntermark	{
	return (countitem(47007) > 0);
}

 

and keep everything else as it was

;)

Edited by Keitenai
  • 0
Posted
7 minutes ago, Keitenai said:

are you using it for other script?

if so then you can just change the:


if (!callfunc("D_huntermark")) {

in to this:


if(!countitem(47007)){

 

Ye Im using for other script, then I dont need to call the function anymore?

  • 0
Posted
1 minute ago, Keitenai said:

No need to make additional function for item check, plus you will also free a small portion of your server resources by removing the function script. :)

Thanks for the help, so now instead of calling the function, I use 

if(!countitem(47007)){?

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