Skip to content

Commit

Permalink
add cdata files
Browse files Browse the repository at this point in the history
  • Loading branch information
Joelrau committed Jul 13, 2024
1 parent 6ab1e4f commit 8b0fa20
Show file tree
Hide file tree
Showing 36 changed files with 239 additions and 0 deletions.
48 changes: 48 additions & 0 deletions data/cdata/custom_scripts/cp_mp/inspect.gsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
init()
{
level thread onPlayerConnect();
}

onPlayerConnect()
{
for( ;; )
{
level waittill( "connected", player );
player thread onPlayerSpawned();
}
}

watchWeaponInspection()
{
self endon( "death" );
self endon( "disconnect" );
self endon( "faux_spawn" );

if ( isai( self ) || isbot( self ) )
return;

self notifyonplayercommand( "weapon_inspection", "+actionslot 8" );

for (;;)
{
self waittill( "weapon_inspection" );
self iPrintLnBold("actionslot 8 pressed...");

self startweaponinspection();
wait 0.05;

while ( self isinspectingweapon() )
wait 0.05;
}
}

onPlayerSpawned()
{
self endon( "disconnect" );

for (;;)
{
scripts\engine\utility::waittill_any( "spawned_player", "faux_spawn" );
self thread watchWeaponInspection();
}
}
157 changes: 157 additions & 0 deletions data/cdata/custom_scripts/mp/ranked.gsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
main()
{
// Rank fixes.
replacefunc(scripts\mp\menus::addtoteam, ::addtoteam_stub);
replacefunc(scripts\mp\menus::watchforteamchange, ::watchforteamchange_stub);

// Bypass check for sessionteam
replacefunc(scripts\mp\playerlogic::connect_validateplayerteam, ::connect_validateplayerteam_stub);
}

addtoteam_stub( team, firstConnect, changeTeamsWithoutRespawning )
{
if ( isdefined( self.team ) )
{
scripts\mp\playerlogic::removefromteamcount();

if ( isdefined( changeTeamsWithoutRespawning ) && changeTeamsWithoutRespawning )
scripts\mp\playerlogic::decrementalivecount( self.team );
}

if ( isdefined( self.pers["team"] ) && self.pers["team"] != "" && self.pers["team"] != "spectator" )
self.pers["last_team"] = self.pers["team"];

self.pers["team"] = team;
self.team = team;

// bypass session team is readonly in ranked matches if "teambased" is set on the playlist
if ( level.teambased )
self.sessionteam = team;
else if ( team == "spectator" )
self.sessionteam = "spectator";
else
self.sessionteam = "none";

if ( game["state"] != "postgame" )
{
scripts\mp\playerlogic::addtoteamcount();

if ( isdefined( changeTeamsWithoutRespawning ) && changeTeamsWithoutRespawning )
scripts\mp\playerlogic::incrementalivecount( self.team );
}

if ( isgamebattlematch() )
setmatchdata( "players", self.clientid, "team", team );

scripts\mp\utility::updateobjectivetext();

if ( isdefined( firstConnect ) && firstConnect )
waittillframeend;

scripts\mp\utility::updatemainmenu();

if ( team == "spectator" )
{
self notify( "joined_spectators" );
level notify( "joined_team", self );
}
else
{
self notify( "joined_team" );
level notify( "joined_team", self );
}
}

watchforteamchange_stub()
{
self endon( "disconnect" );
level endon( "game_ended" );

//------------------
// 0 = axis
// 1 = allies
// 2 = auto
// 3 = spectate
//------------------

for (;;)
{
self waittill( "luinotifyserver", channel, teamSelected );

if ( channel != "team_select" )
continue;

var_2 = 0;

if ( teamSelected >= 3 )
var_2 = 1;

if ( var_2 )
{
self setclientomnvar( "ui_spectator_selected", 1 );
self setclientomnvar( "ui_loadout_selected", -1 );
self.spectating_actively = 1;
}
else
{
self setclientomnvar( "ui_spectator_selected", -1 );
self.spectating_actively = 0;
}

var_3 = self ismlgspectator();
var_4 = !var_3 && isdefined( self.team ) && self.team == "spectator";
var_5 = var_3 && teamSelected == 3 || var_4 && teamSelected == 4;

if ( teamSelected == 4 )
{
teamSelected = 3;
self setmlgspectator( 1 );
}
else
self setmlgspectator( 0 );

self setclientomnvar( "ui_team_selected", teamSelected );

if ( teamSelected == 0 )
teamSelected = "axis";
else if ( teamSelected == 1 )
teamSelected = "allies";
else if ( teamSelected == 2 )
teamSelected = "random";
else
teamSelected = "spectator";

if ( !var_5 && isdefined( self.pers["team"] ) && teamSelected == self.pers["team"] )
continue;

self setclientomnvar( "ui_loadout_selected", -1 );
thread scripts\mp\menus::logteamselection( teamSelected );

if ( teamSelected == "axis" )
{
thread scripts\mp\menus::setteam( "axis" );
continue;
}

if ( teamSelected == "allies" )
{
thread scripts\mp\menus::setteam( "allies" );
continue;
}

if ( teamSelected == "random" )
{
thread scripts\mp\menus::autoassign();
continue;
}

if ( teamSelected == "spectator" )
thread scripts\mp\menus::setspectator( var_5 );
}
}

connect_validateplayerteam_stub()
{
if ( !isdefined( self ) )
return;
}
1 change: 1 addition & 0 deletions data/cdata/sounddata/cp/cp_disco.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/cp/cp_final.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/cp/cp_rave.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/cp/cp_town.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/cp/cp_zmb.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_afghan.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_breakneck.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_codphish.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_depot.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_desert.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_divide.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_dome_iw.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_fallen.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_flip.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_frontier.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_geneva.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_hawkwar.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_junk.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_mansion.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_marsoasis.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_metropolis.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_neon.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_nova.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_overflow.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_paris.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_parkour.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_pixel.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_prime.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_proto.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_quarry.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_rally.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_riot.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_rivet.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/cdata/sounddata/mp/mp_skyway.json

Large diffs are not rendered by default.

0 comments on commit 8b0fa20

Please sign in to comment.