mirror of
https://github.com/rehlds/reapi.git
synced 2025-04-15 13:52:40 +03:00
Reworked rg_remove_items_by_slot, rg_reset_user_model
Ignore VS2015 files.
This commit is contained in:
parent
782db3774c
commit
e8c4c14f40
3
.gitignore
vendored
3
.gitignore
vendored
@ -8,7 +8,10 @@
|
|||||||
**/msvc/*.opensdf
|
**/msvc/*.opensdf
|
||||||
**/msvc/*.user
|
**/msvc/*.user
|
||||||
**/msvc/*.suo
|
**/msvc/*.suo
|
||||||
|
**/msvc/*.db
|
||||||
|
**/msvc/*.opendb
|
||||||
**/msvc/*.aps
|
**/msvc/*.aps
|
||||||
|
**/msvc/.vs
|
||||||
**/msvc/START*.bat
|
**/msvc/START*.bat
|
||||||
**/msvc/ipch
|
**/msvc/ipch
|
||||||
**/PublishPath*.txt
|
**/PublishPath*.txt
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
<Configuration>Debug</Configuration>
|
<Configuration>Debug</Configuration>
|
||||||
@ -288,13 +288,13 @@
|
|||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<PlatformToolset>v120_xp</PlatformToolset>
|
<PlatformToolset>v140_xp</PlatformToolset>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<PlatformToolset>v120_xp</PlatformToolset>
|
<PlatformToolset>v140_xp</PlatformToolset>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@ -807,10 +807,14 @@ cell AMX_NATIVE_CALL rg_remove_items_by_slot(AMX *amx, cell *params)
|
|||||||
|
|
||||||
pPlayer->ForEachItem(params[arg_slot], [pPlayer](CBasePlayerItem *pItem) {
|
pPlayer->ForEachItem(params[arg_slot], [pPlayer](CBasePlayerItem *pItem) {
|
||||||
|
|
||||||
if (pItem->IsWeapon() && pItem == pPlayer->m_pActiveItem) {
|
if (pItem->IsWeapon()) {
|
||||||
|
if (pItem == pPlayer->m_pActiveItem) {
|
||||||
((CBasePlayerWeapon *)pItem)->RetireWeapon();
|
((CBasePlayerWeapon *)pItem)->RetireWeapon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pPlayer->m_rgAmmo[ pItem->PrimaryAmmoIndex() ] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (pPlayer->RemovePlayerItem(pItem)) {
|
if (pPlayer->RemovePlayerItem(pItem)) {
|
||||||
pPlayer->pev->weapons &= ~(1 << pItem->m_iId);
|
pPlayer->pev->weapons &= ~(1 << pItem->m_iId);
|
||||||
pItem->Kill();
|
pItem->Kill();
|
||||||
@ -890,10 +894,11 @@ cell AMX_NATIVE_CALL rg_internal_cmd(AMX *amx, cell *params)
|
|||||||
CHECK_ISPLAYER(arg_index);
|
CHECK_ISPLAYER(arg_index);
|
||||||
|
|
||||||
CBasePlayer *pPlayer = UTIL_PlayerByIndex(params[arg_index]);
|
CBasePlayer *pPlayer = UTIL_PlayerByIndex(params[arg_index]);
|
||||||
CHECK_CONNECTED(pPlayer, arg_index);
|
if (unlikely(pPlayer == nullptr || pPlayer->has_disconnected)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
pPlayer->CSPlayer()->ClientCommand(getAmxString(amx, params[arg_cmd]), getAmxString(amx, params[arg_arg]));
|
pPlayer->CSPlayer()->ClientCommand(getAmxString(amx, params[arg_cmd]), getAmxString(amx, params[arg_arg]));
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1235,7 +1240,7 @@ cell AMX_NATIVE_CALL rg_set_user_model(AMX *amx, cell *params)
|
|||||||
|
|
||||||
if (params[arg_update] != 0)
|
if (params[arg_update] != 0)
|
||||||
{
|
{
|
||||||
char model[260];
|
char model[MAX_PATH];
|
||||||
snprintf(model, sizeof(model), "models/player/%s/%s.mdl", newModel, newModel);
|
snprintf(model, sizeof(model), "models/player/%s/%s.mdl", newModel, newModel);
|
||||||
pPlayer->CSPlayer()->SetNewPlayerModel(model);
|
pPlayer->CSPlayer()->SetNewPlayerModel(model);
|
||||||
}
|
}
|
||||||
@ -1247,14 +1252,15 @@ cell AMX_NATIVE_CALL rg_set_user_model(AMX *amx, cell *params)
|
|||||||
* Reset model user
|
* Reset model user
|
||||||
*
|
*
|
||||||
* @param index Client index
|
* @param index Client index
|
||||||
|
* @param update_index If true, the modelindex is reseted as well
|
||||||
*
|
*
|
||||||
* @return 1 if successfully, 0 otherwise
|
* @return 1 if successfully, 0 otherwise
|
||||||
*
|
*
|
||||||
* native rg_reset_user_model(const index);
|
* native rg_reset_user_model(const index, const bool:update_index = false);
|
||||||
*/
|
*/
|
||||||
cell AMX_NATIVE_CALL rg_reset_user_model(AMX *amx, cell *params)
|
cell AMX_NATIVE_CALL rg_reset_user_model(AMX *amx, cell *params)
|
||||||
{
|
{
|
||||||
enum args_e { arg_count, arg_index, arg_team, arg_model };
|
enum args_e { arg_count, arg_index, arg_update };
|
||||||
|
|
||||||
CHECK_ISPLAYER(arg_index);
|
CHECK_ISPLAYER(arg_index);
|
||||||
|
|
||||||
@ -1263,6 +1269,17 @@ cell AMX_NATIVE_CALL rg_reset_user_model(AMX *amx, cell *params)
|
|||||||
|
|
||||||
pPlayer->CSPlayer()->SetPlayerModelEx("");
|
pPlayer->CSPlayer()->SetPlayerModelEx("");
|
||||||
pPlayer->CSPlayer()->SetPlayerModel(pPlayer->m_bHasC4);
|
pPlayer->CSPlayer()->SetPlayerModel(pPlayer->m_bHasC4);
|
||||||
|
|
||||||
|
if (params[arg_update] != 0)
|
||||||
|
{
|
||||||
|
char *infobuffer = GET_INFO_BUFFER(pPlayer->edict());
|
||||||
|
char *pModel = GET_KEY_VALUE(infobuffer, "model");
|
||||||
|
|
||||||
|
char model[MAX_PATH];
|
||||||
|
snprintf(model, sizeof(model), "models/player/%s/%s.mdl", pModel, pModel);
|
||||||
|
pPlayer->CSPlayer()->SetNewPlayerModel(model);
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user