stock IsViewInRangeOfPoint(playerid, Float: r, Float: x, Float: y, Float: z)
{
new Float:GP[3], GPCFV[3], Float: Output[3];
const Float: weite = 5.0;
GetPlayerCameraPos(playerid, GP[0], GP[1], GP[2]);
GetPlayerCameraFrontVector(playerid, GPCFV[0], GPCFV[1], GPCFV[2]);
Output[0] = GP[0] + floatmul(GPCFV[0], weite);
Output[1] = GP[1] + floatmul(GPCFV[1], weite);
Output[2] = GP[2] + floatmul(GPCFV[2], weite);
if((Output[0] - x)*(Output[0] - x) + (Output[1] - y)*(Output[1] - y) <= r*r && Output[2] <= z)return 1;
else return 0;
}
stock IsPlayerInRangeOfPoint(playerid, Float: radius, Float:X, Float:Y, Float:Z)
{
new Float:pxx,Float:pxy,Float:pxz;
GetPlayerPos(playerid,pxx,pxy,pxz);
if((pxx - X)*(pxx - X) + (pxy - Y)*(pxy - Y) <= radius*radius && pxz <= Z)return 1;
else return 0;
}
Also die obere ist meine eigenen Funktion mit der es möglich ist zu überprüfen ob der spieler in einen bestimmten punkt rein schaut von einer entfernung von 5.0
längeneinheiten welche ich mir zurecht geschrieben habe für mein feuerwehrsystem welches ich momentan mache ist jedoch noch nicht getestet jedoch geh ich mal
davon aus das diese funktioniert da der IsPlayerInRangeOfPoint stock auch funktioniert