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

Solved Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server ♰


Post New Thread Reply   
 
Thread Tools Display Modes
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 01-25-2022 , 16:15   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #41

Quote:
Originally Posted by Supremache View Post
Fixed:

Method: "Model Name" "Team" "Flag"
Ex: "owner_model" "1" "a"
0 = any team, 1 = T team, 2 = Ct team

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <amxmisc>

//Spicial thanks for OciXCrom

new const Version[ ] = "1.0.1";
new const 
g_szModelFile[ ] = "CustomModels.ini";

enum _:ModelData

    
Model_Name64 ],
    
Model_Team,
    
Model_Flag
}

new Array:
g_aModels
new eModelModelData ]

public 
plugin_init( ) 
{
    
register_plugin"Cs Models"Version"Supremache" );
    
RegisterHamHam_Spawn"player""CBasePlayer_Spawn")
    
    if( 
ArraySizeg_aModels ) )
    {
        
log_amx"Loaded %d models"ArraySizeg_aModels ) )
    }
}

public 
plugin_precache() 
{
    
g_aModels ArrayCreateModelData );
    
ReadFile( );
}
    
public 
CBasePlayer_Spawnid )
{
    if( 
is_user_aliveid ) )
    {
        for( new 
iFlags get_user_flagsid ), iTeam get_user_teamid ), iArraySizeg_aModels ); i++ )
        {
            
ArrayGetArrayg_aModelsieModel )
            
            if( ( !
eModelModel_Team ] || iTeam == eModelModel_Team ] ) && ( iFlags eModelModel_Flag ] == eModelModel_Flag ] ) ) //allow multi flags
            
{
                
cs_set_user_modelideModelModel_Name ] )
                break;
            }
            else 
cs_reset_user_modelid );
        }
    }
}

ReadFile( )
{
    new 
g_szFile128 ], g_szConfigs64 ];
    
get_configsdirg_szConfigscharsmaxg_szConfigs ) )
    
formatexg_szFilecharsmaxg_szFile ), "%s/%s"g_szConfigsg_szModelFile )
    
    new 
iFile fopeng_szFile"rt" );
    
    if( 
iFile )
    {
        new 
szData512 ], szModel64 ], szTeam32 ], szFlag32 ];
        
        while( 
fgetsiFileszDatacharsmaxszData ) ) )
        {    
            
trimszData );
            
            switch( 
szData] )
            {
                case 
EOS';',  '#''/':
                {
                    continue;
                }

                default:
                {
                    
szFlag] = ADMIN_ALL
                    szTeam
] = EOS
                    
                    parse 
szDataszModelcharsmaxszModel ), szTeamcharsmaxszTeam ), szFlagcharsmaxszFlag ) )
                    
                    
trimszModel ); trimszTeam ); trimszFlag );
                    
                    if( 
szModel] )
                    {
                        
precache_player_modelszModel )
                        
copyeModelModel_Name ], charsmaxeModelModel_Name ] ), szModel )
                    
                        
eModelModel_Team ] = clampstr_to_numszTeam ), 0)
                        
eModelModel_Flag ] = read_flagsszFlag )
                        
                        
ArrayPushArrayg_aModelseModel )
                    }
                }
            }
        }
        
fcloseiFile );
    }
    else
    {
        
formatg_szFilecharsmaxg_szFile ), "ERROR: ^"%s^" not found!"g_szFile )
        
set_fail_stateg_szFile )
    }


//by OciXCrom
precache_player_model(const szModel[], &id 0)
{
    new 
model[128]
    
formatex(modelcharsmax(model), "models/player/%s/%sT.mdl"szModelszModel)

    if(
file_exists(model))
    {
        
id precache_generic(model)
    }

    static const 
extension[] = "T.mdl"
    
#pragma unused extension

    
copy(model[strlen(model) - charsmax(extension)], charsmax(model), ".mdl")
    
    if(!
file_exists(model))
    {
        
log_amx"ERROR: model ^"%s^" not found!"model )
        return 
1// dont precache it if file doesn't exists
    
}
    
    return 
precache_generic(model)

I mean this code
I do not know why it works when I turn it off
amirwolf is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-25-2022 , 16:19   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #42

That makes 0 sense. The plugin is incapable of interacting with the chat or anything else except the player's model in any way.

This is the entire portion of the code that actually does something:

Code:
cs_set_user_model( id, eModel[ Model_Name ] ) else cs_reset_user_model( id );
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 01-25-2022 , 16:31   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #43

I have no idea
I disabled all plugins
The name changes but is not displayed in the chat
amirwolf is offline
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 01-25-2022 , 16:40   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #44

The problem is fixed when I delete the added models in the CustomModels.ini file
amirwolf is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 01-26-2022 , 03:18   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #45

huh !!! I don't think that happening from my plugin.
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Reply


Thread Tools
Display Modes

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:36.


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