diff --git a/plugins/include/amxconst.inc b/plugins/include/amxconst.inc index ca5011ee..33d0610c 100755 --- a/plugins/include/amxconst.inc +++ b/plugins/include/amxconst.inc @@ -533,4 +533,16 @@ enum STATSX_MAX_STATS } +/** + * Constants for get_user_origin() + */ +enum +{ + Origin_Client = 0, // Client's Origin + Origin_Eyes, // Eyes (and Weapon) Origin + Origin_AimEndClient, // Aim End Origin from Client's Position + Origin_AimEndEyes, // Aim End Origin from Eyes Position + Origin_CS_LastBullet // Last Bullet's Origin (Counter-Strike) +} + #include // To keep backward compatibility diff --git a/plugins/include/amxmodx.inc b/plugins/include/amxmodx.inc index 98630819..74f87432 100755 --- a/plugins/include/amxmodx.inc +++ b/plugins/include/amxmodx.inc @@ -1203,14 +1203,16 @@ native get_user_ping(index, &ping, &loss); /** * Retrieves an origin related to the client. * + * @note For a list of possible modes see the Origin_* constants in amxconst.inc. + * * @param index Client index * @param origin Array to store origin in * @param mode What type of origin to retrieve: - * 0 - current position - * 1 - position of eyes (and weapon) - * 2 - aim end position from client position - * 3 - aim end position from eyes (hit point for weapon) - * 4 - position of last bullet hit (only for Counter-Strike) + * Origin_Client - current position + * Origin_Eyes - position of eyes (and weapon) + * Origin_AimEndClient - aim end position from client position + * Origin_AimEndEyes - aim end position from eyes (hit point for weapon) + * Origin_CS_LastBullet - position of last bullet hit (only for Counter-Strike) * * @return 1 on success, 0 if client is not connected * @error If the client index is not within the range of 1 to diff --git a/plugins/include/engine_stocks.inc b/plugins/include/engine_stocks.inc index 1ef21890..baa386fa 100755 --- a/plugins/include/engine_stocks.inc +++ b/plugins/include/engine_stocks.inc @@ -125,7 +125,7 @@ stock remove_entity_name(const eName[]) stock ViewContents(id) { new origin[3], Float:Orig[3]; - get_user_origin(id, origin, 3); + get_user_origin(id, origin, Origin_AimEndEyes); Orig[0] = float(origin[0]); Orig[1] = float(origin[1]); Orig[2] = float(origin[2]); diff --git a/plugins/include/fakemeta_util.inc b/plugins/include/fakemeta_util.inc index b0bab0d0..4c66231e 100644 --- a/plugins/include/fakemeta_util.inc +++ b/plugins/include/fakemeta_util.inc @@ -325,7 +325,7 @@ stock fm_remove_entity_name(const classname[]) { stock fm_ViewContents(id) { new origin[3], Float:Orig[3]; - get_user_origin(id, origin, 3); + get_user_origin(id, origin, Origin_AimEndEyes); IVecFVec(origin, Orig); return fm_point_contents(Orig);