This is pretty much what I've done so far, pretty hard coded but just an example:
PHP Code:
new Float:fFireAngle[3]
pev(iPlayer, pev_angles, fFireAngle)
new iPlayers[32], iNum
get_players(iPlayers, iNum, "a")
for(new iPlayerAround, Float:fPlayerAngle[3], i;i < iNum;i++)
{
iPlayerAround = iPlayers[i] // iPlayerAround is the ID of all players around me, I'm checking which side they are from my perspective.
pev(iPlayerAround, pev_angles, fPlayerAngle)
if(40.0 <= (fPlayerAngle[1] - fFireAngle[1]) <= 105.0)
{
log_amx("Player is on my left")
}
else if(120.0 <= (fPlayerAngle[1] - fFireAngle[1]) > -147.0)
{
log_amx("Player is behind me")
}
else log_amx("Player is on my right")
console_print(iPlayer, "%f %f %f", fPlayerAngle[0] - fFireAngle[0], fPlayerAngle[1] - fFireAngle[1], fPlayerAngle[2] - fFireAngle[2])
}
If I shot at you, I wanna know first if it's behind you, your left or right or in front of you, then create an entity based on that information.
If I shot at behind you, I wanna get an origin behind you and then spawn an entity there.
__________________