Jump to content
  • 0
Sign in to follow this  
kyeme

Requesting joinwaitingroom <3

Question

I would like to request script commands that can make me automatically join in chatrooms if i use this command.

example : joinwaitingroom <npc name>

 

Thanks in advance! :)

Share this post


Link to post
Share on other sites

18 answers to this question

Recommended Posts

  • 0

Yes sir, even if im not near the NPC (or im other maps/location) :)

Edited by kyeme

Share this post


Link to post
Share on other sites
  • 0

yes totally possible o-o like uh i'll show a example editing a existent command oo (didnt test btw)

BUILDIN_FUNC(delwaitingroom){	struct npc_data* nd;	if( script_hasdata(st,2) )		nd = npc_name2id(script_getstr(st, 2));	else		nd = (struct npc_data *)map_id2bl(st->oid);	if( nd != NULL )		chat_deletenpcchat(nd);	return 0;}
to
BUILDIN_FUNC(delwaitingroom){	struct npc_data* nd;TBL_PC *sd = script_rid2sd(st);	if( script_hasdata(st,2) ) /* string is npc name that holds the chat */		nd = npc_name2id(script_getstr(st, 2));	else /* assume the chat room is in this invoking npc */		nd = (struct npc_data *)map_id2bl(st->oid);	if( nd != NULL && nd->chat_id ) {chat_joinchat(sd, nd->chat_id, NULL);}	return 0;}
let me know if you have any problems o:

Share this post


Link to post
Share on other sites
  • 0

 

yes totally possible o-o like uh i'll show a example editing a existent command oo (didnt test btw)

BUILDIN_FUNC(delwaitingroom){	struct npc_data* nd;	if( script_hasdata(st,2) )		nd = npc_name2id(script_getstr(st, 2));	else		nd = (struct npc_data *)map_id2bl(st->oid);	if( nd != NULL )		chat_deletenpcchat(nd);	return 0;}
to
BUILDIN_FUNC(delwaitingroom){	struct npc_data* nd;TBL_PC *sd = script_rid2sd(st);	if( script_hasdata(st,2) ) /* string is npc name that holds the chat */		nd = npc_name2id(script_getstr(st, 2));	else /* assume the chat room is in this invoking npc */		nd = (struct npc_data *)map_id2bl(st->oid);	if( nd != NULL && nd->chat_id ) {chat_joinchat(sd, nd->chat_id, NULL);}	return 0;}
let me know if you have any problems o:

Thanks Sir i will try this. Btw what script command that i will use?

 

My sample:

 

-	script	atcmd_joinchatroom	-1,{OnInit:	bindatcmd "joinchatroom",strnpcinfo(3)+"::OnAtcommand";	end;OnAtcommand:	"what script command";	end;} 
Edited by kyeme

Share this post


Link to post
Share on other sites
  • 0

any o-o you can create a new one and input that code or throw it into a existent

Ok ive got it.

 

Sir in the 

BUILDIN_DEF(waitingroom,"si?????"),BUILDIN_DEF(delwaitingroom,"?"), 

Mine is joinwaitingroom, I dont know what to put here.. xD

Edited by kyeme

Share this post


Link to post
Share on other sites
  • 0

ahh in chat.c find

	if( cd == NULL || cd->bl.type != BL_CHAT || cd->bl.m != sd->bl.m || sd->state.vending || sd->state.buyingstore || sd->chatID || ((cd->owner->type == BL_NPC) ? cd->users+1 : cd->users) >= cd->limit )	{		clif->joinchatfail(sd,0);		return 0;	}
replace with
	if( cd == NULL || cd->bl.type != BL_CHAT || sd->state.vending || sd->state.buyingstore || sd->chatID || ((cd->owner->type == BL_NPC) ? cd->users+1 : cd->users) >= cd->limit )	{		clif->joinchatfail(sd,0);		return 0;	}

Share this post


Link to post
Share on other sites
  • 0

And when im away from the NPC, the commands are working but i dont have a chatroom box.

 

Sorry for late post.

Share this post


Link to post
Share on other sites
  • 0

aaaah i see why ._. well this just got complicated Xd would need to make the command spawn a fake chatroom in player sight in order for it to be fully functional and doing that is quite troublesome :| mhmm

Share this post


Link to post
Share on other sites
  • 0

i think i thought of some lazy but fast way to go around the issue o-o moving the chat rooms source npc quickly to the players sight, open the chatroom and move it back to its original location D: would that be acceptable?

Share this post


Link to post
Share on other sites
  • 0

Nice idea, . . how can i do that.. What script commands.. xD

 

 

Oppss im requesting too much. Sorry..

Request Solved xD

 

Thanks for the help Sir Ind! :)

Edited by Mhalicot

Share this post


Link to post
Share on other sites
  • 0

the movenpc command for some reason is restricted to the same map the npc is in o__O hu well its sort of late for me D:~ i'll think of something as i sleep +__+

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.