Jump to content
  • 0

Request waiting room


wall_cf

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  08/27/13
  • Last Seen:  

Hey, everyone, i would like to request a script like waiting room, but when the char will be teleported to the event room ,it will be announced in the chat window anything like this " The player "+strcharinfo(0)+"  was teleported to the event room! ". I'd like to request too that when there isn't any player in a certain map, the player that is more time in the chat window can be teleported to this map, just he, nobody more, the rest wait in the waiting room for the map is empty again. Just one player by time can be teleported.

 

I appreciate if someone can help me!

Link to comment
Share on other sites

21 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:  

oO I didn't see the <number of people> option

prontera,155,182,2	script	onoi	75,{
end;
OnInit:
	waitingroom "Party - Waiting Room",20,strnpcinfo(3)+"::OnStart",1;
	end;
OnTimer2000:
OnStart:
	if ( getmapusers( "new_1-2" ) == 0 ) {
		warpwaitingpc "new_1-2",0,0,1;
		if ( $@warpwaitingpcnum )
			announce  "The player "+ rid2name( $@warpwaitingpc[0] ) +" was teleported to the event room!",bc_blue|bc_all;
		if ( getwaitingroomstate(0) == 0 ) {
			stopnpctimer;
			end;
		}
	}
	initnpctimer;
	end;
}

 

thanks for remind me

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  398
  • Reputation:   131
  • Joined:  11/10/12
  • Last Seen:  

*warpwaitingpc "<map name>",<x>,<y>{,<number of people>};

This command will warp the amount of characters equal to the trigger 
number of the waiting room chat attached to the NPC object running this 
command to the specified map and coordinates, kicking them out of the 
chat. Those waiting the longest will get warped first. It can also do a 
random warp on the same map ("Random" instead of map name) and warp to the 
save point ("SavePoint").

try to apply this.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  08/27/13
  • Last Seen:  

*warpwaitingpc "<map name>",<x>,<y>{,<number of people>};

This command will warp the amount of characters equal to the trigger 
number of the waiting room chat attached to the NPC object running this 
command to the specified map and coordinates, kicking them out of the 
chat. Those waiting the longest will get warped first. It can also do a 
random warp on the same map ("Random" instead of map name) and warp to the 
save point ("SavePoint").

try to apply this.

 

 

The most near that i reach is it but it doesn't solve my problem :

 

prontera,154,186,6	script	Waiting room	81,{

onstart:
	warpwaitingpc "force_4-1",99,12,1;
	end;

OnInit:
	waitingroom "Waiting Room",10,"::onstart",1;
	end;
	
}

 

The char that is inside of the waiting room just is teleported if anyone click in the npc, he isn't teleported if there is just one person in the waiting room and too the message doesn't show.

Edited by wall_cf
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  398
  • Reputation:   131
  • Joined:  11/10/12
  • Last Seen:  

prontera,154,186,6	script	Waiting room	81,{
    end;

OnInit:
    waitingroom "Waiting Room",2,"Waiting room::OnStart",1;
    end;

OnStart:
    warpwaitingpc "force_4-1",99,12,1;
    end;

}

try this.

to annouce the strcharinfo(0) you must attach the player to the npc.

*attachrid(<account ID>)
*detachrid;

These commands allow the manipulation of the script's currently attached 
player. While attachrid allows attaching of a different player by using 
its account id for the parameter rid, detachrid makes the following 
commands run as if the script was never invoked by a player.

In case, that the player cannot be attached, such as, when the player went 
offline in the mean time, attachrid returns 0, otherwise 1.
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  08/27/13
  • Last Seen:  

is it correct ?

 

prontera,154,186,6	script	Waiting room	81,{

onstart:
	warpwaitingpc "force_4-1",99,12,1;
	end;

OnInit:
	waitingroom "Waiting Room",10,"::onstart",1;
	attachrid($@warpwaitingnpc[]);
	end;
	
}

 

could you  say me how/where can I put the speech of the character ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  398
  • Reputation:   131
  • Joined:  11/10/12
  • Last Seen:  

No. use my script. also the attachrid is a different issue. you need to think how it will be attached.

prontera,154,186,6	script	Waiting room	81,{
    end;

OnInit:
    waitingroom "Waiting Room",2,"Waiting room::OnStart",1;
    end;

OnStart:
    warpwaitingpc "force_4-1",99,12,1;
    end;

}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  08/27/13
  • Last Seen:  

