06.01.2016, 17:53
TITLE SAYS EVERYTHING!
CMD:me(playerid, params[])
{
new string[75], name[MAX_PLAYER_NAME];
if(isnull(params)) return SendClientMessage(playerid, -1, "/me [text]");
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string, sizeof string, "%s %s %s", name, string, params);
SendClientMessageToAll(-1, string);
return 1;
}
command(me, playerid, params[])
{
new
text[128], name[MAX_PLAYER_NAME];
if(!IsPlayerConnected(playerid)) return 1;
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, -1, "USAGE: /me [action]");
GetPlayerName(playerid, name, sizeof name);
format(text, sizeof text, "* %s %s ", name, text);
SendActionMessage(playerid, -1, text);
return 1;
}
SendActionMessage(playerid, color, text[])
{
new
Float:range = 5.0, Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
for(new i, j = GetPlayerPoolSize(); i <= j; i++)
{
if(IsPlayerInRangeOfPoint(i, range, X, Y, Z))
{
SendClientMessage(i, color, text);
}
}
return 1;
}