Jump to content
  • 0

Make auto hide PVP NPC


Question

Posted (edited)

hi, i have this pvp warper script.. and i want it to set autohide or disable every 14:00 and enable again @ 16:00 same with the duplicate npcs ..

i tried to add code using enable and disable but its not working with no error on my SSH..

please correct me if i did wrong..

here's the script thanks in advance to those who will help me /no1



turbo_room,87,117,6 script PVP Warper 470,{
			mes "[Pvp Warper]";
			mes "Would You Like Join sRO Pvp Arena";
			next;
			menu "PvP Arena",Arena,"Cancel",Cancel;

			Arena:
			   mes "[Pvp Warper]";
			   mes "Are You Ready?";
			   next;
			   mes "Let Go!!";
			   next;
			   warp "guild_vs5",0,0;
			   L_All:
			   announce "[Pvp Warper]: "+strcharinfo(0)+" Has Enter Pvp Arena come and Kill him!",bc_all,0xFF9500;
			   close;

Cancel:
			   mes "[Pvp Warper]";
			   mes "Wah !! So Fast u're Surrender";
			   next;
			   mes "See You Again";
			   next;
			   emotion e_pif;
			   close;

OnClock1600:
enablenpc "PVP Warper";
end;

OnInit:
OnClock1400:
disablenpc "PVP Warper";
end;

}

prontera.gat,151,187,4 duplicate(PVP Warper) PVP Warper#p1-1 469
morocc.gat,159,97,4 duplicate(PVP Warper) PVP Warper#p1-2 469
geffen.gat,111,63,4 duplicate(PVP Warper) PVP Warper#p1-3 469
geffen.gat,111,63,4 duplicate(PVP Warper) PVP Warper#p1-4 469
payon.gat,169,229,4 duplicate(PVP Warper) PVP Warper#p1-5 469
alberta.gat,188,149,4 duplicate(PVP Warper) PVP Warper#p1-6 469
izlude.gat,138,110,4 duplicate(PVP Warper) PVP Warper#p1-7 469
aldebaran.gat,144,123,4 duplicate(PVP Warper) PVP Warper#p1-8 469
xmas.gat,142,126,4 duplicate(PVP Warper) PVP Warper#p1-9 469
comodo.gat,207,152,4 duplicate(PVP Warper) PVP Warper#p1-10 469
hugel.gat,102,149,4 duplicate(PVP Warper) PVP Warper#p1-11 469

Edited by jigsgfx

5 answers to this question

Recommended Posts

Posted

You can add a check under OnInit to see if the time is within 14:00-16:00.

OnInit:
.@hour = gettime(3);
if (.@hour >= 14 && .@hour < 16)
 disablenpc strnpcinfo(0);
else
 enablenpc strnpcinfo(0);
end;

OnClock1400:
disablenpc strnpcinfo(0);
end;

OnClock16000:
enablenpc strnpcinfo(0);
end;

Posted

Use strnpcinfo(0) instead of specifying the NPC name as each NPC has different name (hidden name).

OnInit:
.@hour = gettime(3);
if (.@hour >= 14 && .@hour < 16)
 disablenpc strnpcinfo(0);
else
 enablenpc strnpcinfo(0);
end;

OnClock1400:
disablenpc strnpcinfo(0);
end;

OnClock16000:
enablenpc strnpcinfo(0);
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...