ok, i will try to do it, but the problem is that i don't know how can i will do it, because i don't know the codes i just try to stand, studying the script and learn anything, i got to make that script above searching in others, if you put an egs or hint, it will become more easy to me try to stand, but i will try to do it here and if i don't get i post here again.

Edited by wall_cf
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  398
  • Reputation:   131
  • Joined:  11/10/12
  • Last Seen:  

this will warp the player if you click the waitingroom above the npc.not the npc itself

prontera,154,186,6	script	Waiting room	81,{
    end;

OnInit:
    waitingroom "Waiting Room",2,"Waiting room::OnStart",1;
    end;

OnStart:
    warpwaitingpc "force_4-1",99,12,1;
    //try to attachrid here. to be able to use strcharinfo
    //anounce here
    end;

}

i think you can attach a rid using warpwaitingpc using

    attachrid $@warpwaitingpc;

so output will be.

try this. this may work.not sure though.not tested

prontera,154,186,6	script	Waiting room	81,{
    end;

OnInit:
    waitingroom "Waiting Room",2,"Waiting room::OnStart",1;
    end;

OnStart:
    warpwaitingpc "force_4-1",99,12,1;
    attachrid $@warpwaitingpc;
    announce  "The player "+strcharinfo(0)+" was teleported to the event room!",bc_blue|bc_all;
    end;

}
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  08/27/13
  • Last Seen:  

Thank you for help me, your scrit works good, but now to me put to go into the map just one by time when the map is empty (like if there is a player in map, nobady can entry but if nobody is in the map just one go into there up to it is empty again), what need i do? i make one modification but the player that is in the waiting room isn't teleported immediately to the map, one player need to click in the balloon to he be able to be teleported.

 

prontera,154,186,6	script	Waiting room	81,{
    end;

OnInit:
    waitingroom "Waiting Room",2,"Waiting room::OnStart",1;
    end;

OnStart:
	if(getmapusers("force_4-1")==0) {
    warpwaitingpc "force_4-1",99,12,1;
    attachrid $@warpwaitingpc;
    announce  "The player "+strcharinfo(0)+" was teleported to the event room!",bc_blue|bc_all;
    end;
	}

}

Could you give a hint, maybe?

Edited by wall_cf
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  398
  • Reputation:   131
  • Joined:  11/10/12
  • Last Seen:  

prontera,154,186,6	script	Waiting room	81,{
    end;

OnInit:
    waitingroom "Waiting Room",2,"Waiting room::OnStart",1;
    end;

OnStart:
    if(getmapusers("force_4-1")==0) {
        warpwaitingpc "force_4-1",99,12,1;
        attachrid $@warpwaitingpc;
        announce  "The player "+strcharinfo(0)+" was teleported to the event room!",bc_blue|bc_all;
    }
    end;

}

no player will be warped if the room has 1 player.

Edited by LuLu
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  08/27/13
  • Last Seen:  

Could anyone help me?

 

What need i do to put to go into the map just one by time when the map is empty (like if there is a player in map, nobady can entry but if nobody is in the map just one go into there up to it is empty again), what need i do? i make one modification but the player that is in the waiting room isn't teleported immediately to the map, one player need to click in the balloon to he be able to be teleported.

When i go in the waiting room with a char he is teleported to the map, so i go in the waiting room with another char and after i remove my first char from the map that he was teleported and my second char continue in the waiting room, nothing happens, but if i click in the balloon with my first char, the second char is teleported to the map.

 

My script :

 

prontera,154,186,6	script	Waiting room	81,{
    end;

OnInit:
    waitingroom "Waiting Room",2,"Waiting room::OnStart",1;
    end;

OnStart:
    if(getmapusers("force_4-1")==0) {
        warpwaitingpc "force_4-1",99,12,1;
        attachrid $@warpwaitingpc;
        announce  "The player "+strcharinfo(0)+" was teleported to the event room!",bc_blue|bc_all;
    }
    end;

}
Edited by wall_cf
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  08/27/13
  • Last Seen:  

bump

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:  

You mean :

 

player 1 is on the map

  • player 2 can enter
  • player 3 can't enter

none player on the map

  • player 1 can enter
  • player 2 can
  • player 3 can't

?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  08/27/13
  • Last Seen:  

You mean :

 

player 1 is on the map

  • player 2 can enter
  • player 3 can't enter

none player on the map

  • player 1 can enter
  • player 2 can
  • player 3 can't

?

 

 

