15.08.2015, 18:24 
	
	
	
		******d it, no results found. Have anybody thought about it? I can't really think of the way of checking when player is behind other player and other player is not facing him?
	
	
	
	
#include <a_samp>
#include <zcmd>
CMD:kill(playerid, params[])
{
new player1, string[128], rname[24];
if(!IsNumeric(params)) player1 = ReturnPlayerID(params);
else player1 = strval(params);
if(GetDistanceBetweenPlayers(playerid,player1) > 3) {
GetPlayerName(player1, rname, 24);
format(string, sizeof(string), "%s Is not close enough",rname);
SendClientMessage(playerid, -1, string);
} else {
SetPlayerHealth(player1, 0);
}
return 1;
}
forward Float:GetDistanceBetweenPlayers(p1,p2);
public Float:GetDistanceBetweenPlayers(p1,p2){
    new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    if (!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
    {
        return -1.00;
    }
    GetPlayerPos(p1,x1,y1,z1);
    GetPlayerPos(p2,x2,y2,z2);
    return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}
stock IsNumeric(string[])
{
    for (new i = 0, j = strlen(string); i < j; i++)
    {
        if (string[i] > '9' || string[i] < '0') return 0;
    }
    return 1;
}
stock ReturnPlayerID(PlayerName[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(strfind(pName(i),PlayerName,true)!=-1) return i;
        }
    }
    return INVALID_PLAYER_ID;
}
stock pName(playerid)
{
  new plname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, plname, sizeof(plname));
  return plname;
}
stock Float:GetPosInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
     GetPlayerPos(playerid, x, y, a);
      switch(IsPlayerInAnyVehicle(playerid))
       {
        case 0: GetPlayerFacingAngle(playerid, a); // maybe add -180 to this
          case 1: GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
    return a;
} 
stock Float:GetPosInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
switch(IsPlayerInAnyVehicle(playerid))
{
case 0: GetPlayerFacingAngle(playerid, a); // maybe add -180 to this
case 1: GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
return a;
}
| Hmm, you could modify this function: pawn Code: 
 | 
 + Updated
 + Updated