Jump to content
  • 0

script enhancement request


Question

Posted
//Simple HG Hiding by crazyarashi

-	script	Invisible	-1,{
OnAtCommand:
	.@npc$ = "["+ strnpcinfo(1) +"]";
	mes .@npc$;
	mes "Hello, "+strcharinfo(0);
	mes "Which headgear do you want to hide?";	
	next;
	setarray .@hgmenu$, "Top Headgear", "Middle Headgear", "Lower Headgear";
	.@menu$ = implode(.@hgmenu$, ":");
		.@i = select( .@menu$ ) - 1;
				.@equip = getequipid(.location$[.@i]);
				if( .@equip != getequipid(.location$[.@i])) {
				mes .@npc$;
				mes "You're not wearing any headgear";
				close;
		} else {
				atcommand "@"+ .looks$[.@i];
				dispbottom .@hgmenu$[.@i] +" is now hidden";
				end;
				}
OnInit:
	setarray .location$, "EQI_HEAD_TOP", "EQI_HEAD_MID", "EQI_HEAD_LOW";
	setarray .looks$, "changelook 1 0", "changelook 2 0", "changelook 3 0";
	bindatcmd "hidehg",strnpcinfo(0)+"::OnAtCommand";

}

can someone add a checking if

the equipments are already hidden when they do the command again @hidehg it will throw error message and the command will not be use. 

credits to crazyarashi

1 answer to this question

Recommended Posts

  • 0
Posted
.@i = select( .@menu$ ) - 1;

setarray .@look, LOOK_HEAD_TOP, LOOK_HEAD_MID, LOOK_HEAD_BOTTOM;
if (getlook(.@look[.@i]) <= 0) {
	dispbottom .@hgmenu$[.@i] +" is already hidden";
	end;
}

 

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...