mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-26 23:05:37 +03:00
commit
a167170d18
@ -92,7 +92,7 @@ bool CloseNewMenus(CPlayer *pPlayer)
|
||||
|
||||
Menu::Menu(const char *title, AMX *amx, int fid) : m_Title(title), m_ItemColor("\\r"),
|
||||
m_NeverExit(false), m_AutoColors(g_coloredmenus), thisId(0), func(fid),
|
||||
isDestroying(false), pageCallback(-1), items_per_page(7)
|
||||
isDestroying(false), pageCallback(-1), showPageNumber(true), items_per_page(7)
|
||||
{
|
||||
CPluginMngr::CPlugin *pPlugin = g_plugins.findPluginFast(amx);
|
||||
menuId = g_menucmds.registerMenuId(title, amx);
|
||||
@ -357,7 +357,7 @@ const char *Menu::GetTextString(int player, page_t page, int &keys)
|
||||
m_Text = nullptr;
|
||||
|
||||
char buffer[255];
|
||||
if (items_per_page && (pages != 1))
|
||||
if (showPageNumber && items_per_page && (pages != 1))
|
||||
{
|
||||
if (m_AutoColors)
|
||||
ke::SafeSprintf(buffer, sizeof(buffer), "\\y%s %d/%d\n\\w\n", m_Title.chars(), page + 1, pages);
|
||||
@ -983,6 +983,11 @@ static cell AMX_NATIVE_CALL menu_setprop(AMX *amx, cell *params)
|
||||
unregisterSPForward(pMenu->pageCallback);
|
||||
pMenu->pageCallback = callback;
|
||||
|
||||
break;
|
||||
}
|
||||
case MPROP_SHOWPAGE:
|
||||
{
|
||||
pMenu->showPageNumber = (get_amxaddr(amx, params[3]) != 0);
|
||||
break;
|
||||
}
|
||||
case MPROP_SET_NUMBER_COLOR:
|
||||
|
@ -31,6 +31,7 @@
|
||||
#define MPROP_PADMENU 9
|
||||
#define MPROP_SET_NUMBER_COLOR 10
|
||||
#define MPROP_PAGE_CALLBACK 11
|
||||
#define MPROP_SHOWPAGE 12
|
||||
|
||||
typedef int (*MENUITEM_CALLBACK)(int, int, int);
|
||||
|
||||
@ -125,6 +126,7 @@ public:
|
||||
int func;
|
||||
bool isDestroying;
|
||||
int pageCallback;
|
||||
bool showPageNumber;
|
||||
public:
|
||||
unsigned int items_per_page;
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,422 +1,422 @@
|
||||
/* Float arithmetic
|
||||
*
|
||||
* (c) Copyright 1999, Artran, Inc.
|
||||
* Written by Greg Garner (gmg@artran.com)
|
||||
* Modified in March 2001 to include user defined
|
||||
* operators for the floating point functions.
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _float_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _float_included
|
||||
|
||||
#pragma rational Float
|
||||
|
||||
/**
|
||||
* Different methods of rounding
|
||||
*/
|
||||
enum floatround_method {
|
||||
floatround_round = 0,
|
||||
floatround_floor,
|
||||
floatround_ceil,
|
||||
floatround_tozero
|
||||
};
|
||||
|
||||
/**
|
||||
* Different units of measurement for angles
|
||||
*/
|
||||
enum anglemode {
|
||||
radian = 0,
|
||||
degrees,
|
||||
grades
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts an integer into a floating point value.
|
||||
*
|
||||
* @param value Value to be converted
|
||||
*
|
||||
* @return Converted value
|
||||
*/
|
||||
native Float:float(value);
|
||||
|
||||
/**
|
||||
* Converts a string into a floating point value.
|
||||
*
|
||||
* @param string Input string to be converted
|
||||
*
|
||||
* @return Converted value
|
||||
*/
|
||||
native Float:floatstr(const string[]);
|
||||
|
||||
/**
|
||||
* Returns the fractional part of a floating point value
|
||||
*
|
||||
* @param string Floating point value to get the fractional part from
|
||||
*
|
||||
* @return The fractional part
|
||||
*/
|
||||
native Float:floatfract(Float:value);
|
||||
|
||||
/**
|
||||
* Rounds a floating point value to an integer value
|
||||
*
|
||||
* @note For the list of available rounding methods look at
|
||||
* floatround_method enumeration.
|
||||
*
|
||||
* @param value Floating point value to be rounded
|
||||
* @param method Rounding method
|
||||
*
|
||||
* @return Converted value
|
||||
*/
|
||||
native floatround(Float:value, floatround_method:method=floatround_round);
|
||||
|
||||
/**
|
||||
* Compares two floating point values.
|
||||
*
|
||||
* @param fOne First value to be compared
|
||||
* @param fTwo Second value to be compared
|
||||
*
|
||||
* @return If arguments are equal, returns 0.
|
||||
* If the first one is greater, returns 1.
|
||||
* If the second one is greater, returns -1.
|
||||
*/
|
||||
native floatcmp(Float:fOne, Float:fTwo);
|
||||
|
||||
/**
|
||||
* Returns the square root of a floating point value
|
||||
*
|
||||
* @note Same as floatpower(value, 0.5)
|
||||
*
|
||||
* @param value Floating point value to get square root from
|
||||
*
|
||||
* @return Square root of the input value
|
||||
*/
|
||||
native Float:floatsqroot(Float:value);
|
||||
|
||||
/**
|
||||
* Returns the value raised to the power of the exponent
|
||||
*
|
||||
* @param value Floating point value to be raised
|
||||
* @param exponent The exponent
|
||||
*
|
||||
* @return Value raised to the power of the exponent
|
||||
*/
|
||||
native Float:floatpower(Float:value, Float:exponent);
|
||||
|
||||
/**
|
||||
* Returns the logarithm of value
|
||||
*
|
||||
* @param value Floating point value to calculate the logarithm for
|
||||
* @param base The optional logarithmic base to use.
|
||||
* Defaults to 10, or the natural logarithm
|
||||
*
|
||||
* @return Square root of the input value
|
||||
*/
|
||||
native Float:floatlog(Float:value, Float:base=10.0);
|
||||
|
||||
/**
|
||||
* Returns the sine of a given angle
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The angle to calculate the sine from
|
||||
* @param mode What unit of measurement is the angle specified in
|
||||
* Defaults to radians
|
||||
*
|
||||
* @return The sine of a given angle
|
||||
*/
|
||||
native Float:floatsin(Float:value, anglemode:mode=radian);
|
||||
|
||||
/**
|
||||
* Returns the cosine of a given angle
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The angle to calculate the cosine from
|
||||
* @param mode What unit of measurement is the angle specified in
|
||||
* Defaults to radians
|
||||
*
|
||||
* @return The cosine of a given angle
|
||||
*/
|
||||
native Float:floatcos(Float:value, anglemode:mode=radian);
|
||||
|
||||
/**
|
||||
* Returns the tangent of a given angle
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The angle to calculate the tangent from
|
||||
* @param mode What unit of measurement is the angle specified in
|
||||
* Defaults to radians
|
||||
*
|
||||
* @return The tangent of a given angle
|
||||
*/
|
||||
native Float:floattan(Float:value, anglemode:mode=radian);
|
||||
|
||||
/**
|
||||
* Returns the hyperbolic sine of a given angle
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The angle to calculate the hyperbolic sine from
|
||||
* @param mode What unit of measurement is the angle specified in
|
||||
* Defaults to radians
|
||||
*
|
||||
* @return The hyperbolic sine of a given angle
|
||||
*/
|
||||
native Float:floatsinh(Float:angle, anglemode:mode=radian);
|
||||
|
||||
/**
|
||||
* Returns the hyperbolic cosine of a given angle
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The angle to calculate the hyperbolic cosine from
|
||||
* @param mode What unit of measurement is the angle specified in
|
||||
* Defaults to radians
|
||||
*
|
||||
* @return The hyperbolic cosine of a given angle
|
||||
*/
|
||||
native Float:floatcosh(Float:angle, anglemode:mode=radian);
|
||||
|
||||
/**
|
||||
* Returns the hyperbolic tangent of a given angle
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The angle to calculate the hyperbolic tangent from
|
||||
* @param mode What unit of measurement is the angle specified in
|
||||
* Defaults to radians
|
||||
*
|
||||
* @return The hyperbolic tangent of a given angle
|
||||
*/
|
||||
native Float:floattanh(Float:angle, anglemode:mode=radian);
|
||||
|
||||
/**
|
||||
* Returns the absolute value of a floating point value
|
||||
*
|
||||
* @param value The floating point value to get the absolute value from
|
||||
*
|
||||
* @return The absolute value
|
||||
*/
|
||||
native Float:floatabs(Float:value);
|
||||
|
||||
/* Return the angle of a sine, cosine or tangent.
|
||||
* The output angle may be in radians, degrees, or grades. */
|
||||
|
||||
/**
|
||||
* Returns the angle of the given tangent
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The tangent to calculate the angle from
|
||||
* @param mode What unit of measurement should the output angle be in
|
||||
*
|
||||
* @return The angle of a tangent
|
||||
*/
|
||||
native Float:floatatan(Float:angle, {anglemode,_}:radix);
|
||||
|
||||
/**
|
||||
* Returns the angle of the given cosine
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The cosine to calculate the angle from
|
||||
* @param mode What unit of measurement should the output angle be in
|
||||
*
|
||||
* @return The angle of a cosine
|
||||
*/
|
||||
native Float:floatacos(Float:angle, {anglemode,_}:radix);
|
||||
|
||||
/**
|
||||
* Returns the angle of the given sine
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The sine to calculate the angle from
|
||||
* @param mode What unit of measurement should the output angle be in
|
||||
*
|
||||
* @return The angle of a sine
|
||||
*/
|
||||
native Float:floatasin(Float:angle, {anglemode,_}:radix);
|
||||
|
||||
/**
|
||||
* Computes the principal value of arctangent of y/x
|
||||
*
|
||||
* @note Someone should verify this native, not sure what it actually does.
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param x Value representing the proportion of the x-coordinate.
|
||||
* @param y Value representing the proportion of the x-coordinate.
|
||||
* @param mode What unit of measurement should the output angle be in
|
||||
*
|
||||
* @return Arctangent of y/x
|
||||
*/
|
||||
native Float:floatatan2(Float:x, Float:y, {anglemode,_}:radix);
|
||||
|
||||
|
||||
|
||||
/* Multiply two floats together */
|
||||
native Float:floatmul(Float:oper1, Float:oper2);
|
||||
|
||||
/* Divide the dividend float by the divisor float */
|
||||
native Float:floatdiv(Float:dividend, Float:divisor);
|
||||
|
||||
/* Add two floats together */
|
||||
native Float:floatadd(Float:dividend, Float:divisor);
|
||||
|
||||
/* Subtract oper2 float from oper1 float */
|
||||
native Float:floatsub(Float:oper1, Float:oper2);
|
||||
|
||||
/* user defined operators */
|
||||
native Float:operator*(Float:oper1, Float:oper2) = floatmul;
|
||||
native Float:operator/(Float:oper1, Float:oper2) = floatdiv;
|
||||
native Float:operator+(Float:oper1, Float:oper2) = floatadd;
|
||||
native Float:operator-(Float:oper1, Float:oper2) = floatsub;
|
||||
|
||||
stock Float:operator++(Float:oper)
|
||||
return oper+1.0;
|
||||
|
||||
stock Float:operator--(Float:oper)
|
||||
return oper-1.0;
|
||||
|
||||
stock Float:operator-(Float:oper)
|
||||
return oper^Float:cellmin; /* IEEE values are sign/magnitude */
|
||||
|
||||
stock Float:operator*(Float:oper1, oper2)
|
||||
return floatmul(oper1, float(oper2)); /* "*" is commutative */
|
||||
|
||||
stock Float:operator/(Float:oper1, oper2)
|
||||
return floatdiv(oper1, float(oper2));
|
||||
|
||||
stock Float:operator/(oper1, Float:oper2)
|
||||
return floatdiv(float(oper1), oper2);
|
||||
|
||||
stock Float:operator+(Float:oper1, oper2)
|
||||
return floatadd(oper1, float(oper2)); /* "+" is commutative */
|
||||
|
||||
stock Float:operator-(Float:oper1, oper2)
|
||||
return floatsub(oper1, float(oper2));
|
||||
|
||||
stock Float:operator-(oper1, Float:oper2)
|
||||
return floatsub(float(oper1), oper2);
|
||||
|
||||
stock bool:operator==(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) == 0;
|
||||
|
||||
stock bool:operator==(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) == 0; /* "==" is commutative */
|
||||
|
||||
stock bool:operator!=(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) != 0;
|
||||
|
||||
stock bool:operator!=(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) != 0; /* "==" is commutative */
|
||||
|
||||
stock bool:operator>(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) > 0;
|
||||
|
||||
stock bool:operator>(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) > 0;
|
||||
|
||||
stock bool:operator>(oper1, Float:oper2)
|
||||
return floatcmp(float(oper1), oper2) > 0;
|
||||
|
||||
stock bool:operator>=(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) >= 0;
|
||||
|
||||
stock bool:operator>=(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) >= 0;
|
||||
|
||||
stock bool:operator>=(oper1, Float:oper2)
|
||||
return floatcmp(float(oper1), oper2) >= 0;
|
||||
|
||||
stock bool:operator<(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) < 0;
|
||||
|
||||
stock bool:operator<(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) < 0;
|
||||
|
||||
stock bool:operator<(oper1, Float:oper2)
|
||||
return floatcmp(float(oper1), oper2) < 0;
|
||||
|
||||
stock bool:operator<=(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) <= 0;
|
||||
|
||||
stock bool:operator<=(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) <= 0;
|
||||
|
||||
stock bool:operator<=(oper1, Float:oper2)
|
||||
return floatcmp(float(oper1), oper2) <= 0;
|
||||
|
||||
stock bool:operator!(Float:oper)
|
||||
return (_:oper & ((-1)/2)) == 0; /* -1 = all bits to 1; /2 = remove most significant bit (sign)
|
||||
works on both 32bit and 64bit systems; no constant required */
|
||||
/* forbidden operations */
|
||||
forward operator%(Float:oper1, Float:oper2);
|
||||
forward operator%(Float:oper1, oper2);
|
||||
forward operator%(oper1, Float:oper2);
|
||||
|
||||
|
||||
/**
|
||||
* Returns whichever value is the smaller one
|
||||
*
|
||||
* @param ValueA The first value
|
||||
* @param ValueB The second value
|
||||
*
|
||||
* @return ValueA if it is smaller than ValueB, and vice versa
|
||||
*/
|
||||
stock Float:floatmin(Float:ValueA, Float:ValueB)
|
||||
{
|
||||
if (ValueA<=ValueB)
|
||||
{
|
||||
return ValueA;
|
||||
}
|
||||
|
||||
return ValueB;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whichever value is the greater one
|
||||
*
|
||||
* @param ValueA The first value
|
||||
* @param ValueB The second value
|
||||
*
|
||||
* @return ValueA if it is greater than ValueB, and vice versa
|
||||
*/
|
||||
stock Float:floatmax(Float:ValueA, Float:ValueB)
|
||||
{
|
||||
if (ValueA>=ValueB)
|
||||
{
|
||||
return ValueA;
|
||||
}
|
||||
|
||||
return ValueB;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clamps a value between a minimum and a maximum floating point value
|
||||
*
|
||||
* @param Value The value to be clamped
|
||||
* @param MinValue Minimum value
|
||||
* @param MaxValue Maximum value
|
||||
*
|
||||
* @return The Value clamped between MinValue and MaxValue
|
||||
*/
|
||||
stock Float:floatclamp(Float:Value, Float:MinValue, Float:MaxValue)
|
||||
{
|
||||
if (Value<=MinValue)
|
||||
{
|
||||
return MinValue;
|
||||
}
|
||||
if (Value>=MaxValue)
|
||||
{
|
||||
return MaxValue;
|
||||
}
|
||||
|
||||
return Value;
|
||||
/* Float arithmetic
|
||||
*
|
||||
* (c) Copyright 1999, Artran, Inc.
|
||||
* Written by Greg Garner (gmg@artran.com)
|
||||
* Modified in March 2001 to include user defined
|
||||
* operators for the floating point functions.
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _float_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _float_included
|
||||
|
||||
#pragma rational Float
|
||||
|
||||
/**
|
||||
* Different methods of rounding
|
||||
*/
|
||||
enum floatround_method {
|
||||
floatround_round = 0,
|
||||
floatround_floor,
|
||||
floatround_ceil,
|
||||
floatround_tozero
|
||||
};
|
||||
|
||||
/**
|
||||
* Different units of measurement for angles
|
||||
*/
|
||||
enum anglemode {
|
||||
radian = 0,
|
||||
degrees,
|
||||
grades
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts an integer into a floating point value.
|
||||
*
|
||||
* @param value Value to be converted
|
||||
*
|
||||
* @return Converted value
|
||||
*/
|
||||
native Float:float(value);
|
||||
|
||||
/**
|
||||
* Converts a string into a floating point value.
|
||||
*
|
||||
* @param string Input string to be converted
|
||||
*
|
||||
* @return Converted value
|
||||
*/
|
||||
native Float:floatstr(const string[]);
|
||||
|
||||
/**
|
||||
* Returns the fractional part of a floating point value
|
||||
*
|
||||
* @param string Floating point value to get the fractional part from
|
||||
*
|
||||
* @return The fractional part
|
||||
*/
|
||||
native Float:floatfract(Float:value);
|
||||
|
||||
/**
|
||||
* Rounds a floating point value to an integer value
|
||||
*
|
||||
* @note For the list of available rounding methods look at
|
||||
* floatround_method enumeration.
|
||||
*
|
||||
* @param value Floating point value to be rounded
|
||||
* @param method Rounding method
|
||||
*
|
||||
* @return Converted value
|
||||
*/
|
||||
native floatround(Float:value, floatround_method:method=floatround_round);
|
||||
|
||||
/**
|
||||
* Compares two floating point values.
|
||||
*
|
||||
* @param fOne First value to be compared
|
||||
* @param fTwo Second value to be compared
|
||||
*
|
||||
* @return If arguments are equal, returns 0.
|
||||
* If the first one is greater, returns 1.
|
||||
* If the second one is greater, returns -1.
|
||||
*/
|
||||
native floatcmp(Float:fOne, Float:fTwo);
|
||||
|
||||
/**
|
||||
* Returns the square root of a floating point value
|
||||
*
|
||||
* @note Same as floatpower(value, 0.5)
|
||||
*
|
||||
* @param value Floating point value to get square root from
|
||||
*
|
||||
* @return Square root of the input value
|
||||
*/
|
||||
native Float:floatsqroot(Float:value);
|
||||
|
||||
/**
|
||||
* Returns the value raised to the power of the exponent
|
||||
*
|
||||
* @param value Floating point value to be raised
|
||||
* @param exponent The exponent
|
||||
*
|
||||
* @return Value raised to the power of the exponent
|
||||
*/
|
||||
native Float:floatpower(Float:value, Float:exponent);
|
||||
|
||||
/**
|
||||
* Returns the logarithm of value
|
||||
*
|
||||
* @param value Floating point value to calculate the logarithm for
|
||||
* @param base The optional logarithmic base to use.
|
||||
* Defaults to 10, or the natural logarithm
|
||||
*
|
||||
* @return Square root of the input value
|
||||
*/
|
||||
native Float:floatlog(Float:value, Float:base=10.0);
|
||||
|
||||
/**
|
||||
* Returns the sine of a given angle
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The angle to calculate the sine from
|
||||
* @param mode What unit of measurement is the angle specified in
|
||||
* Defaults to radians
|
||||
*
|
||||
* @return The sine of a given angle
|
||||
*/
|
||||
native Float:floatsin(Float:value, anglemode:mode=radian);
|
||||
|
||||
/**
|
||||
* Returns the cosine of a given angle
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The angle to calculate the cosine from
|
||||
* @param mode What unit of measurement is the angle specified in
|
||||
* Defaults to radians
|
||||
*
|
||||
* @return The cosine of a given angle
|
||||
*/
|
||||
native Float:floatcos(Float:value, anglemode:mode=radian);
|
||||
|
||||
/**
|
||||
* Returns the tangent of a given angle
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The angle to calculate the tangent from
|
||||
* @param mode What unit of measurement is the angle specified in
|
||||
* Defaults to radians
|
||||
*
|
||||
* @return The tangent of a given angle
|
||||
*/
|
||||
native Float:floattan(Float:value, anglemode:mode=radian);
|
||||
|
||||
/**
|
||||
* Returns the hyperbolic sine of a given angle
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The angle to calculate the hyperbolic sine from
|
||||
* @param mode What unit of measurement is the angle specified in
|
||||
* Defaults to radians
|
||||
*
|
||||
* @return The hyperbolic sine of a given angle
|
||||
*/
|
||||
native Float:floatsinh(Float:angle, anglemode:mode=radian);
|
||||
|
||||
/**
|
||||
* Returns the hyperbolic cosine of a given angle
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The angle to calculate the hyperbolic cosine from
|
||||
* @param mode What unit of measurement is the angle specified in
|
||||
* Defaults to radians
|
||||
*
|
||||
* @return The hyperbolic cosine of a given angle
|
||||
*/
|
||||
native Float:floatcosh(Float:angle, anglemode:mode=radian);
|
||||
|
||||
/**
|
||||
* Returns the hyperbolic tangent of a given angle
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The angle to calculate the hyperbolic tangent from
|
||||
* @param mode What unit of measurement is the angle specified in
|
||||
* Defaults to radians
|
||||
*
|
||||
* @return The hyperbolic tangent of a given angle
|
||||
*/
|
||||
native Float:floattanh(Float:angle, anglemode:mode=radian);
|
||||
|
||||
/**
|
||||
* Returns the absolute value of a floating point value
|
||||
*
|
||||
* @param value The floating point value to get the absolute value from
|
||||
*
|
||||
* @return The absolute value
|
||||
*/
|
||||
native Float:floatabs(Float:value);
|
||||
|
||||
/* Return the angle of a sine, cosine or tangent.
|
||||
* The output angle may be in radians, degrees, or grades. */
|
||||
|
||||
/**
|
||||
* Returns the angle of the given tangent
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The tangent to calculate the angle from
|
||||
* @param mode What unit of measurement should the output angle be in
|
||||
*
|
||||
* @return The angle of a tangent
|
||||
*/
|
||||
native Float:floatatan(Float:angle, {anglemode,_}:radix);
|
||||
|
||||
/**
|
||||
* Returns the angle of the given cosine
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The cosine to calculate the angle from
|
||||
* @param mode What unit of measurement should the output angle be in
|
||||
*
|
||||
* @return The angle of a cosine
|
||||
*/
|
||||
native Float:floatacos(Float:angle, {anglemode,_}:radix);
|
||||
|
||||
/**
|
||||
* Returns the angle of the given sine
|
||||
*
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param value The sine to calculate the angle from
|
||||
* @param mode What unit of measurement should the output angle be in
|
||||
*
|
||||
* @return The angle of a sine
|
||||
*/
|
||||
native Float:floatasin(Float:angle, {anglemode,_}:radix);
|
||||
|
||||
/**
|
||||
* Computes the principal value of arctangent of y/x
|
||||
*
|
||||
* @note Someone should verify this native, not sure what it actually does.
|
||||
* @note For available units of measurements(modes) look at the anglemode enum
|
||||
*
|
||||
* @param x Value representing the proportion of the x-coordinate.
|
||||
* @param y Value representing the proportion of the x-coordinate.
|
||||
* @param mode What unit of measurement should the output angle be in
|
||||
*
|
||||
* @return Arctangent of y/x
|
||||
*/
|
||||
native Float:floatatan2(Float:x, Float:y, {anglemode,_}:radix);
|
||||
|
||||
|
||||
|
||||
/* Multiply two floats together */
|
||||
native Float:floatmul(Float:oper1, Float:oper2);
|
||||
|
||||
/* Divide the dividend float by the divisor float */
|
||||
native Float:floatdiv(Float:dividend, Float:divisor);
|
||||
|
||||
/* Add two floats together */
|
||||
native Float:floatadd(Float:dividend, Float:divisor);
|
||||
|
||||
/* Subtract oper2 float from oper1 float */
|
||||
native Float:floatsub(Float:oper1, Float:oper2);
|
||||
|
||||
/* user defined operators */
|
||||
native Float:operator*(Float:oper1, Float:oper2) = floatmul;
|
||||
native Float:operator/(Float:oper1, Float:oper2) = floatdiv;
|
||||
native Float:operator+(Float:oper1, Float:oper2) = floatadd;
|
||||
native Float:operator-(Float:oper1, Float:oper2) = floatsub;
|
||||
|
||||
stock Float:operator++(Float:oper)
|
||||
return oper+1.0;
|
||||
|
||||
stock Float:operator--(Float:oper)
|
||||
return oper-1.0;
|
||||
|
||||
stock Float:operator-(Float:oper)
|
||||
return oper^Float:cellmin; /* IEEE values are sign/magnitude */
|
||||
|
||||
stock Float:operator*(Float:oper1, oper2)
|
||||
return floatmul(oper1, float(oper2)); /* "*" is commutative */
|
||||
|
||||
stock Float:operator/(Float:oper1, oper2)
|
||||
return floatdiv(oper1, float(oper2));
|
||||
|
||||
stock Float:operator/(oper1, Float:oper2)
|
||||
return floatdiv(float(oper1), oper2);
|
||||
|
||||
stock Float:operator+(Float:oper1, oper2)
|
||||
return floatadd(oper1, float(oper2)); /* "+" is commutative */
|
||||
|
||||
stock Float:operator-(Float:oper1, oper2)
|
||||
return floatsub(oper1, float(oper2));
|
||||
|
||||
stock Float:operator-(oper1, Float:oper2)
|
||||
return floatsub(float(oper1), oper2);
|
||||
|
||||
stock bool:operator==(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) == 0;
|
||||
|
||||
stock bool:operator==(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) == 0; /* "==" is commutative */
|
||||
|
||||
stock bool:operator!=(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) != 0;
|
||||
|
||||
stock bool:operator!=(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) != 0; /* "==" is commutative */
|
||||
|
||||
stock bool:operator>(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) > 0;
|
||||
|
||||
stock bool:operator>(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) > 0;
|
||||
|
||||
stock bool:operator>(oper1, Float:oper2)
|
||||
return floatcmp(float(oper1), oper2) > 0;
|
||||
|
||||
stock bool:operator>=(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) >= 0;
|
||||
|
||||
stock bool:operator>=(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) >= 0;
|
||||
|
||||
stock bool:operator>=(oper1, Float:oper2)
|
||||
return floatcmp(float(oper1), oper2) >= 0;
|
||||
|
||||
stock bool:operator<(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) < 0;
|
||||
|
||||
stock bool:operator<(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) < 0;
|
||||
|
||||
stock bool:operator<(oper1, Float:oper2)
|
||||
return floatcmp(float(oper1), oper2) < 0;
|
||||
|
||||
stock bool:operator<=(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) <= 0;
|
||||
|
||||
stock bool:operator<=(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) <= 0;
|
||||
|
||||
stock bool:operator<=(oper1, Float:oper2)
|
||||
return floatcmp(float(oper1), oper2) <= 0;
|
||||
|
||||
stock bool:operator!(Float:oper)
|
||||
return (_:oper & ((-1)/2)) == 0; /* -1 = all bits to 1; /2 = remove most significant bit (sign)
|
||||
works on both 32bit and 64bit systems; no constant required */
|
||||
/* forbidden operations */
|
||||
forward operator%(Float:oper1, Float:oper2);
|
||||
forward operator%(Float:oper1, oper2);
|
||||
forward operator%(oper1, Float:oper2);
|
||||
|
||||
|
||||
/**
|
||||
* Returns whichever value is the smaller one
|
||||
*
|
||||
* @param ValueA The first value
|
||||
* @param ValueB The second value
|
||||
*
|
||||
* @return ValueA if it is smaller than ValueB, and vice versa
|
||||
*/
|
||||
stock Float:floatmin(Float:ValueA, Float:ValueB)
|
||||
{
|
||||
if (ValueA<=ValueB)
|
||||
{
|
||||
return ValueA;
|
||||
}
|
||||
|
||||
return ValueB;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whichever value is the greater one
|
||||
*
|
||||
* @param ValueA The first value
|
||||
* @param ValueB The second value
|
||||
*
|
||||
* @return ValueA if it is greater than ValueB, and vice versa
|
||||
*/
|
||||
stock Float:floatmax(Float:ValueA, Float:ValueB)
|
||||
{
|
||||
if (ValueA>=ValueB)
|
||||
{
|
||||
return ValueA;
|
||||
}
|
||||
|
||||
return ValueB;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clamps a value between a minimum and a maximum floating point value
|
||||
*
|
||||
* @param Value The value to be clamped
|
||||
* @param MinValue Minimum value
|
||||
* @param MaxValue Maximum value
|
||||
*
|
||||
* @return The Value clamped between MinValue and MaxValue
|
||||
*/
|
||||
stock Float:floatclamp(Float:Value, Float:MinValue, Float:MaxValue)
|
||||
{
|
||||
if (Value<=MinValue)
|
||||
{
|
||||
return MinValue;
|
||||
}
|
||||
if (Value>=MaxValue)
|
||||
{
|
||||
return MaxValue;
|
||||
}
|
||||
|
||||
return Value;
|
||||
}
|
@ -1,306 +1,306 @@
|
||||
// vim: set ts=4 sw=4 tw=99 noet:
|
||||
//
|
||||
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
|
||||
// Copyright (C) The AMX Mod X Development Team.
|
||||
//
|
||||
// This software is licensed under the GNU General Public License, version 3 or higher.
|
||||
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
|
||||
// https://alliedmods.net/amxmodx-license
|
||||
|
||||
//
|
||||
// Fun Functions
|
||||
//
|
||||
|
||||
#if defined _fun_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _fun_included
|
||||
|
||||
#pragma reqlib fun
|
||||
#if !defined AMXMODX_NOAUTOLOAD
|
||||
#pragma loadlib fun
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Tells whether receiver hears sender via voice communication.
|
||||
*
|
||||
* @param receiver Receiver
|
||||
* @param sender Sender
|
||||
*
|
||||
* @return 1 if receiver hears the sender, 0 otherwise.
|
||||
* @error If receiver or sender are not connected or not
|
||||
* within the range of 1 to MaxClients
|
||||
*/
|
||||
native get_client_listen(receiver, sender);
|
||||
|
||||
/**
|
||||
* Sets who can listen who.
|
||||
*
|
||||
* @param receiver Receiver
|
||||
* @param sender Sender
|
||||
* @param listen 1 if receiver should be able to hear sender, 0 if not
|
||||
*
|
||||
* @return 0 if the setting can't be done for some reason
|
||||
* @error If receiver or sender are not connected or not
|
||||
* within the range of 1 to MaxClients.
|
||||
*/
|
||||
native set_client_listen(receiver, sender, listen);
|
||||
|
||||
/**
|
||||
* Sets player's godmode.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param godmode 1 to enable godmode, 0 to disable
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_godmode(index, godmode = 0);
|
||||
|
||||
/**
|
||||
* Tells whether a player has godmode on.
|
||||
*
|
||||
* @param index Client index
|
||||
*
|
||||
* @return 1 if player has godmode on, 0 if not
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native get_user_godmode(index);
|
||||
|
||||
/**
|
||||
* Sets player's armor amount.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param armor The armor amount to set
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_armor(index, armor);
|
||||
|
||||
/**
|
||||
* Sets player's health amount.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param health The health amount to set
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_health(index, health);
|
||||
|
||||
/**
|
||||
* Moves a player to the given origin.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param origin Origin to move a player to
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_origin(index, const origin[3]);
|
||||
|
||||
/**
|
||||
* Sets player's rendering mode.
|
||||
*
|
||||
* @note A really useful render modes reference:
|
||||
* https://sites.google.com/site/svenmanor/rendermodes
|
||||
*
|
||||
* @param index Client index
|
||||
* @param fx Rendering effects. One of kRenderFx* constants
|
||||
* @param r The amount of red color (0 to 255)
|
||||
* @param g The amount of green color (0 to 255)
|
||||
* @param b The amount of blue color (0 to 255)
|
||||
* @param render Render mode. One of kRender* constants
|
||||
* @param amount Render amount (0 to 255)
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_rendering(index, fx = kRenderFxNone, r = 0, g = 0, b = 0, render = kRenderNormal, amount = 0);
|
||||
|
||||
/**
|
||||
* Gives an item to a player.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param item Classname of the item to give. Should start with either
|
||||
* "weapon_", "ammo_", "item_" or "tf_weapon_"
|
||||
*
|
||||
* @return Item entity index. If an invalid item name is
|
||||
* given or the item failed to create, it will return 0.
|
||||
* If the item was removed, it will return -1
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients or item creation fails.
|
||||
*/
|
||||
native give_item(index, const item[]);
|
||||
|
||||
/**
|
||||
* Sets (adds, removes) hit zones for a player.
|
||||
*
|
||||
* @note This actually sets rules of how any player can hit any other.
|
||||
* Example: set_user_hitzones(id, target, 2) - makes @id able to
|
||||
* hit @target only in the head.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param target The target player
|
||||
* @param body A bitsum of the body parts that can/can't be shot:
|
||||
* 1 - generic
|
||||
* 2 - head
|
||||
* 4 - chest
|
||||
* 8 - stomach
|
||||
* 16 - left arm
|
||||
* 32 - right arm
|
||||
* 64 - left leg
|
||||
* 128 - right leg
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_hitzones(index = 0, target = 0, body = 255);
|
||||
|
||||
/**
|
||||
* Gets the set of hit zone "rules" between @index and @target players.
|
||||
*
|
||||
* @note For the body part bitsum take a look at the set_user_hitzones() native.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param target The target player
|
||||
*
|
||||
* @return The bitsum of @target's body parts @index is able to hit
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native get_user_hitzones(index, target);
|
||||
|
||||
/**
|
||||
* Sets player's maximum movement speed.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param speed The maximum speed player will be able to run at
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_maxspeed(index, Float:speed = -1.0);
|
||||
|
||||
/**
|
||||
* Gets player's maximum movement speed.
|
||||
*
|
||||
* @param index Client index
|
||||
*
|
||||
* @return Player's maximum movement speed
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native Float:get_user_maxspeed(index);
|
||||
|
||||
/**
|
||||
* Sets player's gravity.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param gravity Gravity value to set, 1.0 being normal gravity (800)
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_gravity(index, Float:gravity = 1.0);
|
||||
|
||||
/**
|
||||
* Gets player's gravity.
|
||||
*
|
||||
* @param index Client index
|
||||
*
|
||||
* @return Player's gravity value, 1.0 being normal gravity (800)
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native Float:get_user_gravity(index);
|
||||
|
||||
/**
|
||||
* Spawns an entity.
|
||||
*
|
||||
* @param index Entity index
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native spawn(index);
|
||||
|
||||
/**
|
||||
* Enables or disables player's noclip.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param noclip 1 to enable noclip, 0 to disable
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_noclip(index, noclip = 0);
|
||||
|
||||
/**
|
||||
* Gets whether a player has noclip enabled or not.
|
||||
*
|
||||
* @param index Client index
|
||||
*
|
||||
* @return 1 if noclip is enabled, 0 if disabled
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native get_user_noclip(index);
|
||||
|
||||
/**
|
||||
* Tells whether a player has silent footsteps enabled.
|
||||
*
|
||||
* @param index Client index
|
||||
*
|
||||
* @return 1 if silent footsteps are enabled, 0 if not
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native get_user_footsteps(index);
|
||||
|
||||
/**
|
||||
* Enables or disables player's silent footsteps.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param set 1 if player should have silent footsteps, 0 otherwise
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_footsteps(id, set = 1);
|
||||
|
||||
/**
|
||||
* Strips all weapons from a player, including their knife.
|
||||
*
|
||||
* @param index Client index
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native strip_user_weapons(index);
|
||||
|
||||
/**
|
||||
* Sets player's frags amount.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param frags The amount of frags to set
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_frags(index, frags);
|
||||
// vim: set ts=4 sw=4 tw=99 noet:
|
||||
//
|
||||
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
|
||||
// Copyright (C) The AMX Mod X Development Team.
|
||||
//
|
||||
// This software is licensed under the GNU General Public License, version 3 or higher.
|
||||
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
|
||||
// https://alliedmods.net/amxmodx-license
|
||||
|
||||
//
|
||||
// Fun Functions
|
||||
//
|
||||
|
||||
#if defined _fun_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _fun_included
|
||||
|
||||
#pragma reqlib fun
|
||||
#if !defined AMXMODX_NOAUTOLOAD
|
||||
#pragma loadlib fun
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Tells whether receiver hears sender via voice communication.
|
||||
*
|
||||
* @param receiver Receiver
|
||||
* @param sender Sender
|
||||
*
|
||||
* @return 1 if receiver hears the sender, 0 otherwise.
|
||||
* @error If receiver or sender are not connected or not
|
||||
* within the range of 1 to MaxClients
|
||||
*/
|
||||
native get_client_listen(receiver, sender);
|
||||
|
||||
/**
|
||||
* Sets who can listen who.
|
||||
*
|
||||
* @param receiver Receiver
|
||||
* @param sender Sender
|
||||
* @param listen 1 if receiver should be able to hear sender, 0 if not
|
||||
*
|
||||
* @return 0 if the setting can't be done for some reason
|
||||
* @error If receiver or sender are not connected or not
|
||||
* within the range of 1 to MaxClients.
|
||||
*/
|
||||
native set_client_listen(receiver, sender, listen);
|
||||
|
||||
/**
|
||||
* Sets player's godmode.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param godmode 1 to enable godmode, 0 to disable
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_godmode(index, godmode = 0);
|
||||
|
||||
/**
|
||||
* Tells whether a player has godmode on.
|
||||
*
|
||||
* @param index Client index
|
||||
*
|
||||
* @return 1 if player has godmode on, 0 if not
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native get_user_godmode(index);
|
||||
|
||||
/**
|
||||
* Sets player's armor amount.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param armor The armor amount to set
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_armor(index, armor);
|
||||
|
||||
/**
|
||||
* Sets player's health amount.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param health The health amount to set
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_health(index, health);
|
||||
|
||||
/**
|
||||
* Moves a player to the given origin.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param origin Origin to move a player to
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_origin(index, const origin[3]);
|
||||
|
||||
/**
|
||||
* Sets player's rendering mode.
|
||||
*
|
||||
* @note A really useful render modes reference:
|
||||
* https://sites.google.com/site/svenmanor/rendermodes
|
||||
*
|
||||
* @param index Client index
|
||||
* @param fx Rendering effects. One of kRenderFx* constants
|
||||
* @param r The amount of red color (0 to 255)
|
||||
* @param g The amount of green color (0 to 255)
|
||||
* @param b The amount of blue color (0 to 255)
|
||||
* @param render Render mode. One of kRender* constants
|
||||
* @param amount Render amount (0 to 255)
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_rendering(index, fx = kRenderFxNone, r = 0, g = 0, b = 0, render = kRenderNormal, amount = 0);
|
||||
|
||||
/**
|
||||
* Gives an item to a player.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param item Classname of the item to give. Should start with either
|
||||
* "weapon_", "ammo_", "item_" or "tf_weapon_"
|
||||
*
|
||||
* @return Item entity index. If an invalid item name is
|
||||
* given or the item failed to create, it will return 0.
|
||||
* If the item was removed, it will return -1
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients or item creation fails.
|
||||
*/
|
||||
native give_item(index, const item[]);
|
||||
|
||||
/**
|
||||
* Sets (adds, removes) hit zones for a player.
|
||||
*
|
||||
* @note This actually sets rules of how any player can hit any other.
|
||||
* Example: set_user_hitzones(id, target, 2) - makes @id able to
|
||||
* hit @target only in the head.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param target The target player
|
||||
* @param body A bitsum of the body parts that can/can't be shot:
|
||||
* 1 - generic
|
||||
* 2 - head
|
||||
* 4 - chest
|
||||
* 8 - stomach
|
||||
* 16 - left arm
|
||||
* 32 - right arm
|
||||
* 64 - left leg
|
||||
* 128 - right leg
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_hitzones(index = 0, target = 0, body = 255);
|
||||
|
||||
/**
|
||||
* Gets the set of hit zone "rules" between @index and @target players.
|
||||
*
|
||||
* @note For the body part bitsum take a look at the set_user_hitzones() native.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param target The target player
|
||||
*
|
||||
* @return The bitsum of @target's body parts @index is able to hit
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native get_user_hitzones(index, target);
|
||||
|
||||
/**
|
||||
* Sets player's maximum movement speed.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param speed The maximum speed player will be able to run at
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_maxspeed(index, Float:speed = -1.0);
|
||||
|
||||
/**
|
||||
* Gets player's maximum movement speed.
|
||||
*
|
||||
* @param index Client index
|
||||
*
|
||||
* @return Player's maximum movement speed
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native Float:get_user_maxspeed(index);
|
||||
|
||||
/**
|
||||
* Sets player's gravity.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param gravity Gravity value to set, 1.0 being normal gravity (800)
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_gravity(index, Float:gravity = 1.0);
|
||||
|
||||
/**
|
||||
* Gets player's gravity.
|
||||
*
|
||||
* @param index Client index
|
||||
*
|
||||
* @return Player's gravity value, 1.0 being normal gravity (800)
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native Float:get_user_gravity(index);
|
||||
|
||||
/**
|
||||
* Spawns an entity.
|
||||
*
|
||||
* @param index Entity index
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native spawn(index);
|
||||
|
||||
/**
|
||||
* Enables or disables player's noclip.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param noclip 1 to enable noclip, 0 to disable
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_noclip(index, noclip = 0);
|
||||
|
||||
/**
|
||||
* Gets whether a player has noclip enabled or not.
|
||||
*
|
||||
* @param index Client index
|
||||
*
|
||||
* @return 1 if noclip is enabled, 0 if disabled
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native get_user_noclip(index);
|
||||
|
||||
/**
|
||||
* Tells whether a player has silent footsteps enabled.
|
||||
*
|
||||
* @param index Client index
|
||||
*
|
||||
* @return 1 if silent footsteps are enabled, 0 if not
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native get_user_footsteps(index);
|
||||
|
||||
/**
|
||||
* Enables or disables player's silent footsteps.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param set 1 if player should have silent footsteps, 0 otherwise
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_footsteps(id, set = 1);
|
||||
|
||||
/**
|
||||
* Strips all weapons from a player, including their knife.
|
||||
*
|
||||
* @param index Client index
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native strip_user_weapons(index);
|
||||
|
||||
/**
|
||||
* Sets player's frags amount.
|
||||
*
|
||||
* @param index Client index
|
||||
* @param frags The amount of frags to set
|
||||
*
|
||||
* @noreturn
|
||||
* @error If player is not connected or not within the range
|
||||
* of 1 to MaxClients.
|
||||
*/
|
||||
native set_user_frags(index, frags);
|
||||
|
@ -81,6 +81,11 @@
|
||||
*/
|
||||
#define MPROP_PAGE_CALLBACK 11
|
||||
|
||||
/**
|
||||
* Whether to show the page number in menu title (param1 = bool, true = default)
|
||||
*/
|
||||
#define MPROP_SHOWPAGE 12
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user