Jump to content
  • 0

@who Modification


Question

Posted

Hello :)

I want to ask about @who modification. Now we know that @who command gives a information about Player's Name, Party, and Guild.

How if i am disable the list of player's name. so if i run @who command, it will be final result only (XX players found).

 

Thanks :D 

4 answers to this question

Recommended Posts

  • 0
Posted
2 hours ago, Psyche said:

Hello :)

I want to ask about @who modification. Now we know that @who command gives a information about Player's Name, Party, and Guild.

How if i am disable the list of player's name. so if i run @who command, it will be final result only (XX players found).

 

Thanks :D 

/who ?

  • 0
Posted
12 hours ago, Anacondaqq said:

/who ?

 

7 hours ago, HD Scripts said:

existing /w

 

Yeah, but i wanted to enable who features only with several group id. so the player with group id 1 cannot see the players online.

I know that it was /who, but it forced to be used for all group id/players.

  • 0
Posted

I changed the @who commands to accomodate your wishes. Basically I added @who4/@whomap4 which work exactly like the current @who und @who works as you wished it to :)

 

diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index d8d52b9..ffd2d78 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -621,15 +621,16 @@ ACMD_FUNC(who) {
 	int level = 0;
 	StringBuf buf;
 	/**
-	 * 1 = @who  : Player name, [Title], [Party name], [Guild name]
+	 * 1 = @who  : Count
 	 * 2 = @who2 : Player name, [Title], BLvl, JLvl, Job
 	 * 3 = @who3 : [CID/AID] Player name [Title], Map, X, Y
+	 * 4 = @who4 : Player name, [Title], [Party name], [Guild name]
 	 */
 	int display_type = 1;
 	int map_id = -1;
 
 	nullpo_retr(-1, sd);
-
+	
 	if (strstr(command, "map") != NULL) {
 		char map_name[MAP_NAME_LENGTH_EXT] = "";
 		if (sscanf(message, "%15s %23s", map_name, player_name) < 1 || (map_id = map_mapname2mapid(map_name)) < 0)
@@ -637,12 +638,14 @@ ACMD_FUNC(who) {
 	} else {
 		sscanf(message, "%23s", player_name);
 	}
-
+	
 	if (strstr(command, "2") != NULL)
 		display_type = 2;
 	else if (strstr(command, "3") != NULL)
 		display_type = 3;
-
+	else if (strstr(command, "4") != NULL)
+		display_type = 4;
+	
 	level = pc_get_group_level(sd);
 	StringBuf_Init(&buf);
 
@@ -670,7 +673,7 @@ ACMD_FUNC(who) {
 					StringBuf_Printf(&buf, msg_txt(sd,348), mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); // "| Location: %s %d %d"
 					break;
 				}
-				default: {
+				case 4: {
 					struct party_data *p = party_search(pl_sd->status.party_id);
 					struct guild *g = pl_sd->guild;
 
@@ -683,6 +686,10 @@ ACMD_FUNC(who) {
 						StringBuf_Printf(&buf, msg_txt(sd,346), g->name); // " | Guild: '%s'"
 					break;
 				}
+				default: {
+					count++;	// Just count
+					continue;	// and don't list player infos
+				}
 			}
 			clif_displaymessage(fd, StringBuf_Value(&buf));
 			StringBuf_Clear(&buf);
@@ -9996,9 +10003,11 @@ void atcommand_basecommands(void) {
 		ACMD_DEF(who),
 		ACMD_DEF2("who2", who),
 		ACMD_DEF2("who3", who),
+		ACMD_DEF2("who4", who),
 		ACMD_DEF2("whomap", who),
 		ACMD_DEF2("whomap2", who),
 		ACMD_DEF2("whomap3", who),
+		ACMD_DEF2("whomap4", who),
 		ACMD_DEF(whogm),
 		ACMD_DEF(save),
 		ACMD_DEF(load),

 

  • Like 1

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