Raised This Month: $32 Target: $400
 8% 

[REQ] Lock doors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Joce93
Senior Member
Join Date: Feb 2016
Old 06-30-2016 , 13:25   [REQ] Lock doors
Reply With Quote #1

Hai

I'm searching a plugin who allow admin to lock all doors of the map. A simple command to return back "default lock" would be nice.

I have seen this one but it is the opposite:

https://forums.alliedmods.net/showthread.php?p=174613

Can someone help me ?

Thanks

Last edited by Joce93; 06-30-2016 at 13:28.
Joce93 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 06-30-2016 , 13:37   Re: [REQ] Lock doors
Reply With Quote #2

You want do block the amx_defaultlock ?
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 06-30-2016 at 13:39.
EFFx is offline
Joce93
Senior Member
Join Date: Feb 2016
Old 06-30-2016 , 13:52   Re: [REQ] Lock doors
Reply With Quote #3

Quote:
Originally Posted by EFFx View Post
You want do block the amx_defaultlock ?
I want a second command that allow me to unlock the doors that i just locked
Joce93 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 06-30-2016 , 14:33   Re: [REQ] Lock doors
Reply With Quote #4

I cant understand your english, you want do open the doors again?

Try removing this check:

PHP Code:
public unlock_doors(){
    if(!
g_IsUnlocked) {
        
switch_doors_state (1)
        
server_print ("Forcing doors to be opened without triggers...")
    }
    else 
server_print ("Doors has already been unlocked.")
    return 
PLUGIN_HANDLED

->

PHP Code:
public unlock_doors()
{
    
switch_doors_state (1)
    
server_print ("Forcing doors to be opened without triggers...")
    return 
PLUGIN_HANDLED

__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Joce93
Senior Member
Join Date: Feb 2016
Old 06-30-2016 , 14:44   Re: [REQ] Lock doors
Reply With Quote #5

Quote:
Originally Posted by EFFx View Post
I cant understand your english, you want do open the doors again?

Try removing this check:

PHP Code:
public unlock_doors(){
    if(!
g_IsUnlocked) {
        
switch_doors_state (1)
        
server_print ("Forcing doors to be opened without triggers...")
    }
    else 
server_print ("Doors has already been unlocked.")
    return 
PLUGIN_HANDLED

->

PHP Code:
public unlock_doors()
{
    
switch_doors_state (1)
    
server_print ("Forcing doors to be opened without triggers...")
    return 
PLUGIN_HANDLED


No, i want to block ALL doors. You speak portugese ?

Quero bloquear todas as portas e desbloquear quando eu quero. (i used google translation)
Joce93 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 06-30-2016 , 14:48   Re: [REQ] Lock doors
Reply With Quote #6

Então parça, ja tem isso não? o amx_defaultlock ele abre denovo, o autor falou isto.
Yes brother, already have that, right? amx_defaultlock open all doors again, the author has said that.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Joce93
Senior Member
Join Date: Feb 2016
Old 06-30-2016 , 15:10   Re: [REQ] Lock doors
Reply With Quote #7

I don't think we understand each other...
Joce93 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 06-30-2016 , 16:15   Re: [REQ] Lock doors
Reply With Quote #8

E desbloquear quando eu quero...
Voce quer bloquear o comando? Ou voce quer abrir as portas e depois fecha-las? Se for isso, o plugin ja tem este comando.

Explica mais.

"And unlock when i want"
Want you block the command? Ou you want open the doors and later close they? If is that, already have it in the plugin.

Explain more.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 06-30-2016 , 17:46   Re: [REQ] Lock doors
Reply With Quote #9

No need to bother with overcomplicated stuff

PHP Code:
/* Mod Template generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN    "Door Locker - Unlocker"
#define VERSION    "1.0"
#define AUTHOR    "Luces en babel"

/* Initialization */

new unlocked 1

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /closedoors""CloseDoors"ADMIN_KICK)
    
register_clcmd("say /opendoors""OpenDoors"ADMIN_KICK)

    
RegisterHam(Ham_Use"func_door""Open")
    
RegisterHam(Ham_Use"func_door_rotating""Open")
}

public 
Open(useduser)
{
    if(
unlocked)
        return 
HAM_IGNORED
    
else
    {
        
//This allows to block only player or button attempts to use
        //so triggers will still open normally
        //comment this portion of code if you want to completely lock them
        
new classname[32]
        
pev(user,pev_classnameclassnamesizeof(classname))
        if(!
equal("player"classname) && !equal("func_button"classname))
            return 
HAM_IGNORED
        
//end of portion of code
        
return HAM_SUPERCEDE
    
}
}

public 
CloseDoors()
{
    
client_print(0print_chat"Doors were locked by an admin!")
    
unlocked 0
}

public 
OpenDoors()
{
    
client_print(0print_chat"Doors were unlocked by an admin!")
    
unlocked 1

Untested. May not compile since I rushed through the code.

If playing on Sven Co-op 5, you need updated hamdata.
__________________

Last edited by gabuch2; 06-30-2016 at 21:04. Reason: I hope no one saw that
gabuch2 is offline
Joce93
Senior Member
Join Date: Feb 2016
Old 06-30-2016 , 18:56   Re: [REQ] Lock doors
Reply With Quote #10

Quote:
Originally Posted by Shattered Heart Lynx View Post
No need to bother with overcomplicated stuff

PHP Code:
/* Mod Template generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN    "Door Locker - Unlocker"
#define VERSION    "1.0"
#define AUTHOR    "Luces en babel"

/* Initialization */

new unlocked 1

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /closedoors""CloseDoors"ADMIN_KICK)
    
register_clcmd("say /opendoors""OpenDoors"ADMIN_KICK)
    
    
RegisterHam(Ham_Use"func_door""Open")
    
RegisterHam(Ham_Use"func_door_rotating""Open")
}

public 
Open(useduser)
{
    if(
unlocked)
        return 
HAM_IGNORED
    
else
    {
        
//This allows to block only player or button attempts to use
        //so triggers will still open normally
        //comment this condition if you want to completely lock them
        
if(!equal("player"pev(user,pev_classname)) && !equal("func_button"pev(user,pev_classname)))
            return 
HAM_IGNORED
        
return HAM_SUPERCEDE
    
}
}

public 
CloseDoors()
{
    
client_print(0print_chat"Doors were locked by an admin!")
    
unlocked 0
}

public 
OpenDoors()
{
    
client_print(0print_chat"Doors were unlocked by an admin!")
    
unlocked 1

Untested. May not compile since I rushed through the code.

If playing on Sven Co-op 5, you need updated hamdata.
Yes i'm playing on Sven Co-op 5. Compiling is not working :/
Joce93 is offline
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 16:22.


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