2
0
mirror of https://github.com/s1lentq/reapi.git synced 2024-10-16 15:27:06 +03:00

Added reapi_version.inc and other typos

This commit is contained in:
s1lentq 2016-05-03 19:11:45 +06:00
parent e64210dee7
commit c1c59ce26c
15 changed files with 48 additions and 37 deletions

View File

@ -31,6 +31,10 @@ task publishPrepareFiles << {
from 'reapi/extra'
into 'publish/publishRoot/reapi/addons'
}
copy {
from 'reapi/src/reapi_version.inc'
into 'publish/publishRoot/reapi/addons/amxmodx/scripting/include'
}
}
task publishPackage(type: Zip, dependsOn: 'publishPrepareFiles') {

View File

@ -13,16 +13,12 @@
#pragma library reapi
#endif
// reapi version
#define REAPI_VERSION_MAJOR 1
#define REAPI_VERSION_MINOR 0
#define NULLENT -1
#include <reapi_const.inc>
#include <reapi_engine.inc> // NOTE: only for ReHLDS
#include <reapi_gamedll.inc> // NOTE: only for gamedll Counter-Strike (ReGameDLL_CS)
#include <reapi_addons.inc> // NOTE: 3-rd party addons
#include <reapi_version.inc>
// hookchain return type
enum

View File

@ -26,7 +26,7 @@ enum client_auth_type
* @return 1 if client is speaking, 0 otherwise
*
*/
native VTC_IsClientSpeaking(index);
native VTC_IsClientSpeaking(const index);
/*
* Mutes this player
@ -34,7 +34,7 @@ native VTC_IsClientSpeaking(index);
* @param index Client index
* @noreturn
*/
native VTC_MuteClient(index);
native VTC_MuteClient(const index);
/*
* Unmutes this player
@ -42,7 +42,7 @@ native VTC_MuteClient(index);
* @param index Client index
* @noreturn
*/
native VTC_UnmuteClient(index);
native VTC_UnmuteClient(const index);
/*
* Called when player started talking
@ -50,7 +50,7 @@ native VTC_UnmuteClient(index);
* @param index Client index
* @noreturn
*/
forward VTC_OnClientStartSpeak(index);
forward VTC_OnClientStartSpeak(const index);
/*
* Called when player stopped talking
@ -58,13 +58,13 @@ forward VTC_OnClientStartSpeak(index);
* @param index Client index
* @noreturn
*/
forward VTC_OnClientStopSpeak(index);
forward VTC_OnClientStopSpeak(const index);
/*
* Get client protocol
*
* @param index Client index
* @noreturn
* @return client protocol
*/
native REU_GetProtocol(const index);
@ -72,6 +72,6 @@ native REU_GetProtocol(const index);
* Get client auth type
*
* @param index Client index
* @noreturn
* @return client auth type
*/
native REU_GetAuthtype(const index);
native client_auth_type:REU_GetAuthtype(const index);

View File

@ -173,7 +173,6 @@ enum GamedllFunc_CBasePlayer
*/
RG_CBasePlayer_ObjectCaps,
/**
* Description: -
* Return type: int
@ -571,7 +570,7 @@ enum CSGameRules_Members
m_bMapHasEscapeZone,
/**
* Description: 0 = uninitialized, 1 = has VIP safety zone, 2 = DOES not have VIP safetyzone
* Description: 0 = uninitialized, 1 = has VIP safety zone, 2 = DOES not have VIP safetyzone
* Member type: int
* Get params: get_member_game(member);
* Set params: set_member_game(member, value);

View File

@ -4,7 +4,7 @@
public plugin_init()
{
register_plugin("ReAPI Test", "1.0", "s1lent");
RegisterHookChain(RH_CBasePlayer_GiveAmmo, "CBasePlayer_GiveAmmo");
RegisterHookChain(RG_CBasePlayer_GiveAmmo, "CBasePlayer_GiveAmmo");
}
public CBasePlayer_GiveAmmo(const this, iAmount, szName[], iMax)

View File

@ -268,7 +268,7 @@
<None Include="..\extra\amxmodx\scripting\include\reapi_gamedll_const.inc" />
<None Include="..\extra\amxmodx\scripting\include\reapi_addons.inc" />
<None Include="..\extra\amxmodx\scripting\reapi_test.sma" />
<None Include="..\src\reapi_const.inc" />
<None Include="..\src\reapi_version.inc" />
<None Include="reapi.def" />
</ItemGroup>
<PropertyGroup Label="Globals">

View File

@ -739,9 +739,6 @@
<None Include="..\extra\amxmodx\scripting\reapi_test.sma">
<Filter>amxmodx\scripting</Filter>
</None>
<None Include="..\src\reapi_const.inc">
<Filter>src</Filter>
</None>
<None Include="reapi.def" />
<None Include="..\extra\amxmodx\scripting\include\reapi_gamedll.inc">
<Filter>amxmodx\scripting\include</Filter>
@ -758,6 +755,9 @@
<None Include="..\extra\amxmodx\scripting\include\reapi_addons.inc">
<Filter>amxmodx\scripting\include</Filter>
</None>
<None Include="..\src\reapi_version.inc">
<Filter>src</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="reapi.rc" />

View File

@ -177,7 +177,7 @@ C_DLLEXPORT int AMXX_Detach()
C_DLLEXPORT int AMXX_PluginsLoaded()
{
int iFwd = g_amxxapi.RegisterForward("__reapi_version_check", ET_IGNORE, FP_CELL, FP_CELL, FP_DONE);
g_amxxapi.ExecuteForward(iFwd, REAPI_VERISON_MAJOR, REAPI_VERISON_MINOR);
g_amxxapi.ExecuteForward(iFwd, REAPI_VERSION_MAJOR, REAPI_VERSION_MINOR);
if (api_cfg.hasVTC()) {

View File

@ -1,7 +1,7 @@
#pragma once
// reapi version
#include "reapi_const.inc"
#include "reapi_version.inc"
class CAPI_Config {
public:

View File

@ -6,7 +6,7 @@
* @param index Client index
* @return 1 if client is speaking, 0 otherwise
*
* native VTC_IsClientSpeaking(index);
* native VTC_IsClientSpeaking(const index);
*/
cell AMX_NATIVE_CALL VTC_IsClientSpeaking(AMX *amx, cell *params)
{
@ -23,7 +23,7 @@ cell AMX_NATIVE_CALL VTC_IsClientSpeaking(AMX *amx, cell *params)
* @param index Client index
* @noreturn
*
* native VTC_MuteClient(index);
* native VTC_MuteClient(const index);
*/
cell AMX_NATIVE_CALL VTC_MuteClient(AMX *amx, cell *params)
{
@ -42,7 +42,7 @@ cell AMX_NATIVE_CALL VTC_MuteClient(AMX *amx, cell *params)
* @param index Client index
* @noreturn
*
* native VTC_UnmuteClient(index);
* native VTC_UnmuteClient(const index);
*/
cell AMX_NATIVE_CALL VTC_UnmuteClient(AMX *amx, cell *params)
{
@ -68,6 +68,7 @@ AMX_NATIVE_INFO Vtc_Natives[] =
* Get client protocol
*
* @param index Client index
* @return client protocol
*
* native REU_GetProtocol(const index);
*/
@ -84,6 +85,7 @@ cell AMX_NATIVE_CALL REU_GetProtocol(AMX *amx, cell *params)
* Get client auth type
*
* @param index Client index
* @return client auth type
*
* native REU_GetAuthtype(const index);
*/

View File

@ -36,7 +36,13 @@ public:
{
if (m_value < 0)
return nullptr;
return g_ReGameFuncs->UTIL_PlayerByIndex(m_value);
return getPrivate<CBaseEntity>(m_value);
}
operator CBasePlayer*() const
{
if (m_value < 0)
return nullptr;
return static_cast<CBasePlayer *>(g_ReGameFuncs->UTIL_PlayerByIndex(m_value));
}
operator PLAYER_ANIM() const
{

View File

@ -221,7 +221,7 @@ cell AMX_NATIVE_CALL rg_multidmg_add(AMX *amx, cell *params)
CAmxArgs args(amx, params);
g_ReGameFuncs->AddMultiDamage(args[arg_inflictor], args[arg_victim], args[arg_damage], args[arg_dmg_type]);
return TRUE;
}
@ -481,7 +481,7 @@ cell AMX_NATIVE_CALL rg_find_ent_by_owner(AMX *amx, cell *params)
const char* value = getAmxString(amx, params[arg_classname]);
edict_t *pOwner = edictByIndex(params[arg_onwer]);
edict_t *pEntity = g_pEdicts;
for (int i = 0; i < gpGlobals->maxEntities; i++, pEntity++)
{
if (pEntity->v.owner == pOwner && !strcmp(STRING(pEntity->v.classname), value))

View File

@ -1,8 +0,0 @@
#if defined _reapi_const_included
#endinput
#endif
#define _reapi_const_included
// reapi version
#define REAPI_VERISON_MAJOR 1
#define REAPI_VERISON_MINOR 0

View File

@ -27,7 +27,11 @@ inline edict_t* edictByIndex(size_t index)
template<typename T>
T* getPrivate(int index)
{
return (T *)edictByIndex(index)->pvPrivateData;
edict_t* pent = edictByIndex(index);
if (pent)
return (T *)pent->pvPrivateData;
return nullptr;
}
inline entvars_t* PEV(int index)

View File

@ -0,0 +1,8 @@
#if defined _reapi_version_included
#endinput
#endif
#define _reapi_version_included
// reapi version
#define REAPI_VERSION_MAJOR 1
#define REAPI_VERSION_MINOR 0