03.08.2013, 15:49
(
Последний раз редактировалось Garwan50; 03.08.2013 в 16:05.
Причина: Fail []
)
hello,
i want that just nearby player can hear what someone else tell.
My callback OnPlayerText:
The function SendMessageForNearbyPlayer:
If the player is at 2 meter, i hear well, if 4, less, and 6, barely none. (white to gray/black)
But in game, the text is only white.
Sorry for my english, i'm french !
Thanks a lot
i want that just nearby player can hear what someone else tell.
My callback OnPlayerText:
pawn Код:
if (PlayerInfo[playerid][pAdmin] == 0)
{
new playername[MAX_PLAYER_NAME], str[124];
GetPlayerName(playerid, playername, sizeof(playername));
format(str, sizeof(str), "%s [%i] dit: %s", playername, playerid, text);
SendMessageForNearbyPlayer(playerid, str);
}
pawn Код:
stock SendMessageForNearbyPlayer(playerid, text[])
{
new Float:posX, Float:posY, Float:posZ;
GetPlayerPos(playerid, posX, posY, posZ);
for (new p = 0; p<MAX_PLAYERS; p++)
{
if (IsPlayerConnected(p))
{
if(IsPlayerInRangeOfPoint(p, 2, posX, posY, posZ))
{
SendClientMessage(p, -1, text);
}
else if(IsPlayerInRangeOfPoint(p, 4, posX, posY, posZ))
{
SendClientMessage(p, 0xFF949494, text);
}
else if(IsPlayerInRangeOfPoint(p, 6, posX, posY, posZ))
{
SendClientMessage(p, 0xFF373737, text);
}
}
}
}
If the player is at 2 meter, i hear well, if 4, less, and 6, barely none. (white to gray/black)
But in game, the text is only white.
Sorry for my english, i'm french !
Thanks a lot