Raised This Month: $51 Target: $400
 12% 

Help with pev_groupinfo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pacheco
Senior Member
Join Date: Jul 2011
Old 12-22-2014 , 20:28   Help with pev_groupinfo
Reply With Quote #1

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

__________________




Last edited by pacheco; 12-22-2014 at 20:29.
pacheco is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 12-22-2014 , 20:57   Re: Help with pev_groupinfo
Reply With Quote #2

Instead of changing players groupinfo, change the entities.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 12-24-2014 , 11:22   Re: Help with pev_groupinfo
Reply With Quote #3

I have the same question..
wicho is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 12-25-2014 , 17:52   Re: Help with pev_groupinfo
Reply With Quote #4

Quote:
Originally Posted by bibu View Post
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?
__________________




Last edited by pacheco; 12-25-2014 at 17:54.
pacheco is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 12-26-2014 , 10:18   Re: Help with pev_groupinfo
Reply With Quote #5

Show your full code if you really need help.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 12-27-2014 , 14:39   Re: Help with pev_groupinfo
Reply With Quote #6

Quote:
Originally Posted by bibu View Post
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")

__________________



pacheco is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 12-27-2014 , 15:38   Re: Help with pev_groupinfo
Reply With Quote #7

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)

__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 12-27-2014 , 20:58   Re: Help with pev_groupinfo
Reply With Quote #8

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


Last edited by wicho; 12-27-2014 at 21:03.
wicho is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 12-28-2014 , 13:23   Re: Help with pev_groupinfo
Reply With Quote #9

Quote:
Originally Posted by bibu View Post
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 is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 04-02-2015 , 20:30   Re: Help with pev_groupinfo
Reply With Quote #10

Bump. I still don't know how to do it! Help here..?!
__________________



pacheco 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 08:22.


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