Raised This Month: $ Target: $400
 0% 

How to hide door only for a player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JusTGo
Veteran Member
Join Date: Mar 2013
Old 02-21-2023 , 13:55   Re: How to hide door only for a player
Reply With Quote #1

This plugin hides doors for admins, you can edit to choose the players to hide the entity for

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

public plugin_init() {
    
register_plugin("Admin hide doors""0.0.1""JustGo")

    
register_forward(FM_AddToFullPack"AddToFullPack_Post"1)
}

public 
AddToFullPack_Post(es_handle,e,ent,host,hostflags,player,pSet)
{
    if(
player) return FMRES_IGNORED

    
if(!is_user_alive(host)) return FMRES_IGNORED

    
if(!is_user_admin(host)) return FMRES_IGNORED

    
if(!isDoor(ent)) return FMRES_IGNORED

    set_es
es_handleES_EffectsEF_NODRAW );

    return 
FMRES_IGNORED
}

stock bool:isDoor(ent) {
    if(!
pev_valid(ent)) return false;

    static 
szClassName[32]; 
    
    
pev(entpev_classnameszClassNamecharsmax(szClassName));

    if(!
equal(szClassName"func_door")) return false;

    return 
true;

__________________
JusTGo is offline
OneHites100
New Member
Join Date: Feb 2023
Old 02-28-2023 , 12:03   Re: How to hide door only for a player
Reply With Quote #2

Quote:
Originally Posted by JusTGo View Post
This plugin hides doors for admins, you can edit to choose the players to hide the entity for

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

public plugin_init() {
    
register_plugin("Admin hide doors""0.0.1""JustGo")

    
register_forward(FM_AddToFullPack"AddToFullPack_Post"1)
}

public 
AddToFullPack_Post(es_handle,e,ent,host,hostflags,player,pSet)
{
    if(
player) return FMRES_IGNORED

    
if(!is_user_alive(host)) return FMRES_IGNORED

    
if(!is_user_admin(host)) return FMRES_IGNORED

    
if(!isDoor(ent)) return FMRES_IGNORED

    set_es
es_handleES_EffectsEF_NODRAW );

    return 
FMRES_IGNORED
}

stock bool:isDoor(ent) {
    if(!
pev_valid(ent)) return false;

    static 
szClassName[32]; 
    
    
pev(entpev_classnameszClassNamecharsmax(szClassName));

    if(!
equal(szClassName"func_door")) return false;

    return 
true;


Thanks, i will test it
OneHites100 is offline
Reply


Thread Tools
Display Modes

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 23:24.


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