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

Suppress warnings C4573 VS2015

Add native rg_drop_items_by_slot
This commit is contained in:
s1lent 2017-02-03 19:01:06 +07:00
parent e8c4c14f40
commit b8f7c25fb5
4 changed files with 48 additions and 4 deletions

View File

@ -348,6 +348,17 @@ native rg_set_weapon_info(const {WeaponIdType,_}:weapon_id, WpnInfo:type, any:..
*/ */
native rg_remove_items_by_slot(const index, const InventorySlotType:slot); 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.
*
* @return 1 if successfully, 0 otherwise
*
*/
native rg_drop_items_by_slot(const index, const InventorySlotType:slot);
/* /*
* Remove all the player's stuff. * Remove all the player's stuff.
* *

View File

@ -1,5 +1,9 @@
#include "precompiled.h" #include "precompiled.h"
#if _MSC_VER >= 1900
#pragma warning(disable:4573)
#endif
#if _MSC_VER <= 1800 && __INTEL_COMPILER < 1500 #if _MSC_VER <= 1800 && __INTEL_COMPILER < 1500
// BUG BUG // BUG BUG
// http://connect.microsoft.com/VisualStudio/feedbackdetail/view/797682/c-decltype-of-class-member-access-incompletely-implemented // http://connect.microsoft.com/VisualStudio/feedbackdetail/view/797682/c-decltype-of-class-member-access-incompletely-implemented

View File

@ -55,9 +55,9 @@ struct member_t
bool hasTable(size_t members, memberlist_t::members_tables_e tbl) const; bool hasTable(size_t members, memberlist_t::members_tables_e tbl) const;
bool isTypeReturnable() const; bool isTypeReturnable() const;
uint16 size; size_t size;
uint16 max_size; size_t max_size;
uint32 offset; size_t offset;
const char *name; const char *name;
MType type; MType type;
}; };

View File

@ -830,6 +830,33 @@ cell AMX_NATIVE_CALL rg_remove_items_by_slot(AMX *amx, cell *params)
return TRUE; return TRUE;
} }
/*
* Drop to floor all the player's stuff by specific slot.
*
* @param index Client index
* @param slot Specific slot for remove of each item.
*
* @return 1 if successfully, 0 otherwise
*
* native rg_drop_items_by_slot(const index, const InventorySlotType:slot);
*/
cell AMX_NATIVE_CALL rg_drop_items_by_slot(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_index, arg_slot };
CHECK_ISPLAYER(arg_index);
CBasePlayer *pPlayer = UTIL_PlayerByIndex(params[arg_index]);
CHECK_CONNECTED(pPlayer, arg_index);
pPlayer->ForEachItem(params[arg_slot], [pPlayer](CBasePlayerItem *pItem) {
pPlayer->CSPlayer()->DropPlayerItem(STRING(pItem->pev->classname));
return false;
});
return TRUE;
}
/* /*
* Remove all the player's stuff * Remove all the player's stuff
* *
@ -1803,6 +1830,8 @@ AMX_NATIVE_INFO Misc_Natives_RG[] =
{ "rg_set_weapon_info", rg_set_weapon_info }, { "rg_set_weapon_info", rg_set_weapon_info },
{ "rg_remove_items_by_slot", rg_remove_items_by_slot }, { "rg_remove_items_by_slot", rg_remove_items_by_slot },
{ "rg_drop_items_by_slot", rg_drop_items_by_slot },
{ "rg_remove_all_items", rg_remove_all_items }, { "rg_remove_all_items", rg_remove_all_items },
{ "rg_remove_item", rg_remove_item }, { "rg_remove_item", rg_remove_item },
{ "rg_drop_item", rg_drop_item }, { "rg_drop_item", rg_drop_item },