added request at22274
This commit is contained in:
@ -334,6 +334,19 @@ static cell AMX_NATIVE_CALL ns_set_struct_owner(AMX *amx, cell *params)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL ns_get_hive_ability(AMX *amx, cell *params)
|
||||
{
|
||||
int id = params[1];
|
||||
int abilitynum = params[2];
|
||||
if (id < 1 || id > gpGlobals->maxClients)
|
||||
return 0;
|
||||
|
||||
CPlayer *player = GET_PLAYER_I(id);
|
||||
int result = get_private(player->edict, OFFSET_WIN_HIVEABILITY, OFFSET_LIN_HIVEABILITY);
|
||||
|
||||
return (abilitynum > 0) ? (result >= abilitynum - 1) : result;
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO ns_pdata_natives[] = {
|
||||
/*****************/
|
||||
{ "ns_get_res", ns_get_res },
|
||||
@ -369,6 +382,8 @@ AMX_NATIVE_INFO ns_pdata_natives[] = {
|
||||
{ "ns_get_struct_owner", ns_get_struct_owner },
|
||||
{ "ns_set_struct_owner", ns_set_struct_owner },
|
||||
|
||||
{ "ns_get_hive_ability", ns_get_hive_ability},
|
||||
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
@ -54,6 +54,8 @@
|
||||
#define OFFSET_WIN_STRUCTOWNER 324 //81 * 4
|
||||
#define OFFSET_LIN_STRUCTOWNER 340 //85 * 4
|
||||
|
||||
#define OFFSET_WIN_HIVEABILITY 6220 //1555 * 4
|
||||
#define OFFSET_LIN_HIVEABILITY 6240 //1560 * 4
|
||||
|
||||
enum
|
||||
{
|
||||
|
Reference in New Issue
Block a user