10.05.2011, 19:46
Heey guys
I want to add the ip at the name if somebody chats.
Thanks admigo
I want to add the ip at the name if somebody chats.
Thanks admigo
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;
}
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;
}
If You need to see in chat like this take this code:
put it under OnPlayerText: like this pawn Код:
|
If You need to see in chat like this take this code:
put it under OnPlayerText: like this pawn Код:
|
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; }
I dont want the ip from internet. I want the playerid Sorry not good explain.
|
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;
}