Add player model pack mod, add gitignore

This commit is contained in:
callanb
2023-12-26 03:32:22 +00:00
parent fbed170bce
commit 167d2b511c
16 changed files with 470 additions and 0 deletions

View File

@ -0,0 +1,47 @@
#include common_scripts\utility;
#include maps\mp\_utility;
main()
{
replaceFunc( maps\mp\teams\_teams::set_player_model, ::set_player_model_override );
}
set_player_model_override( team, weapon )
{
weaponclass = getweaponclass( weapon );
bodytype = "default";
switch ( weaponclass )
{
case "weapon_sniper":
bodytype = "rifle";
break;
case "weapon_cqb":
bodytype = "spread";
break;
case "weapon_lmg":
bodytype = "mg";
break;
case "weapon_smg":
bodytype = "smg";
break;
}
self detachall();
self setmovespeedscale( 1 );
self setsprintduration( 4 );
self setsprintcooldown( 0 );
possible_models = game[ "characters" ][ team ];
if ( isDefined( possible_models ) && possible_models.size > 0 )
{
model = random( possible_models );
self setModel( model[ "body_model" ] );
self setViewModel( model[ "view_model" ] );
}
else
{
self [[ game["set_player_model"][team][bodytype] ]]();
}
}

View File

@ -0,0 +1,33 @@
#define CHARACTER_CSV "mp/pmp_character_table.csv"
main()
{
parse_character_table();
}
parse_character_table()
{
game[ "characters" ] = [];
for ( index = 0; tablelookuprownum( CHARACTER_CSV, 0, index ) != -1; index++ )
{
alias = tablelookup( CHARACTER_CSV, 0, index, 1);
body_model = tablelookup( CHARACTER_CSV, 0, index, 2);
view_model = tablelookup( CHARACTER_CSV, 0, index, 3);
team = tablelookup( CHARACTER_CSV, 0, index, 4);
class_name = tablelookup( CHARACTER_CSV, 0, index, 5);
if ( !isDefined( game[ "characters" ][ team ] ) )
{
game[ "characters" ][ team ] = [];
}
game[ "characters" ][ team ][ alias ] = [];
game[ "characters" ][ team ][ alias ][ "body_model" ] = body_model;
game[ "characters" ][ team ][ alias ][ "view_model" ] = view_model;
game[ "characters" ][ team ][ alias ][ "class_name" ] = class_name;
precacheModel( body_model );
precacheModel( view_model );
}
}