2
0
mirror of https://github.com/rehlds/reapi.git synced 2025-01-16 00:28:17 +03:00

Refactoring amxx-cssdk

This commit is contained in:
s1lent 2017-09-26 04:07:03 +07:00
parent 15efb24d1c
commit a8ea223a51
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
9 changed files with 3235 additions and 3300 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
#if defined _hlsdk_const_included
#endinput
#endif
#define _hlsdk_const_included
// Counter-Strike SDK Constants
#include <cssdk_const.inc>

View File

@ -43,18 +43,18 @@ enum members_tables_e
};
// Is like FNullEnt
#define is_nullent(%0) (%0 == 0 || is_entity(%0) == false)
#define is_nullent(%0) (%0 == 0 || is_entity(%0) == false)
#define MAX_REGION_RANGE 1024
#define MAX_REGION_RANGE 1024
#define BEGIN_FUNC_REGION(%0) (any:MAX_REGION_RANGE * hooks_tables_e:ht_%0)
#define BEGIN_MEMBER_REGION(%0) (any:MAX_REGION_RANGE * members_tables_e:mt_%0)
#define BEGIN_FUNC_REGION(%0) (any:MAX_REGION_RANGE * hooks_tables_e:ht_%0)
#define BEGIN_MEMBER_REGION(%0) (any:MAX_REGION_RANGE * members_tables_e:mt_%0)
#include <cssdk_const>
#include <reapi_version>
#include <reapi_engine> // NOTE: only for ReHLDS
#include <reapi_gamedll> // NOTE: only for gamedll Counter-Strike (ReGameDLL_CS)
#include <reapi_engine> // @note: only for ReHLDS
#include <reapi_gamedll> // @note: only for gamedll Counter-Strike (ReGameDLL_CS)
// addons
#include <reapi_vtc>
@ -64,10 +64,10 @@ enum members_tables_e
// hookchain return type
enum
{
HC_CONTINUE = 0, // Plugin didn't take any action
HC_SUPERCEDE, // Skip real function, use my return value
HC_BREAK // Skip all forwards and real function, use my return value
// @note Warning: Be very careful, using this type of return will skip calls for all following AMXX plugins
HC_CONTINUE = 0, // Plugin didn't take any action
HC_SUPERCEDE, // Skip real function, use my return value
HC_BREAK // Skip all forwards and real function, use my return value
// @note Warning: Be very careful, using this type of return will skip calls for all following AMXX plugins
};
// hookchain types
@ -89,10 +89,11 @@ enum HookChain
* Hook API function that are available into enum.
* Look at the enums for parameter lists.
*
* @param function The function to hook
* @param callback The forward to call
* @param post Whether or not to forward this in post
* @return Returns a hook handle. Use EnableHookChain/DisableHookChain to toggle the forward on or off
* @param function The function to hook
* @param callback The forward to call
* @param post Whether or not to forward this in post
*
* @return Returns a hook handle. Use EnableHookChain/DisableHookChain to toggle the forward on or off
*
*/
native HookChain:RegisterHookChain({EngineFunc, GamedllFunc, GamedllFunc_CBaseAnimating, GamedllFunc_CBasePlayer, GamedllFunc_CSGameRules, ReCheckerFunc}:function_id, const callback[], post = 0);
@ -101,7 +102,7 @@ native HookChain:RegisterHookChain({EngineFunc, GamedllFunc, GamedllFunc_CBaseAn
* Stops a hook from triggering.
* Use the return value from RegisterHookChain as the parameter here!
*
* @param hook The hook to stop
* @param hook The hook to stop
*
*/
native bool:DisableHookChain(HookChain:hook);
@ -110,8 +111,9 @@ native bool:DisableHookChain(HookChain:hook);
* Starts a hook back up.
* Use the return value from RegisterHookChain as the parameter here!
*
* @param hook The hook to re-enable
* @return Returns true if the function is successfully executed, otherwise false
* @param hook The hook to re-enable
*
* @return Returns true if the function is successfully executed, otherwise false
*
*/
native bool:EnableHookChain(HookChain:hook);
@ -119,8 +121,8 @@ native bool:EnableHookChain(HookChain:hook);
/*
* Sets the return value of a hookchain.
*
* @param type To specify the ATYPE_* parameter, look at the enum AType
* @param value The value to set the return to
* @param type To specify the ATYPE_* parameter, look at the enum AType
* @param value The value to set the return to
*
*/
native SetHookChainReturn(AType:type, any:...);
@ -129,9 +131,10 @@ native SetHookChainReturn(AType:type, any:...);
* Gets the return value of the current hookchain.
* This has no effect in pre hookchain.
*
* @param type To specify the ATYPE_* parameter, look at the enum AType
* @param [maxlen] Max length of string (optional)
* @return If an integer or boolean or one byte or float, array or everything else is passed via 1st argument and more
* @param type To specify the ATYPE_* parameter, look at the enum AType
* @param [maxlen] Max length of string (optional)
*
* @return If an integer or boolean or one byte or float, array or everything else is passed via 1st argument and more
*
*/
native any:GetHookChainReturn(AType:type, any:...);
@ -140,10 +143,11 @@ native any:GetHookChainReturn(AType:type, any:...);
* Set hookchain argument.
* This has no effect in post hookchain.
*
* @param number Number of argument
* @param value New value
* @param [maxlen] Max length of string (optional)
* @return Returns true if the function is successfully executed, otherwise false
* @param number Number of argument
* @param value New value
* @param [maxlen] Max length of string (optional)
*
* @return Returns true if the function is successfully executed, otherwise false
*
*/
native SetHookChainArg(number, AType:type, any:...);
@ -152,7 +156,7 @@ native SetHookChainArg(number, AType:type, any:...);
* Compares the entity to a specified classname.
* @note This native also checks the validity of an entity.
*
* @return true/false
* @return true/false
*
*/
native bool:FClassnameIs(const entityIndex, const className[]);
@ -179,7 +183,7 @@ native engset_view(const index, const const viewEntity);
/*
* Gets the return index of the current view entity on a client.
*
* @param index Client index
* @param index Client index
*
*/
native get_viewent(const index);
@ -187,7 +191,7 @@ native get_viewent(const index);
/*
* Check if the entity is valid.
*
* @return true/false
* @return true/false
*
*/
native bool:is_entity(const entityIndex);
@ -195,7 +199,7 @@ native bool:is_entity(const entityIndex);
/*
* Check if ReHLDS is available.
*
* @return true/false
* @return true/false
*
*/
native bool:is_rehlds();
@ -203,7 +207,7 @@ native bool:is_rehlds();
/*
* Check if ReGameDLL is available.
*
* @return true/false
* @return true/false
*
*/
native bool:is_regamedll();
@ -211,7 +215,7 @@ native bool:is_regamedll();
/*
* Check if Reunion is available.
*
* @return true/false
* @return true/false
*
*/
native bool:has_reunion();
@ -219,7 +223,7 @@ native bool:has_reunion();
/*
* Check if VTC is available.
*
* @return true/false
* @return true/false
*
*/
native bool:has_vtc();
@ -227,7 +231,7 @@ native bool:has_vtc();
/*
* Check if Rechecker is available.
*
* @return true/false
* @return true/false
*
*/
native bool:has_rechecker();

View File

@ -1,111 +0,0 @@
#if defined _reapi_addons_included
#endinput
#endif
#define _reapi_addons_included
enum client_auth_type
{
CA_TYPE_NONE = 0,
CA_TYPE_DPROTO,
CA_TYPE_STEAM,
CA_TYPE_STEAMEMU,
CA_TYPE_REVEMU,
CA_TYPE_OLDREVEMU,
CA_TYPE_HLTV,
CA_TYPE_SC2009,
CA_TYPE_AVSMP,
CA_TYPE_SXEI,
CA_TYPE_REVEMU2013,
CA_TYPE_SSE3,
};
#define is_user_steam(%0) (REU_GetAuthtype(%0) == CA_TYPE_STEAM)
/*
* Checks whether the player is talking at the moment.
*
* @param index Client index
* @return true if client is speaking, false otherwise
*
*/
native bool:VTC_IsClientSpeaking(const index);
/*
* Mutes the player.
*
* @param index Client index
* @noreturn
*/
native VTC_MuteClient(const index);
/*
* Unmutes the player.
*
* @param index Client index
* @noreturn
*/
native VTC_UnmuteClient(const index);
/*
* Checks whether the player is muted at the moment.
*
* @param index Client index
* @return true if client is muted, false otherwise
*
*/
native bool:VTC_IsClientMuted(const index);
/*
* Play the audio file via the voice stream.
*
* @param receiver Receiver index
* @param soundFilePath The path to the sound file
*
* @note Usage example:
* VTC_PlaySound(id, "sound/ambience/Opera.wav");
*
* @noreturn
*
*/
native VTC_PlaySound(const receiver, const soundFilePath[]);
/*
* Called when the player started talking.
*
* @param index Client index
* @noreturn
*/
forward VTC_OnClientStartSpeak(const index);
/*
* Called when the player stopped talking.
*
* @param index Client index
* @noreturn
*/
forward VTC_OnClientStopSpeak(const index);
/*
* Gets client protocol.
*
* @param index Client index
* @return Client protocol
*/
native REU_GetProtocol(const index);
/*
* Gets client auth type.
*
* @param index Client index
* @return Client auth type
*/
native client_auth_type:REU_GetAuthtype(const index);
/*
* Check if the client is running RevEmu with limited user rights.
*
* @param index Client index
* @return 1/0
*
*/
native bool:REU_IsRevemuWithoutAdminRights(const index);

File diff suppressed because it is too large Load Diff

View File

@ -9,18 +9,18 @@
/*
* Sets a value to CSGameRules_Members members.
*
* @param member The specified member, look at the enums with name CSGameRules_Members
* @param member The specified member, look at the enums with name CSGameRules_Members
*
* @return 1 on success.
* @return 1 on success.
*/
native set_member_game(CSGameRules_Members:member, any:...);
/*
* Returns a value from CSGameRules_Members members
*
* @param member The specified member, look at the enums with name CSGameRules_Members
* @param member The specified member, look at the enums with name CSGameRules_Members
*
* @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified member
* @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified member
*
*/
native any:get_member_game(CSGameRules_Members:member, any:...);
@ -28,10 +28,10 @@ native any:get_member_game(CSGameRules_Members:member, any:...);
/*
* Sets a value to an entity's member.
*
* @param index Entity index
* @param member The specified member, look at the enums with name *_Members
* @param index Entity index
* @param member The specified member, look at the enums with name *_Members
*
* @return 1 on success.
* @return 1 on success.
*/
native set_member(const index, {CBaseEntity_Members, CBaseAnimating_Members, CBaseMonster_Members,
CBasePlayer_Members, CCSPlayer_Members, CBasePlayerItem_Members, CBasePlayerWeapon_Members,
@ -40,10 +40,10 @@ native set_member(const index, {CBaseEntity_Members, CBaseAnimating_Members, CBa
/*
* Returns a value from an entity's member.
*
* @param index Entity index
* @param member The specified member, look at the enums with name *_Members
* @param index Entity index
* @param member The specified member, look at the enums with name *_Members
*
* @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified member
* @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified member
*/
native any:get_member(const index, {CBaseEntity_Members, CBaseAnimating_Members, CBaseMonster_Members,
CBasePlayer_Members, CCSPlayer_Members, CBasePlayerItem_Members, CBasePlayerWeapon_Members,
@ -52,62 +52,62 @@ native any:get_member(const index, {CBaseEntity_Members, CBaseAnimating_Members,
/*
* Sets playermove var.
*
* @param var The specified playermove, look at the enum PlayerMove
* @param var The specified playermove, look at the enum PlayerMove
*
* @return 1 on success.
* @return 1 on success.
*/
native set_pmove(const PlayerMove:var, any:...);
/*
* Returns a playermove var.
*
* @param var The specified playermove var, look at the enums PlayerMove
* @param var The specified playermove var, look at the enums PlayerMove
*
* @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified mvar
* @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified mvar
*/
native any:get_pmove(const PlayerMove:var, any:...);
/*
* Sets a movevar value to a playermove.
*
* @param var The specified mvar, look at the enum MoveVars
* @param var The specified mvar, look at the enum MoveVars
*
* @return 1 on success.
* @return 1 on success.
*/
native set_movevar(const MoveVars:var, any:...);
/*
* Returns a movevar value from a playermove.
*
* @param var The specified mvar, look at the enum MoveVars
* @param var The specified mvar, look at the enum MoveVars
*
* @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified mvar
* @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified mvar
*/
native any:get_movevar(const MoveVars:var, any:...);
/*
* Sets a pmtrace var.
*
* @param var The specified mvar, look at the enum PMTrace
* @param var The specified mvar, look at the enum PMTrace
*
* @return 1 on success.
* @return 1 on success.
*/
native set_pmtrace(const tracehandle, const PMTrace:var, any:...);
/*
* Returns a pmtrace var
*
* @param var The specified mvar, look at the enum PMTrace
* @param var The specified mvar, look at the enum PMTrace
*
* @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified mvar
* @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified mvar
*/
native any:get_pmtrace(const tracehandle, const PMTrace:var, any:...);
/*
* Assign the number of the player's animation.
*
* @param index Client index
* @param playerAnim Specific animation number
* @param index Client index
* @param playerAnim Specific animation number
*
* @noreturn
*/
@ -116,9 +116,9 @@ native rg_set_animation(const index, PLAYER_ANIM:playerAnim);
/*
* Adds money to player's account.
*
* @param index Client index
* @param amount The amount of money
* @param bTrackChange If bTrackChange is 1, the amount of money added will also be displayed.
* @param index Client index
* @param amount The amount of money
* @param bTrackChange If bTrackChange is 1, the amount of money added will also be displayed.
*
* @noreturn
*/
@ -127,18 +127,18 @@ native rg_add_account(const index, amount, AccountSet:typeSet = AS_ADD, const bo
/*
* Gives the player an item.
*
* @param index Client index
* @param pszName Item classname
* @param type Look at the enums with name GiveType
* @param index Client index
* @param pszName Item classname
* @param type Look at the enums with name GiveType
*
* @return Index of entity if successfull, -1 otherwise
* @return Index of entity if successfull, -1 otherwise
*/
native rg_give_item(const index, const pszName[], GiveType:type = GT_APPEND);
/*
* Give the default items to a player.
*
* @param index Client index
* @param index Client index
*
* @noreturn
*/
@ -147,8 +147,8 @@ native rg_give_default_items(const index);
/*
* Gives the player a shield
*
* @param index Client index
* @param bDeploy To deploy the shield
* @param index Client index
* @param bDeploy To deploy the shield
*
* @noreturn
*/
@ -157,13 +157,13 @@ native rg_give_shield(const index, const bool:bDeploy = true);
/*
* Inflicts damage in a radius from the source position.
*
* @param vecSrc The source position
* @param inflictor Inflictor is the entity that caused the damage (such as a gun)
* @param attacker Attacker is the entity that triggered the damage (such as the gun's owner)
* @param flDamage The amount of damage
* @param flRadius Damage radius
* @param iClassIgnore To specify classes that are immune to damage
* @param bitsDamageType Damage type DMG_*
* @param vecSrc The source position
* @param inflictor Inflictor is the entity that caused the damage (such as a gun)
* @param attacker Attacker is the entity that triggered the damage (such as the gun's owner)
* @param flDamage The amount of damage
* @param flRadius Damage radius
* @param iClassIgnore To specify classes that are immune to damage
* @param bitsDamageType Damage type DMG_*
*
* @noreturn
*/
@ -179,8 +179,8 @@ native rg_multidmg_clear();
/*
* Inflicts contents of global multi damage registered on victim.
*
* @param inflictor Inflictor is the entity that caused the damage (such as a gun)
* @param attacker Attacker is the entity that triggered the damage (such as the gun's owner)
* @param inflictor Inflictor is the entity that caused the damage (such as a gun)
* @param attacker Attacker is the entity that triggered the damage (such as the gun's owner)
*
* @noreturn
*/
@ -189,10 +189,10 @@ native rg_multidmg_apply(const inflictor, const attacker);
/*
* Adds damage to the accumulator.
*
* @param inflictor Inflictor is the entity that caused the damage (such as a gun)
* @param victim The victim that takes damage
* @param flDamage The amount of damage
* @param bitsDamageType Damage type DMG_*
* @param inflictor Inflictor is the entity that caused the damage (such as a gun)
* @param victim The victim that takes damage
* @param flDamage The amount of damage
* @param bitsDamageType Damage type DMG_*
*
* @noreturn
*/
@ -201,16 +201,16 @@ native rg_multidmg_add(const inflictor, const victim, const Float:flDamage, cons
/*
* Fires bullets from entity.
*
* @param inflictor Inflictor is the entity that caused the damage (such as a gun)
* @param attacker Attacker is the entity that tirggered the damage (such as the gun's owner)
* @param shots The number of shots
* @param vecSrc The source position of the barrel
* @param vecDirShooting Shooting direction
* @param vecSpread Spread
* @param flDistance Max shot distance
* @param iBulletType Bullet type, look at the enum with name Bullet in cssdk_const.inc
* @param iTracerFreq Tracer frequency
* @param iDamage Damage amount
* @param inflictor Inflictor is the entity that caused the damage (such as a gun)
* @param attacker Attacker is the entity that tirggered the damage (such as the gun's owner)
* @param shots The number of shots
* @param vecSrc The source position of the barrel
* @param vecDirShooting Shooting direction
* @param vecSpread Spread
* @param flDistance Max shot distance
* @param iBulletType Bullet type, look at the enum with name Bullet in cssdk_const.inc
* @param iTracerFreq Tracer frequency
* @param iDamage Damage amount
*
* @noreturn
*/
@ -219,31 +219,31 @@ native rg_fire_bullets(const inflictor, const attacker, const shots, Float:vecSr
/*
* Fires bullets from player's weapon.
*
* @param inflictor Inflictor is the entity that caused the damage (such as a gun)
* @param attacker Attacker is the entity that tirggered the damage (such as the gun's owner)
* @param vecSrc The source position of the barrel
* @param vecDirShooting Shooting direction
* @param vecSpread Spread
* @param flDistance Max shot distance
* @param iPenetration The amount of penetration
* @param iBulletType Bullet type, look at the enum with name Bullet in cssdk_const.inc
* @param iDamage Damage amount
* @param flRangeModifier Damage range modifier
* @param bPistol Pistol shot
* @param shared_rand Use player's random seed, get circular gaussian spread
* @param inflictor Inflictor is the entity that caused the damage (such as a gun)
* @param attacker Attacker is the entity that tirggered the damage (such as the gun's owner)
* @param vecSrc The source position of the barrel
* @param vecDirShooting Shooting direction
* @param vecSpread Spread
* @param flDistance Max shot distance
* @param iPenetration The amount of penetration
* @param iBulletType Bullet type, look at the enum with name Bullet in cssdk_const.inc
* @param iDamage Damage amount
* @param flRangeModifier Damage range modifier
* @param bPistol Pistol shot
* @param shared_rand Use player's random seed, get circular gaussian spread
*
* @return Float:[3] The spread result
* @return Float:[3] The spread result
*/
native Float:[3] rg_fire_bullets3(const inflictor, const attacker, Float:vecSrc[3], Float:vecDirShooting[3], const Float:vecSpread, const Float:flDistance, const iPenetration, const Bullet:iBulletType, const iDamage, const Float:flRangeModifier, const bool:bPistol, const shared_rand);
/*
* Forces the round to end.
*
* @param tmDelay Delay before the onset of a new round
* @param st Which team won
* @param event The event is the end of the round
* @param message The message on round end
* @param sentence The sound at the end of the round
* @param tmDelay Delay before the onset of a new round
* @param st Which team won
* @param event The event is the end of the round
* @param message The message on round end
* @param sentence The sound at the end of the round
*
* @noreturn
*/
@ -252,9 +252,9 @@ native rg_round_end(const Float:tmDelay, const WinStatus:st, const ScenarioEvent
/*
* Updates current scores.
*
* @param iCtsWins The amount of wins for counter-terrorists
* @param iTsWins The amount of wins for terrorists
* @param bAdd Adds the score to the current amount
* @param iCtsWins The amount of wins for counter-terrorists
* @param iTsWins The amount of wins for terrorists
* @param bAdd Adds the score to the current amount
*
* @noreturn
*/
@ -263,11 +263,12 @@ native rg_update_teamscores(const iCtsWins = 0, const iTsWins = 0, const bool:bA
/*
* Creates an entity using Counter-Strike's custom CreateNamedEntity wrapper.
*
* @param classname Entity classname
* @param useHashTable Use this only for known game entities
* NOTE: Do not use this if you use a custom classname
* @param classname Entity classname
* @param useHashTable Use this only for known game entities
*
* @return Index of the created entity or 0 otherwise
* @note: Do not use this if you use a custom classname
*
* @return Index of the created entity or 0 otherwise
*
*/
native rg_create_entity(const classname[], const bool:useHashTable = false);
@ -275,12 +276,13 @@ native rg_create_entity(const classname[], const bool:useHashTable = false);
/*
* Finds an entity in the world using Counter-Strike's custom FindEntityByString wrapper.
*
* @param start_index Entity index to start searching from. -1 to start from the first entity
* @param classname Classname to search for
* @param useHashTable Use this only for known game entities
* NOTE: Do not use this if you use a custom classname
* @param start_index Entity index to start searching from. -1 to start from the first entity
* @param classname Classname to search for
* @param useHashTable Use this only for known game entities
*
* @return Entity index > 0 if found, 0 otherwise
* @note: Do not use this if you use a custom classname
*
* @return Entity index > 0 if found, 0 otherwise
*
*/
native rg_find_ent_by_class(start_index, const classname[], const bool:useHashTable = false);
@ -288,10 +290,10 @@ native rg_find_ent_by_class(start_index, const classname[], const bool:useHashTa
/*
* Finds an entity in the world using Counter-Strike's custom FindEntityByString wrapper, matching by owner.
*
* @param start_index Entity index to start searching from. -1 to start from the first entity
* @param classname Classname to search for
* @param start_index Entity index to start searching from. -1 to start from the first entity
* @param classname Classname to search for
*
* @return 1 if found, 0 otherwise
* @return 1 if found, 0 otherwise
*
*/
native rg_find_ent_by_owner(&start_index, const classname[], owner);
@ -299,10 +301,10 @@ native rg_find_ent_by_owner(&start_index, const classname[], owner);
/*
* Finds the weapon by name in the player's inventory.
*
* @param index Client index
* @param weapon Weapon name
* @param index Client index
* @param weapon Weapon name
*
* @return Weapon's entity index, 0 otherwise
* @return Weapon's entity index, 0 otherwise
*
*/
native rg_find_weapon_bpack_by_name(const index, const weapon[]);
@ -310,10 +312,10 @@ native rg_find_weapon_bpack_by_name(const index, const weapon[]);
/*
* Checks if the player has the item.
*
* @param index Client index
* @param item Item name
* @param index Client index
* @param item Item name
*
* @return true if he does, false otherwise
* @return true if he does, false otherwise
*
*/
native bool:rg_has_item_by_name(const index, const item[]);
@ -321,11 +323,11 @@ native bool:rg_has_item_by_name(const index, const item[]);
/*
* Returns specific information about the weapon.
*
* @param weapon name or id Weapon id, see WEAPON_* constants, WeaponIdType or weapon_* name
* @param WpnInfo:type Info type, see WI_* constants
* @param weapon name or id Weapon id, see WEAPON_* constants, WeaponIdType or weapon_* name
* @param WpnInfo:type Info type, see WI_* constants
*
* @return Weapon information
* @error If weapon_id or type are out of bounds, an error will be thrown
* @return Weapon information
* @error If weapon_id or type are out of bounds, an error will be thrown
*
*/
native any:rg_get_weapon_info(any:...);
@ -333,10 +335,10 @@ native any:rg_get_weapon_info(any:...);
/*
* Sets specific weapon info values.
*
* @param weapon_id Weapon id, see WEAPON_* constants
* @param type Info type, see WI_* constants
* @param weapon_id Weapon id, see WEAPON_* constants
* @param type Info type, see WI_* constants
*
* @return 1 on success, 0 otherwise
* @return 1 on success, 0 otherwise
*
*/
native rg_set_weapon_info(const {WeaponIdType,_}:weapon_id, WpnInfo:type, any:...);
@ -344,10 +346,10 @@ native rg_set_weapon_info(const {WeaponIdType,_}:weapon_id, WpnInfo:type, any:..
/*
* Remove all the player's stuff in a specific slot.
*
* @param index Client index
* @param slot The slot that will be emptied
* @param index Client index
* @param slot The slot that will be emptied
*
* @return 1 on success, 0 otherwise
* @return 1 on success, 0 otherwise
*
*/
native rg_remove_items_by_slot(const index, const InventorySlotType:slot);
@ -355,10 +357,10 @@ native rg_remove_items_by_slot(const index, const InventorySlotType:slot);
/*
* Drop to floor all the player's stuff by specific slot.
*
* @param index Client index
* @param slot Specific slot for remove of each item.
* @param index Client index
* @param slot Specific slot for remove of each item.
*
* @return 1 on success, 0 otherwise
* @return 1 on success, 0 otherwise
*
*/
native rg_drop_items_by_slot(const index, const InventorySlotType:slot);
@ -366,10 +368,10 @@ native rg_drop_items_by_slot(const index, const InventorySlotType:slot);
/*
* Remove all of the player's items.
*
* @param index Client index
* @param removeSuit Remove suit
* @param index Client index
* @param removeSuit Remove suit
*
* @return 1 on success, 0 otherwise
* @return 1 on success, 0 otherwise
*
*/
native rg_remove_all_items(const index, const bool:removeSuit = false);
@ -377,10 +379,10 @@ native rg_remove_all_items(const index, const bool:removeSuit = false);
/*
* Forces the player to drop the specified item classname.
*
* @param index Client index
* @param item_name Item classname
* @param index Client index
* @param item_name Item classname
*
* @return 1 on success, 0 otherwise
* @return 1 on success, 0 otherwise
*
*/
native rg_drop_item(const index, const item_name[]);
@ -388,11 +390,11 @@ native rg_drop_item(const index, const item_name[]);
/*
* Executes a client command on the gamedll side.
*
* @param index Client index
* @param command Client command to execute
* @param arg Optional command arguments
* @param index Client index
* @param command Client command to execute
* @param arg Optional command arguments
*
* @return 1 on success, 0 otherwise
* @return 1 on success, 0 otherwise
*
*/
native rg_internal_cmd(const index, const cmd[], const arg[] = "");
@ -400,10 +402,10 @@ native rg_internal_cmd(const index, const cmd[], const arg[] = "");
/*
* Removes the specified item classname from the player
*
* @param index Client index
* @param item_name Item classname
* @param index Client index
* @param item_name Item classname
*
* @return 1 if found and remove, 0 otherwise
* @return 1 if found and remove, 0 otherwise
*
*/
native rg_remove_item(const index, const item_name[]);
@ -411,10 +413,10 @@ native rg_remove_item(const index, const item_name[]);
/*
* Returns the amount of ammo in the client's backpack for a specific weapon.
*
* @param index Client index
* @param weapon Weapon id
* @param index Client index
* @param weapon Weapon id
*
* @return Amount of ammo in backpack
* @return Amount of ammo in backpack
*
*/
native rg_get_user_bpammo(const index, WeaponIdType:weapon);
@ -422,9 +424,9 @@ native rg_get_user_bpammo(const index, WeaponIdType:weapon);
/*
* Sets the amount of ammo in the client's backpack for a specific weapon.
*
* @param index Client index
* @param weapon Weapon id
* @param amount New backpack ammo amount to set
* @param index Client index
* @param weapon Weapon id
* @param amount New backpack ammo amount to set
*
* @noreturn
*
@ -434,11 +436,11 @@ native rg_set_user_bpammo(const index, WeaponIdType:weapon, amount);
/*
* Sets the client's defusekit status and allows to set a custom HUD icon and color.
*
* @param index Client index
* @param defusekit If nonzero the client will have a defusekit, otherwise it will be removed
* @param color Color RGB
* @param icon HUD sprite to use as an icon
* @param flash If nonzero the icon will flash red
* @param index Client index
* @param defusekit If nonzero the client will have a defusekit, otherwise it will be removed
* @param color Color RGB
* @param icon HUD sprite to use as an icon
* @param flash If nonzero the icon will flash red
*
* @noreturn
*
@ -448,10 +450,10 @@ native rg_give_defusekit(const index, const bool:bDefusekit = true, const Float:
/*
* Returns the client's armor value and retrieves the type of armor.
*
* @param index Client index
* @param armortype Variable to store armor type in
* @param index Client index
* @param armortype Variable to store armor type in
*
* @return Amount of armor, 0 if the client has no armor
* @return Amount of armor, 0 if the client has no armor
*
*/
native rg_get_user_armor(const index, &ArmorType:armortype);
@ -459,9 +461,9 @@ native rg_get_user_armor(const index, &ArmorType:armortype);
/*
* Sets the client's armor value and the type of armor.
*
* @param index Client index
* @param armorvalue Amount of armor to set
* @param armortype Armor type to set
* @param index Client index
* @param armorvalue Amount of armor to set
* @param armortype Armor type to set
*
* @noreturn
*
@ -471,15 +473,15 @@ native rg_set_user_armor(const index, armorvalue, ArmorType:armortype);
/*
* Sets the client's team without killing the player and sets the client's model.
* @note To obtain a TeamName use the following:
* new TeamName:team = get_member(id, m_iTeam);
* new TeamName:team = get_member(id, m_iTeam);
*
* @param index Client index
* @param team Team id
* @param model Internal model, use MODEL_AUTO for a random appearance or MODEL_UNASSIGNED to not update it
* @param index Client index
* @param team Team id
* @param model Internal model, use MODEL_AUTO for a random appearance or MODEL_UNASSIGNED to not update it
*
* @param send_teaminfo If true, a TeamInfo message will be sent
* @param send_teaminfo If true, a TeamInfo message will be sent
*
* @return 1 on success, 0 otherwise
* @return 1 on success, 0 otherwise
*
*/
native rg_set_user_team(const index, {TeamName,_}:team, {ModelName,_}:model = MODEL_AUTO, const bool:send_teaminfo = true);
@ -487,11 +489,11 @@ native rg_set_user_team(const index, {TeamName,_}:team, {ModelName,_}:model = MO
/*
* Sets the client's player model.
*
* @param index Client index
* @param model Model name
* @param update_index If true, the modelindex is updated as well
* @param index Client index
* @param model Model name
* @param update_index If true, the modelindex is updated as well
*
* @return 1 on success, 0 otherwise
* @return 1 on success, 0 otherwise
*
*/
native rg_set_user_model(const index, const model[], const bool:update_index = false);
@ -499,10 +501,10 @@ native rg_set_user_model(const index, const model[], const bool:update_index = f
/*
* Resets the client's model.
*
* @param index Client index
* @param update_index If true, the modelindex is reset as well
* @param index Client index
* @param update_index If true, the modelindex is reset as well
*
* @return 1 on success, 0 otherwise
* @return 1 on success, 0 otherwise
*
*/
native rg_reset_user_model(const index, const bool:update_index = false);
@ -510,10 +512,10 @@ native rg_reset_user_model(const index, const bool:update_index = false);
/*
* Enable/Disable player's footsteps.
*
* @param index Client index
* @param silent To enable silent footsteps
* @param index Client index
* @param silent To enable silent footsteps
*
* @return 1 on success, 0 otherwise
* @return 1 on success, 0 otherwise
*
*/
native rg_set_user_footsteps(const index, bool:silent = false);
@ -521,9 +523,9 @@ native rg_set_user_footsteps(const index, bool:silent = false);
/*
* Get the current footsteps state of the player.
*
* @param index Client index
* @param index Client index
*
* @return 1 if the player has silent footsteps, 0 otherwise
* @return 1 if the player has silent footsteps, 0 otherwise
*
*/
native rg_get_user_footsteps(const index);
@ -531,10 +533,10 @@ native rg_get_user_footsteps(const index);
/*
* Transfers C4 from one player to another.
*
* @param index Client index
* @param receiver Receiver index, if 0 it will transfer to a random player
* @param index Client index
* @param receiver Receiver index, if 0 it will transfer to a random player
*
* @return 1 on success, 0 otherwise
* @return 1 on success, 0 otherwise
*
*/
native rg_transfer_c4(const index, const receiver = 0);
@ -542,10 +544,10 @@ native rg_transfer_c4(const index, const receiver = 0);
/*
* Instantly reload client's weapons.
*
* @param index Client index
* @param weapon Weapon entity-index, if 0 then all weapons will be reloaded
* @param index Client index
* @param weapon Weapon entity-index, if 0 then all weapons will be reloaded
*
* @return 1 on success, 0 otherwise
* @return 1 on success, 0 otherwise
*
*/
native rg_instant_reload_weapons(const index, const weapon = 0);
@ -553,8 +555,8 @@ native rg_instant_reload_weapons(const index, const weapon = 0);
/*
* Sets the amount of reward in the game account for all players.
*
* @param rules_index Look at the enum with name RewardRules
* @param amount The money amount
* @param rules_index Look at the enum with name RewardRules
* @param amount The money amount
*
* @noreturn
*
@ -564,9 +566,9 @@ native rg_set_account_rules(const RewardRules:rules_index, const amount);
/*
* Gets the specified reward rule's money amount.
*
* @param rules_index Look at the enum with name RewardRules
* @param rules_index Look at the enum with name RewardRules
*
* @return The amount of reward
* @return The amount of reward
*
*/
native rg_get_account_rules(const RewardRules:rules_index);
@ -574,7 +576,7 @@ native rg_get_account_rules(const RewardRules:rules_index);
/*
* Checks if the bomb is planted.
*
* @return true if the bomb is planted, false otherwise
* @return true if the bomb is planted, false otherwise
*
*/
native bool:rg_is_bomb_planted();
@ -582,10 +584,10 @@ native bool:rg_is_bomb_planted();
/*
* Forces a player to join a team.
*
* @param index Client index
* @param team Team id
* @param index Client index
* @param team Team id
*
* @return 1 on success, 0 otherwise
* @return 1 on success, 0 otherwise
*
*/
native rg_join_team(const index, const TeamName:team);
@ -610,7 +612,7 @@ native rg_swap_all_players();
* Instantly switches the player to his opposite team.
* @note Switch from CT to TERRORIST is also opposite.
*
* @param index Client index
* @param index Client index
*
* @noreturn
*
@ -620,10 +622,10 @@ native rg_switch_team(const index);
/*
* Forces the player to switch to a specific weapon.
*
* @param index Client index
* @param weapon Weapon entity-index
* @param index Client index
* @param weapon Weapon entity-index
*
* @return 1 on success, 0 otherwise
* @return 1 on success, 0 otherwise
*
*/
native rg_switch_weapon(const index, const weapon);
@ -631,7 +633,7 @@ native rg_switch_weapon(const index, const weapon);
/*
* Gets which team has a higher join priority.
*
* @return Returns the Team Name
* @return Returns the Team Name
*
*/
native TeamName:rg_get_join_team_priority();
@ -639,10 +641,10 @@ native TeamName:rg_get_join_team_priority();
/*
* Checks whether the player can take damage from the attacker.
*
* @param index Client index
* @param attacker Attacker index
* @param index Client index
* @param attacker Attacker index
*
* @return true if he can take damage, false otherwise
* @return true if he can take damage, false otherwise
*
*/
native bool:rg_is_player_can_takedamage(const index, const attacker);
@ -650,9 +652,9 @@ native bool:rg_is_player_can_takedamage(const index, const attacker);
/*
* Gets WeaponIdType from weaponbox
*
* @param entity Weaponbox entity
* @param entity Weaponbox entity
*
* @return return enum of WeaponIdType
* @return return enum of WeaponIdType
*
*/
native WeaponIdType:rg_get_weaponbox_id(const entity);
@ -660,7 +662,7 @@ native WeaponIdType:rg_get_weaponbox_id(const entity);
/*
* Respawn on round for players/bots.
*
* @param index Client index
* @param index Client index
*
* @noreturn
*
@ -670,7 +672,7 @@ native rg_round_respawn(const index);
/*
* Resets player's maxspeed.
*
* @param index Client index
* @param index Client index
*
* @noreturn
*
@ -679,11 +681,11 @@ native rg_reset_maxspeed(const index);
/*
* Draws a HUD progress bar which fills from 0% to 100% for the time duration in seconds.
* NOTE: Set the duration to 0 to hide the bar.
* @note: Set the duration to 0 to hide the bar.
*
* @param index Client index
* @param time Duration
* @param observer Send for everyone who is observing the player
* @param index Client index
* @param time Duration
* @param observer Send for everyone who is observing the player
*
* @noreturn
*
@ -693,10 +695,10 @@ native rg_send_bartime(const index, const duration, const bool:observer = true);
/*
* Same as BarTime, but StartPercent specifies how much of the bar is (already) filled.
*
* @param index Client index
* @param time Duration
* @param startPercent Start percent
* @param observer Send for everyone who is observing the player
* @param index Client index
* @param time Duration
* @param startPercent Start percent
* @param observer Send for everyone who is observing the player
*
* @noreturn
*
@ -706,9 +708,9 @@ native rg_send_bartime2(const index, const duration, const startPercent, const b
/*
* Sends the SendAudio message - plays the specified audio.
*
* @param index Receiver index or use 0 for everyone
* @param sample Sound file to play
* @param pitch Sound pitch
* @param index Receiver index or use 0 for everyone
* @param sample Sound file to play
* @param pitch Sound pitch
*
* @noreturn
*

File diff suppressed because it is too large Load Diff

View File

@ -19,27 +19,32 @@ enum client_auth_type
CA_TYPE_SSE3,
};
#define is_user_steam(%0) (REU_GetAuthtype(%0) == CA_TYPE_STEAM)
/*
* Gets client protocol.
*
* @param index Client index
* @return Client protocol
* @param index Client index
*
* @return Client protocol
*/
native REU_GetProtocol(const index);
/*
* Gets client auth type.
*
* @param index Client index
* @return Client auth type
* @param index Client index
*
* @return Client auth type
*/
native client_auth_type:REU_GetAuthtype(const index);
/*
* Check if the client is running RevEmu with limited user rights.
*
* @param index Client index
* @return 1/0
* @param index Client index
*
* @return 1/0
*
*/
native bool:REU_IsRevemuWithoutAdminRights(const index);

View File

@ -6,8 +6,9 @@
/*
* Checks whether the player is talking at the moment.
*
* @param index Client index
* @return true if client is speaking, false otherwise
* @param index Client index
*
* @return true if client is speaking, false otherwise
*
*/
native bool:VTC_IsClientSpeaking(const index);
@ -15,7 +16,8 @@ native bool:VTC_IsClientSpeaking(const index);
/*
* Mutes the player.
*
* @param index Client index
* @param index Client index
*
* @noreturn
*/
native VTC_MuteClient(const index);
@ -23,7 +25,8 @@ native VTC_MuteClient(const index);
/*
* Unmutes the player.
*
* @param index Client index
* @param index Client index
*
* @noreturn
*/
native VTC_UnmuteClient(const index);
@ -31,8 +34,9 @@ native VTC_UnmuteClient(const index);
/*
* Checks whether the player is muted at the moment.
*
* @param index Client index
* @return true if client is muted, false otherwise
* @param index Client index
*
* @return true if client is muted, false otherwise
*
*/
native bool:VTC_IsClientMuted(const index);
@ -54,7 +58,8 @@ native VTC_PlaySound(const receiver, const soundFilePath[]);
/*
* Called when the player started talking.
*
* @param index Client index
* @param index Client index
*
* @noreturn
*/
forward VTC_OnClientStartSpeak(const index);
@ -62,7 +67,8 @@ forward VTC_OnClientStartSpeak(const index);
/*
* Called when the player stopped talking.
*
* @param index Client index
* @param index Client index
*
* @noreturn
*/
forward VTC_OnClientStopSpeak(const index);