mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 18:38:26 +00:00
add Shavit_GetZoneTrack, Shavit_GetZoneType, and Shavit_GetZoneID
This commit is contained in:
parent
e8e8f71657
commit
baa824e872
@ -206,6 +206,30 @@ native int Shavit_GetHighestStage(int track);
|
||||
*/
|
||||
native int Shavit_GetClientLastStage(int client);
|
||||
|
||||
/**
|
||||
* Returns the zone index for the entity if available.
|
||||
*
|
||||
* @param entity Client index.
|
||||
* @return -1 if not a zone entity. >=0 for a zone index.
|
||||
*/
|
||||
native int Shavit_GetZoneID(int entity);
|
||||
|
||||
/**
|
||||
* Returns the zone track.
|
||||
*
|
||||
* @param zoneid Zone index.
|
||||
* @return Zone track.
|
||||
*/
|
||||
native int Shavit_GetZoneTrack(int zoneid);
|
||||
|
||||
/**
|
||||
* Returns the zone type.
|
||||
*
|
||||
* @param zoneid Zone index.
|
||||
* @return Zone type.
|
||||
*/
|
||||
native int Shavit_GetZoneType(int zoneid);
|
||||
|
||||
/**
|
||||
* Retrieve the WR's stage time.
|
||||
*
|
||||
@ -283,5 +307,8 @@ public void __pl_shavit_zones_SetNTVOptional()
|
||||
MarkNativeAsOptional("Shavit_SetStart");
|
||||
MarkNativeAsOptional("Shavit_DeleteSetStart");
|
||||
MarkNativeAsOptional("Shavit_GetClientLastStage");
|
||||
MarkNativeAsOptional("Shavit_GetZoneTrack");
|
||||
MarkNativeAsOptional("Shavit_GetZoneType");
|
||||
MarkNativeAsOptional("Shavit_GetZoneID");
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -207,6 +207,9 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
|
||||
CreateNative("Shavit_SetStart", Native_SetStart);
|
||||
CreateNative("Shavit_DeleteSetStart", Native_DeleteSetStart);
|
||||
CreateNative("Shavit_GetClientLastStage", Native_GetClientLastStage);
|
||||
CreateNative("Shavit_GetZoneTrack", Native_GetZoneTrack);
|
||||
CreateNative("Shavit_GetZoneType", Native_GetZoneType);
|
||||
CreateNative("Shavit_GetZoneID", Native_GetZoneID);
|
||||
|
||||
// registers library, check "bool LibraryExists(const char[] name)" in order to use with other plugins
|
||||
RegPluginLibrary("shavit-zones");
|
||||
@ -663,6 +666,24 @@ public int Native_GetClientLastStage(Handle plugin, int numParams)
|
||||
return gI_LastStage[GetNativeCell(1)];
|
||||
}
|
||||
|
||||
public any Native_GetZoneTrack(Handle plugin, int numParams)
|
||||
{
|
||||
int zoneid = GetNativeCell(1);
|
||||
return gA_ZoneCache[zoneid].iZoneTrack;
|
||||
}
|
||||
|
||||
public any Native_GetZoneType(Handle plugin, int numParams)
|
||||
{
|
||||
int zoneid = GetNativeCell(1);
|
||||
return gA_ZoneCache[zoneid].iZoneType;
|
||||
}
|
||||
|
||||
public any Native_GetZoneID(Handle plugin, int numParams)
|
||||
{
|
||||
int entity = GetNativeCell(1);
|
||||
return gI_EntityZone[entity] > -1;
|
||||
}
|
||||
|
||||
bool JumpToZoneType(KeyValues kv, int type, int track)
|
||||
{
|
||||
static const char config_keys[ZONETYPES_SIZE][2][50] = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user