Jump to content
  • 0

PvP with Limited Time


MukkiesftKies

Question


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  123
  • Reputation:   7
  • Joined:  03/13/12
  • Last Seen:  

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

Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Capuche, why did you change the timer to only 5 seconds? (5000)

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Haha it was for testing purpose :P

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Ahh I get it ;)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  123
  • Reputation:   7
  • Joined:  03/13/12
  • Last Seen:  

Thanks Capuche and nanakiwurtz . You will make my PvP more interesting: D

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Damn you're absolutely right x.x

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