SA-MP Forums Archive
Id Infront of name - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Id Infront of name (/showthread.php?tid=281555)



Id Infront of name - spd_sahil - 06.09.2011

GUyss i guess its damn simple but i dont know it.couldnt find it on search also. when people send a chat message.. i want it in this format :-

[ID]Name : *Message

i dont know how to do it


Re: Id Infront of name - Kingunit - 06.09.2011

// I see someone got it here.


Re: Id Infront of name - [MWR]Blood - 06.09.2011

pawn Code:
public OnPlayerText(playerid, text[])
{
     new string[128];
     format(string,sizeof(string),"[%i]%s: %s",playerid,GetPName(playerid),text);
     SendClientMessageToAll(GetPlayerColor(playerid),string);
     return 0;
}



Re: Id Infront of name - spd_sahil - 06.09.2011

all right thanks for that .. but one more thing.. i want my text to be normal white colours.. and my ID to be Yellow in colour.. also there is a little bug that.. when i enter the server.. my colour is always black


Re: Id Infront of name - Jafet_Macario - 06.09.2011

pawn Code:
public OnPlayerText(playerid, text[])
{
     new string[128];
     format(string,sizeof(string),"{FFFF00}[%i]{FFFFFF}%s: %s",playerid,GetPName(playerid),text);
     SendClientMessageToAll(GetPlayerColor(playerid),string);
     return 0;
}
SetPlayerColor(playerid, 0xFFFFFFAA); // OnPlayerConnect or OnplayerSpawn



Re: Id Infront of name - spd_sahil - 07.09.2011

Its Not Helping... i mean i get the ID there.. bug i want the ID to be in YELLOW color and the Name to be in PLayer's Colour and the Text in WHITE


Re: Id Infront of name - =WoR=Varth - 07.09.2011

https://sampwiki.blast.hk/wiki/Colors_List


Re: Id Infront of name - spd_sahil - 07.09.2011

Ohh .. wait up


Re: Id Infront of name - spd_sahil - 07.09.2011

Code:
public OnPlayerText(playerid, text[])
{
     new string[128];
     new Pname[256];
	 GetPlayerName(playerid,Pname,256);
	 format(string,sizeof(string),"{FFDC00}[%i] - %s : {FFFFFF}%s",playerid,Pname,text);
     SendClientMessageToAll(GetPlayerColor(playerid),string);
     return 0;
}
i need the middle %s to have player's colour


Re: Id Infront of name - [H]ead - 07.09.2011

pawn Code:
public OnPlayerText(playerid, text[])
{
     static string[128];
     GetPlayerName(playerid, string, MAX_PLAYER_NAME); // fix name

     format(string,sizeof string ,"[%d] %s:{FFFFFF} %s",playerid, string,text); // fix colour :d

     SendClientMessageToAll(GetPlayerColor(playerid),string);
     return 0;    
}
sdp and Jafet_Macario:
Your code send all messages with color FFDC00 and FFFF00

Blood
Your code cause undefined symbol, and send ALL message with one color