Raised This Month: $ Target: $400
 0% 

get_user_buttom


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-24-2011 , 20:32   Re: get_user_buttom
Reply With Quote #1

Sorry about that, I must have misread the OP and I coded it in the opposite scenario. I fixed the above code.
__________________
Bugsy is offline
2reason2kill
Senior Member
Join Date: Feb 2011
Old 07-25-2011 , 03:54   Re: get_user_buttom
Reply With Quote #2

Quote:
Originally Posted by Bugsy View Post
Sorry about that, I must have misread the OP and I coded it in the opposite scenario. I fixed the above code.
Can i do So If im a T I se My teammates X and Ct See them Like y?

Last edited by 2reason2kill; 07-25-2011 at 06:11.
2reason2kill is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-25-2011 , 10:10   Re: get_user_buttom
Reply With Quote #3

Look here: FFA Models
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
2reason2kill
Senior Member
Join Date: Feb 2011
Old 07-25-2011 , 16:53   Re: get_user_buttom
Reply With Quote #4

Quote:
Originally Posted by Exolent[jNr] View Post
Look here: FFA Models
What Im Trying to do Is T's In invisble and ct's is Visble.

im trying to do So T's Can See Each other normal but cT Dosent See them.

Do i need this code then?


PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <cstrike>

enum EntityPart
{
    
Body,
    
Weapon
}

new 
EntitiesOwner

new CsInternalModel:InternalModelChangeTable[CsInternalModel] = 
{
    
_:CS_DONTCHANGE
    
_:CS_T_ARCTIC,//CS_CT_URBAN
    
_:CS_CT_GSG9,//CS_T_TERROR
    
_:CS_CT_GIGN,//CS_T_LEET
    
_:CS_CT_URBAN,//CS_T_ARCTIC
    
_:CS_T_TERROR,//CS_CT_GSG9
    
_:CS_T_LEET,//CS_CT_GIGN
    
_:CS_T_GUERILLA,//CS_CT_SAS
    
_:CS_CT_SAS,//CS_T_GUERILLA
    
_:CS_CT_VIP
    
_:CZ_CT_SPETSNAZ,//CZ_T_MILITIA
    
_:CZ_T_MILITIA,//CZ_CT_SPETSNAZ
}

new 
CsTeams:InternalModelChangeTableTeam[CsInternalModel] = 
{
    
_:CS_TEAM_UNASSIGNED
    
_:CS_TEAM_CT,//CS_CT_URBAN
    
_:CS_TEAM_T,//CS_T_TERROR
    
_:CS_TEAM_T,//CS_T_LEET
    
_:CS_TEAM_T,//CS_T_ARCTIC
    
_:CS_TEAM_CT,//CS_CT_GSG9
    
_:CS_TEAM_CT,//CS_CT_GIGN
    
_:CS_TEAM_CT,//CS_CT_SAS
    
_:CS_TEAM_T,//CS_T_GUERILLA
    
_:CS_TEAM_CT
    
_:CS_TEAM_T,//CZ_T_MILITIA
    
_:CS_TEAM_CT,//CZ_CT_SPETSNAZ
}

new 
CsInternalModel:TeamsDefaultInternalModel[CsTeams] =
{
    
0,
    
_:CS_T_GUERILLA,
    
_:CS_CT_SAS,
    
0
}

new 
InternalModelModels[CsInternalModel][] = 
{
    
"",
    
"urban",
    
"terror",
    
"leet",
    
"arctic",
    
"gsg9",
    
"gign",
    
"sas",
    
"guerilla",
    
"vip",
    
"militia",
    
"spetsnaz"
}

new 
InternalModelModelIDs[CsInternalModel

const 
OffsetInternalModel 126

new Trie:ModelToCsInternalModel

new CsTeams:TeamsSum CS_TEAM_T CS_TEAM_CT

public plugin_precache()
{
    
ModelToCsInternalModel TrieCreate()
    
    new 
model[50]
    
    for(new 
CsInternalModel:CS_CT_URBAN;i<CsInternalModel;i++)
    {
        
format(model,charsmax(model),"models/player/%s/%s.mdl",InternalModelModels[i],InternalModelModels[i])
        
        
TrieSetCell(ModelToCsInternalModel,model,i)
    }
    
    
register_forward(FM_PrecacheModel,"PrecacheModel",1)
}

public 
PrecacheModel(model[])
{
    static 
CsInternalModel:internalModel 
    
    
if(TrieGetCell(ModelToCsInternalModel,model,internalModel))
    {
        
InternalModelModelIDs[internalModel] = get_orig_retval()
    }
}

public 
plugin_init()
{
    
register_forward(FM_AddToFullPack,"AddToFullPackPre",0);
    
register_forward(FM_AddToFullPack,"AddToFullPackPost",1);
    
    
set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET)
}

public 
plugin_cfg()
{
    
EntitiesOwner create_entity("info_target")
    
    for(new 
EntityPart:i=Body;i<EntityPart;i++)
    {
        for(new 
j=1;j<=get_maxplayers();j++)
        {
            new 
ent create_entity("info_target")
            
            
set_pev(ent,pev_owner,EntitiesOwner)
            
set_pev(ent,pev_aiment,j)
            
set_pev(ent,pev_movetype,MOVETYPE_FOLLOW)
            
set_pev(ent,pev_solid,SOLID_NOT)
            
            
entity_set_model(ent,"models/player/leet/leet.mdl");
                                
            
set_pev(ent,pev_iuser1,_:i)
        }
    }
}

