21.09.2010, 14:46
something like this
pawn Код:
public OnPlayerText(playerid, text[])
{
new name[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s( %d) says: %s", name, playerid, text);
new Float:x1,Float:y1,Float:z1
GetPlayerPos(playerid,x1,y1,z1);
for(new i = 0; i < MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
Float:x2,Float:y2,Float:z2;
GetPlayerPos(i,x2,y2,z2);
if(GetPlayerInterior(playerid) == GetPlayerInterior(i))
{
new Float:dist = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
if(dist < 20)
{
SendClientMessage(i,0xAFAFAFAA,string);
}
}
}
}
return 0;
}