AMX Mod X API Documentation

Signature
native Float:get_user_aiming(index, &id, &body = HIT_GENERIC, dist = 9999);
Description

Traces the client's current aim vector to see if it hits something.

Notes
  • If the trace does not hit a client, id and body will be set to 0.
  • If the trace hits nothing within the specified distance, 0 is returned.
  • For a list of possible body hitplaces see the HIT_* constants in amxconst.inc.
Parameters
  • index Client index to trace aim from
  • id Variable to store hit client index (if applicable)
  • body Variable to store hit client body part (if applicable)
  • dist Maximum distance of the trace
Returns

Distance between the trace start and end point

Errors
  • If the client index is not within the range of 1 to

    MaxClients, an error will be thrown.

Назад
Верх