Jump to content
  • 0

[SOLVED] enablenpc/disablenpc


llchrisll

Question


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Hi guys,

momentally I'm working on an script which handles your NPC loadings (like the scripts_custom.conf),

which allows you to load/unload & enalbe/disable your npcs as you like via NPC.

(If you think that's a stupid idea, then I agree, I'm just scripting and testing in order to learn ohmy.png)

My question is now with the "#hidden" part of an NPC Name.

If I put something like this:

enablenpc "#test";

So would any script which holds the "#test" be enabled or not?

If this doesn't work I still have a another solution so no worries biggrin.png.

Thx and Regards,

Chris

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

enablenpc "#test";

^ This would only enable the npc named "#test". For example:

prontera,155,188,0	script	#test	910,{
dispbottom "Hello world";
}

(it would not enable another npc named "something#test" )

Are you going to have multiple NPCs, and you want to enable/disable them all?

Maybe put OnEnable and OnDisable labels in all of them:

OnEnable:
enablenpc strnpcinfo(3);
end;
OnDisable:
disablenpc strnpcinfo(3);
end;

then use donpcevent "::OnEnable"; because that does trigger all npcs with the given label.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Hmm I thought so.

@OnEnable/OnDisable:

This was my 2nd option^^.

Thanks Brian learned yet another thing^^.

Can be closed then.

Regards,

Chris

  • Upvote 1
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...