AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem w/ FM_AddToFullPack (https://forums.alliedmods.net/showthread.php?t=189475)

Spriite 07-07-2012 13:51

Problem w/ FM_AddToFullPack
 
I tried using this plugin, but the entity stays solid.

PHP Code:

/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fakemeta>
 
new bool:g_hasAccess[33];
 
public 
plugin_init() {
        
register_forward(FM_AddToFullPack"fw_AddToFullPack_post"1);
}
 
public 
client_putinserver(id)
        if(
get_user_flags(id)& ADMIN_IMMUNITY)
                
g_hasAccess[id] = true;
 
public 
fw_AddToFullPack_post(es_handleeenthosthflagsplayerset)
{
        if(!
player && pev_valid(ent) && g_hasAccess[host])
        {
                static 
szClass[20];
                
pev(entpev_classnameszClasscharsmax(szClass));
                if(
equal(szClass"some_ent"))
                        
set_es(es_handleES_SolidSOLID_NOT);
        }


What's wrong with my code?

Obs: sorry for my bad english.

WooMhotes 07-07-2012 21:23

Re: Problem w/ FM_AddToFullPack
 
PHP Code:

/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fakemeta>
 
new bool:g_hasAccess[33];
 
public 
plugin_init()
{
        
register_plugin"blabla""1.0""blabla" );
        
register_forward(FM_AddToFullPack"fw_AddToFullPack_post"1);
}
 
public 
client_putinserver(id)
{
        
g_hasAccess[id] = (get_user_flags(id)& ADMIN_IMMUNITY) ? true false ;
}

 
public 
fw_AddToFullPack_post(es_handleeenthosthflagsplayerset)
{
        if( 
g_hasAccess[host] && pev_valid(ent) )
        {
                static 
szClass[33];
                
pev(entpev_classnameszClasscharsmax(szClass));

                if( 
equal(szClass"some_ent") )
                {
                        
set_es(es_handleES_SolidSOLID_NOT);
                }
        }



Spriite 07-07-2012 21:31

Re: Problem w/ FM_AddToFullPack
 
Don't works...

ConnorMcLeod 07-08-2012 05:13

Re: Problem w/ FM_AddToFullPack
 
AddToFullPack is only for visual (hud and prediction), it can't change an entity from solid state to not solid state.

<VeCo> 07-08-2012 06:58

Re: Problem w/ FM_AddToFullPack
 
You could try to check touch and set the entity's owner (pev_owner) to the player that touches it if he has the needed access flag. That will make the entity solid for all other players, except for the owner. If another player tries to touch it, the entity will be solid. If that player has the access too - he will be the new owner and he will move trough it... But I'm not sure how good it will work if there are two or more players with that flag, touching the entity at the same time.


All times are GMT -4. The time now is 14:59.

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