Ridley
Community Administrator
- Messages
- 1,157
- Points
- 0
- Age
- 38
- Location
- Germany
- Discord
- Ridley#5102
- IRC Nickname
- Ridley
- Github
- ridley8819
- Emulator
- Client Version
- 2019-03-22
Hello, I would like to request a command that displays all the duals on the map where the command is executed
example
i use @sameip in prontera
then display in the chat window
---------------List of Same IP in Prontera---------
User 1<ip> and User 2<ip>
User 1<ip> and User 3<ip>
User 4<ip> and User 18<ip>
User 8<ip> and User 22<ip>
(and so on)
instead of "user" it shows the char name
I got an old src code of this but i hoped someone got an idea about how to make it a plugin or do it via bindatcmd. Anyways, here is the src (eathena)
example
i use @sameip in prontera
then display in the chat window
---------------List of Same IP in Prontera---------
User 1<ip> and User 2<ip>
User 1<ip> and User 3<ip>
User 4<ip> and User 18<ip>
User 8<ip> and User 22<ip>
(and so on)
instead of "user" it shows the char name
I got an old src code of this but i hoped someone got an idea about how to make it a plugin or do it via bindatcmd. Anyways, here is the src (eathena)
Code:
/*========================================== * @sameip * List all players on a map currently on the same IP. *------------------------------------------*/ACMD_FUNC(sameip){ int i, j; int map_id; char map_name[MAP_NAME_LENGTH]; struct s_mapiterator* iter; struct map_session_data* ssd; struct ip_record record[100]; struct same_record same[100]; nullpo_retr(-1, sd); if (!message || !*message) { safestrncpy(map_name, map[sd->bl.m].name, MAP_NAME_LENGTH); } else { safestrncpy(map_name, message, MAP_NAME_LENGTH); } map_id = map_mapname2mapid(map_name); if (map_id == -1) { sprintf(atcmd_output, "The map name '%s' doesn't exist.", map_name); clif_displaymessage(sd->fd, atcmd_output); return -1; } sprintf(atcmd_output, "---- Listing all players on %s ----", map_name); clif_displaymessage(sd->fd, atcmd_output); memset(same, 0, sizeof same); memset(record, 0, sizeof record); i = 0; iter = mapit_getallusers(); for (ssd = (struct map_session_data*)mapit_first(iter); mapit_exists(iter); ssd = (struct map_session_data*)mapit_next(iter)) { if (ssd == NULL) continue; if (ssd->state.autotrade) continue; if (ssd->fd < 0 || session[ssd->fd] == NULL) continue; if (ssd->bl.m != map_id) continue; ARR_FIND(0, 100, j, record[j].ip == session[ssd->fd]->client_addr); if (j == 100) { ARR_FIND(0, 100, j, record[j].account_id == 0); if (j == 100) break; record[j].ip = session[ssd->fd]->client_addr; record[j].char_id = ssd->status.char_id; record[j].account_id = ssd->status.account_id; continue; } same[i].ip = session[ssd->fd]->client_addr; same[i].pl1 = map_id2sd(record[j].account_id); same[i].pl2 = ssd; i++; } if (i > 0) { for (j = 0; i > j; j++) { if (same[j].pl1 && same[j].pl2) { sprintf(atcmd_output, "- Characters '%s' and '%s' are on the same IP.", same[j].pl1->status.name, same[j].pl2->status.name); clif_displaymessage(sd->fd, atcmd_output); } } } sprintf(atcmd_output, "---- Found %d players on the same IP ----", i); clif_displaymessage(sd->fd, atcmd_output); mapit_free(iter); return 0;}
Last edited by a moderator: