2019-04-25, 09:47 PM
You want to a local IC chat about RP servers etc?
Just use something like this maybe, no need for that..-
Just use something like this maybe, no need for that..-
Code:
public OnPlayerText(playerid, text[])
{
new Float:Pos[3];
GetPlayerPosition(playerid, Pos[0], Pos[1], Post[2]);
new str[ 128 1 ];
format(str, sizeof str, "whatever you want here..");
for(new i = 0; i != MAX_PLAYERS; i)
{
if(!IsPlayerConnected(i)) continue;
if(!IsPlayerInRangeOfPoint(i, 30.0, Pos[0], Pos[1], Post[2])) continue;
if(GetPlayerVirtualWorld(i) != GetPlayerVirtualWorld(playerid) || GetPlayerInterior(i) != GetPlayerInterior(playerid)) continue;
new Float:dis;
dis = GetDistanceBetweenPlayers(playerid,i);
if(dis <=25 ) SendClientMessage(i, -1, str); // change the distance here
}
return 0;
}
stock GetDistanceBetweenPlayers(playerid, playerid2)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
new Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z1);
GetPlayerPos(playerid2,x2,y2,z2);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)繚᪶騰(floatabs(floatsub(y2,y1)),2)繚᪶騰(floatabs(floatsub(z2,z1)),2));
return floatround(tmpdis);
}