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

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
McTavish
Senior Member
Join Date: May 2021
Old 12-14-2021 , 07:18   Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server ♰
Reply With Quote #1

Hello , i hope you all good guys , i have 10 days searching for ze models to give / owner / staff / admin .... special models so finally i got it , so i will share it here.

Plugin :
give special skins for Owner / Co-owner / Sponser / Super-Admin / Head-Admin / Mini Admin / Admin / mini vip / Vip , with special Flags.

Author : Aditya Ambre - Developer & Owner - Xavier's Server ♰
-
Code:
// Xavier's Server † Auto-Admin Skin Models Plugin.
// Designed & Developed by, Aditya Ambre [a.k.a. Vladimir Dz].
// Created on 27 Aug 2020.
// Copyrights © 2020 ¦ All Rights Reserved.
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init() {
	
    register_plugin("XVSkins †", "5.0", "Vladimir Dz")
    
    register_event("ResetHUD", "resetModel", "b")
    
    return PLUGIN_CONTINUE
}

public plugin_precache() {
    
    // Server-Owner [Flags - "abcdefghijklmnopqrstu"] .
    precache_model("models/player/owner_ct/owner_ct.mdl")
    precache_model("models/player/owner_te/owner_te.mdl")

    // Co-Owner [Flags - "abcdefgjinopqrst"] .
    precache_model("models/player/co_owner_ct/co_owner_ct.mdl")
    precache_model("models/player/co_owner_te/co_owner_te.mdl")

    // Sponser [Flags - "abcdefjinopqrst"] .
    precache_model("models/player/sponser_ct/sponser_ct.mdl")
    precache_model("models/player/sponser_te/sponser_te.mdl")
    
    // Super-Admin [Flags - "abcdefjiopqrst"] .
    precache_model("models/player/super_admin_ct/super_admin_ct.mdl")
    precache_model("models/player/super_admin_te/super_admin_te.mdl")

    // Head-Admin [Flags - "bcdejipqrst"] .
    precache_model("models/player/super_admin_ct/super_admin_ct.mdl")
    precache_model("models/player/super_admin_te/super_admin_te.mdl")

    // Mini-Admin [Flags - "bceiqrst"] .
    precache_model("models/player/admin_ct/admin_ct.mdl")
    precache_model("models/player/admin_te/admin_te.mdl")
    
    // Admin [Flags - "beirst"] .
    precache_model("models/player/admin_ct/admin_ct.mdl")
    precache_model("models/player/admin_te/admin_te.mdl")

    // Mini-Vip [Flags - "bit"] .
    precache_model("models/player/vip_ct/vip_ct.mdl")
    precache_model("models/player/vip_te/vip_te.mdl")

    // Vip [Flags - "bt"] .
    precache_model("models/player/vip_ct/vip_ct.mdl")
    precache_model("models/player/vip_te/vip_te.mdl")
    
    return PLUGIN_CONTINUE
    
}

public resetModel(id, level, cid) 
{
    // Server-Owner.
    if( has_flag( id, "l" )) {
        new CsTeams:userTeam = cs_get_user_team(id)
        if (userTeam == CS_TEAM_CT) {
            cs_set_user_model(id, "owner_ct")
        }
        else if(userTeam == CS_TEAM_T) {
            cs_set_user_model(id, "owner_te")
        }
        else {
            cs_reset_user_model(id)
        }
    }

    // Co-Owner.
    else if( has_flag( id, "g" )) {
        new CsTeams:userTeam = cs_get_user_team(id)
        if (userTeam == CS_TEAM_CT) {
            cs_set_user_model(id, "co_owner_ct")
        }
        else if(userTeam == CS_TEAM_T) {
            cs_set_user_model(id, "co_owner_te")
        }
        else {
            cs_reset_user_model(id)
        }
    }

    // Sponser.
    else if( has_flag( id, "n" )) {
        new CsTeams:userTeam = cs_get_user_team(id)
        if (userTeam == CS_TEAM_CT) {
            cs_set_user_model(id, "sponser_ct")
        }
        else if(userTeam == CS_TEAM_T) {
            cs_set_user_model(id, "sponser_te")
        }
        else {
            cs_reset_user_model(id)
        }
    }
    
    // Super-Admin.
    else if( has_flag( id, "a" )) {
        new CsTeams:userTeam = cs_get_user_team(id)
        if (userTeam == CS_TEAM_CT) {
            cs_set_user_model(id, "super_admin_ct")
        }
        else if(userTeam == CS_TEAM_T) {
            cs_set_user_model(id, "super_admin_te")
        }
        else {
            cs_reset_user_model(id)
        }
    }

    // Head-Admin.
    else if( has_flag( id, "d" )) {
        new CsTeams:userTeam = cs_get_user_team(id)
        if (userTeam == CS_TEAM_CT) {
            cs_set_user_model(id, "super_admin_ct")
        }
        else if(userTeam == CS_TEAM_T) {
            cs_set_user_model(id, "super_admin_te")
        }
        else {
            cs_reset_user_model(id)
        }
    }
    
    // Mini-Admin.
    else if( has_flag( id, "c" )) {
        new CsTeams:userTeam = cs_get_user_team(id)
        if (userTeam == CS_TEAM_CT) {
            cs_set_user_model(id, "admin_ct")
        }
        else if(userTeam == CS_TEAM_T) {
            cs_set_user_model(id, "admin_te")
        }
        else {
            cs_reset_user_model(id)
        }
    }

    // Admin.
    else if( has_flag( id, "e" )) {
        new CsTeams:userTeam = cs_get_user_team(id)
        if (userTeam == CS_TEAM_CT) {
            cs_set_user_model(id, "admin_ct")
        }
        else if(userTeam == CS_TEAM_T) {
            cs_set_user_model(id, "admin_te")
        }
        else {
            cs_reset_user_model(id)
        }
    }
    
    // Mini-Vip.
    else if( has_flag( id, "i" )) {
        new CsTeams:userTeam = cs_get_user_team(id)
        if (userTeam == CS_TEAM_CT) {
            cs_set_user_model(id, "vip_ct")
        }
        else if(userTeam == CS_TEAM_T) {
            cs_set_user_model(id, "vip_te")
        }
        else {
            cs_reset_user_model(id)
        }
    }
    
    // Vip.
    else if( has_flag( id, "b" )) {
        new CsTeams:userTeam = cs_get_user_team(id)
        if (userTeam == CS_TEAM_CT) {
            cs_set_user_model(id, "vip_ct")
        }
        else if(userTeam == CS_TEAM_T) {
            cs_set_user_model(id, "vip_te")
        }
        else {
            cs_reset_user_model(id)
        }
    }

    return PLUGIN_CONTINUE
}
Attached Files
File Type: zip AMXX-Plugins-master.zip (1.31 MB, 91 views)
McTavish is offline
McTavish
Senior Member
Join Date: May 2021
Old 12-14-2021 , 07:19   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #2

