Jump to content
  • 0

script enhancement request


kalabasa

Question


  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

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

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

.@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;
}

 

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