mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
Add get_map_objectives native for CS (bug 5820, r=Nextra)
This commit is contained in:
parent
ea7b0f56fd
commit
47487a4aa7
@ -370,6 +370,36 @@ static cell AMX_NATIVE_CALL get_stats_size(AMX *amx, cell *params){
|
|||||||
return 8;
|
return 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum MapObjective
|
||||||
|
{
|
||||||
|
MapObjective_Bomb = (1<<0),
|
||||||
|
MapObjective_Hostage = (1<<1),
|
||||||
|
MapObjective_Vip = (1<<2),
|
||||||
|
MapObjective_Escape = (1<<3),
|
||||||
|
};
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_map_objectives(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int flags = 0;
|
||||||
|
|
||||||
|
if (!FNullEnt(FIND_ENTITY_BY_STRING(NULL, "classname", "func_bomb_target")) ||
|
||||||
|
!FNullEnt(FIND_ENTITY_BY_STRING(NULL, "classname", "info_bomb_target")))
|
||||||
|
flags |= MapObjective_Bomb;
|
||||||
|
|
||||||
|
if (!FNullEnt(FIND_ENTITY_BY_STRING(NULL, "classname", "func_hostage_rescue")) ||
|
||||||
|
!FNullEnt(FIND_ENTITY_BY_STRING(NULL, "classname", "info_hostage_rescue")) ||
|
||||||
|
!FNullEnt(FIND_ENTITY_BY_STRING(NULL, "classname", "hostage_entity"))) // there are maps with only this and using team spawn as rescue zone.
|
||||||
|
flags |= MapObjective_Hostage;
|
||||||
|
|
||||||
|
if (!FNullEnt(FIND_ENTITY_BY_STRING(NULL, "classname", "func_vip_safetyzone")))
|
||||||
|
flags |= MapObjective_Vip;
|
||||||
|
|
||||||
|
if (!FNullEnt(FIND_ENTITY_BY_STRING(NULL, "classname", "func_escapezone")))
|
||||||
|
flags |= MapObjective_Escape;
|
||||||
|
|
||||||
|
return flags;
|
||||||
|
}
|
||||||
|
|
||||||
AMX_NATIVE_INFO stats_Natives[] = {
|
AMX_NATIVE_INFO stats_Natives[] = {
|
||||||
{ "get_stats", get_stats},
|
{ "get_stats", get_stats},
|
||||||
{ "get_stats2", get_stats2},
|
{ "get_stats2", get_stats2},
|
||||||
@ -395,6 +425,8 @@ AMX_NATIVE_INFO stats_Natives[] = {
|
|||||||
{ "xmod_get_maxweapons", get_maxweapons },
|
{ "xmod_get_maxweapons", get_maxweapons },
|
||||||
{ "xmod_get_stats_size", get_stats_size },
|
{ "xmod_get_stats_size", get_stats_size },
|
||||||
|
|
||||||
|
{ "get_map_objectives", get_map_objectives },
|
||||||
|
|
||||||
//***************************************
|
//***************************************
|
||||||
//{ "get_weaponname", get_wpnname },
|
//{ "get_weaponname", get_wpnname },
|
||||||
|
|
||||||
|
@ -66,3 +66,19 @@ native xmod_get_maxweapons();
|
|||||||
native xmod_get_stats_size();
|
native xmod_get_stats_size();
|
||||||
|
|
||||||
/************* Shared Natives End ********************************/
|
/************* Shared Natives End ********************************/
|
||||||
|
|
||||||
|
enum MapObjective
|
||||||
|
{
|
||||||
|
MapObjective_Bomb = (1<<0),
|
||||||
|
MapObjective_Hostage = (1<<1),
|
||||||
|
MapObjective_Vip = (1<<2),
|
||||||
|
MapObjective_Escape = (1<<3),
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets current map objectives.
|
||||||
|
*
|
||||||
|
* @return Returns a bits sum if objectives are found, otherwise 0.
|
||||||
|
* See MapObjective_* constants.
|
||||||
|
*/
|
||||||
|
native MapObjective:get_map_objectives();
|
||||||
|
Loading…
Reference in New Issue
Block a user