No, i'd like that just one player was teleported to the map and the other players wait in the waiting room while the first player stays there, in the map. When the first player go out from the map, the second goes in the map and others wait too and so on. My scrit above isn't working this way, it's teleporting the players to the map, ok, but it isn't doing the second player in the waiting queue teleport immediately after the first player goes out from the map. The second player is getting to teleport just if another player clicks on the balloon above the npc( waiting room). This is my problem, the players don't get to teleport immediately after the player that is in a position above his position gets out from map.

bump

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:  

Guess you need source mod to check if a player is still in a waitingroom and to keep the rid when the player enter and trigger the event.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  08/27/13
  • Last Seen:  

Guess you need source mod to check if a player is still in a waitingroom and to keep the rid when the player enter and trigger the event.

 

 

Thank you, but is it hard ?

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:  

I don't think. Try it and tell me.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  08/27/13
  • Last Seen:  

Anyone knows how can i do to the npc send a message to a specify map(1) when in this same map(1) there is somebody and in another map(2) there isn't anybody ??? . The npc has to check if someone go in the map(1) and if there is anyone in the map(2), so it send the message.

 

I try to do something like this but doesn't work :

 

if(getmapusers("new_1-2") > 0) {
     mapannounce   "prontera","Now, there is one player doing the test, please wait your turn!",bc_map,0xFF0000;
     end;
	}

 

i'm not getting to do the npc check if one player go in the map(1)=prontera to the npc send the message.

 

*map(2) = new_1-2

 

could anyone help me ?



I would like to add a code in it that when one player go out from new_1-2, the npc send a message to prontera like " new_1-2 is empty, please go into map the next ".

 

my code :

 

prontera,151,182,6	script	John	81,{

end;

OnInit:
    waitingroom "Waiting Room",5,strnpcinfo(3)+"::OnStart",1;
    end;
	
OnStart:
	if( getmapusers( "new_1-2" ) > 0) {
	attachrid $@warpwaitingpc;
	announce	"The player "+strcharinfo(0)+" is in the event room!",bc_blue|bc_all;
    end;
	}
	
    warpwaitingpc "new_1-2",98,17,1;
    attachrid $@warpwaitingpc;
    announce  "The player "+strcharinfo(0)+" was teleported to the event room!",bc_blue|bc_all;
    end;
	
}

 

So, i just need to add something that do it sends a message when a player goes out from new_1-2 . I tried here, but no advance.

 

Could anyone help me???

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:  

prontera,155,182,2	script	onoi	75,{
end;
OnInit:
	waitingroom "Party - Waiting Room",20,strnpcinfo(3)+"::OnStart",1;
	end;
OnTimer2000:
OnStart:
	.@size = getwaitingroomstate(40);
	if ( getmapusers( "new_1-2" ) == 0 ) {
		attachrid $@waitingaccountid[0];
		warp "new_1-2",0,0;
		announce  "The player "+ strcharinfo(0) +" was teleported to the event room!",bc_blue|bc_all;
		.@size--;
	}
	announce .@size,0;
	if ( .@size > 0 )
		initnpctimer;
	else
		stopnpctimer;
	end;
}

 

apply the following diff and recompile. With this you retrieve the account id of the player in the waitingroom

Index: script.c
===================================================================
--- script.c	(revision 17690)
+++ script.c	(working copy)
@@ -10525,7 +10525,8 @@
 {
 	struct npc_data *nd;
 	struct chat_data *cd;
-	int type;
+	int type, i;
+	TBL_PC* sd;
 
 	type = script_getnum(st,2);
 	if( script_hasdata(st,3) )
@@ -10550,6 +10551,13 @@
 	case 16: script_pushstrcopy(st, cd->npc_event);break;
 	case 32: script_pushint(st, (cd->users >= cd->limit)); break;
 	case 33: script_pushint(st, (cd->users >= cd->trigger)); break;
+	case 40:
+		for( i = 0; i < cd->users; i++ ) {
+			sd = cd->usersd[i];
+			mapreg_setreg(reference_uid(add_str("$@waitingaccountid"),i), sd->bl.id);
+		}
+		script_pushint(st, i);
+		break;
 	default: script_pushint(st, -1); break;
 	}
 	return 0;

Link to comment
Share on other sites


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

actually you wont really need source mod for this....normally a player that warped by warpwaitingpc are those people who are currently online too..

so you can make use of getcharid to get the account id of players .... =)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  08/27/13
  • Last Seen:  

Many thanks to all who tried to help me, I'm very grateful for that.

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