AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to hide door only for a player (https://forums.alliedmods.net/showthread.php?t=341914)

OneHites100 02-21-2023 10:31

How to hide door only for a player
 
How i can hide entity only for a player ?

JusTGo 02-21-2023 13:55

Re: How to hide door only for a player
 
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;



OneHites100 02-28-2023 12:03

Re: How to hide door only for a player
 
Quote:

Originally Posted by JusTGo (Post 2799985)
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

rantab 03-03-2023 02:03

Re: How to hide door only for a player
 
Wildlife photography is mostly about capturing and documenting different forms of life in natural habitats. A career in the best wildlife camera is equally challenging and requires commitment. best camera for wildlife


All times are GMT -4. The time now is 23:24.

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