01.09.2010, 15:29
Try this homie'
pawn Код:
/* use `string_change[]` for things to add like (( or )), MUST use for roleplay servers!
Make string_change `local` if you want to use it for local chat
Make string_change `ooc` if you want to use it for ooc chat
Make string_change `ic` if you want to use it for ic chat*/
stock SendLocalMessage(playerid, color, string[], string_change[])
{
new Float:x, Float:y, Float:z, name[24], str_con[128];
GetPlayerName(playerid, name, sizeof name);
GetPlayerPos(playerid, x, y, z);
if(string_change == local)
{
format(str_con, 128, "%s(%d) says: %s", name, playerid, string);
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, x, y, z))
{
SendClientMessage(i, color, string);
return 1;
}
}
}
else if(string_change == ooc)
{
format(str_con, 128, "(( %s: (%d) %s ))", name, playerid, string);
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, x, y, z))
{
SendClientMessage(i, color, string);
return 1;
}
}
}
else if(string_change == ic)
{
format(str_con, 128, "%s: (%d) %s", name, playerid, string);
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, x, y, z))
{
SendClientMessage(i, color, string);
return 1;
}
}
}
return 0;
}