Jump to content
  • 0

Waiting room problem.


bearnope246

Question


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  94
  • Reputation:   5
  • Joined:  06/30/16
  • Last Seen:  

This is a pvpladder script, and this the waiting room part:

prontera.gat,126,193,5	script	PvP Ladder	57,{
if ($@LadderChatRoom == 1) {
		waitingroom "PvP Top "+$@LadderLength+"",0;
}

I changed it to this:

prontera,155,188,5	script	PvP Ladder	857,{
if ($@LadderChatRoom == 1) {
		waitingroom "Top1 "+$terces_PVP_names$[@1]+"",0;
		}



to show the top player on the waiting room, and it worked fine, except i have to click the npc for the chat room to showup, and i want the chat room to reset after an amount of time. 

so i changed it again:

prontera,155,188,5	script	PvP Ladder	857,{
onlnit:
if ($@LadderChatRoom == 1) {
		while(1) {
		waitingroom "Top1 "+$terces_PVP_names$[@1]+"",0;
		sleep 100;
		delwaitingroom;
		}
}
end;

Now after i click the npc, the chat room showup for 1 sec, and disappear.

And i can't talk to the npc.

How to fix this?

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  588
  • Reputation:   431
  • Joined:  01/26/16
  • Last Seen:  

Change OnLnit to OnInit

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  92
  • Reputation:   17
  • Joined:  08/11/12
  • Last Seen:  

@bearnope246
 

Hello buddy, how are you? Here is what you want, btw I don't know if we need to put freeloop()'s to bypass the infinite loop protection, If so try using the script that uses the donpcevent command. I really don't know if it works and besides that I don't know if its a good choice but let me know if you get any performance issues.

for-loop:

prontera,155,188,5	script	PvP Ladder	857,{

    mes "[PvP Ladder]";
    mes "Hello, how are you?";
    next;
    mes "[PvP Ladder]";
    mes "Bye bye!";
    close;

OnInit:
	if ($@LadderChatRoom == 1) {
		freeloop(1);

		while(1) {
			waitingroom "Top 1 " + $terces_PVP_names$[0],0;
			sleep 1000;
			delwaitingroom;
		}

		freeloop(0);
	}
}

donpcevent:

prontera,155,188,5	script	PvP Ladder	857,{

    mes "[PvP Ladder]";
    mes "Hello, how are you?";
    next;
    mes "[PvP Ladder]";
    mes "Bye bye!";
    close;

OnDisplayWaitingRoom:
	waitingroom "Top 1 " + $terces_PVP_names$[0],0;
	sleep 1000;
	delwaitingroom;
	donpcevent strnpcinfo(3)+"::OnDisplayWaitingRoom";
	end;

OnInit:
	if ($@LadderChatRoom == 1) {
		donpcevent strnpcinfo(3)+"::OnDisplayWaitingRoom";
	}
}

C ya!

Edited by _Okuz_
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  94
  • Reputation:   5
  • Joined:  06/30/16
  • Last Seen:  

Change OnLnit to OnInit

 

 

@bearnope246

 

Hello buddy, how are you? Here is what you want, btw I don't know if we need to put freeloop()'s to bypass the infinite loop protection, If so try using the script that uses the donpcevent command. I really don't know if it works and besides that I don't know if its a good choice but let me know if you get any performance issues.

for-loop:

prontera,155,188,5	script	PvP Ladder	857,{

OnInit:
	if ($@LadderChatRoom == 1) {
		freeloop(1);

		while(1) {
			waitingroom "Top 1 " + $terces_PVP_names$[0],0;
			sleep 1000;
			delwaitingroom;
		}

		freeloop(0);
	}
}

donpcevent:

prontera,155,188,5	script	PvP Ladder	857,{

OnDisplayWaitingRoom:
	waitingroom "Top 1 " + $terces_PVP_names$[0],0;
	sleep 1000;
	delwaitingroom;
	donpcevent strnpcinfo(3)+"::OnDisplayWaitingRoom";
	end;

OnInit:
	if ($@LadderChatRoom == 1) {
		donpcevent strnpcinfo(3)+"::OnDisplayWaitingRoom";
	}
}

C ya!

@secrets i changed it and the room still dissapear , and cant talk to npc.

@okuz The waiting room work, but the npc is non clickable, cant talk to npc, any clue?

 

i realized every time i put in

sleep 1000;
delwaitingroom;

i can't talk to npc

Edited by bearnope246
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  92
  • Reputation:   17
  • Joined:  08/11/12
  • Last Seen:  

@bearnope246

Actually you can talk to the NPC but your NPC must contain texts or anything else to proceed with the dialog because this draft that I left for you is only intended to display a waitingroom that is reloaded every second.
 
So if you want to do something more with this script you should start bellow the first line and please don't forget to use close; close2; end; before reaching your On* Events.
 
Take a look at the scripts that I did for you, I edited both of them to make a sample.
 
C ya!
Edited by _Okuz_
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  94
  • Reputation:   5
  • Joined:  06/30/16
  • Last Seen:  

 

@bearnope246

Actually you can talk to the NPC but your NPC must contain texts or anything else to proceed with the dialog because this draft that I left for you is only intended to display a waitingroom that is reloaded every second.
 
So if you want to do something more with this script you should start bellow the first line and please don't forget to use close; close2; end; before reaching your On* Events.
 
Take a look at the scripts that I did for you, I edited both of them to make a sample.
 
C ya!

 

Thanks for the reply but ofcourse the npc contain text, thats why i said that i cant talk to it :(

here's the full script


-	script	PVPLADDEROPTIONS	-1,{
end;
OnInit:
// 0 = Disabled (NO)
// 1 = Enable   (YES)
set $@languageselect, 0;	//Enable/Disable language selection [English/German] (Default: 1)
set $@LadderAnnounce, 0;	//Enable/Disable the announcement when a char reaches a new position in the ladder (Default: 1)
set $@LadderLength, 30;		//Set the length of the Ladder [!Not higher than 128!] (Default: 30)
set $@LadderSteps, 10;		//Set the views per page (Default: 10)set $@LadderExpGain, 1;		//Enable/Disable experience gain when reaching a new position in the ladder (*Note1)
set $@LadderExp, 50;		//Set Experience gain value (*Note1)
set $@LadderZenyGain, 1;	//Enable/Disable zeny gain when reaching a new position in the ladder
set $@LadderZeny, 50;		//Set Zeny gain value 
set $@LadderChatRoom, 1;	//Enable/Disable an Chat Room over the NPC with the message "PvP Ladder" (Users can not enter the Chat room) 
set $@LadderAskLogin, 0;	//Enable/Disable that the NPC asks about the Broadcast when a Player logins / or  with the Npc Chat (0 = Login Ask , 1 = Npc Chat) Related: 0
set $@LadderGM,	100;		//All GM LVL UNDER this value will show on the PvP Ladder (Over GM LVL: Not shown on Ladder | under GM LVL:  Shown on Ladder)
set $@LadderGMMenu,	99;	//GM LVL that need for entering GM Menu
}

-	script	PVPLADDER	-1,{
OnPCKillEvent:
if ( getgmlevel() >= $@LadderGM ) end;
if (terces_PVP_resets != $terces_PVP_resets) {
	dispbottom "Please relog your character, in order to get the correct kills for you in the PVP ladder.";
	dispbottom "Because a GM just reset the ladder.";
	end;
}
if ( killedrid == getcharid(3) ) {
	set PVPDeaths, PVPDeaths +1;
	set #PVPDeathsAccount, #PVPDeathsAccount +1;
	set @PVPDeathstoday, @PVPDeathstoday +1;
	end;
}
set $@PVPcounter,$@PVPcounter+1;
set getd("$@PVPKill"+$@PVPcounter),getcharid(3);	//getd to avoid errors when more than 1 people kill someone
attachrid(killedrid);
set PVPDeaths,PVPDeaths+1;
set @PVPDeathstoday,@PVPDeathstoday+1;
set #PVPDeathsAccount,#PVPDeathsAccount+1;
set getd("$@PVPkilledplayer"+$@PVPcounter+"$"), strcharinfo(0);	//again, getd to avoid possible glitches
detachrid;

attachrid(getd("$@PVPKill"+$@PVPcounter));
CountKills:
	set PVPKills,PVPKills+1;
	set @PVPKillstoday,@PVPKillstoday+1;
	set #PVPKillsAccount,#PVPKillsAccount+1;
	setarray @playerstats[0],@PVPKillstoday,@PVPDeathstoday,PVPKills,PVPDeaths,#PVPKillsAccount,#PVPDeathsAccount;

l_ladder:
	set @considerdeath,0;
	for (set @PosinLadder, 0; @PosinLadder < $@LadderLength; set @PosinLadder, @PosinLadder + 1){
		if (PVPKills >= $terces_PVP_kills[@PosinLadder]){	//Player deserves to be in the ladder
			//Check if Death plays a role on the position
			if ((PVPKills == $terces_PVP_kills[@PosinLadder]) && (PVPDeaths > $terces_PVP_deaths[@PosinLadder])) set @considerdeath,1; //Consider Deaths
			//Check if the player only topped his own scores
			if ($terces_PVP_names$[@PosinLadder] == strcharinfo(0)){
				set $terces_PVP_kills[@PosinLadder],PVPKills;
				set $terces_PVP_deaths[@PosinLadder],PVPDeaths;
				end;
			}
			//Moves all characters in the Ladder
			for (set @beginmoving, $@LadderLength; @beginmoving >= (@PosinLadder+@considerdeath); set @beginmoving, @beginmoving - 1){
				if ($terces_PVP_names$[@beginmoving] == strcharinfo(0)){
					//If the player already is in the Ladder it only has to move players between characters new position and characters old position
					callsub L_LadderMove,0;
					end;
				}
				else if (@beginmoving == (@PosinLadder+@considerdeath)){
					//Player is not in the Ladder and therefor it has to move all players from characters new position downwards
					callsub L_LadderMove,1;
					end;
				}
			}
			end;
		}
	}
	end;


L_LadderMove:
	if (getarg(0) == 0) set @length,@beginmoving;
	if (getarg(0) == 1) set @length,$@LadderLength;
	for (set @movecycle, @length; @movecycle > (@PosinLadder+@considerdeath);
	 set @movecycle, @movecycle - 1){

		set $terces_PVP_names$[@movecycle],$terces_PVP_names$[(@movecycle-1)];
		set $terces_PVP_kills[@movecycle],$terces_PVP_kills[(@movecycle-1)];
		set $terces_PVP_deaths[@movecycle],$terces_PVP_deaths[(@movecycle-1)];
		set $terces_PVP_times[@movecycle],$terces_PVP_times[(@movecycle-1)];
	}
	//sets the character's stats in the new position
	set $terces_PVP_names$[(@PosinLadder+@considerdeath)],strcharinfo(0);
	set $terces_PVP_kills[(@PosinLadder+@considerdeath)],PVPKills;
	set $terces_PVP_deaths[(@PosinLadder+@considerdeath)],PVPDeaths;
	set $terces_PVP_times[(@PosinLadder+@considerdeath)],gettimetick(2);
	//Experience Gain
	if ($@LadderExpGain == 1){
		set BaseExp,BaseExp+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderExp);
		dispbottom "You have just been rewarded with "+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderExp)+" base experience points";
	}
	//Zeny Gain
	if ($@LadderZenyGain == 1){
		set Zeny,Zeny+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderZeny);
		dispbottom "You have just been rewarded with "+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderZeny)+" Zeny";
	}
	//Announcement (Setting for Char)
	if (pvpbroadcast == 2){
	announce strcharinfo(0)+" just claimed the "+((@PosinLadder+@considerdeath)+1)+". Position in the Top "+$@LadderLength+" after killing "+getd("$@PVPkilledplayer"+$@PVPcounter+"$")+".",16;
	}
	//Announcement (Setting for Account)
	if (#pvpbroadcast == 2){
	announce strcharinfo(0)+" just claimed the "+((@PosinLadder+@considerdeath)+1)+". Position in the Top "+$@LadderLength+" after killing "+getd("$@PVPkilledplayer"+$@PVPcounter+"$")+".",bc_all,0xf7646c;
	}
	end;

OnPCLoginEvent:
if (terces_PVP_resets != $terces_PVP_resets){
		set PVPDeaths,0;
		set @PVPDeathstoday,0;
		set #PVPDeathsAccount,0;
		set PVPKills,0;
		set @PVPKillstoday,0;
		set #PVPKillsAccount,0;
		set terces_PVP_resets,$terces_PVP_resets;
	}
if ($@LadderAskLogin == 0){
	if (pvpbroadcast == 0)
	set #pvpbroadcast,2;
}
}

