Skip to content

A3D_IsPointOnScreen

imshooter edited this page Oct 17, 2026 · 1 revision

Whether a point shows on the screen of a player.

native bool:A3D_IsPointOnScreen(playerid, Float:x, Float:y, Float:z, bool:sight = false);

Parameters

Parameter Description Default
playerid Player whose screen it is.
Float:x Point on the X axis.
Float:y Point on the Y axis.
Float:z Point on the Z axis.
bool:sight Whether the camera must see it, with the map and static objects in the way. false

Returns

  • true when the point shows.
  • false when it does not, or the player sent no camera yet.

Remarks

The point shows when it lies in front of the camera and inside the 640 by 448 units of the screen. With sight, the line from the camera to the point must also be free of the map and of static objects, in the virtual world of the player.

Example

Rewards a player who spots a hidden package.

stock CheckPackage(playerid, Float:x, Float:y, Float:z) {
    if (GetPlayerDistanceFromPoint(playerid, x, y, z) > 30.0) {
        return;
    }

    if (!A3D_IsPointOnScreen(playerid, x, y, z, true)) {
        return;
    }

    SendClientMessage(playerid, -1, "You spotted a package.");
}

Related

Home

Guides

Reference

Functions

Creating objects
Motion
Placement
Behaviour
Display and data
Rays
Shapes
Players, vehicles and actors
Map probes
Screen
Map objects
Water
Models and surfaces
Rotations and offsets
Vehicles
Routes
Route display
Walking
Callbacks

Clone this wiki locally