10.09.2012, 00:36
Boa noite, gostaria de saber como fasso para poder aparecer uma msg somente para quem estб prуximo a mim eu atй consegui mais a msg ela aparece tanto no xat global quanto no xat prуximo poderiam me ajudar?
Eis o meu OnPlayerText
O cуdigo que faz com que eu uso ; para falar no xat prуximo й este
Poderiam me ajudar?
Eis o meu OnPlayerText
pawn Код:
public OnPlayerText(playerid, text[])
{
if (APlayerData[playerid][PlayerLevel] >= 1)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]{FFFF00}[ADM-%d]{FFFFFF}diz: %s", pname, playerid,APlayerData[playerid][PlayerLevel], text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
if (APlayerData[playerid][PlayerLevel] <= 0)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]diz: %s", pname, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}//PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
if(text[0] == ';')
{
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
new n[24],s[128],Float:Pos[3];
GetPlayerName(playerid,n,24);
format(s,128,"{FFFDE8}(Chat proximo){60F7FF}%s: %s",n,text[1]);
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
for(new i = 0 ; i < GetMaxPlayers(); i++) {
if(IsPlayerInRangeOfPoint(i,2,Pos[0],Pos[1],Pos[2])) {
SendClientMessage(i,-1,s);
}
}
}
return false;
}
pawn Код:
if(text[0] == ';')
{
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
new n[24],s[128],Float:Pos[3];
GetPlayerName(playerid,n,24);
format(s,128,"{FFFDE8}(Chat proximo){60F7FF}%s: %s",n,text[1]);
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
for(new i = 0 ; i < GetMaxPlayers(); i++) {
if(IsPlayerInRangeOfPoint(i,2,Pos[0],Pos[1],Pos[2])) {
SendClientMessage(i,-1,s);
}
}
}
return false;
Poderiam me ajudar?