Hi! Im trying to add SAVE LOAD and SELL Style feature on my stylist ... Question, why does all my saved styles get wiped out everytime I logout/login ??? Thanks
prontera,76,96,1 script Stylist#custom_stylist 122,{
set .@Styles, getbattleflag("max_hair_style");
set .@Look, LOOK_HAIR;
set .@Revert, getlook(.@Look);
set .@Style,1;
set .cost,70000;
set .@SlotName$,"Hair Style";
@stylist_look_type = .@Look;
@stylist_look_value = getlook(@stylist_look_type);
addtimer 1, strnpcinfo(0) + "::OnPCLogoutEvent";
switch(select("Change Hairstyle:Style collections:Quit")) {
case 1:
while(1) {
ignoretimeout 1;
setlook .@Look, .@Style;
mes "Hair Style [#"+.@Style+"].";
set .@menu$, " ~ Next (^0055FF"+((.@Style!=.@Styles[.@s])?.@Style+1:1)+"^000000): ~ Previous (^0055FF"+((.@Style!=1)?.@Style-1:.@Styles[.@s])+"^000000): ~ Jump to...: ~ I want this style";
switch(prompt(.@menu$)) {
case 1:
set .@Style, ((.@Style != .@Styles[.@s]) ? .@Style+1 : 1);
break;
case 2:
set .@Style, ((.@Style != 1) ? .@Style-1 : .@Styles[.@s]);
break;
case 3:
message strcharinfo(0),"Choose a style between 1 - "+.@Styles[.@s]+".";
input .@Style,0,.@Styles[.@s];
if (!.@Style)
set .@Style, rand(1,.@Styles[.@s]);
break;
case 4:
// You have to set the values to 0 and remove the timer event once the colors are chosen and confirmed
// Your code currently doesn't have a way out of your loops, so I added this one.
@stylist_look_type = @stylist_look_value = 0;
deltimer strnpcinfo(0) + "::OnPCLogoutEvent";
end;
default:
set .@Style, .@Revert;
setlook .@Look[.@s], .@Revert;
end;
}
}
case 2:
while(1) {
switch(select("Save current hairstyle:Load hairstyle:Sell hairstyle")) {
case 1:
mes "Choose which slot you'd like to save to:";
close2;
set .@x, select(""+.@SlotName$+" [" +@revert[1]+ "]",
""+.@SlotName$+" [" +@revert[2]+ "]",
""+.@SlotName$+" [" +@revert[3]+ "]",
""+.@SlotName$+" [" +@revert[4]+ "]",
""+.@SlotName$+" [" +@revert[5]+ "]");
setarray @revert[.@x], .@Revert;
break;
case 2:
mes "Choose which slot you'd like to load from:";
close2;
set .@x, select(""+.@SlotName$+" [" +@revert[1]+ "]",
""+.@SlotName$+" [" +@revert[2]+ "]",
""+.@SlotName$+" [" +@revert[3]+ "]",
""+.@SlotName$+" [" +@revert[4]+ "]",
""+.@SlotName$+" [" +@revert[5]+ "]");
if (@revert[.@x] == 0) { message strcharinfo(0),"NO SAVED STYLE"; end; }
setlook LOOK_HAIR, @revert[.@x];
@stylist_look_type = @stylist_look_value = 0;
//deltimer strnpcinfo(0) + "::OnPCLogoutEvent";
break;
case 3:
mes "Choose which slot you'd like to sell:";
close2;
set .@x, select(""+.@SlotName$+" [" +@revert[1]+ "]",
""+.@SlotName$+" [" +@revert[2]+ "]",
""+.@SlotName$+" [" +@revert[3]+ "]",
""+.@SlotName$+" [" +@revert[4]+ "]",
""+.@SlotName$+" [" +@revert[5]+ "]");
if (@revert[.@x] == 0) { message strcharinfo(0),"NO SAVED STYLE"; end; }
switch (select("Cofirm:Cancel")) {
setarray @revert[.@x], "";
}
}
}
}
end;
OnPCLogoutEvent:
if (@stylist_look_type != 0) {
setlook @stylist_look_type, @stylist_look_value;
}
deltimer strnpcinfo(0) + "::OnPCLogoutEvent";
end;
}
Question
Eross
Hi! Im trying to add SAVE LOAD and SELL Style feature on my stylist ... Question, why does all my saved styles get wiped out everytime I logout/login ??? Thanks
prontera,76,96,1 script Stylist#custom_stylist 122,{ set .@Styles, getbattleflag("max_hair_style"); set .@Look, LOOK_HAIR; set .@Revert, getlook(.@Look); set .@Style,1; set .cost,70000; set .@SlotName$,"Hair Style"; @stylist_look_type = .@Look; @stylist_look_value = getlook(@stylist_look_type); addtimer 1, strnpcinfo(0) + "::OnPCLogoutEvent"; switch(select("Change Hairstyle:Style collections:Quit")) { case 1: while(1) { ignoretimeout 1; setlook .@Look, .@Style; mes "Hair Style [#"+.@Style+"]."; set .@menu$, " ~ Next (^0055FF"+((.@Style!=.@Styles[.@s])?.@Style+1:1)+"^000000): ~ Previous (^0055FF"+((.@Style!=1)?.@Style-1:.@Styles[.@s])+"^000000): ~ Jump to...: ~ I want this style"; switch(prompt(.@menu$)) { case 1: set .@Style, ((.@Style != .@Styles[.@s]) ? .@Style+1 : 1); break; case 2: set .@Style, ((.@Style != 1) ? .@Style-1 : .@Styles[.@s]); break; case 3: message strcharinfo(0),"Choose a style between 1 - "+.@Styles[.@s]+"."; input .@Style,0,.@Styles[.@s]; if (!.@Style) set .@Style, rand(1,.@Styles[.@s]); break; case 4: // You have to set the values to 0 and remove the timer event once the colors are chosen and confirmed // Your code currently doesn't have a way out of your loops, so I added this one. @stylist_look_type = @stylist_look_value = 0; deltimer strnpcinfo(0) + "::OnPCLogoutEvent"; end; default: set .@Style, .@Revert; setlook .@Look[.@s], .@Revert; end; } } case 2: while(1) { switch(select("Save current hairstyle:Load hairstyle:Sell hairstyle")) { case 1: mes "Choose which slot you'd like to save to:"; close2; set .@x, select(""+.@SlotName$+" [" +@revert[1]+ "]", ""+.@SlotName$+" [" +@revert[2]+ "]", ""+.@SlotName$+" [" +@revert[3]+ "]", ""+.@SlotName$+" [" +@revert[4]+ "]", ""+.@SlotName$+" [" +@revert[5]+ "]"); setarray @revert[.@x], .@Revert; break; case 2: mes "Choose which slot you'd like to load from:"; close2; set .@x, select(""+.@SlotName$+" [" +@revert[1]+ "]", ""+.@SlotName$+" [" +@revert[2]+ "]", ""+.@SlotName$+" [" +@revert[3]+ "]", ""+.@SlotName$+" [" +@revert[4]+ "]", ""+.@SlotName$+" [" +@revert[5]+ "]"); if (@revert[.@x] == 0) { message strcharinfo(0),"NO SAVED STYLE"; end; } setlook LOOK_HAIR, @revert[.@x]; @stylist_look_type = @stylist_look_value = 0; //deltimer strnpcinfo(0) + "::OnPCLogoutEvent"; break; case 3: mes "Choose which slot you'd like to sell:"; close2; set .@x, select(""+.@SlotName$+" [" +@revert[1]+ "]", ""+.@SlotName$+" [" +@revert[2]+ "]", ""+.@SlotName$+" [" +@revert[3]+ "]", ""+.@SlotName$+" [" +@revert[4]+ "]", ""+.@SlotName$+" [" +@revert[5]+ "]"); if (@revert[.@x] == 0) { message strcharinfo(0),"NO SAVED STYLE"; end; } switch (select("Cofirm:Cancel")) { setarray @revert[.@x], ""; } } } } end; OnPCLogoutEvent: if (@stylist_look_type != 0) { setlook @stylist_look_type, @stylist_look_value; } deltimer strnpcinfo(0) + "::OnPCLogoutEvent"; end; }
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.