Jump to content

Question

Posted
map,146,139,5	script	Arena Master	808,{

if( select("PVP Room [ "+getmapusers("arena02")+"/50 ]:Cancel") == 1 ) { if( getmapusers("arena02") >= 50 ) { 
    mes "[Arena Master]", "I'm sorry but the PVP Room is already full!"; 
	close; 
	}
	
    warp "arena02",0,0;
    atcommand "@heal";
    }
close;

OnPCDieEvent:
    atcommand "@alive";
    atcommand "@heal";
end;
}

arena02	mapflag	pvp
arena02	mapflag	nocommand	80
arena02	mapflag	nomemo
arena02	mapflag	nosave	SavePoint
arena02	mapflag	noteleport
arena02	mapflag	nowarp
arena02	mapflag	nowarpto
arena02	mapflag	noreturn
arena02	mapflag	nobranch
 

 

My example like this . 

- Pvp Room have 5 minutes , if 5 minutes end , ppl auto exit from map

8 answers to this question

Recommended Posts

Posted (edited)

Little optimized

map,146,139,5	script	Arena Master	808,{
	if( select("PVP Room [ "+getmapusers("arena02")+"/50 ]:Cancel") == 1 ) {
		if( getmapusers("arena02") >= 50 ) {
			mes "[Arena Master]", "I'm sorry but the PVP Room is already full!";
			close;
		}
		addtimer 300000,"Arena Master::OnTimeout";
		warp "arena02",0,0;
		percentheal 100,100;
	}
	close;

OnPCDieEvent:
	getmapxy .@map$, .@x, .@y, 0;
	if( .@map$ != "arena02" ) end;
	sleep2 2;
	warp .@map$, .@x, .@y;
	percentheal 100,100;
	end;

OnTimeout:
	dispbottom "5 minutes has been elapsed.";
	warp "SavePoint",0,0;
	end;
}
Edited by Capuche
  • Upvote 1
Posted
map,146,139,5    script    Arena Master    808,{
if( select("PVP Room [ "+getmapusers("arena02")+"/50 ]:Cancel") == 1 ) { if( getmapusers("arena02") >= 50 ) {
mes "[Arena Master]", "I'm sorry but the PVP Room is already full!";
    close;
    }
    addtimer 300000,"Arena Master::OnTimeout";
warp "arena02",0,0;
atcommand "@heal";
}
close;

OnPCDieEvent:
atcommand "@alive";
atcommand "@heal";
end;

OnTimeout:
dispbottom "5 minutes has been elapsed.";
warp "SavePoint",0,0;
end;
}

arena02    mapflag    pvp
arena02    mapflag    nocommand    80
arena02    mapflag    nomemo
arena02    mapflag    nosave    SavePoint
arena02    mapflag    noteleport
arena02    mapflag    nowarp
arena02    mapflag    nowarpto
arena02    mapflag    noreturn
arena02    mapflag    nobranch

/no1

  • Upvote 1
Posted

it's better to add a deltimer to remove any current attached timer to that label..

deltimer "Arena Master::OnTimeout";
addtimer 300000,"Arena Master::OnTimeout";

 

otherwise the the player could have attached multiple addtimer and run separately...

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