#1

Heey guys
I want to add the ip at the name if somebody chats.
Thanks admigo
Reply
#2

If You need to see in chat like this take this code:

put it under OnPlayerText:

like this

pawn Код:
public OnPlayerText(playerid, text[])
{
    new newname[256], oldname[30], ip[16];
    GetPlayerIp(playerid,ip,16);
    GetPlayerName(playerid, oldname, 30);
    format(newname, 256, "%s[%s]", oldname, ip);
    SetPlayerName(playerid, newname);
    SendPlayerMessageToAll(playerid, text);
    SetPlayerName(playerid, oldname);
    return 1;
}
Reply
#3

pawn Код:
public OnPlayerText(...)
{
     new IP[16];
     new string[512];
     new pname[MAX_PLAYER_NAME];
     GetPlayerName(playerid,pname,sizeof(pname));
     GetPlayerIp(playerid,IP,sizeof(IP));
     format(string,sizeof(string),"%s[%d][%d] says: %s",pname,IP,playerid,text);
     SendClientMessageToAll(COLOR_WHITE,string);
     return 0;
}
EDIT:
Quote:
Originally Posted by Nexotronix
Посмотреть сообщение
If You need to see in chat like this take this code:

put it under OnPlayerText:

like this

pawn Код:
public OnPlayerText(playerid, text[])
{
    new newname[256], oldname[30], ip[16];
    GetPlayerIp(playerid,ip,16);
    GetPlayerName(playerid, oldname, 30);
    format(newname, 256, "%s[%s]", oldname, ip);
    SetPlayerName(playerid, newname);
    SendPlayerMessageToAll(playerid, text);
    SetPlayerName(playerid, oldname);
    return 1;
}
O M F G ....
That's really really..hmm
Reply
#4

Quote:
Originally Posted by Nexotronix
Посмотреть сообщение
If You need to see in chat like this take this code:

put it under OnPlayerText:

like this

pawn Код:
public OnPlayerText(playerid, text[])
{
    new newname[256], oldname[30], ip[16];
    GetPlayerIp(playerid,ip,16);
    GetPlayerName(playerid, oldname, 30);
    format(newname, 256, "%s[%s]", oldname, ip);
    SetPlayerName(playerid, newname);
    SendPlayerMessageToAll(playerid, text);
    SetPlayerName(playerid, oldname);
    return 1;
}
Oh God, what have you done!?
Reply
#5

Код:
public OnPlayerText(playerid, text[])
{
	new string[500];
	new name[50];
	new IP[50];
	GetPlayerName(playerid,name,sizeof(name));
	GetPlayerIp(playerid,IP,sizeof(IP));
	format(string,sizeof(string),"[%s]%s[%d]: %s",IP,name,playerid,text);
	SendClientMessageToAll(GetPlayerColor(playerid),string);
	return 0;
}
@SkizzoTrick - %d is not used for IP's.

@xRyder - The post you made was just useless.
Reply
#6

Quote:
Originally Posted by coole210
Посмотреть сообщение
@SkizzoTrick - %d is not used for IP's.
Yep,your right.My bad...
Reply
#7

If i add the codes i get double chat lol;P
Reply
#8

Quote:
Originally Posted by admigo
Посмотреть сообщение
If i add the codes i get double chat lol;P
I told you in the first post to set "return 0;"

This forum requires that you wait 120 seconds between posts. Please try again in 23 seconds.
Reply
#9

I dont want the ip from internet. I want the playerid Sorry not good explain.
Reply
#10

Quote:
Originally Posted by admigo
Посмотреть сообщение
I dont want the ip from internet. I want the playerid Sorry not good explain.
I did it in the first post,just delete the IP.
pawn Код:
public OnPlayerText(...)
{
     new string[512];
     new pname[MAX_PLAYER_NAME];
     GetPlayerName(playerid,pname,sizeof(pname));
     format(string,sizeof(string),"%s[%d] says: %s",pname,playerid,text);
     SendClientMessageToAll(COLOR_WHITE,string);
     return 0;
}
This forum requires that you wait 120 seconds between posts. Please try again in 14 seconds.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)