Add has_map_ent_class native (bug 5814, r=Nextra)
Former-commit-id: bfa749105feb49cf9f9b3878dededa33ae7d699c
This commit is contained in:
parent
5557124f05
commit
7e11cb5cc1
|
@ -4623,6 +4623,16 @@ static cell AMX_NATIVE_CALL LookupLangKey(AMX *amx, cell *params)
|
|||
set_amxstring(amx,params[1],def,params[2]);
|
||||
return 1;
|
||||
};
|
||||
|
||||
// has_map_ent_class(const classname[])
|
||||
static cell AMX_NATIVE_CALL has_map_ent_class(AMX *amx, cell *params)
|
||||
{
|
||||
int len;
|
||||
char *name = get_amxstring(amx, params[1], 0, len);
|
||||
|
||||
return len && !FNullEnt(FIND_ENTITY_BY_STRING(NULL, "classname", name));
|
||||
};
|
||||
|
||||
static cell AMX_NATIVE_CALL is_rukia_a_hag(AMX *amx, cell *params)
|
||||
{
|
||||
return 1;
|
||||
|
@ -4728,6 +4738,7 @@ AMX_NATIVE_INFO amxmodx_Natives[] =
|
|||
{"get_xvar_float", get_xvar_num},
|
||||
{"get_xvar_id", get_xvar_id},
|
||||
{"get_xvar_num", get_xvar_num},
|
||||
{"has_map_ent_class", has_map_ent_class},
|
||||
{"int3", int3},
|
||||
{"is_amd64_server", is_amd64_server},
|
||||
{"is_dedicated_server", is_dedicated_server},
|
||||
|
|
|
@ -1084,5 +1084,16 @@ native admins_lookup(num, AdminProp:Property, Buffer[]="", BufferSize=0);
|
|||
* Clears the list of dynamically stored admins
|
||||
*/
|
||||
native admins_flush();
|
||||
|
||||
/**
|
||||
* Searches whether a map contains at least one entity with the provided class name.
|
||||
*
|
||||
* @param classname The entity classname to check.
|
||||
*
|
||||
* @return Returns true if an entity is found, otherwise false.
|
||||
*/
|
||||
native bool:has_map_ent_class(const classname[]);
|
||||
|
||||
|
||||
// Keep this always at the bottom of this file
|
||||
#include <message_stocks>
|
||||
|
|
Loading…
Reference in New Issue
Block a user