prontera.gat,148,193,5	script	PvP Ladder	827,{
waitingroom "PvP Top "+$@LadderLength+"",0;
	set @name$,"[PvP-Ladder]";
	//Colour of:			Position	Name		Kills		Deaths		Time
	setarray @colour$[0],	"^996600",	"^006699",	"^00AA00",	"^FF0000",	"^EE8800";
if ($@LadderAskLogin == 1){
	if (#pvpbroadcast == 2) goto 	access_eng;
	if (pvpbroadcast == 2) goto 	access_eng;
	if (#pvpbroadcast == 1) goto 	access_eng;
	if (pvpbroadcast == 1) goto 	access_eng;
	if (pvpbroadcast == 0)
	mes "Hi, "+strcharinfo(0)+"";
	mes "Me is the PvP Top Management!";
	mes "Let me ask you one Question and i will let you play!";
	menu "Later please",L_close,"Okay, fine",L_fine;

	L_fine:
	next;
	mes "Well, do you want read Broadcast Messages when a Player reach a new position on the PvP Ranglist?";
	menu "Yeah, why not",L_accept,"No, thanks",L_accept_2,"Wtf is Broadcast?",L_broadcast;

	L_accept:
	next;
	mes "Yay, thank you! ^_^";
	mes "Will this Setting work on all your Chars on this account or only this char?";
	menu "Account",L_account,"Only this char",L_char;

	L_account:
	set #pvpbroadcast,2;
	next;
	mes "Okay, "+strcharinfo(0)+"";
	mes "Thank you for your time and have fun!";
	close;

	L_char:
	set pvpbroadcast,2;
	next;
	mes "Okay, "+strcharinfo(0)+"";
	mes "Thank you for your time and have fun!";
	goto access_eng;
	close;
	
	L_accept_2:
	next;
	mes "Yay, thank you! ^_^";
	mes "Will this Setting work on all your Chars on this account or only this char?";
	menu "Account",L_account_2,"Only this char",L_char_2;

	L_close:
	close;

	L_account_2:
	set #pvpbroadcast,1;
	next;
	mes "Okay, "+strcharinfo(0)+"";
	mes "Thank you for your time and have fun!";
	close;

	L_char_2:
	set pvpbroadcast,1;
	next;
	mes "Okay, "+strcharinfo(0)+"";
	mes "Thank you for your time and have fun!";
	goto access_eng;
	close;


	L_broadcast:
	mes "Broadcasts are this yellow messages from  the GMs";
	goto L_fine;
}
	access_eng:
	mes @name$;
	mes "Hello "+strcharinfo(0)+"...";
	mes "If you want to I can show you your PVP stats.";
	next;
	M_selection_eng:
	if ( getgmlevel () < $@LadderGMMenu )
		menu "Show me the PVP Ladder",M_Ladder_eng,"PvP stats since my login",M_seitLogin_eng,"PvP stats of this Char",M_dieserChar_eng,"Stats of the whole account",M_vomAccount_eng,"Cancel",M_abbrechen_eng;
	else
		menu "[GM MENU]",GMMenu,"[USER MENU]",UserMenu;

	UserMenu:
	menu "Show me the PVP Ladder",M_Ladder_eng,"PvP stats since my login",M_seitLogin_eng,"PvP stats of this Char",M_dieserChar_eng,"Stats of the whole account",M_vomAccount_eng,"Cancel",M_abbrechen_eng;

	GMMenu:
	mes "PVP Ladder Script";
	mes "Version: 1.7.3";
	mes "Status of functions: ";
	mes "Reset Ladder: No Bugs";
	mes "Delete Char on the ladder: BETA [Not working perfect]";
	menu "Reset Ladder",L_reset,"Delete a Char on the Ladder",L_del_char,"Cancel",M_abbrechen_eng;

	M_Ladder_eng:
	mes "Alright...I'll show you the Top "+ $@LadderLength +" with "+$@LadderSteps+" entries per page.";
	mes "It'll be viewed like this:";
	mes @colour$[0]+"Place^000000: "+@colour$[1]+"<name>^000000 :"+@colour$[2]+"<kills>^000000:"+@colour$[3]+"<deaths>^000000 "+@colour$[4]+"<time>";
	next;
	callsub L_Ladder;
	goto M_selection_eng;

	M_seitLogin_eng:
	mes @name$;
	mes "Your stats since your login:";
	mes @PVPKillstoday+"/"+@PVPDeathstoday+"(Kills/Deaths)";
	next;
	goto M_selection_eng;

	M_dieserChar_eng:
	mes @name$;
	mes "Your stats of this Char:";
	mes PVPKills+"/"+PVPDeaths+"(Kills/Deaths)";
	next;
	goto M_selection_eng;

	M_vomAccount_eng:
	mes @name$;
	mes "Your stats of the whole account:";
	mes #PVPKillsAccount+"/"+#PVPDeathsAccount+"(Kills/Deaths)";
	next;
	goto M_selection_eng;

	M_abbrechen_eng:
	mes @name$;
	mes "OK. You can come back to me and see your stats whenever you want.";
	close;

L_del_char:
	if (getgmlevel() < 99) end;
	mes "Do you want to delete a char on the Ladder?";
	if (select ("Yes","No") == 2) goto L_end;
	next;
	mes "Please give me the Ladder Position of the Char";
	input $@CharLadderInput;
	set $@CharLadder, $@CharLadderInput;
	deletearray @PosinLadder, $@CharLadderInput;
	next;
	mes "THIS IS ONLY  BETA";
	mes "When this step has not worked PLEASE wait until the next Update for this script";
	mes "Please don't request support when this step has not worked";
	close;

L_reset:
	if (getgmlevel() < 99) end;
	mes "Do you want to reset the ladder?";
	if (select ("Yes","No") == 2) goto L_end;
	mes "Are you really really sure you want to reset it?";
	menu "Yes, ffs!!",-,"No",L_end;
	deletearray $terces_PVP_kills,128;
	deletearray $terces_PVP_deaths,128;
	deletearray $terces_PVP_names$,128;
	deletearray $terces_PVP_times,128;
	set $terces_PVP_resets,$terces_PVP_resets +1;

	L_end:
	mes "Okay...cya";
	close;
	
	L_Ladder:
	for (set @y,0; @y < $@LadderLength; set @y,@y+$@LadderSteps){
		for (set @x,@y; (@x < (@y+$@LadderSteps)) && (@x < ($@LadderLength)); set @x,@x+1){
			if ($terces_PVP_names$[@x] != ""){
				mes @colour$[0]+(@x+1)+"^000000: "+@colour$[1]+$terces_PVP_names$[@x]+"^000000 "+@colour$[2]+$terces_PVP_kills[@x]+"^000000:"+@colour$[3]+$terces_PVP_deaths[@x]+"^000000 ~ "+@colour$[4]+callfunc ("Gettime",$terces_PVP_times[@x])+"^000000";
			} else {
				mes "^DD0000"+(@x+1)+": ^006699None^000000 ";
			}
		}
		next;
	}
	return;
}

function	script	Gettime	{
if (getarg(0)==0) return;

set @difftimedays,(gettimetick(2) - getarg(0));
set @difftimehours,@difftimedays%86400;
set @difftimeminutes,@difftimehours%3600;
set @difftimeseconds,@difftimeminutes%60;

set @days,@difftimedays/86400;
set @hours,@difftimehours/3600;
set @minutes,@difftimeminutes/60;
set @seconds,@difftimeseconds;
set @result$,"";
if(@days != 0) set @result$,@result$+@days+"d ";
if(@hours != 0) set @result$,@result$+@hours+"h ";
if(@minutes != 0) set @result$,@result$+@minutes+"m ";
if(@seconds != 0) set @result$,@result$+@seconds+"s";

return (@result$);
}

If i added the sleep and delwaiting room, the npc talk no more :((

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  92
  • Reputation:   17
  • Joined:  08/11/12
  • Last Seen:  

Sorry, but in cases like this you have to post the full script so we can assist you better.

Try using this:

-	script	PVPLADDEROPTIONS	-1,{
end;
OnInit:
// 0 = Disabled (NO)
// 1 = Enable   (YES)
set $@languageselect, 0;	//Enable/Disable language selection [English/German] (Default: 1)
set $@LadderAnnounce, 0;	//Enable/Disable the announcement when a char reaches a new position in the ladder (Default: 1)
set $@LadderLength, 30;		//Set the length of the Ladder [!Not higher than 128!] (Default: 30)
set $@LadderSteps, 10;		//Set the views per page (Default: 10)set $@LadderExpGain, 1;		//Enable/Disable experience gain when reaching a new position in the ladder (*Note1)
set $@LadderExp, 50;		//Set Experience gain value (*Note1)
set $@LadderZenyGain, 1;	//Enable/Disable zeny gain when reaching a new position in the ladder
set $@LadderZeny, 50;		//Set Zeny gain value 
set $@LadderChatRoom, 1;	//Enable/Disable an Chat Room over the NPC with the message "PvP Ladder" (Users can not enter the Chat room) 
set $@LadderAskLogin, 0;	//Enable/Disable that the NPC asks about the Broadcast when a Player logins / or  with the Npc Chat (0 = Login Ask , 1 = Npc Chat) Related: 0
set $@LadderGM,	100;		//All GM LVL UNDER this value will show on the PvP Ladder (Over GM LVL: Not shown on Ladder | under GM LVL:  Shown on Ladder)
set $@LadderGMMenu,	99;	//GM LVL that need for entering GM Menu
}

-	script	PVPLADDER	-1,{
OnPCKillEvent:
if ( getgmlevel() >= $@LadderGM ) end;
if (terces_PVP_resets != $terces_PVP_resets) {
	dispbottom "Please relog your character, in order to get the correct kills for you in the PVP ladder.";
	dispbottom "Because a GM just reset the ladder.";
	end;
}
if ( killedrid == getcharid(3) ) {
	set PVPDeaths, PVPDeaths +1;
	set #PVPDeathsAccount, #PVPDeathsAccount +1;
	set @PVPDeathstoday, @PVPDeathstoday +1;
	end;
}
set $@PVPcounter,$@PVPcounter+1;
set getd("$@PVPKill"+$@PVPcounter),getcharid(3);	//getd to avoid errors when more than 1 people kill someone
attachrid(killedrid);
set PVPDeaths,PVPDeaths+1;
set @PVPDeathstoday,@PVPDeathstoday+1;
set #PVPDeathsAccount,#PVPDeathsAccount+1;
set getd("$@PVPkilledplayer"+$@PVPcounter+"$"), strcharinfo(0);	//again, getd to avoid possible glitches
detachrid;

attachrid(getd("$@PVPKill"+$@PVPcounter));
CountKills:
	set PVPKills,PVPKills+1;
	set @PVPKillstoday,@PVPKillstoday+1;
	set #PVPKillsAccount,#PVPKillsAccount+1;
	setarray @playerstats[0],@PVPKillstoday,@PVPDeathstoday,PVPKills,PVPDeaths,#PVPKillsAccount,#PVPDeathsAccount;

l_ladder:
	set @considerdeath,0;
	for (set @PosinLadder, 0; @PosinLadder < $@LadderLength; set @PosinLadder, @PosinLadder + 1){
		if (PVPKills >= $terces_PVP_kills[@PosinLadder]){	//Player deserves to be in the ladder
			//Check if Death plays a role on the position
			if ((PVPKills == $terces_PVP_kills[@PosinLadder]) && (PVPDeaths > $terces_PVP_deaths[@PosinLadder])) set @considerdeath,1; //Consider Deaths
			//Check if the player only topped his own scores
			if ($terces_PVP_names$[@PosinLadder] == strcharinfo(0)){
				set $terces_PVP_kills[@PosinLadder],PVPKills;
				set $terces_PVP_deaths[@PosinLadder],PVPDeaths;
				end;
			}
			//Moves all characters in the Ladder
			for (set @beginmoving, $@LadderLength; @beginmoving >= (@PosinLadder+@considerdeath); set @beginmoving, @beginmoving - 1){
				if ($terces_PVP_names$[@beginmoving] == strcharinfo(0)){
					//If the player already is in the Ladder it only has to move players between characters new position and characters old position
					callsub L_LadderMove,0;
					end;
				}
				else if (@beginmoving == (@PosinLadder+@considerdeath)){
					//Player is not in the Ladder and therefor it has to move all players from characters new position downwards
					callsub L_LadderMove,1;
					end;
				}
			}
			end;
		}
	}
	end;


L_LadderMove:
	if (getarg(0) == 0) set @length,@beginmoving;
	if (getarg(0) == 1) set @length,$@LadderLength;
	for (set @movecycle, @length; @movecycle > (@PosinLadder+@considerdeath);
	 set @movecycle, @movecycle - 1){

		set $terces_PVP_names$[@movecycle],$terces_PVP_names$[(@movecycle-1)];
		set $terces_PVP_kills[@movecycle],$terces_PVP_kills[(@movecycle-1)];
		set $terces_PVP_deaths[@movecycle],$terces_PVP_deaths[(@movecycle-1)];
		set $terces_PVP_times[@movecycle],$terces_PVP_times[(@movecycle-1)];
	}
	//sets the character's stats in the new position
	set $terces_PVP_names$[(@PosinLadder+@considerdeath)],strcharinfo(0);
	set $terces_PVP_kills[(@PosinLadder+@considerdeath)],PVPKills;
	set $terces_PVP_deaths[(@PosinLadder+@considerdeath)],PVPDeaths;
	set $terces_PVP_times[(@PosinLadder+@considerdeath)],gettimetick(2);
	//Experience Gain
	if ($@LadderExpGain == 1){
		set BaseExp,BaseExp+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderExp);
		dispbottom "You have just been rewarded with "+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderExp)+" base experience points";
	}
	//Zeny Gain
	if ($@LadderZenyGain == 1){
		set Zeny,Zeny+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderZeny);
		dispbottom "You have just been rewarded with "+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderZeny)+" Zeny";
	}
	//Announcement (Setting for Char)
	if (pvpbroadcast == 2){
	announce strcharinfo(0)+" just claimed the "+((@PosinLadder+@considerdeath)+1)+". Position in the Top "+$@LadderLength+" after killing "+getd("$@PVPkilledplayer"+$@PVPcounter+"$")+".",16;
	}
	//Announcement (Setting for Account)
	if (#pvpbroadcast == 2){
	announce strcharinfo(0)+" just claimed the "+((@PosinLadder+@considerdeath)+1)+". Position in the Top "+$@LadderLength+" after killing "+getd("$@PVPkilledplayer"+$@PVPcounter+"$")+".",bc_all,0xf7646c;
	}
	end;

OnPCLoginEvent:
if (terces_PVP_resets != $terces_PVP_resets){
		set PVPDeaths,0;
		set @PVPDeathstoday,0;
		set #PVPDeathsAccount,0;
		set PVPKills,0;
		set @PVPKillstoday,0;
		set #PVPKillsAccount,0;
		set terces_PVP_resets,$terces_PVP_resets;
	}
if ($@LadderAskLogin == 0){
	if (pvpbroadcast == 0)
	set #pvpbroadcast,2;
}
}

