Jump to content

Question

11 answers to this question

Recommended Posts

  • 1
Posted (edited)

You can use the Hikirikawa script and add maps in the array you see in the end. I edited the script a bit to use inarray rather than the loop it used.

OnPCDieEvent:
	.@map$ = strcharinfo(3);
	if(inarray(.map$,.@map$) != -1){
		for(.@y = 5; .@y; .@y--){
			message strcharinfo(0),"You will respawn in "+.@y+" second"+((.@y > 1)?"s":"")+".";
			sleep2 1000;
		}
		recovery 0;
		warp .@map$,0,0;
	}
end;

OnInit:
	setarray .map$, "pvp_y_1-2","guild_vs2","guild_vs3";
end;

 

Edited by n0tttt
  • Upvote 2
  • 1
Posted

Is it a custom command do you have?

if not, use this:

OnPCDieEvent:
	.@map$ = strcharinfo(3);
	if(inarray(.map$,.@map$) != -1){
		for(.@y = 5; .@y; .@y--){
			message strcharinfo(0),"You will respawn in "+.@y+" second"+((.@y > 1)?"s":"")+".";
			sleep2 1000;
		}
		recovery 0;
		repairall;
		if(.size_buffs) {
			for(;.@i < .size_buffs;.@i+= 3)
				sc_start .buffs[.@i],.buffs[.@i + 1],.buffs[.@i + 2];
		}
		warp .@map$,0,0;
	}
end;

OnInit:
	setarray .map$, "pvp_y_1-2","guild_vs2","guild_vs3";
			 // Buff         Duration(ms) Lvl
	setarray .buffs, SC_INCREASEAGI, 5*60*1000,   10,
			 SC_BLESSING,    5*60*1000,   10;
	.size_buffs = getarraysize(.buffs);
end;

You can add all the buffs you want in .buffs array.

  • Upvote 1
  • Love 1
  • 0
Posted

Untested.

ONPCDieEvent:
	.@map$ = strcharinfo(3);
	if(.@map$ == "pvp_y_1-2"){
		for(.@i = 5; .@i < 1; .@i--){
			message strcharinfo(0),"You will respawn in "+.@i;
			sleep2 1000;
		}
		recovery 0;
		warp .@map$,0,0;
	}
end;

More flexible

ONPCDieEvent:
	.@map$ = strcharinfo(3);
	for(.@i = 0; .@i < getarraysize(.map$); .@i++){
		if(.@map$ == .map$){
			for(.@y = 5; .@y < 1; .@y--){
				message strcharinfo(0),"You will respawn in "+.@y;
				sleep2 1000;
			}
			recovery 0;
			warp .@map$,0,0;
		}
	}
end;

OnInit:
	setarray .map$, "pvp_y_1-2","guild_vs2","guild_vs3";
end;

 

  • 0
Posted
1 hour ago, Hijirikawa said:

Untested.


ONPCDieEvent:
	.@map$ = strcharinfo(3);
	if(.@map$ == "pvp_y_1-2"){
		for(.@i = 5; .@i < 1; .@i--){
			message strcharinfo(0),"You will respawn in "+.@i;
			sleep2 1000;
		}
		recovery 0;
		warp .@map$,0,0;
	}
end;

More flexible


ONPCDieEvent:
	.@map$ = strcharinfo(3);
	for(.@i = 0; .@i < getarraysize(.map$); .@i++){
		if(.@map$ == .map$){
			for(.@y = 5; .@y < 1; .@y--){
				message strcharinfo(0),"You will respawn in "+.@y;
				sleep2 1000;
			}
			recovery 0;
			warp .@map$,0,0;
		}
	}
end;

OnInit:
	setarray .map$, "pvp_y_1-2","guild_vs2","guild_vs3";
end;

 

 

unfortunately gave a syntax error, I do not know the reason, could you help me?

http://prntscr.com/lml2lp

 

  • 0
Posted

Try this:

