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

CSDM all as Enemys


Post New Thread Reply   
 
Thread Tools Display Modes
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 06-23-2010 , 15:34   Re: CSDM all as Enemys
Reply With Quote #11

How about Steam only? As we know from other topics that you have dproto..

@ Ark:

I told it cause of this? Did I say something wrong?

Quote:
mp_playerid 0 0 2 integer server Toggles what information players see in the status bar
0 everyone: players see all names listed in the status bar (with appropriate
team colors)
1 team only: players only see names for their teammates and hostages in the
status bar
2 off: players do not see any names in the status bar (hostages included)
source:
http://scripting.elxdraco.net/cvarlist/
KadiR is offline
dj_freeze
Veteran Member
Join Date: Dec 2009
Location: Looking for you!
Old 06-23-2010 , 15:35   Re: CSDM all as Enemys
Reply With Quote #12

Quote:
Originally Posted by KadiR View Post
How about Steam only? As we know from other topics that you have dproto..

@ Ark:

I told it cause of this? Did I say something wrong?



source:
http://scripting.elxdraco.net/cvarlist/
I don't have dproto or whatever this is.


okey. Ive updated it again and it worked. But there is one problem!

Even when ffa is off my teammate has enemies model.

I need the plugin to work only when i turn ffa on.

Can you fix it?
__________________

Last edited by dj_freeze; 06-23-2010 at 15:38.
dj_freeze is offline
Send a message via Skype™ to dj_freeze
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-23-2010 , 15:37   Re: CSDM all as Enemys
Reply With Quote #13

Yes, KadiR. Now, review what does the plugin and try to understand why mp_playerid is used.
__________________
Arkshine is offline
dj_freeze
Veteran Member
Join Date: Dec 2009
Location: Looking for you!
Old 06-23-2010 , 15:44   Re: CSDM all as Enemys
Reply With Quote #14

Quote:
Originally Posted by Arkshine View Post
Yes, KadiR. Now, review what does the plugin and try to understand why mp_playerid is used.
When i connect to my server i see everyone as enemies. I need this only to be activated if FFA is ON.
__________________
dj_freeze is offline
Send a message via Skype™ to dj_freeze
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 06-23-2010 , 15:45   Re: CSDM all as Enemys
Reply With Quote #15

Quote:
Originally Posted by Arkshine View Post
Yes, KadiR. Now, review what does the plugin and try to understand why mp_playerid is used.
It does execute the command / cvar mp_playerid if a client is dis/connecting. How can it be useful if it is a server cvar?

We're going off-topic I think.
KadiR is offline
dj_freeze
Veteran Member
Join Date: Dec 2009
Location: Looking for you!
Old 06-23-2010 , 16:09   Re: CSDM all as Enemys
Reply With Quote #16

Any ideas how to hook this plugin with csdm_ffa ?
__________________
dj_freeze is offline
Send a message via Skype™ to dj_freeze
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-23-2010 , 17:39   Re: CSDM all as Enemys
Reply With Quote #17

Quote:
Originally Posted by dj_freeze View Post
Even when ffa is off my teammate has enemies model.
PHP Code:
#include <amxmodx> 
#include <fakemeta> 
#include <engine> 
#include <cstrike> 
#include < csdm >

enum EntityPart 

    
Body
    
Weapon 


new 
EntitiesOwner 
new g_bEnabled;

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
    



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
    
    
server_cmd("mp_playerid 2");
    
server_exec( );


public 
csdm_StateChangeiState ) {
    
g_bEnabled bool:( iState == CSDM_FFA_ENABLE );
}

public 
PrecacheModel(model[]) 

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


public 
plugin_init() 

    
register_plugin("CSDM All as Enemy""0.1""joaquimandrade"); 
    
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(
g_bEnabled && !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(
g_bEnabled && !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
    } 

__________________

Last edited by xPaw; 06-24-2010 at 15:53.
xPaw is offline
dj_freeze
Veteran Member
Join Date: Dec 2009
Location: Looking for you!
Old 06-24-2010 , 05:00   Re: CSDM all as Enemys
Reply With Quote #18

Quote:
/home/groups/amxmodx/tmp3/phpeR4rYw.sma(5) : fatal error 100: cannot read from file: "csdm"
I can't compile it


Quote:
Originally Posted by xPaw View Post
PHP Code:
#include <amxmodx> 
#include <fakemeta> 
#include <engine> 
#include <cstrike> 
#include < csdm >

enum EntityPart 

    
Body
    
Weapon 


new 
EntitiesOwner 
new g_bEnabled;

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
    



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
    
    
server_cmd(id,"mp_playerid 2");
    
server_exec( );


public 
csdm_StateChangeiState ) {
    
g_bEnabled bool:( iState == CSDM_FFA_ENABLE );
}

public 
PrecacheModel(model[]) 

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


public 
plugin_init() 

    
register_plugin("CSDM All as Enemy""0.1""joaquimandrade"); 
    
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(
g_bEnabled && !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(
g_bEnabled && !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
    } 

I need this plugin to work like this:
When i enabla FFA, only then, players must see each other as enemies.
__________________
dj_freeze is offline
Send a message via Skype™ to dj_freeze
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-24-2010 , 05:31   Re: CSDM all as Enemys
Reply With Quote #19

compile locally with csdm.inc
__________________
xPaw is offline
dj_freeze
Veteran Member
Join Date: Dec 2009
Location: Looking for you!
Old 06-24-2010 , 07:11  
Reply With Quote #20

Still not compiling I have csdm.inc in the include folder right? It's giving me a whole bunch of errors.

Sry for double posting but can you post the amxx file?
__________________

Last edited by YamiKaitou; 06-24-2010 at 09:40.
dj_freeze is offline
Send a message via Skype™ to dj_freeze
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 07:58.


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