07.12.2018, 20:45
PHP Code:
#define COLOR_ACTION 0xDA70D6FF
SendClientActionMessage(playerid, Float:radius, action[])
{
new Float:fDist[3], message[145];
GetPlayerPos(playerid, fDist[0], fDist[1], fDist[2]);
format(message, sizeof(message), "* %s %s", GetUserName(playerid), action);
foreach(new i: Player)
{
if(GetPlayerDistanceFromPoint(i, fDist[0], fDist[1], fDist[2]) <= radius && GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
{
SendClientMessage(i, COLOR_ACTION, message);
}
}
}
stock GetUserName(playerid)
{
new pnome[MAX_PLAYER_NAME];
GetPlayerName(playerid, pnome, sizeof(pnome));
return pnome;
}
PHP Code:
SendClientActionMessage(playerid, 15.0, "equipou o seu kit-socio nivel 1.");