-	script	F_PVPRecovery	-1,{
	end;
OnPCDieEvent:
	.@map$ = strcharinfo(3);
	.@nme$ = strcharinfo(0);
	if( .@map$ == "pvp_y_1-2" ) {
		for( .@s = 5; .@s >= 0; .@s-- ) {
			message .@nme$ ,"You will respawn in  "+.@s+" second"+ ( .@s > 1 ? "s" : "") +".";
			sleep2 1000;
		}
		recovery 0;
		warp .@map$,0,0;
	}
	end;
}

 

  • 0
Posted
4 hours ago, Royr said:

Try this:


-	script	F_PVPRecovery	-1,{
	end;
OnPCDieEvent:
	.@map$ = strcharinfo(3);
	.@nme$ = strcharinfo(0);
	if( .@map$ == "pvp_y_1-2" ) {
		for( .@s = 5; .@s >= 0; .@s-- ) {
			message .@nme$ ,"You will respawn in  "+.@s+" second"+ ( .@s > 1 ? "s" : "") +".";
			sleep2 1000;
		}
		recovery 0;
		warp .@map$,0,0;
	}
	end;
}

 

Isn't this basically the same thing? Lmao, anyways either will do.
 

5 hours ago, melv0 said:

change :

 


ONPCDieEvent:

to

OnPCDieEvent

^ Change the event label to what this guy says, sorry, my mistake.

  • Love 1
  • 0
Posted
11 hours ago, Hijirikawa said:

Isn't this basically the same thing? Lmao, anyways either will do.
 

^ Change the event label to what this guy says, sorry, my mistake.

 

17 hours ago, melv0 said:

change :

 


ONPCDieEvent:

to

OnPCDieEvent

It worked perfectly as I wanted to thank you both! ?
one more question, if I wanted to do this for other maps, will I need other scripts and just edit the map or can I add in that same script to avoid multiple scripts?

  • 0
Posted
48 minutes ago, n0tttt said:

You can use the Hikirikawa script and add maps in the array you see in the end. I edited the script a bit to use inarray rather than the loop it used.


OnPCDieEvent:
	.@map$ = strcharinfo(3);
	if(inarray(.map$,.@map$) != -1){
		for(.@y = 5; .@y; .@y--){
			message strcharinfo(0),"You will respawn in "+.@y+" second"+((.@y > 1)?"s":"")+".";
			sleep2 1000;
		}
		recovery 0;
		warp .@map$,0,0;
	}
end;

OnInit:
	setarray .map$, "pvp_y_1-2","guild_vs2","guild_vs3";
end;

 

Thank you, I'll test and notify if it worked, one more question ...
how do I use a command created when reborn? I would like to use @buffs and @repairall
  • 0
Posted

Here you go:

OnPCDieEvent:
	.@map$ = strcharinfo(3);
	if(inarray(.map$,.@map$) != -1){
		for(.@y = 5; .@y; .@y--){
			message strcharinfo(0),"You will respawn in "+.@y+" second"+((.@y > 1)?"s":"")+".";
			sleep2 1000;
		}
		recovery 0;
		repairall;
		atcommand "@buffs";
		warp .@map$,0,0;
	}
end;

OnInit:
	setarray .map$, "pvp_y_1-2","guild_vs2","guild_vs3";
end;

 

  • 0
Posted
12 minutes ago, n0tttt said:

Here you go:


OnPCDieEvent:
	.@map$ = strcharinfo(3);
	if(inarray(.map$,.@map$) != -1){
		for(.@y = 5; .@y; .@y--){
			message strcharinfo(0),"You will respawn in "+.@y+" second"+((.@y > 1)?"s":"")+".";
			sleep2 1000;
		}
		recovery 0;
		repairall;
		atcommand "@buffs";
		warp .@map$,0,0;
	}
end;

OnInit:
	setarray .map$, "pvp_y_1-2","guild_vs2","guild_vs3";
end;

 

 

the @repairall command worked, but @buffs do not ?

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