Jump to content
  • 0

Initnpctimer within a function


PedroProplayer

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   4
  • Joined:  10/10/13
  • Last Seen:  

I'm working on an anti-bot script for my server. The player has a given time to reply before being flagged as a potential bot.

The script works fine while I was making it inside a NPC script. I then moved it to a function and made the NPC call the function, and now the timer doesn't attach to the character.

yuno_fild01,125,119,0	script	captcha	611,5,5,{

	attachnpctimer;
	initnpctimer;

The above part works. However, when I changed it to this:

yuno_fild01,125,119,0	script	captcha::patrol01	611,5,5,{

	callfunc "botpatrol",strcharinfo(0),strnpcinfo(2);

}

function	script	botpatrol	{

	attachnpctimer;
	initnpctimer;

At first I thought that I had to pass the RID and NPC names as arguments into the function but that didn't work. Am I missing something here?

Also the documentation for initnpctimer is terrible. What the hell is a an "attach flag"? Is it expecting a 1(true)? Or is it expecting a character name? Or the RID number?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

an initnpctimer won't work on function script because that is not NPC.
You better use doevent on the function script.

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