prontera.gat,148,193,5	script	PvP Ladder	827,{
	set @name$,"[PvP-Ladder]";
	//Colour of:			Position	Name		Kills		Deaths		Time
	setarray @colour$[0],	"^996600",	"^006699",	"^00AA00",	"^FF0000",	"^EE8800";
if ($@LadderAskLogin == 1){
	if (#pvpbroadcast == 2) goto 	access_eng;
	if (pvpbroadcast == 2) goto 	access_eng;
	if (#pvpbroadcast == 1) goto 	access_eng;
	if (pvpbroadcast == 1) goto 	access_eng;
	if (pvpbroadcast == 0)
	mes "Hi, "+strcharinfo(0)+"";
	mes "Me is the PvP Top Management!";
	mes "Let me ask you one Question and i will let you play!";
	menu "Later please",L_close,"Okay, fine",L_fine;

	L_fine:
	next;
	mes "Well, do you want read Broadcast Messages when a Player reach a new position on the PvP Ranglist?";
	menu "Yeah, why not",L_accept,"No, thanks",L_accept_2,"Wtf is Broadcast?",L_broadcast;

	L_accept:
	next;
	mes "Yay, thank you! ^_^";
	mes "Will this Setting work on all your Chars on this account or only this char?";
	menu "Account",L_account,"Only this char",L_char;

	L_account:
	set #pvpbroadcast,2;
	next;
	mes "Okay, "+strcharinfo(0)+"";
	mes "Thank you for your time and have fun!";
	close;

	L_char:
	set pvpbroadcast,2;
	next;
	mes "Okay, "+strcharinfo(0)+"";
	mes "Thank you for your time and have fun!";
	goto access_eng;
	close;
	
	L_accept_2:
	next;
	mes "Yay, thank you! ^_^";
	mes "Will this Setting work on all your Chars on this account or only this char?";
	menu "Account",L_account_2,"Only this char",L_char_2;

	L_close:
	close;

	L_account_2:
	set #pvpbroadcast,1;
	next;
	mes "Okay, "+strcharinfo(0)+"";
	mes "Thank you for your time and have fun!";
	close;

	L_char_2:
	set pvpbroadcast,1;
	next;
	mes "Okay, "+strcharinfo(0)+"";
	mes "Thank you for your time and have fun!";
	goto access_eng;
	close;


	L_broadcast:
	mes "Broadcasts are this yellow messages from  the GMs";
	goto L_fine;
}
	access_eng:
	mes @name$;
	mes "Hello "+strcharinfo(0)+"...";
	mes "If you want to I can show you your PVP stats.";
	next;
	M_selection_eng:
	if ( getgmlevel () < $@LadderGMMenu )
		menu "Show me the PVP Ladder",M_Ladder_eng,"PvP stats since my login",M_seitLogin_eng,"PvP stats of this Char",M_dieserChar_eng,"Stats of the whole account",M_vomAccount_eng,"Cancel",M_abbrechen_eng;
	else
		menu "[GM MENU]",GMMenu,"[USER MENU]",UserMenu;

	UserMenu:
	menu "Show me the PVP Ladder",M_Ladder_eng,"PvP stats since my login",M_seitLogin_eng,"PvP stats of this Char",M_dieserChar_eng,"Stats of the whole account",M_vomAccount_eng,"Cancel",M_abbrechen_eng;

	GMMenu:
	mes "PVP Ladder Script";
	mes "Version: 1.7.3";
	mes "Status of functions: ";
	mes "Reset Ladder: No Bugs";
	mes "Delete Char on the ladder: BETA [Not working perfect]";
	menu "Reset Ladder",L_reset,"Delete a Char on the Ladder",L_del_char,"Cancel",M_abbrechen_eng;

	M_Ladder_eng:
	mes "Alright...I'll show you the Top "+ $@LadderLength +" with "+$@LadderSteps+" entries per page.";
	mes "It'll be viewed like this:";
	mes @colour$[0]+"Place^000000: "+@colour$[1]+"<name>^000000 :"+@colour$[2]+"<kills>^000000:"+@colour$[3]+"<deaths>^000000 "+@colour$[4]+"<time>";
	next;
	callsub L_Ladder;
	goto M_selection_eng;

	M_seitLogin_eng:
	mes @name$;
	mes "Your stats since your login:";
	mes @PVPKillstoday+"/"+@PVPDeathstoday+"(Kills/Deaths)";
	next;
	goto M_selection_eng;

	M_dieserChar_eng:
	mes @name$;
	mes "Your stats of this Char:";
	mes PVPKills+"/"+PVPDeaths+"(Kills/Deaths)";
	next;
	goto M_selection_eng;

	M_vomAccount_eng:
	mes @name$;
	mes "Your stats of the whole account:";
	mes #PVPKillsAccount+"/"+#PVPDeathsAccount+"(Kills/Deaths)";
	next;
	goto M_selection_eng;

	M_abbrechen_eng:
	mes @name$;
	mes "OK. You can come back to me and see your stats whenever you want.";
	close;

L_del_char:
	if (getgmlevel() < 99) end;
	mes "Do you want to delete a char on the Ladder?";
	if (select ("Yes","No") == 2) goto L_end;
	next;
	mes "Please give me the Ladder Position of the Char";
	input $@CharLadderInput;
	set $@CharLadder, $@CharLadderInput;
	deletearray @PosinLadder, $@CharLadderInput;
	next;
	mes "THIS IS ONLY  BETA";
	mes "When this step has not worked PLEASE wait until the next Update for this script";
	mes "Please don't request support when this step has not worked";
	close;

L_reset:
	if (getgmlevel() < 99) end;
	mes "Do you want to reset the ladder?";
	if (select ("Yes","No") == 2) goto L_end;
	mes "Are you really really sure you want to reset it?";
	menu "Yes, ffs!!",-,"No",L_end;
	deletearray $terces_PVP_kills,128;
	deletearray $terces_PVP_deaths,128;
	deletearray $terces_PVP_names$,128;
	deletearray $terces_PVP_times,128;
	set $terces_PVP_resets,$terces_PVP_resets +1;

	L_end:
	mes "Okay...cya";
	close;
	
	L_Ladder:
	for (set @y,0; @y < $@LadderLength; set @y,@y+$@LadderSteps){
		for (set @x,@y; (@x < (@y+$@LadderSteps)) && (@x < ($@LadderLength)); set @x,@x+1){
			if ($terces_PVP_names$[@x] != ""){
				mes @colour$[0]+(@x+1)+"^000000: "+@colour$[1]+$terces_PVP_names$[@x]+"^000000 "+@colour$[2]+$terces_PVP_kills[@x]+"^000000:"+@colour$[3]+$terces_PVP_deaths[@x]+"^000000 ~ "+@colour$[4]+callfunc ("Gettime",$terces_PVP_times[@x])+"^000000";
			} else {
				mes "^DD0000"+(@x+1)+": ^006699None^000000 ";
			}
		}
		next;
	}
	return;
	
OnInit:
	if ($@LadderChatRoom == 1) {
		freeloop(1);
 
		while(1) {
			waitingroom "Top 1 " + $terces_PVP_names$[0],0;
			sleep 1000;
			delwaitingroom;
		}
 
		freeloop(0);
	}
}

function	script	Gettime	{
if (getarg(0)==0) return;

set @difftimedays,(gettimetick(2) - getarg(0));
set @difftimehours,@difftimedays%86400;
set @difftimeminutes,@difftimehours%3600;
set @difftimeseconds,@difftimeminutes%60;

set @days,@difftimedays/86400;
set @hours,@difftimehours/3600;
set @minutes,@difftimeminutes/60;
set @seconds,@difftimeseconds;
set @result$,"";
if(@days != 0) set @result$,@result$+@days+"d ";
if(@hours != 0) set @result$,@result$+@hours+"h ";
if(@minutes != 0) set @result$,@result$+@minutes+"m ";
if(@seconds != 0) set @result$,@result$+@seconds+"s";

return (@result$);
}

As you can see the OnInit is my last instruction because I want this to be triggered only when map-server is loaded. I have made this because now I'm sure that OnInit won't be accessed by players anymore.

Maybe you should request a new script or ask someone to rewrite this one, because I can see a very old script syntax using commands such as menu; Label: and goto;...
 

C ya!

Edited by _Okuz_
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  94
  • Reputation:   5
  • Joined:  06/30/16
  • Last Seen:  

Sorry, but in cases like this you have to post the full script so we can assist you better.

Try using this:

-	script	PVPLADDEROPTIONS	-1,{
end;
OnInit:
// 0 = Disabled (NO)
// 1 = Enable   (YES)
set $@languageselect, 0;	//Enable/Disable language selection [English/German] (Default: 1)
set $@LadderAnnounce, 0;	//Enable/Disable the announcement when a char reaches a new position in the ladder (Default: 1)
set $@LadderLength, 30;		//Set the length of the Ladder [!Not higher than 128!] (Default: 30)
set $@LadderSteps, 10;		//Set the views per page (Default: 10)set $@LadderExpGain, 1;		//Enable/Disable experience gain when reaching a new position in the ladder (*Note1)
set $@LadderExp, 50;		//Set Experience gain value (*Note1)
set $@LadderZenyGain, 1;	//Enable/Disable zeny gain when reaching a new position in the ladder
set $@LadderZeny, 50;		//Set Zeny gain value 
set $@LadderChatRoom, 1;	//Enable/Disable an Chat Room over the NPC with the message "PvP Ladder" (Users can not enter the Chat room) 
set $@LadderAskLogin, 0;	//Enable/Disable that the NPC asks about the Broadcast when a Player logins / or  with the Npc Chat (0 = Login Ask , 1 = Npc Chat) Related: 0
set $@LadderGM,	100;		//All GM LVL UNDER this value will show on the PvP Ladder (Over GM LVL: Not shown on Ladder | under GM LVL:  Shown on Ladder)
set $@LadderGMMenu,	99;	//GM LVL that need for entering GM Menu
}

-	script	PVPLADDER	-1,{
OnPCKillEvent:
if ( getgmlevel() >= $@LadderGM ) end;
if (terces_PVP_resets != $terces_PVP_resets) {
	dispbottom "Please relog your character, in order to get the correct kills for you in the PVP ladder.";
	dispbottom "Because a GM just reset the ladder.";
	end;
}
if ( killedrid == getcharid(3) ) {
	set PVPDeaths, PVPDeaths +1;
	set #PVPDeathsAccount, #PVPDeathsAccount +1;
	set @PVPDeathstoday, @PVPDeathstoday +1;
	end;
}
set $@PVPcounter,$@PVPcounter+1;
set getd("$@PVPKill"+$@PVPcounter),getcharid(3);	//getd to avoid errors when more than 1 people kill someone
attachrid(killedrid);
set PVPDeaths,PVPDeaths+1;
set @PVPDeathstoday,@PVPDeathstoday+1;
set #PVPDeathsAccount,#PVPDeathsAccount+1;
set getd("$@PVPkilledplayer"+$@PVPcounter+"$"), strcharinfo(0);	//again, getd to avoid possible glitches
detachrid;

attachrid(getd("$@PVPKill"+$@PVPcounter));
CountKills:
	set PVPKills,PVPKills+1;
	set @PVPKillstoday,@PVPKillstoday+1;
	set #PVPKillsAccount,#PVPKillsAccount+1;
	setarray @playerstats[0],@PVPKillstoday,@PVPDeathstoday,PVPKills,PVPDeaths,#PVPKillsAccount,#PVPDeathsAccount;

l_ladder:
	set @considerdeath,0;
	for (set @PosinLadder, 0; @PosinLadder < $@LadderLength; set @PosinLadder, @PosinLadder + 1){
		if (PVPKills >= $terces_PVP_kills[@PosinLadder]){	//Player deserves to be in the ladder
			//Check if Death plays a role on the position
			if ((PVPKills == $terces_PVP_kills[@PosinLadder]) && (PVPDeaths > $terces_PVP_deaths[@PosinLadder])) set @considerdeath,1; //Consider Deaths
			//Check if the player only topped his own scores
			if ($terces_PVP_names$[@PosinLadder] == strcharinfo(0)){
				set $terces_PVP_kills[@PosinLadder],PVPKills;
				set $terces_PVP_deaths[@PosinLadder],PVPDeaths;
				end;
			}
			//Moves all characters in the Ladder
			for (set @beginmoving, $@LadderLength; @beginmoving >= (@PosinLadder+@considerdeath); set @beginmoving, @beginmoving - 1){
				if ($terces_PVP_names$[@beginmoving] == strcharinfo(0)){
					//If the player already is in the Ladder it only has to move players between characters new position and characters old position
					callsub L_LadderMove,0;
					end;
				}
				else if (@beginmoving == (@PosinLadder+@considerdeath)){
					//Player is not in the Ladder and therefor it has to move all players from characters new position downwards
					callsub L_LadderMove,1;
					end;
				}
			}
			end;
		}
	}
	end;


L_LadderMove:
	if (getarg(0) == 0) set @length,@beginmoving;
	if (getarg(0) == 1) set @length,$@LadderLength;
	for (set @movecycle, @length; @movecycle > (@PosinLadder+@considerdeath);
	 set @movecycle, @movecycle - 1){

		set $terces_PVP_names$[@movecycle],$terces_PVP_names$[(@movecycle-1)];
		set $terces_PVP_kills[@movecycle],$terces_PVP_kills[(@movecycle-1)];
		set $terces_PVP_deaths[@movecycle],$terces_PVP_deaths[(@movecycle-1)];
		set $terces_PVP_times[@movecycle],$terces_PVP_times[(@movecycle-1)];
	}
	//sets the character's stats in the new position
	set $terces_PVP_names$[(@PosinLadder+@considerdeath)],strcharinfo(0);
	set $terces_PVP_kills[(@PosinLadder+@considerdeath)],PVPKills;
	set $terces_PVP_deaths[(@PosinLadder+@considerdeath)],PVPDeaths;
	set $terces_PVP_times[(@PosinLadder+@considerdeath)],gettimetick(2);
	//Experience Gain
	if ($@LadderExpGain == 1){
		set BaseExp,BaseExp+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderExp);
		dispbottom "You have just been rewarded with "+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderExp)+" base experience points";
	}
	//Zeny Gain
	if ($@LadderZenyGain == 1){
		set Zeny,Zeny+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderZeny);
		dispbottom "You have just been rewarded with "+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderZeny)+" Zeny";
	}
	//Announcement (Setting for Char)
	if (pvpbroadcast == 2){
	announce strcharinfo(0)+" just claimed the "+((@PosinLadder+@considerdeath)+1)+". Position in the Top "+$@LadderLength+" after killing "+getd("$@PVPkilledplayer"+$@PVPcounter+"$")+".",16;
	}
	//Announcement (Setting for Account)
	if (#pvpbroadcast == 2){
	announce strcharinfo(0)+" just claimed the "+((@PosinLadder+@considerdeath)+1)+". Position in the Top "+$@LadderLength+" after killing "+getd("$@PVPkilledplayer"+$@PVPcounter+"$")+".",bc_all,0xf7646c;
	}
	end;

