Jump to content
  • 0

Question

13 answers to this question

Recommended Posts

Posted (edited)

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
Posted


- 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

Posted (edited)

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

Posted (edited)

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
Posted

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

 

>_>

Posted

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.

Posted (edited)

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

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