IsPlayerNearPlayer(playerid, n_playerid, Float:radius){
new Float:npx, Float:npy, Float:npz;
GetPlayerPos(n_playerid, npx, npy, npz);
if(IsPlayerInRangeOfPoint(playerid, radius, npx, npy, npz)){
return true;
}else{
return false;
}
}
forward IsPlayerNearPlayer(playerid, n_playerid, Float:radius);
IsPlayerNearPlayer(playerid, n_playerid, Float:radius){
new Float:npx, Float:npy, Float:npz;
GetPlayerPos(n_playerid, npx, npy, npz);
if(IsPlayerInRangeOfPoint(playerid, radius, npx, npy, npz)){
return true;
}else{
return false;
}
}
public OnPlayerCommandText(playerid, cmdtext[]){
new idx, cmd[256];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/near")){
if(IsPlayerNearPlayer(playerid, 5, 10.0)){
SendClientMessage(playerid, COLOR_WHITE, "You are near player with id 5 Radius is 10");
return 1;
}else{
SendClientMessage(playerid, COLOR_WHITE, "You are NOT near player with id 5 Radius is 10");
return 1;
}
}
}
stock PlayerToPlayer(playerid,targetid,Float:distance)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
if(IsPlayerInRangeOfPoint(targetid,distance,x,y,z))
{
return true;
}
return false;
}
public OnPlayerCommandText(playerid, cmdtext[]){
new idx, cmd[256];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/near")){
if(PlayerToPlayer(playerid,5, 10.0)){
SendClientMessage(playerid, COLOR_WHITE, "You are near player with id 5 Radius is 10");
return 1;
}else{
SendClientMessage(playerid, COLOR_WHITE, "You are NOT near player with id 5 Radius is 10");
return 1;
}
}
}
I made something like this 2 weeks ago and i copy } else { reutrn true; code from your FUNC tnx alot i give you credits
|