Hello! I use this plugin but doesn't work on all maps.
It works on few maps.. someone know a fix ? Thank you!
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <smlib>
#include <cstrike>
#define PREFIX "\x04[Jailbreak]\x01"
new bool:gB_CellsAreOpen;
new String:gS_Currentmap[32];
public OnMapStart()
{
GetCurrentMap(gS_Currentmap, 32);
}
public Action:Command_Open(client, args)
{
if(!client)
{
return Plugin_Handled;
}
if(!IsPlayerAlive(client) && !CheckCommandAccess(client, "cell_open", ADMFLAG_GENERIC))
{
ReplyToCommand(client, "%s You can't open the cells when you're dead.", PREFIX);
return Plugin_Handled;
}
if(GetClientTeam(client) != CS_TEAM_CT && !CheckCommandAccess(client, "cell_open", ADMFLAG_GENERIC))
{
ReplyToCommand(client, "%s You are not allowed to perform this command since you're not a prison guard or an admin.", PREFIX);
return Plugin_Handled;
}
if(gB_CellsAreOpen)
{
ReplyToCommand(client, "%s Well, it looks like the cells are already open.", PREFIX);
return Plugin_Handled;
}
new bool:Success;
static gI_Entity;
gI_Entity = -1;
while((gI_Entity = Entity_FindByClassName(gI_Entity, "func_door")) != INVALID_ENT_REFERENCE)
{
new String:name[32];
Entity_GetName(gI_Entity, name, 32);
if(StrContains(name, "cell", false) != -1 || StrContains(name, "cage", false) != -1 || StrContains(name, "prison", false) != -1 || StrContains(name, "open", false) != -1 || StrContains(name, "taim", false) != -1 || StrContains(name, "jaildoor", false) != -1 || StrEqual(name, "c1", false))
{
AcceptEntityInput(gI_Entity, "Open");
Success = true;
}
}
gI_Entity = -1;
while((gI_Entity = Entity_FindByClassName(gI_Entity, "func_button")) != INVALID_ENT_REFERENCE)
{
new String:name[32];
Entity_GetName(gI_Entity, name, 32);
if(StrEqual(gS_Currentmap, "jb_vipinthemix_v1_2", false))
{
if(Entity_GetHammerId(gI_Entity) == 40045)
{
AcceptEntityInput(gI_Entity, "Use");
Success = true;
}
}
else if(StrContains(name, "cell", false) != -1 || StrContains(name, "cage", false) != -1 || StrContains(name, "prison", false) != -1 || StrContains(name, "open", false) != -1 || StrContains(name, "taim", false) != -1 || StrContains(name, "jaildoor", false) != -1)
{
AcceptEntityInput(gI_Entity, "Use");
Success = true;
}
}
gB_CellsAreOpen = Success;
if(Success)
{
ReplyToCommand(client, "%s You have opened the cells.", PREFIX);
PrintToChatAll("%s \x074A4A4A%N\x01 has opened the cells!", PREFIX, client);
}
else
{
ReplyToCommand(client, "%s Welp, it looks like this map is not supported. Report to \x074A4A4Athe server owner\x01.", PREFIX);
}
return Plugin_Handled;
}