Index: src/map/script.c =================================================================== --- src/map/script.c (revision 14393) +++ src/map/script.c (working copy) @@ -13,6 +13,7 @@ #include "../common/lock.h" #include "../common/nullpo.h" #include "../common/showmsg.h" +#include "../common/socket.h" #include "../common/strlib.h" #include "../common/timer.h" #include "../common/utils.h" @@ -6089,12 +6090,14 @@ TBL_PC *sd; int num; char *buf; + uint32 ip; sd=script_rid2sd(st); if (!sd) { //Avoid crashing.... script_pushconststr(st,""); return 0; } + ip = session[sd->fd]->client_addr; num=script_getnum(st,2); switch(num){ case 0: @@ -6117,6 +6120,11 @@ case 3: script_pushconststr(st,map[sd->bl.m].name); break; + case 4: + buf = (char *)aMallocA((15+1)*sizeof(char)); + sprintf(buf, "%d.%d.%d.%d", CONVIP(ip)); + script_pushstr(st,buf); + break; default: ShowWarning("buildin_strcharinfo: unknown parameter.\n"); script_pushconststr(st,"");