OnPCLoginEvent:
if (terces_PVP_resets != $terces_PVP_resets){
		set PVPDeaths,0;
		set @PVPDeathstoday,0;
		set #PVPDeathsAccount,0;
		set PVPKills,0;
		set @PVPKillstoday,0;
		set #PVPKillsAccount,0;
		set terces_PVP_resets,$terces_PVP_resets;
	}
if ($@LadderAskLogin == 0){
	if (pvpbroadcast == 0)
	set #pvpbroadcast,2;
}
}

prontera.gat,148,193,5	script	PvP Ladder	827,{
	set @name$,"[PvP-Ladder]";
	//Colour of:			Position	Name		Kills		Deaths		Time
	setarray @colour$[0],	"^996600",	"^006699",	"^00AA00",	"^FF0000",	"^EE8800";
if ($@LadderAskLogin == 1){
	if (#pvpbroadcast == 2) goto 	access_eng;
	if (pvpbroadcast == 2) goto 	access_eng;
	if (#pvpbroadcast == 1) goto 	access_eng;
	if (pvpbroadcast == 1) goto 	access_eng;
	if (pvpbroadcast == 0)
	mes "Hi, "+strcharinfo(0)+"";
	mes "Me is the PvP Top Management!";
	mes "Let me ask you one Question and i will let you play!";
	menu "Later please",L_close,"Okay, fine",L_fine;

	L_fine:
	next;
	mes "Well, do you want read Broadcast Messages when a Player reach a new position on the PvP Ranglist?";
	menu "Yeah, why not",L_accept,"No, thanks",L_accept_2,"Wtf is Broadcast?",L_broadcast;

	L_accept:
	next;
	mes "Yay, thank you! ^_^";
	mes "Will this Setting work on all your Chars on this account or only this char?";
	menu "Account",L_account,"Only this char",L_char;

	L_account:
	set #pvpbroadcast,2;
	next;
	mes "Okay, "+strcharinfo(0)+"";
	mes "Thank you for your time and have fun!";
	close;

	L_char:
	set pvpbroadcast,2;
	next;
	mes "Okay, "+strcharinfo(0)+"";
	mes "Thank you for your time and have fun!";
	goto access_eng;
	close;
	
	L_accept_2:
	next;
	mes "Yay, thank you! ^_^";
	mes "Will this Setting work on all your Chars on this account or only this char?";
	menu "Account",L_account_2,"Only this char",L_char_2;

	L_close:
	close;

	L_account_2:
	set #pvpbroadcast,1;
	next;
	mes "Okay, "+strcharinfo(0)+"";
	mes "Thank you for your time and have fun!";
	close;

	L_char_2:
	set pvpbroadcast,1;
	next;
	mes "Okay, "+strcharinfo(0)+"";
	mes "Thank you for your time and have fun!";
	goto access_eng;
	close;


	L_broadcast:
	mes "Broadcasts are this yellow messages from  the GMs";
	goto L_fine;
}
	access_eng:
	mes @name$;
	mes "Hello "+strcharinfo(0)+"...";
	mes "If you want to I can show you your PVP stats.";
	next;
	M_selection_eng:
	if ( getgmlevel () < $@LadderGMMenu )
		menu "Show me the PVP Ladder",M_Ladder_eng,"PvP stats since my login",M_seitLogin_eng,"PvP stats of this Char",M_dieserChar_eng,"Stats of the whole account",M_vomAccount_eng,"Cancel",M_abbrechen_eng;
	else
		menu "[GM MENU]",GMMenu,"[USER MENU]",UserMenu;

	UserMenu:
	menu "Show me the PVP Ladder",M_Ladder_eng,"PvP stats since my login",M_seitLogin_eng,"PvP stats of this Char",M_dieserChar_eng,"Stats of the whole account",M_vomAccount_eng,"Cancel",M_abbrechen_eng;

	GMMenu:
	mes "PVP Ladder Script";
	mes "Version: 1.7.3";
	mes "Status of functions: ";
	mes "Reset Ladder: No Bugs";
	mes "Delete Char on the ladder: BETA [Not working perfect]";
	menu "Reset Ladder",L_reset,"Delete a Char on the Ladder",L_del_char,"Cancel",M_abbrechen_eng;

	M_Ladder_eng:
	mes "Alright...I'll show you the Top "+ $@LadderLength +" with "+$@LadderSteps+" entries per page.";
	mes "It'll be viewed like this:";
	mes @colour$[0]+"Place^000000: "+@colour$[1]+"<name>^000000 :"+@colour$[2]+"<kills>^000000:"+@colour$[3]+"<deaths>^000000 "+@colour$[4]+"<time>";
	next;
	callsub L_Ladder;
	goto M_selection_eng;

	M_seitLogin_eng:
	mes @name$;
	mes "Your stats since your login:";
	mes @PVPKillstoday+"/"+@PVPDeathstoday+"(Kills/Deaths)";
	next;
	goto M_selection_eng;

	M_dieserChar_eng:
	mes @name$;
	mes "Your stats of this Char:";
	mes PVPKills+"/"+PVPDeaths+"(Kills/Deaths)";
	next;
	goto M_selection_eng;

	M_vomAccount_eng:
	mes @name$;
	mes "Your stats of the whole account:";
	mes #PVPKillsAccount+"/"+#PVPDeathsAccount+"(Kills/Deaths)";
	next;
	goto M_selection_eng;

	M_abbrechen_eng:
	mes @name$;
	mes "OK. You can come back to me and see your stats whenever you want.";
	close;

L_del_char:
	if (getgmlevel() < 99) end;
	mes "Do you want to delete a char on the Ladder?";
	if (select ("Yes","No") == 2) goto L_end;
	next;
	mes "Please give me the Ladder Position of the Char";
	input $@CharLadderInput;
	set $@CharLadder, $@CharLadderInput;
	deletearray @PosinLadder, $@CharLadderInput;
	next;
	mes "THIS IS ONLY  BETA";
	mes "When this step has not worked PLEASE wait until the next Update for this script";
	mes "Please don't request support when this step has not worked";
	close;

L_reset:
	if (getgmlevel() < 99) end;
	mes "Do you want to reset the ladder?";
	if (select ("Yes","No") == 2) goto L_end;
	mes "Are you really really sure you want to reset it?";
	menu "Yes, ffs!!",-,"No",L_end;
	deletearray $terces_PVP_kills,128;
	deletearray $terces_PVP_deaths,128;
	deletearray $terces_PVP_names$,128;
	deletearray $terces_PVP_times,128;
	set $terces_PVP_resets,$terces_PVP_resets +1;

	L_end:
	mes "Okay...cya";
	close;
	
	L_Ladder:
	for (set @y,0; @y < $@LadderLength; set @y,@y+$@LadderSteps){
		for (set @x,@y; (@x < (@y+$@LadderSteps)) && (@x < ($@LadderLength)); set @x,@x+1){
			if ($terces_PVP_names$[@x] != ""){
				mes @colour$[0]+(@x+1)+"^000000: "+@colour$[1]+$terces_PVP_names$[@x]+"^000000 "+@colour$[2]+$terces_PVP_kills[@x]+"^000000:"+@colour$[3]+$terces_PVP_deaths[@x]+"^000000 ~ "+@colour$[4]+callfunc ("Gettime",$terces_PVP_times[@x])+"^000000";
			} else {
				mes "^DD0000"+(@x+1)+": ^006699None^000000 ";
			}
		}
		next;
	}
	return;
	
OnInit:
	if ($@LadderChatRoom == 1) {
		freeloop(1);
 
		while(1) {
			waitingroom "Top 1 " + $terces_PVP_names$[0],0;
			sleep 1000;
			delwaitingroom;
		}
 
		freeloop(0);
	}
}

function	script	Gettime	{
if (getarg(0)==0) return;

set @difftimedays,(gettimetick(2) - getarg(0));
set @difftimehours,@difftimedays%86400;
set @difftimeminutes,@difftimehours%3600;
set @difftimeseconds,@difftimeminutes%60;

set @days,@difftimedays/86400;
set @hours,@difftimehours/3600;
set @minutes,@difftimeminutes/60;
set @seconds,@difftimeseconds;
set @result$,"";
if(@days != 0) set @result$,@result$+@days+"d ";
if(@hours != 0) set @result$,@result$+@hours+"h ";
if(@minutes != 0) set @result$,@result$+@minutes+"m ";
if(@seconds != 0) set @result$,@result$+@seconds+"s";

return (@result$);
}

As you can see the OnInit is my last instruction because I want this to be triggered only when map-server is loaded. I have made this because now I'm sure that OnInit won't be accessed by players anymore.

Maybe you should request a new script or ask someone to rewrite this one, because I can see a very old script syntax using commands such as menu; Label: and goto;...

 

C ya!

Thanks for you help, but your script doesn't work :( the waiting room not even showup :(

i tried every ways :(

i think i will leave this unsolved :( thanks 

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