AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with pev_groupinfo (https://forums.alliedmods.net/showthread.php?t=253474)

pacheco 12-22-2014 20:28

Help with pev_groupinfo
 
I'm trying to make one entity SOLID_NOT for CT and SOLID for TR. I read here about pev_groupinfo and tried it. It works, but have one problem: i can pass not only in the ent, but through the enemies too. It's like a semiclip plugin... i don't want that. How to put it only for entity?

Here is the code pev_groupinfo:

In entity part:
PHP Code:

set_pev(entpev_groupinfo1);
set_pev(idpev_groupinfo0); 

Team changes.. (zp)
PHP Code:

// TR
public zp_user_infected_post(id)
{
    
set_pev(idpev_groupinfo1); // same group
}

// CT
public zp_user_humanized_post(id)
{
    
set_pev(idpev_groupinfo0); // different group



bibu 12-22-2014 20:57

Re: Help with pev_groupinfo
 
Instead of changing players groupinfo, change the entities.

wicho 12-24-2014 11:22

Re: Help with pev_groupinfo
 
I have the same question..

pacheco 12-25-2014 17:52

Re: Help with pev_groupinfo
 
Quote:

Originally Posted by bibu (Post 2238726)
Instead of changing players groupinfo, change the entities.

I tried and it doesn't work well. Sometimes CT and TR have it.

Ent's part (CT id):
Code:

set_pev(ent, pev_groupinfo, pev(ent, pev_groupinfo) | id);
CT/TR part:
TR:
Code:

set_pev(ent, pev_groupinfo, pev(ent, pev_groupinfo) & ~id)
CT:
Code:

set_pev(ent, pev_groupinfo, pev(ent, pev_groupinfo) | id);
Is it correct?

bibu 12-26-2014 10:18

Re: Help with pev_groupinfo
 
Show your full code if you really need help.

pacheco 12-27-2014 14:39

Re: Help with pev_groupinfo
 
Quote:

Originally Posted by bibu (Post 2240233)
Show your full code if you really need help.

PHP Code:

#include <amxmodx> 
#include <amxmisc> 
#include <fakemeta> 
#include <zombieplague>

#define PLUGIN    "Solid y NO Solid" 
#define AUTHOR    "Gonza.-*" 
#define VERSION    "1.0" 

new g_ent = -

#define g_model "models/box.mdl"

public plugin_precache() precache_model(g_model

public 
plugin_init() 

    
register_plugin(PLUGINVERSIONAUTHOR
    
    
register_clcmd("test""test"
    
register_clcmd("test2""test2"


public 
test2(id

    
set_pev(g_entpev_groupinfopev(g_entpev_groupinfo) & ~id


public 
test(id

    
g_ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")) 
    
    if (!
pev_valid(g_ent)) return 
    
    
set_pev(g_entpev_classname"BM_Block"
    
set_pev(g_entpev_solidSOLID_BBOX
    
    
engfunc(EngFunc_SetModelg_entg_model
    
engfunc(EngFunc_SetSizeg_entFloat:{-32.0, -32.0, -4.0}, Float:{ 32.032.04.0 }) 
    
    new 
Float:fOrigin[3]; pev(idpev_originfOrigin
    
fOrigin[1] -= 60.0 
    
    engfunc
(EngFunc_SetOriging_entfOrigin
    
    
set_pev(g_entpev_groupinfopev(g_entpev_groupinfo) | id
    
    
engfunc(EngFunc_DropToFloor,g_ent)


// TR
public zp_user_infected_post(id)
{
    
set_pev(g_entpev_groupinfopev(g_entpev_groupinfo) & ~id)
    
//client_print(0, print_chat, "called infected")
}

// CT
public zp_user_humanized_post(id)
{
    
set_pev(g_entpev_groupinfopev(g_entpev_groupinfo) | id);
    
//client_print(0, print_chat, "called humanized")



bibu 12-27-2014 15:38

Re: Help with pev_groupinfo
 
Works fine, credit for connor:

PHP Code:

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

#define PLUGIN    "Solid y NO Solid" 
#define AUTHOR    "Gonza.-*" 
#define VERSION    "1.0" 

new g_ent = -

#define g_model "models/dust_brick.mdl"

enum groups ( <<= )
{
    
GROUP_NONE,
    
GROUP_T 1,
    
GROUP_CT
}

public 
plugin_precache() precache_model(g_model

public 
plugin_init() 

    
register_plugin(PLUGINVERSIONAUTHOR
    
RegisterHam(Ham_Spawn"player""OnCBasePlayer_Spawn_Post"true);
    
register_clcmd("test""test"
    
register_clcmd("test2""test2"
    
register_clcmd("test3""test3"


public 
OnCBasePlayer_Spawn_Post(id)
{
    if( 
is_user_alive(id) )
    {
        
set_pev(idpev_groupinfoGROUP_T GROUP_CT);
    }
}  

public 
test2(id

    
set_pev(idpev_groupinfoGROUP_T


public 
test3(id

    
set_pev(idpev_groupinfoGROUP_CT


public 
test(id

    
g_ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")) 
    
    if (!
pev_valid(g_ent)) return 
    
    
set_pev(g_entpev_classname"BM_Block"
    
set_pev(g_entpev_solidSOLID_BBOX
    
    
engfunc(EngFunc_SetModelg_entg_model
    
engfunc(EngFunc_SetSizeg_entFloat:{-32.0, -32.0, -4.0}, Float:{ 32.032.04.0 }) 
    
    new 
Float:fOrigin[3]; pev(idpev_originfOrigin
    
fOrigin[1] -= 60.0 
    
    engfunc
(EngFunc_SetOriging_entfOrigin
    
    
set_pev(g_entpev_groupinfoGROUP_T);  
    
    
engfunc(EngFunc_DropToFloor,g_ent)



wicho 12-27-2014 20:58

Re: Help with pev_groupinfo
 
I try with the sandbags of zombie plague but dont work well, the humans can transfer but the zombies too and the owner of sandbags cant transfer them, why dont work well?

code:

PHP Code:

public place_palletwbags(OwnerEnt

     
    if( 
palletscout == get_pcvar_num(maxpallets) ) 
    { 
        
client_print(OwnerEntprint_chat,"[ZP] For security reasons only allow %d Sandbags on the server!",get_pcvar_num(maxpallets)); 
        return 
PLUGIN_HANDLED
    } 
     
    
// create a new entity  
    
new ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"func_wall")); 
             
    
// set a name to the entity 
    
set_pev(ent,pev_classname,"amxx_pallets"); 

    
entity_set_int(entEV_INT_iuser1OwnerEnt)
   
    
// set model         
    
engfunc(EngFunc_SetModel,ent,g_models[random(sizeof g_models)]); 
     
    
// register a new var. for origin 
    
static Float:xorigin[3]; 
    
get_user_hitpoint(OwnerEntxorigin); 
     
     
    
// check if user is aiming at the air  
    
if(engfunc(EngFunc_PointContents,xorigin) == CONTENTS_SKY
    {      
        
client_print(OwnerEntprint_chat,"[ZP] You can not put sandbags in the sky!");            
        return 
PLUGIN_HANDLED
    } 
     
     
    
// set sizes 
    
static Float:p_mins[3], Float:p_maxs[3]; 
    
p_mins PALLET_MINS
    
p_maxs PALLET_MAXS
    
engfunc(EngFunc_SetSizeentp_minsp_maxs); 
    
set_pev(entpev_minsp_mins); 
    
set_pev(entpev_maxsp_maxs ); 
    
set_pev(entpev_absminp_mins); 
    
set_pev(entpev_absmaxp_maxs ); 

     
    
// set the rock of origin where is user placed 
    
engfunc(EngFunc_SetOriginentxorigin); 
         
    
// make the rock solid 
    
set_pev(ent,pev_solid,SOLID_BBOX); // touch on edge, block 
     
    // set the movetype 
    
set_pev(ent,pev_movetype,MOVETYPE_FLY); // no gravity, but still collides with stuff 
     
    // now the damage stuff, to set to take it or no 
    // if you set the cvar "pallets_wbags_health" 0, you can't destroy a pallet with bags 
    // else, if you want to make it destroyable, just set the health > 0 and will be 
    // destroyable. 
    
new Float:p_cvar_health get_pcvar_float(phealth); 
    switch(
p_cvar_health
    { 
        case 
0.0 
        { 
            
set_pev(ent,pev_takedamage,DAMAGE_NO); 
        } 
         
        default : 
        { 
            
set_pev(ent,pev_health,p_cvar_health); 
            
set_pev(ent,pev_takedamage,DAMAGE_YES); 
        } 
    } 
     
             
    static 
Float:rvec[3]; 
    
pev(OwnerEntpev_v_anglervec); 
     
    
rvec[0] = 0.0
     
    
set_pev(entpev_anglesrvec); 
    
    
set_pev(entpev_groupinfoGROUP_T)
     
    
// drop entity to floor 
    
fm_drop_to_floor(ent); 
     
    
// num .. 
    
palletscout++; 
     
    return 
PLUGIN_HANDLED



pacheco 12-28-2014 13:23

Re: Help with pev_groupinfo
 
Quote:

Originally Posted by bibu (Post 2240750)
Works fine, credit for connor:

Thank you for answer, but didn't work. CT and TR can pass through entity. When I type "test3" in console, ent disappears (invisible) to me.

pacheco 04-02-2015 20:30

Re: Help with pev_groupinfo
 
Bump. I still don't know how to do it! Help here..?! :?:


All times are GMT -4. The time now is 15:42.

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