Jump to content
  • 0

donpcevent with passing rid


DanTheMan

Question


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  01/28/20
  • Last Seen:  

Hi!

Is it possible to execute "donpcevent" with passing the RID of the attached player? Basically executing another script while passing the RID and ending the initial script.

Greetings,

Dan 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  9
  • Reputation:   2
  • Joined:  01/26/13
  • Last Seen:  

NPC 1:

set .char_id,getcharid(0);
donpcevent "NPC2:Event";
end;

Continue:
set .@char_rid,getvariableofnpc(.char_id,NPC2);
attachrid(.@char_rid);
[...] code [...]

-/-/-/-/-/-

NPC2:

Event:
set .@char_rid,getvariableofnpc(.char_id,NPC1);
attachrid(.@char_rid);
[...] code [...]
set .char_id,getcharid(0);
donpcevent "NPC1:Continue";

  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  01/28/20
  • Last Seen:  

Thanks for the suggestion! It doesn't seem to work tho.


Map server says:

[Error]: buildin_disableitemuse: fatal error ! player not attached!
[Debug]: Function: disable_items (no parameters)
[Debug]: Source (NPC): Taho at ma_scene01 (174,179)

That's what I wrote in the initial script:

		set .char_id,getcharid(0);
		donpcevent "Taho::OnAtCommand";
		end;

And that's what I wrote in the script to be executed:

	OnAtCommand:
	set .@char_rid,getvariableofnpc(.char_id,"instance_command");
	attachrid(.@char_rid);
	
	disable_items;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  9
  • Reputation:   2
  • Joined:  01/26/13
  • Last Seen:  

Sorry, my bad...

change getcharid(0) to getcharid(3)

 

Edited by Start
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  01/28/20
  • Last Seen:  

Works now although the server just crashed, hehe. Doesn't have anything to do with that part tho. Thanks a lot!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  9
  • Reputation:   2
  • Joined:  01/26/13
  • Last Seen:  

kkkkkkkk

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

Either integrate the part onto the script or use close2 + doevent.

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