Jump to content
  • 0
Sign in to follow this  
Nerual

A little help please! bindatcmd>getgroupid>menu

Question

I'm trying to to use bindatcmd to open a menu.. not sure what I'm doing wrong I always get "npc_event: event not found"  error.

-	script	gmmenu	-1,{

OnInit:

	bindatcmd "gmmenu",strnpcinfo(3)+"::GM_Menu";
	end;

GM_Menu:

	if (getgroupid() >= 60){

		set .@menu$,"menu1:menu2";

		switch(select(.@menu$)){

			case 1:	
			    mes "menu1";
			    close;

			case 2:
			    mes "menu2";
			    close;
			}
	}
}
Edited by Wahahahaha

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

 

-    script    gmmenu    -1,{
 
OnAtGM_Menu:
 
    if (getgmlevel() >= 60) {
 
        .@menu$ = "menu1:menu2";
 
        switch(select(.@menu$)){
 
            case 1:    
                mes "menu1";
                close;
 
            case 2:
                mes "menu2";
                close;
            }
    }
end;
OnInit:
 
    bindatcmd "gmmenu",strnpcinfo(0)+"::OnAtGM_Menu";
    end;
}

PS: Also had to name the menu "::OnAt(menuname)"

Share this post


Link to post
Share on other sites
  • 0

 

-    script    gmmenu    -1,{
 
OnAtGM_Menu:
 
    if (getgmlevel() >= 60) {
 
        .@menu$ = "menu1:menu2";
 
        switch(select(.@menu$)){
 
            case 1:    
                mes "menu1";
                close;
 
            case 2:
                mes "menu2";
                close;
            }
    }
end;
OnInit:
 
    bindatcmd "gmmenu",strnpcinfo(0)+"::OnAtGM_Menu";
    end;
}

PS: Also had to name the menu "::OnAt(menuname)"

I never knew ::OnAt was anything could you explain to me exactly what that means or is? I don't see any information on that (searching ::OnAt only shows this post I made) Maybe I'm just bad at searching? Now that I'm paying attention I also see "::On" being used on some other scripts. Sorry to be a pain but id rather not just copy and paste it and say fixed. :) (Also I never knew GM Ocean had a huge scripting guide pinned here... I've been learning via trial and error... and looking at other scripts.+ the Wiki I'll def be reading that. Sorry again thanks for your help. Also to you @evilpuncker thanks! ~getgmlevel is deprecated so I just put getgroupid like my original script seems to work fine either way thanks~

Edited by Wahahahaha

Share this post


Link to post
Share on other sites
  • 0

Never knew getgmlevel was deprecated. :o


EDIT: Also I tested without "OnAt" I was wrong. It just needs "On" in order to be triggered. I had this problem awhile ago with instance scripts so I guess it applies to bindatcmd too.

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.