Jump to content
  • 0
Sign in to follow this  
brunosc

Plugin Call Event

Question

2 answers to this question

Recommended Posts

  • 0
On 2/13/2021 at 5:04 PM, brunosc said:

Im try to make onr plugin to call any event like Onpclogin , or other custom Event.

doevent will do

 

doevent "NPCNAME:OnPCLogin"; - attached player with RID
donpcevent "NPCNAME:OnLabel"; - player not attached

Edited by Kuya Jeo
added donpcevent

Share this post


Link to post
Share on other sites
  • 0
3 hours ago, brunosc said:

i know it, but i want to make like @newcommand and it call some event.

if you want to make it a new command then used bindatcmd

 

Try this one, just change the content if you want

-	script	Sample_Atcmd	FAKE_NPC,{

OnInit:
	// This command can only use for GM Group 99
	bindatcmd "newcommand",strnpcinfo(3)+"::OnNewCommand",99,99;
end;

OnNewCommand:
	mes "[ Admin Command ]";
	mes "Choose what option you want to perform.";
	next;
	switch(select("Event 1:Event 2")){
	
		// Attached Player with RID
		case 1:
			mes "[ Admin Command ]";
			mes "You selected Event 1.";
			close2;
			doevent "EventNPC_1::OnEventStart";
		break;
		
		// No Player Attached in the NPC
		case 2:
			mes "[ Admin Command ]";
			mes "You selected Event 2.";
			close2;
			donpcevent "EventNPC_2::OnEventStart";
		break;

	}
end;

}

 

Edited by Kuya Jeo

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.