and thanks for help : HamletEagle , iceeedr , OciXCrom , Natsheh ^^
McTavish is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 12-14-2021 , 08:20   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #3

Quote:
Originally Posted by McTavish View Post
and thanks for help : HamletEagle , iceeedr , OciXCrom , Natsheh ^^
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)

__________________
Youtube.com/Supremache

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

Last edited by Supremache; 12-15-2021 at 03:41.
Supremache is offline
McTavish
Senior Member
Join Date: May 2021
Old 12-14-2021 , 09:28   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #4

Quote:
Originally Posted by Supremache View Post
Try this, untested:

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>

new const Version[ ] = "1.0.0";

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");
}

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( 
iFlags eModelModel_Flag ] && iTeam == eModelModel_Team ] )
            {
                
cs_set_user_modelideModelModel_Name ] )
            }
            else 
cs_reset_user_modelid )
        }
    }
}

ReadFile( )
{
    
ArrayClearg_aModels );
    
    new 
g_szFile128 ]
    
    
addg_szFilecharsmaxg_szFile ), "/CsModels.ini" )
    
    new 
iFile fopeng_szFile"rt" );
    
    if( 
iFile )
    {
        new 
szData512 ], szModel64 ], szTeam32 ], szFlag32 ];
        
        while( 
fgetsiFileszDatacharsmaxszData ) ) )
        {    
            
trimszData );
            
            switch( 
szData] )
            {
                case 
EOS';',  '#''/':
                {
                    continue;
                }

                default:
                {
                    
                    
parse 
                    

                        
szDataszModelcharsmaxszModel ), szTeamcharsmaxszTeam ), szFlagcharsmaxszFlag )
                    )
                    
                    
trimszModel ); trimszTeam ); trimszFlag );
                    
remove_quotesszModel ); remove_quotesszTeam ); remove_quotesszFlag );
                    
                    if( 
szModel] )
                    {
                        
formatszModelcharsmaxszModel ), "models/player/%s/%s.mdl"szModelszModel )
                        if( !
file_existsszModel ) )
                        {
                            
log_amx"ERROR: model ^"%s^" not found!"szModel )
                        }
                        else
                        {
                            
precache_modelszModel )
                            
copyeModelModel_Name ], charsmaxeModelModel_Name ] ), szModel )
                        }
                    
                        
eModelModel_Team ] = clampstr_to_numszTeam ), 0// Dont need to add 3, who want to put model for spectator's xD
                        
eModelModel_Flag ] = szFlag] == '0' ADMIN_ALL read_flagsszFlag 
                    
                        
ArrayPushArray(g_aModelseModel)
                    }
                }
            }
        }
        
fcloseiFile );
    }

Nice , But explain more how to use it
McTavish is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 12-14-2021 , 09:39   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #5

Quote:
Originally Posted by McTavish View Post
Nice , But explain more how to use it
Create ini file in confing folder, name it "Cs_Models"
And follow the method on post #2
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
McTavish
Senior Member
Join Date: May 2021
Old 12-14-2021 , 10:10   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #6

Quote:
Originally Posted by Supremache View Post
Create ini file in confing folder, name it "Cs_Models"
And follow the method on post #2
i will test it later. Nice plugin mate.
McTavish is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-14-2021 , 11:43   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #7

The code in the first post should be burned.

You should get the other one working instead. No point in using a hardcoded copy/paste x5 plugin in 2021.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
McTavish
Senior Member
Join Date: May 2021
Old 12-14-2021 , 11:56   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #8

Quote:
Originally Posted by OciXCrom View Post
The code in the first post should be burned.

You should get the other one working instead. No point in using a hardcoded copy/paste x5 plugin in 2021.
if you have a good plugin you can share it mate.
McTavish is offline
McTavish
Senior Member
Join Date: May 2021
Old 12-14-2021 , 12:03   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #9

Quote:
Originally Posted by Supremache View Post
Create ini file in confing folder, name it "Cs_Models"
And follow the method on post #2
the plugin is running but the skin nope.
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	45
Size:	4.6 KB
ID:	192654  
McTavish is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 12-14-2021 , 12:13   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #10

Quote:
Originally Posted by McTavish View Post
the plugin is running but the skin nope.
The file name is : CsModels

Edit: i forget to set a location for the file, try it #3
__________________
Youtube.com/Supremache

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

Last edited by Supremache; 12-14-2021 at 13:20.
Supremache 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 21:25.


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