Jump to content
  • 0

Max player in map


Blue Jem

Question


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

can i request :)

example:

1. in guild_vs1 the max player can enter is 1 player only

if is full in map the npc say "Sorry the map is full by (name of Character)"

Link to comment
Share on other sites

13 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  90
  • Topics Per Day:  0.02
  • Content Count:  361
  • Reputation:   18
  • Joined:  01/09/13
  • Last Seen:  

if (getmapusers(prontera)=30 {

        mes "I'm sorry, this arena is full. Please try again later.";

        close;

    }

else

warp prontera 0,0;

 

something like that :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

ok how can add the player name? 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  90
  • Topics Per Day:  0.02
  • Content Count:  361
  • Reputation:   18
  • Joined:  01/09/13
  • Last Seen:  

if (getmapusers(prontera)=30 {

        mes "I'm sorry, this arena is full. Please try again later ""+strcharinfo(0)+".";

        close;

    }

else

warp prontera 0,0;

 

something like that  :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

no i mean in map who's inside then the npc show the name 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  51
  • Reputation:   3
  • Joined:  11/29/13
  • Last Seen:  

try this, i'm not test this script yet

yourmap,x,y,facing	script	Sign	50,{
if (getmapusers(yourmap)==1)goto Full;
mes "Do you want to enter this room?";
menu "Enter",enter,"Cancel",cancel;
enter:
        set @name, +strcharinfo(0);
        warp "yourdestinationmap",0,0;
        end;

cancel:
        end;

Full:
        next;
        mes "Sorry, the room is on used by "+@name+" right now";
        next;
        mes "Please wait until the person get out from this room.";
        next;
        end;

OnInit:
	while( 1 ){
	delwaitingroom;
	waitingroom "Miner(s) : "+getmapusers("yourmap")+"",0;
	sleep 1000;
	}
end;
}
Edited by Jesky
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  


- script Sample -1,{

OnPCLoadMapEvent:

getmapxy( .@map$, .@x, .@y, 0 );

if ( .@map$ == "guild_vs1" && getmapusers( "guild_vs1" ) ) {

message strcharinfo( 0 ),"Map is full";

sleep2 3000;

warp "SavePoint", 0, 0;

}

end;

}

guild_vs1 mapflag loadevent

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

this is show to every who inside in map 

-	script	Sample	-1,{
	OnPCLoadMapEvent:
		getmapxy( .@map$, .@x, .@y, 0 );
		if ( .@map$ == "guild_vs1" && getmapusers( "guild_vs1" ) ) {
			message strcharinfo( 0 ),"Map is full";
			sleep2 3000;
			warp "SavePoint", 0, 0;
		}
		end;
}
guild_vs1	mapflag	loadevent

i mean show the npc or PUB the name of player who inside in map ..

if no one inside click the npc warp to inside then the npc show to every who's inside  or Example this using pub npc "ON: name of player"

Edited by Blue Jem
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

prontera,100,200,3	script	full_map	46,{

mes "Warp?";
next;
if(getmapusers(.map$[0])) {
	mes "Someone's inside";
	close;
}
delwaitingroom;
waitingroom "ON: "+strcharinfo(0),0;
warp .map$[0],atoi(.map$[1]),atoi(.map$[2]);
close;

OnInit:
	setarray .map$[0],"guild_vs1",50,50; //Map name and coordinates
	end;

}

Should work unless the map has been entered via @warp

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

the npc nothing happen .


this scrip from jesky
if (getmapusers(guidl_vs1)==1)goto Full;
mes "Do you want to enter this room?";
menu "Enter",enter,"Cancel",cancel;
enter:
        set @name, +strcharinfo(0);
        warp "guidl_vs1",50,50;
        end;

cancel:
        end;

Full:
        next;
        mes "Sorry, the room is on used by "+@name+" right now";
        next;
        mes "Please wait until the person get out from this room.";
        next;
        end;

OnInit:
while( 1 ){
delwaitingroom;
waitingroom "Miner(s) : "+getmapusers("guidl_vs1")+"",0;
sleep 1000;
}
end;
}

post-20646-0-08351300-1394928474_thumb.jpg

post-20646-0-78593000-1394928661_thumb.jpg

Edited by Blue Jem
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

If you are actually reading the scripts that people provide for you, you can easily learn and know what's going on.

 

The code you pasted got typos all over..

 

instead of 

 

guild_vs1

 

you wrote guidl_vs1

 

>_>

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

i mean your script is nothing happen

see 

 


i test your script with 1 player inside to guild_vs1 map

post-20646-0-04438800-1394963707_thumb.jpg

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   1
  • Joined:  12/21/11
  • Last Seen:  

i mean your script is nothing happen

see 

 

i test your script with 1 player inside to guild_vs1 map

prontera,100,200,3    script    full_map    46,{

mes "Warp?";

next;

close; // <<<<<------------ I remove this and its working

if(getmapusers(.map$[0])) {

    mes "Someone's inside";

    close;

}

delwaitingroom;

waitingroom "ON: "+strcharinfo(0),0;

warp .map$[0],atoi(.map$[1]),atoi(.map$[2]);

close;

OnInit:

    setarray .map$[0],"guild_vs1",50,50; //Map name and coordinates

    end;

}

The problem is if you got out the name is still there, it does not reset.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  51
  • Reputation:   3
  • Joined:  11/29/13
  • Last Seen:  

ups sorry, i forgot add " on set variable..

 

try this, hope this time the script will work well..

prontera,150,150,6	script	Sign	50,{
mes "Do you want to enter this room?";
menu "Enter",L_enter,"Cancel",L_cancel;
	L_enter:
		if (getmapusers("poring_c02") >= 1) goto Lfull;
		mes "Please input your name";
		next;
		input .@name$;
		set .@aid, getcharid(3, .@name$);
		if ( !.@aid ) {
		if ( !query_sql("select account_id, from `char` where name = '"+ escape_sql(.@name$) +"'", .@aid) ) {
			mes "Sorry, but your name is not exist";
			close;
			}
		} else {
		set .@name$, rid2name( .@aid );
		}
		warp "poring_c02",0,0;
		end;

	L_cancel:
		end;

Lfull:
        next;
        mes .@name$ +" has already inside the room.";
        next;
        mes "Please wait until this person get out from this room.";
        next;
        end;

OnInit:
	while( 1 ){
	delwaitingroom;
	waitingroom "Player : "+getmapusers("poring_c02")+"",0;
	sleep 1000;
	}
end;
}
Edited by Jesky
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...