Raised This Month: $51 Target: $400
 12% 

CSGO Open doors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hadesownage
AlliedModders Donor
Join Date: Jun 2013
Location: Romania, Iași
Old 07-22-2015 , 23:32   CSGO Open doors
Reply With Quote #1

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_Currentmap32);   
}

public 
Action:Command_Open(clientargs)
{
    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_Entityname32);
        
        if(
StrContains(name"cell"false) != -|| StrContains(name"cage"false) != -|| StrContains(name"prison"false) != -|| StrContains(name"open"false) != -|| StrContains(name"taim"false) != -|| StrContains(name"jaildoor"false) != -|| 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_Entityname32);
        
        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) != -|| StrContains(name"cage"false) != -|| StrContains(name"prison"false) != -|| StrContains(name"open"false) != -|| StrContains(name"taim"false) != -|| 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!"PREFIXclient);
    }
    
    else
    {
        
ReplyToCommand(client"%s Welp, it looks like this map is not supported. Report to \x074A4A4Athe server owner\x01."PREFIX);
    }
    
    return 
Plugin_Handled;

hadesownage is offline
Send a message via Yahoo to hadesownage Send a message via Skype™ to hadesownage
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode