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

Looking for model changing for every class in CT and TT


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
galebhasis
Junior Member
Join Date: Jul 2021
Old 07-17-2021 , 11:15   Looking for model changing for every class in CT and TT
Reply With Quote #1

What we need for our server:

A plugin like admin models that will change the model for every class in CT or TT for admins.

I've seen it in some Zombey servers, but we use Public Mode. Anyone if they have seen it or can help out or any similar plugin for Public ?
galebhasis is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 07-17-2021 , 11:37   Re: Looking for model changing for every class in CT and TT
Reply With Quote #2

I made something a while ago, but couldn't cba publishing it.

PHP Code:
/* Credits to
    ConnorMcLeod:
        - I got the Free For All code from his plugin: https://forums.alliedmods.net/showthread.php?t=80208
    Bugsy:
        - Helping me figure out how to set model to the player if the weapon can be bought by both teams.
        - I still need to work on blocking weapon pickup to avoid bugs.
*/

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fun>

#pragma semicolon 1

#define PLUGIN "FFA: WeaponBased PlayerModels"
#define VERSION "1.0.0"
#define AUTHOR "NapoleoN#"

enum _:ModelsInfo
{
    
szModelName[32],
    
iWeaponID,
    
CsTeams:csTeams
}

new const 
szWeapons[][ModelsInfo] =
{
    { 
"wbknife"CSW_KNIFE CS_TEAM_UNASSIGNED },             // Knife
    
"wbawp"CSW_AWP CS_TEAM_UNASSIGNED },            // AWP
    
"wbfamas"CSW_FAMASCS_TEAM_CT },                 // Famas
    
"wbm4a1"CSW_M4A1CS_TEAM_CT },                    // M4A1
    
"wbak47"CSW_AK47CS_TEAM_T },                     // AK47
    
"wbgalil"CSW_GALILCS_TEAM_T },                     // Galil
    
"wbtmp"CSW_TMPCS_TEAM_CT },                     // TMP
    
"wbump45"CSW_UMP45 CS_TEAM_UNASSIGNED},             // Ump45
    
"wbscout"CSW_SCOUT CS_TEAM_UNASSIGNED},             // Scout
    
"wbxm1014"CSW_XM1014 CS_TEAM_UNASSIGNED},            // XM1014
    
"wbaug"CSW_AUGCS_TEAM_CT },                    // AUG
    
"wbsg550"CSW_SG550CS_TEAM_CT },                // SG550
    
"wbmp5navy"CSW_MP5NAVY CS_TEAM_UNASSIGNED},            // MP5 Navy
    
"wbm249"CSW_M249 CS_TEAM_UNASSIGNED},                 // M249
    
"wbm3"CSW_M3 CS_TEAM_UNASSIGNED},                // M3
    
"wbg3sg1"CSW_G3SG1CS_TEAM_T },                    // G3SG1
    
"wbsg552"CSW_SG552CS_TEAM_T }                     // SG552
};

new 
iMsgRadar;
new 
iMaxPlayers;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);

    
register_event("CurWeapon""CheckWeapons""be""1=1");

    
RegisterHam(Ham_TakeDamage"player""PreTakeDamage");
    
RegisterHam(Ham_TraceAttack"player""TraceAttack");

    
iMsgRadar get_user_msgid("Radar");
    
register_message(iMsgRadar"RadarMessage");

    
server_cmd("mp_friendlyfire 1");

    
iMaxPlayers get_maxplayers();
}

precache_player_model(szModel[])
{
    static 
szFile[128];
    
formatex(szFilecharsmax(szFile), "models/player/%s/%s.mdl"szModelszModel);
    
precache_model(szFile);
    
replace(szFilecharsmax(szFile), ".mdl""T.mdl");

    if(
file_exists(szFile))
    {
        
precache_model(szFile);
    }
}

public 
plugin_precache()
{
    for(new 
isizeof(szWeapons); i++)
    {
        
precache_player_model(szWeapons[i][szModelName]);
    }
}

public 
client_putinserver(id)
{
    
client_cmd(id"hideradar");
}

public 
RadarMessage(iMsgIDMsgDestid)
{
    return 
PLUGIN_HANDLED;
}

public 
CheckWeapons(id)
{
    new 
iUserWeapon get_user_weapon(id);
    new 
CsTeams:csTeam cs_get_user_team(id);

    for (new 
isizeof(szWeapons) ; i++)
    {
        if (
iUserWeapon == szWeapons[i][iWeaponID])
        {
            if((
szWeapons[i][csTeams] == CS_TEAM_UNASSIGNED) || (csTeam == szWeapons[i][csTeams]))
            {
                
cs_set_user_model(id szWeapons[i][szModelName]);
            }
            else
            {
                
cs_reset_user_model(id);
            }

            break;
        }
    }
}

public 
PreTakeDamage(iVictimiInflictoriAttackerFloat:fDamageDamageBits)
{
    if(
iVictim != iAttacker && (<= iAttacker <= iMaxPlayers))
    {
        new 
CsTeams:csVictimTeam cs_get_user_team(iVictim);
        if(
csVictimTeam == cs_get_user_team(iAttacker))
        {
            
cs_set_user_team(iVictimcsVictimTeam == CS_TEAM_T CS_TEAM_CT CS_TEAM_T);
            
ExecuteHamB(Ham_TakeDamageiVictimiInflictoriAttackerfDamageDamageBits);
            
cs_set_user_team(iVictimcsVictimTeam);
            return 
HAM_SUPERCEDE;
        }
    }
    return 
HAM_IGNORED;
}

public 
TraceAttack(iVictimiAttackerFloat:fDamageFloat:fDirection[3], TraceHandleDamageBits)
{
    if( 
iVictim != iAttacker && (<= iAttacker <= iMaxPlayers))
    {
        new 
CsTeams:csVictimTeam cs_get_user_team(iVictim);
        if(
csVictimTeam == cs_get_user_team(iAttacker))
        {
            
cs_set_user_team(iVictimcsVictimTeam == CS_TEAM_T CS_TEAM_CT CS_TEAM_T);
            
ExecuteHamB(Ham_TraceAttackiVictimiAttackerfDamagefDirectionTraceHandleDamageBits);
            
cs_set_user_team(iVictimcsVictimTeam);
            return 
HAM_SUPERCEDE;
        }
    }
    return 
HAM_IGNORED;

This basicly gives everyone a model according to their weapon. I made it "Free For All" based since it are all different models.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
galebhasis
Junior Member
Join Date: Jul 2021
Old 07-17-2021 , 12:56   Re: Looking for model changing for every class in CT and TT
Reply With Quote #3

Quote:
Originally Posted by Napoleon_be View Post
I made something a while ago, but couldn't cba publishing it.

PHP Code:
/* Credits to
    ConnorMcLeod:
        - I got the Free For All code from his plugin: https://forums.alliedmods.net/showthread.php?t=80208
    Bugsy:
        - Helping me figure out how to set model to the player if the weapon can be bought by both teams.
        - I still need to work on blocking weapon pickup to avoid bugs.
*/

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fun>

#pragma semicolon 1

#define PLUGIN "FFA: WeaponBased PlayerModels"
#define VERSION "1.0.0"
#define AUTHOR "NapoleoN#"

enum _:ModelsInfo
{
    
szModelName[32],
    
iWeaponID,
    
CsTeams:csTeams
}

new const 
szWeapons[][ModelsInfo] =
{
    { 
"wbknife"CSW_KNIFE CS_TEAM_UNASSIGNED },             // Knife
    
"wbawp"CSW_AWP CS_TEAM_UNASSIGNED },            // AWP
    
"wbfamas"CSW_FAMASCS_TEAM_CT },                 // Famas
    
"wbm4a1"CSW_M4A1CS_TEAM_CT },                    // M4A1
    
"wbak47"CSW_AK47CS_TEAM_T },                     // AK47
    
"wbgalil"CSW_GALILCS_TEAM_T },                     // Galil
    
"wbtmp"CSW_TMPCS_TEAM_CT },                     // TMP
    
"wbump45"CSW_UMP45 CS_TEAM_UNASSIGNED},             // Ump45
    
"wbscout"CSW_SCOUT CS_TEAM_UNASSIGNED},             // Scout
    
"wbxm1014"CSW_XM1014 CS_TEAM_UNASSIGNED},            // XM1014
    
"wbaug"CSW_AUGCS_TEAM_CT },                    // AUG
    
"wbsg550"CSW_SG550CS_TEAM_CT },                // SG550
    
"wbmp5navy"CSW_MP5NAVY CS_TEAM_UNASSIGNED},            // MP5 Navy
    
"wbm249"CSW_M249 CS_TEAM_UNASSIGNED},                 // M249
    
"wbm3"CSW_M3 CS_TEAM_UNASSIGNED},                // M3
    
"wbg3sg1"CSW_G3SG1CS_TEAM_T },                    // G3SG1
    
"wbsg552"CSW_SG552CS_TEAM_T }                     // SG552
};

new 
iMsgRadar;
new 
iMaxPlayers;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);

    
register_event("CurWeapon""CheckWeapons""be""1=1");

    
RegisterHam(Ham_TakeDamage"player""PreTakeDamage");
    
RegisterHam(Ham_TraceAttack"player""TraceAttack");

    
iMsgRadar get_user_msgid("Radar");
    
register_message(iMsgRadar"RadarMessage");

    
server_cmd("mp_friendlyfire 1");

    
iMaxPlayers get_maxplayers();
}

precache_player_model(szModel[])
{
    static 
szFile[128];
    
formatex(szFilecharsmax(szFile), "models/player/%s/%s.mdl"szModelszModel);
    
precache_model(szFile);
    
replace(szFilecharsmax(szFile), ".mdl""T.mdl");

    if(
file_exists(szFile))
    {
        
precache_model(szFile);
    }
}

public 
plugin_precache()
{
    for(new 
isizeof(szWeapons); i++)
    {
        
precache_player_model(szWeapons[i][szModelName]);
    }
}

public 
client_putinserver(id)
{
    
client_cmd(id"hideradar");
}

public 
RadarMessage(iMsgIDMsgDestid)
{
    return 
PLUGIN_HANDLED;
}

public 
CheckWeapons(id)
{
    new 
iUserWeapon get_user_weapon(id);
    new 
CsTeams:csTeam cs_get_user_team(id);

    for (new 
isizeof(szWeapons) ; i++)
    {
        if (
iUserWeapon == szWeapons[i][iWeaponID])
        {
            if((
szWeapons[i][csTeams] == CS_TEAM_UNASSIGNED) || (csTeam == szWeapons[i][csTeams]))
            {
                
cs_set_user_model(id szWeapons[i][szModelName]);
            }
            else
            {
                
cs_reset_user_model(id);
            }

            break;
        }
    }
}

public 
PreTakeDamage(iVictimiInflictoriAttackerFloat:fDamageDamageBits)
{
    if(
iVictim != iAttacker && (<= iAttacker <= iMaxPlayers))
    {
        new 
CsTeams:csVictimTeam cs_get_user_team(iVictim);
        if(
csVictimTeam == cs_get_user_team(iAttacker))
        {
            
cs_set_user_team(iVictimcsVictimTeam == CS_TEAM_T CS_TEAM_CT CS_TEAM_T);
            
ExecuteHamB(Ham_TakeDamageiVictimiInflictoriAttackerfDamageDamageBits);
            
cs_set_user_team(iVictimcsVictimTeam);
            return 
HAM_SUPERCEDE;
        }
    }
    return 
HAM_IGNORED;
}

public 
TraceAttack(iVictimiAttackerFloat:fDamageFloat:fDirection[3], TraceHandleDamageBits)
{
    if( 
iVictim != iAttacker && (<= iAttacker <= iMaxPlayers))
    {
        new 
CsTeams:csVictimTeam cs_get_user_team(iVictim);
        if(
csVictimTeam == cs_get_user_team(iAttacker))
        {
            
cs_set_user_team(iVictimcsVictimTeam == CS_TEAM_T CS_TEAM_CT CS_TEAM_T);
            
ExecuteHamB(Ham_TraceAttackiVictimiAttackerfDamagefDirectionTraceHandleDamageBits);
            
cs_set_user_team(iVictimcsVictimTeam);
            return 
HAM_SUPERCEDE;
        }
    }
    return 
HAM_IGNORED;

This basicly gives everyone a model according to their weapon. I made it "Free For All" based since it are all different models.

hi im looking something to change models for every class.

If he is in tt picks guerilla he will get replaced for it.

so basicly it will work like 4 skins to replace default skins.

i've seen plugins but they give u based on team 1 skin

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

public plugin_init() {
        
register_plugin("AMX VIP Model""1.1.1""nylemustafa")
        
register_event("ResetHUD""resetModel""b")
        return 
PLUGIN_CONTINUE
}

public 
plugin_precache() {
        
precache_model("models/player/admin_vip/admin_vip.mdl")
        
precache_model("models/player/admin_vip/admin_vip.mdl")

        return 
PLUGIN_CONTINUE
}

public 
resetModel(idlevelcid) {
        if (
get_user_flags(id) & ADMIN_LEVEL_H) {
                new 
CsTeams:userTeam cs_get_user_team(id)
                if (
userTeam == CS_TEAM_T) {
                        
cs_set_user_model(id"admin_vip")
                }
                else if(
userTeam == CS_TEAM_CT) {
                        
cs_set_user_model(id"admin_vip")
                }
                else {
                        
cs_reset_user_model(id)
                }
        }

        return 
PLUGIN_CONTINUE

galebhasis is offline
galebhasis
Junior Member
Join Date: Jul 2021
Old 07-17-2021 , 13:08   Re: Looking for model changing for every class in CT and TT
Reply With Quote #4

Something like " cs_get_user_model " to code, that will detect if he is SAS, GIGN, GSG9, URBAN if CT to change SAS to MDL1, GIGN to md2, etc
galebhasis is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-17-2021 , 15:48   Re: Looking for model changing for every class in CT and TT
Reply With Quote #5

https://forums.alliedmods.net/showth...06094?t=106094
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
galebhasis
Junior Member
Join Date: Jul 2021
Old 07-17-2021 , 16:45   Re: Looking for model changing for every class in CT and TT
Reply With Quote #6

Quote:
Originally Posted by Natsheh View Post
tryed that one, server keeps crashing for some reason
galebhasis is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-17-2021 , 18:23   Re: Looking for model changing for every class in CT and TT
Reply With Quote #7

make sure your replacement model files are existed in the server or fastdl folders.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
galebhasis
Junior Member
Join Date: Jul 2021
Old 07-19-2021 , 10:14   Re: Looking for model changing for every class in CT and TT
Reply With Quote #8

Quote:
Originally Posted by Natsheh View Post
make sure your replacement model files are existed in the server or fastdl folders.
they are, still server won't start when using conors plugin, maybe it's just to old for new amxx/engine

Last edited by galebhasis; 07-19-2021 at 10:14.
galebhasis is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-19-2021 , 10:19   Re: Looking for model changing for every class in CT and TT
Reply With Quote #9

Quote:
Originally Posted by galebhasis View Post
they are, still server won't start when using conors plugin, maybe it's just to old for new amxx/engine
No its compatible with latest amxx version.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 11:28.


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