onplayertext - 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: onplayertext (
/showthread.php?tid=333430)
onplayertext -
spd_sahil - 11.04.2012
pawn Code:
public OnPlayerText(playerid, text[])
{
static string[128];
GetPlayerName(playerid, string, MAX_PLAYER_NAME); // fix name
format(string, sizeof(string),"{FFDC00}[%d] {%06x}%s:{FFFFFF} %s",playerid, GetPlayerColor(playerid), string,text); // fix colour :d
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 0;
}
this is the code to put player id in yellow behind a players name when he says something.. its not working for my server
also yes i have the fix for the GetPlayerColor
Re: onplayertext -
emokidx - 11.04.2012
pawn Code:
public OnPlayerText(playerid, text[])
{
static string[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname)); // fix name
format(string, sizeof(string),"{FFDC00}[%d] {%06x}%s:{FFFFFF} %s",playerid, GetPlayerColor(playerid)/* i don't get why are you using it, i never have seen nything like this, so i will leave it as it is.*/, pname,text); // fix colour :d
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 0;
}
Re: onplayertext -
Cjgogo - 11.04.2012
pawn Code:
public OnPlayerText(playerid, text[])
{
new pName[MAX_PLAYER_NAME];
new string[256];
GetPlayerName(playerid, pName,sizeof(pName));
format(string, sizeof(string),"{FFDC00}[%d] {%06x}%s:{FFFFFF} %s",playerid,pName,text);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 0;
}
Replace the whole code with what I gave you,if it's working Rep++,please?
(I usually don't ask for rep,but I have 39 points and I want to have 40 :P)
Re: onplayertext -
ViniBorn - 11.04.2012
pawn Code:
public OnPlayerText(playerid, text[])
{
new string[128], VBName[MAX_PLAYER_NAME];
GetPlayerName(playerid, VBName, MAX_PLAYER_NAME); // fix name
format(string, sizeof(string),"{FFDC00}[%d] {%h}%s:{FFFFFF} %s",playerid, GetPlayerColor(playerid) >>> 8, VBName,text); // fix colour :d
SendClientMessageToAll(-1,string);
return 0;
}