04.02.2010, 17:13
As the title says, I need to make some sort of radius for chats, like when I /me farts, the whole world knows!
Originally Posted by Rubennnnn
|
strcmp......
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
for(new p=0; p<GetMaxPlayers(); p++)
{
//replace 10 with the radius you want
If(IsPlayerConnected(p) && IsPlayerInRangeOfPoint(p, 10, X, Y, Z)) SendClientMessage(p, 0xAAAAAAAA, "your message here");
}
.....
if(!strcmp(cmdtext, "/me", true, 4)) { if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [ACTION]"); new str[128]; GetPlayerName(playerid, str, sizeof(str)); format(str, sizeof(str), "* %s %s", str, cmdtext[4]); SendClientMessageToAll(0xFFFF00AA, str); return 1; }
if(!strcmp(cmdtext, "/me", true, 4))
{
if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [ACTION]");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 40.0, x, y, z))
{
SendClientMessage(i, 0xFFFF00AA, str);
}
}
}
return 1;
}