forked from UNLOZE/sm-plugins
added natives in mapchooser for knockback low pop plugin which now on low pop gives infintie ammo and high HP for doing difficult maps
This commit is contained in:
@@ -115,6 +115,7 @@ native int GetMapMinTime(const char[] map);
|
||||
native int GetMapMaxTime(const char[] map);
|
||||
native int GetMapMinPlayers(const char[] map);
|
||||
native int GetMapMaxPlayers(const char[] map);
|
||||
native int GetMapMinHoursAvg(const char[] map);
|
||||
|
||||
// 0 = Okay
|
||||
// >0 = Minutes till Okay
|
||||
|
||||
@@ -484,6 +484,7 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
|
||||
CreateNative("GetMapMaxTime", Native_GetMapMaxTime);
|
||||
CreateNative("GetMapMinPlayers", Native_GetMapMinPlayers);
|
||||
CreateNative("GetMapMaxPlayers", Native_GetMapMaxPlayers);
|
||||
CreateNative("GetMapMinHoursAvg", Native_GetMapMinHoursAvg);
|
||||
CreateNative("GetMapTimeRestriction", Native_GetMapTimeRestriction);
|
||||
CreateNative("GetMapPlayerRestriction", Native_GetMapPlayerRestriction);
|
||||
CreateNative("GetMapGroups", Native_GetMapGroups);
|
||||
@@ -2778,6 +2779,7 @@ public int Native_GetMapCooldown(Handle plugin, int numParams)
|
||||
return Cooldown;
|
||||
}
|
||||
|
||||
//GetMapCooldownTime
|
||||
public int Native_GetMapCooldownTime(Handle plugin, int numParams)
|
||||
{
|
||||
int len;
|
||||
@@ -2789,10 +2791,7 @@ public int Native_GetMapCooldownTime(Handle plugin, int numParams)
|
||||
char[] map = new char[len+1];
|
||||
GetNativeString(1, map, len+1);
|
||||
|
||||
int Cooldown = 0;
|
||||
g_TimeMapList.GetValue(map, Cooldown);
|
||||
|
||||
return Cooldown;
|
||||
return InternalGetMapCooldownTime2(map);
|
||||
}
|
||||
|
||||
public int Native_GetMapMinTime(Handle plugin, int numParams)
|
||||
@@ -2837,6 +2836,20 @@ public int Native_GetMapMinPlayers(Handle plugin, int numParams)
|
||||
return InternalGetMapMinPlayers(map);
|
||||
}
|
||||
|
||||
public int Native_GetMapMinHoursAvg(Handle plugin, int numParams)
|
||||
{
|
||||
int len;
|
||||
GetNativeStringLength(1, len);
|
||||
|
||||
if(len <= 0)
|
||||
return false;
|
||||
|
||||
char[] map = new char[len+1];
|
||||
GetNativeString(1, map, len+1);
|
||||
|
||||
return InternalGetMapMinHoursAvg(map);
|
||||
}
|
||||
|
||||
public int Native_GetMapMaxPlayers(Handle plugin, int numParams)
|
||||
{
|
||||
int len;
|
||||
@@ -3079,6 +3092,22 @@ stock int InternalGetMapCooldown(const char[] map)
|
||||
return Cooldown;
|
||||
}
|
||||
|
||||
stock int InternalGetMapCooldownTime2(const char[] map)
|
||||
{
|
||||
char time[16];
|
||||
int Cooldown = 0;
|
||||
if(g_Config && g_Config.JumpToKey(map))
|
||||
{
|
||||
g_Config.GetString("CooldownTime", time, sizeof(time), "");
|
||||
if(time[0])
|
||||
Cooldown = TimeStrToSeconds(time);
|
||||
|
||||
g_Config.Rewind();
|
||||
}
|
||||
|
||||
return Cooldown;
|
||||
}
|
||||
|
||||
stock int InternalGetMapCooldownTime(const char[] map)
|
||||
{
|
||||
char time[16];
|
||||
@@ -3136,6 +3165,17 @@ stock int InternalGetMapMinPlayers(const char[] map)
|
||||
return MinPlayers;
|
||||
}
|
||||
|
||||
stock int InternalGetMapMinHoursAvg(const char[] map)
|
||||
{
|
||||
int MinHoursAvg = 0;
|
||||
if(g_Config && g_Config.JumpToKey(map))
|
||||
{
|
||||
MinHoursAvg = g_Config.GetNum("MinHoursAvg", MinHoursAvg);
|
||||
g_Config.Rewind();
|
||||
}
|
||||
return MinHoursAvg;
|
||||
}
|
||||
|
||||
stock int InternalGetMapMaxPlayers(const char[] map)
|
||||
{
|
||||
int MaxPlayers = 0;
|
||||
|
||||
Reference in New Issue
Block a user