public 
AddToFullPackPre(es,e,ent,host,hostflags,player,pSet)
{
    if(!
player)
    {
        if(
is_valid_ent(ent) && (pev(ent,pev_owner) == EntitiesOwner))
        {
            new 
aiment pev(ent,pev_aiment)
            
            if((
aiment == host) || !is_user_connected(aiment) || (pev(aiment,pev_effects) & EF_NODRAW) || (cs_get_user_team(host) != cs_get_user_team(aiment)) )
            {
                
forward_return(FMV_CELL,0)
                return 
FMRES_SUPERCEDE
            
}
        }
    }
    
    return 
FMRES_IGNORED
}
public 
AddToFullPackPost(es,e,ent,host,hostflags,player,pSet)
{
    if(!
player && get_orig_retval())
    {
        if(
is_valid_ent(ent) && (pev(ent,pev_owner) == EntitiesOwner))
        {
            new 
aiment pev(ent,pev_aiment)
            
            if(
pev(ent,pev_iuser1) == _:Weapon)
            {
                static 
weaponModel[50]
                
pev(aiment,pev_weaponmodel2,weaponModel,charsmax(weaponModel))
            
                if(
weaponModel[0])
                {
                    
set_es(es,ES_ModelIndex,engfunc(EngFunc_ModelIndex,weaponModel))
                    
set_es(es,ES_Sequence,pev(aiment,pev_weaponanim))
                }
                else
                {
                    
set_es(es,ES_Effects,EF_NODRAW)
                }        
            }
            else
            {
                new 
CsTeams:wantedTeam TeamsSum cs_get_user_team(host)
                
                new 
CsInternalModel:internalModel CsInternalModel:get_pdata_int(aiment,OffsetInternalModel)
                
                if(
internalModel)
                {
                    
internalModel InternalModelChangeTable[internalModel]
                    
                    if(
InternalModelChangeTableTeam[internalModel] != wantedTeam)
                    {
                        
internalModel TeamsDefaultInternalModel[wantedTeam]
                    }
                }
                else
                {
                    
internalModel TeamsDefaultInternalModel[wantedTeam]
                }
                
                
set_es(es,ES_ModelIndex,InternalModelModelIDs[internalModel])
            }
        }
    }
    else if(
is_user_connected(ent) && (ent != host) && (cs_get_user_team(host) == cs_get_user_team(ent)))
    {
        
set_es(es,ES_RenderMode,kRenderTransAlpha)
        
set_es(es,ES_RenderAmt,0)
    }

2reason2kill is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-25-2011 , 16:56   Re: get_user_buttom
Reply With Quote #5

You don't know at all what you're doing.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
2reason2kill
Senior Member
Join Date: Feb 2011
Old 07-25-2011 , 17:01   Re: get_user_buttom
Reply With Quote #6

Quote:
Originally Posted by bibu View Post
You don't know at all what you're doing.
Yeah, That's Why Im Asking
2reason2kill is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-25-2011 , 17:20   Re: get_user_buttom
Reply With Quote #7

If you need help scripting, you post questions here. If you want someone to make an entire plugin to your specifications, you should post in suggestions/requests.

Posting a large chunk of code and asking whether or not you need it indicates you do not know much about scripting. I'm not trying to be mean but it is what it is.

I understand everyone starts somewhere but you need to put time into reading existing code and function descriptions to learn scripting.
__________________

Last edited by Bugsy; 07-25-2011 at 17:22.
Bugsy is offline
2reason2kill
Senior Member
Join Date: Feb 2011
Old 07-25-2011 , 17:21   Re: get_user_buttom
Reply With Quote #8

Quote:
Originally Posted by Bugsy View Post
If you need help scripting, you post questions here. If you want someone to make an entire plugin to your specifications, you should post in suggestions/requests.

Posting a large chunk of code and asking whether or not you need it indicates you do not know much about scripting. I'm not trying to be mean but it is what it is.
Okay.

Thank You For Your Help.
2reason2kill is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 07-25-2011 , 17:41   Re: get_user_buttom
Reply With Quote #9

T's invisible to ct's but visible to teammates

PHP Code:
#pragma semicolon 1

#include <amxmodx>
#include <fakemeta>

new g_invisAmount;

public 
plugin_init()
{
    
register_plugin("T's Invisible""0.0.1""SavSin");
    
    
register_forward(FM_AddToFullPack"fwdAddToFullPack"1);

    
g_invisAmount register_cvar("ti_renderAmount""0");

}

public 
fwdAddToFullPack(es_handleeenthosthostflagsplayerpSet)
{
    if(!
player)
        return 
FMRES_IGNORED;
        
    if(
get_user_team(ent) == && get_user_team(host) == 2)
    {
        
set_es(es_handleES_RenderModekRenderTransAlpha);
        
set_es(es_handleES_RenderAmtget_pcvar_num(g_invisAmount);
    }

    return 
FMRES_IGNORED;

Doc-Holiday 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 01:08.


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