12.12.2012, 04:28
Hello, i keep make mine RP chat but when i chat none can see it.
Some help? Anyone got a proper rp chat?
Some help? Anyone got a proper rp chat?
public OnPlayerText(playerid, text[])
{
new szString[128];
format(szString, sizeof(szString), "%s says: %s", getName(playerid), text);
sendNearbyMessage(playerid, szString, COLOR_GREY);
// you don't need to specify "range" unless you want to
// COLOR_GREY will need to be your color of choice
return 1;
}
stock getName(playerid) // gets and returns a particular playerid's name
{
new szName[25];
GetPlayerName(playerid, szName, sizeof(szName));
return szName;
}
/* sendNearbyMessage was created by RealCop228 - fuck rights, he doesn't care
the params are:
playerid is the person sending the message
text[] is the string message itself (formatted already)
color is the color you want the message to be
range is the range to send the message, it defaults to 30 meters from playerid's position
*/
stock sendNearbyMessage(playerid, text[], COLOR, Float:range = 30.0)
{
new Float:fPosition[3];
GetPlayerPos(playerid, fPosition[0], fPosition[1], fPosition[2]);
foreach(new i : Player)
{
if(IsPlayerInRangeOfPoint(i, range, fPosition[0], fPosition[1], fPosition[2])
{
SendClientMessage(i, COLOR, text);
}
}
return 1;
}