checked 8 scripts 5 for mp only 3 for both mp and zombies

checked _clientids, _scoreboard, and _spectating for mp and zombies. Checked_deathicons, _friendicons, _killcam, _objpoints, and _rank for mp.
This commit is contained in:
JezuzLizard 2020-05-08 23:17:16 -07:00
parent d0b1a4648e
commit ec75d8b49a
13 changed files with 407 additions and 477 deletions

View File

@ -1,11 +1,11 @@
init()
init() //checked matches cerberus output
{
level.clientid = 0;
level thread onplayerconnect();
}
onplayerconnect()
onplayerconnect() //checked matches cerberus output
{
for ( ;; )
{

View File

@ -1,7 +1,8 @@
//checked includes match cerberus output
#include maps/mp/gametypes/_deathicons;
#include maps/mp/gametypes/_globallogic_utils;
init()
init() //checked matches cerberus output
{
if ( !isDefined( level.ragdoll_override ) )
{
@ -15,7 +16,7 @@ init()
level thread onplayerconnect();
}
onplayerconnect()
onplayerconnect() //checked matches cerberus output
{
for ( ;; )
{
@ -24,11 +25,11 @@ onplayerconnect()
}
}
updatedeathiconsenabled()
updatedeathiconsenabled() //checked matches cerberus output
{
}
adddeathicon( entity, dyingplayer, team, timeout )
adddeathicon( entity, dyingplayer, team, timeout ) //checked matches cerberus output
{
if ( !level.teambased )
{
@ -37,11 +38,13 @@ adddeathicon( entity, dyingplayer, team, timeout )
iconorg = entity.origin;
dyingplayer endon( "spawned_player" );
dyingplayer endon( "disconnect" );
wait 0,05;
wait 0.05;
maps/mp/gametypes/_globallogic_utils::waittillslowprocessallowed();
/*
/#
assert( isDefined( level.teams[ team ] ) );
#/
*/
if ( getDvar( "ui_hud_showdeathicons" ) == "0" )
{
return;
@ -58,7 +61,7 @@ adddeathicon( entity, dyingplayer, team, timeout )
newdeathicon.x = iconorg[ 0 ];
newdeathicon.y = iconorg[ 1 ];
newdeathicon.z = iconorg[ 2 ] + 54;
newdeathicon.alpha = 0,61;
newdeathicon.alpha = 0.61;
newdeathicon.archived = 1;
if ( level.splitscreen )
{
@ -73,7 +76,7 @@ adddeathicon( entity, dyingplayer, team, timeout )
newdeathicon thread destroyslowly( timeout );
}
destroyslowly( timeout )
destroyslowly( timeout ) //checked matches cerberus output
{
self endon( "death" );
wait timeout;
@ -83,7 +86,7 @@ destroyslowly( timeout )
self destroy();
}
ragdoll_override( idamage, smeansofdeath, sweapon, shitloc, vdir, vattackerorigin, deathanimduration, einflictor, ragdoll_jib, body )
ragdoll_override( idamage, smeansofdeath, sweapon, shitloc, vdir, vattackerorigin, deathanimduration, einflictor, ragdoll_jib, body ) //checked matches cerberus output
{
if ( smeansofdeath == "MOD_FALLING" && self isonground() == 1 )
{
@ -96,3 +99,4 @@ ragdoll_override( idamage, smeansofdeath, sweapon, shitloc, vdir, vattackerorigi
}
return 0;
}

View File

@ -1,5 +1,5 @@
init()
init() //checked matches cerberus output
{
if ( level.createfx_enabled || sessionmodeiszombiesgame() )
{
@ -10,12 +10,14 @@ init()
setdvar( "scr_drawfriend", "0" );
}
level.drawfriend = getDvarInt( "scr_drawfriend" );
/*
/#
assert( isDefined( game[ "headicon_allies" ] ), "Allied head icons are not defined. Check the team set for the level." );
#/
/#
assert( isDefined( game[ "headicon_axis" ] ), "Axis head icons are not defined. Check the team set for the level." );
#/
*/
precacheheadicon( game[ "headicon_allies" ] );
precacheheadicon( game[ "headicon_axis" ] );
level thread onplayerconnect();
@ -26,7 +28,7 @@ init()
}
}
onplayerconnect()
onplayerconnect() //checked matches cerberus output
{
for ( ;; )
{
@ -36,7 +38,7 @@ onplayerconnect()
}
}
onplayerspawned()
onplayerspawned() //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -46,7 +48,7 @@ onplayerspawned()
}
}
onplayerkilled()
onplayerkilled() //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -56,7 +58,7 @@ onplayerkilled()
}
}
showfriendicon()
showfriendicon() //checked matches cerberus output
{
if ( level.drawfriend )
{
@ -66,7 +68,7 @@ showfriendicon()
}
}
updatefriendiconsettings()
updatefriendiconsettings() //checked matches cerberus output
{
drawfriend = getDvarFloat( "scr_drawfriend" );
if ( level.drawfriend != drawfriend )
@ -79,35 +81,29 @@ updatefriendiconsettings()
updatefriendicons()
{
players = level.players;
i = 0;
while ( i < players.size )
for ( i = 0; i < players.size; i++ )
{
player = players[ i ];
while ( isDefined( player.pers[ "team" ] ) && player.pers[ "team" ] != "spectator" && player.sessionstate == "playing" )
if ( isDefined( player.pers[ "team" ] ) && player.pers[ "team" ] != "spectator" && player.sessionstate == "playing" )
{
if ( level.drawfriend )
{
team = self.pers[ "team" ];
self.headicon = game[ "headicon_" + team ];
self.headiconteam = team;
i++;
continue;
break;
}
else
players = level.players;
for ( j = 0; i < players.size; j++ )
{
players = level.players;
i = 0;
while ( i < players.size )
player = players[ j ];
if ( isDefined( player.pers[ "team" ] ) && player.pers[ "team" ] != "spectator" && player.sessionstate == "playing" )
{
player = players[ i ];
if ( isDefined( player.pers[ "team" ] ) && player.pers[ "team" ] != "spectator" && player.sessionstate == "playing" )
{
player.headicon = "";
}
i++;
player.headicon = "";
}
}
}
i++;
}
}

View File

@ -6,7 +6,7 @@
#include maps/mp/gametypes/_hud_util;
#include maps/mp/_utility;
init()
init() //checked matches cerberus output
{
precachestring( &"PLATFORM_PRESS_TO_SKIP" );
precachestring( &"PLATFORM_PRESS_TO_RESPAWN" );
@ -16,28 +16,24 @@ init()
initfinalkillcam();
}
initfinalkillcam()
initfinalkillcam() //checked changed to match cerberus output
{
level.finalkillcamsettings = [];
initfinalkillcamteam( "none" );
_a23 = level.teams;
_k23 = getFirstArrayKey( _a23 );
while ( isDefined( _k23 ) )
foreach ( team in level.teams )
{
team = _a23[ _k23 ];
initfinalkillcamteam( team );
_k23 = getNextArrayKey( _a23, _k23 );
}
level.finalkillcam_winner = undefined;
}
initfinalkillcamteam( team )
initfinalkillcamteam( team ) //checked matches cerberus output
{
level.finalkillcamsettings[ team ] = spawnstruct();
clearfinalkillcamteam( team );
}
clearfinalkillcamteam( team )
clearfinalkillcamteam( team ) //checked matches cerberus output
{
level.finalkillcamsettings[ team ].spectatorclient = undefined;
level.finalkillcamsettings[ team ].weapon = undefined;
@ -52,7 +48,7 @@ clearfinalkillcamteam( team )
level.finalkillcamsettings[ team ].attacker = undefined;
}
recordkillcamsettings( spectatorclient, targetentityindex, sweapon, deathtime, deathtimeoffset, offsettime, entityindex, entitystarttime, perks, killstreaks, attacker )
recordkillcamsettings( spectatorclient, targetentityindex, sweapon, deathtime, deathtimeoffset, offsettime, entityindex, entitystarttime, perks, killstreaks, attacker ) //checked matches cerberus output
{
if ( level.teambased && isDefined( attacker.team ) && isDefined( level.teams[ attacker.team ] ) )
{
@ -82,21 +78,17 @@ recordkillcamsettings( spectatorclient, targetentityindex, sweapon, deathtime, d
level.finalkillcamsettings[ "none" ].attacker = attacker;
}
erasefinalkillcam()
erasefinalkillcam() //checked changed to match cerberus output
{
clearfinalkillcamteam( "none" );
_a89 = level.teams;
_k89 = getFirstArrayKey( _a89 );
while ( isDefined( _k89 ) )
foreach ( team in level.teams )
{
team = _a89[ _k89 ];
clearfinalkillcamteam( team );
_k89 = getNextArrayKey( _a89, _k89 );
}
level.finalkillcam_winner = undefined;
}
finalkillcamwaiter()
finalkillcamwaiter() //checked matches cerberus output
{
if ( !isDefined( level.finalkillcam_winner ) )
{
@ -106,7 +98,7 @@ finalkillcamwaiter()
return 1;
}
postroundfinalkillcam()
postroundfinalkillcam() //checked matches cerberus output
{
if ( isDefined( level.sidebet ) && level.sidebet )
{
@ -117,7 +109,7 @@ postroundfinalkillcam()
finalkillcamwaiter();
}
dofinalkillcam()
dofinalkillcam() //checked changed to match cerberus output
{
level waittill( "play_final_killcam" );
level.infinalkillcam = 1;
@ -138,45 +130,41 @@ dofinalkillcam()
}
visionsetnaked( getDvar( "mapname" ), 0 );
players = level.players;
index = 0;
while ( index < players.size )
for ( index = 0; index < players.size; index++ )
{
player = players[ index ];
player closemenu();
player closeingamemenu();
player thread finalkillcam( winner );
index++;
}
wait 0,1;
wait 0.1;
while ( areanyplayerswatchingthekillcam() )
{
wait 0,05;
wait 0.05;
}
level notify( "final_killcam_done" );
level.infinalkillcam = 0;
}
startlastkillcam()
startlastkillcam() //checked matches cerberus output
{
}
areanyplayerswatchingthekillcam()
areanyplayerswatchingthekillcam() //checked changed to match cerberus output
{
players = level.players;
index = 0;
while ( index < players.size )
for ( index = 0; index < players.size; index++ )
{
player = players[ index ];
if ( isDefined( player.killcam ) )
{
return 1;
}
index++;
}
return 0;
}
killcam( attackernum, targetnum, killcamentity, killcamentityindex, killcamentitystarttime, sweapon, deathtime, deathtimeoffset, offsettime, respawn, maxtime, perks, killstreaks, attacker )
killcam( attackernum, targetnum, killcamentity, killcamentityindex, killcamentitystarttime, sweapon, deathtime, deathtimeoffset, offsettime, respawn, maxtime, perks, killstreaks, attacker ) //checked changed to match cerberus output
{
self endon( "disconnect" );
self endon( "spawned" );
@ -222,18 +210,14 @@ killcam( attackernum, targetnum, killcamentity, killcamentityindex, killcamentit
self.killcamlength = killcamlength;
self.psoffsettime = offsettime;
recordkillcamsettings( attackernum, targetnum, sweapon, deathtime, deathtimeoffset, offsettime, killcamentityindex, killcamentitystarttime, perks, killstreaks, attacker );
_a268 = level.teams;
_k268 = getFirstArrayKey( _a268 );
while ( isDefined( _k268 ) )
foreach ( team in level.teams )
{
team = _a268[ _k268 ];
self allowspectateteam( team, 1 );
_k268 = getNextArrayKey( _a268, _k268 );
}
self allowspectateteam( "freelook", 1 );
self allowspectateteam( "none", 1 );
self thread endedkillcamcleanup();
wait 0,05;
wait 0.05;
if ( self.archivetime <= predelay )
{
self.sessionstate = "dead";
@ -266,7 +250,7 @@ killcam( attackernum, targetnum, killcamentity, killcamentityindex, killcamentit
self.psoffsettime = 0;
}
setkillcamentity( killcamentityindex, delayms )
setkillcamentity( killcamentityindex, delayms ) //checked matches cerberus output
{
self endon( "disconnect" );
self endon( "end_killcam" );
@ -278,15 +262,15 @@ setkillcamentity( killcamentityindex, delayms )
self.killcamentity = killcamentityindex;
}
waitkillcamtime()
waitkillcamtime() //checked matches cerberus output
{
self endon( "disconnect" );
self endon( "end_killcam" );
wait ( self.killcamlength - 0,05 );
wait ( self.killcamlength - 0.05 );
self notify( "end_killcam" );
}
waitfinalkillcamslowdown( deathtime, starttime )
waitfinalkillcamslowdown( deathtime, starttime ) //checked matches cerberus output
{
self endon( "disconnect" );
self endon( "end_killcam" );
@ -295,30 +279,30 @@ waitfinalkillcamslowdown( deathtime, starttime )
waitbeforedeath = 2;
maps/mp/_utility::setclientsysstate( "levelNotify", "fkcb" );
wait max( 0, secondsuntildeath - waitbeforedeath );
setslowmotion( 1, 0,25, waitbeforedeath );
wait ( waitbeforedeath + 0,5 );
setslowmotion( 0,25, 1, 1 );
wait 0,5;
setslowmotion( 1, 0.25, waitbeforedeath );
wait ( waitbeforedeath + 0.5 );
setslowmotion( 0.25, 1, 1 );
wait 0.5;
maps/mp/_utility::setclientsysstate( "levelNotify", "fkce" );
}
waitskipkillcambutton()
waitskipkillcambutton() //checked matches cerberus output
{
self endon( "disconnect" );
self endon( "end_killcam" );
while ( self usebuttonpressed() )
{
wait 0,05;
wait 0.05;
}
while ( !self usebuttonpressed() )
{
wait 0,05;
wait 0.05;
}
self notify( "end_killcam" );
self clientnotify( "fkce" );
}
waitteamchangeendkillcam()
waitteamchangeendkillcam() //checked matches cerberus output
{
self endon( "disconnect" );
self endon( "end_killcam" );
@ -326,23 +310,23 @@ waitteamchangeendkillcam()
endkillcam( 0 );
}
waitskipkillcamsafespawnbutton()
waitskipkillcamsafespawnbutton() //checked matches cerberus output
{
self endon( "disconnect" );
self endon( "end_killcam" );
while ( self fragbuttonpressed() )
{
wait 0,05;
wait 0.05;
}
while ( !self fragbuttonpressed() )
{
wait 0,05;
wait 0.05;
}
self.wantsafespawn = 1;
self notify( "end_killcam" );
}
endkillcam( final )
endkillcam( final ) //checked matches cerberus output
{
if ( isDefined( self.kc_skiptext ) )
{
@ -360,7 +344,7 @@ endkillcam( final )
self thread maps/mp/gametypes/_spectating::setspectatepermissions();
}
checkforabruptkillcamend()
checkforabruptkillcamend() //checked changed to match cerberus output
{
self endon( "disconnect" );
self endon( "end_killcam" );
@ -370,15 +354,12 @@ checkforabruptkillcamend()
{
break;
}
else
{
wait 0,05;
}
wait 0.05;
}
self notify( "end_killcam" );
}
spawnedkillcamcleanup()
spawnedkillcamcleanup() //checked matches cerberus output
{
self endon( "end_killcam" );
self endon( "disconnect" );
@ -386,7 +367,7 @@ spawnedkillcamcleanup()
self endkillcam( 0 );
}
spectatorkillcamcleanup( attacker )
spectatorkillcamcleanup( attacker ) //checked matches cerberus output
{
self endon( "end_killcam" );
self endon( "disconnect" );
@ -397,7 +378,7 @@ spectatorkillcamcleanup( attacker )
self endkillcam( 0 );
}
endedkillcamcleanup()
endedkillcamcleanup() //checked matches cerberus output
{
self endon( "end_killcam" );
self endon( "disconnect" );
@ -405,7 +386,7 @@ endedkillcamcleanup()
self endkillcam( 0 );
}
endedfinalkillcamcleanup()
endedfinalkillcamcleanup() //checked matches cerberus output
{
self endon( "end_killcam" );
self endon( "disconnect" );
@ -413,61 +394,61 @@ endedfinalkillcamcleanup()
self endkillcam( 1 );
}
cancelkillcamusebutton()
cancelkillcamusebutton() //checked matches cerberus output
{
return self usebuttonpressed();
}
cancelkillcamsafespawnbutton()
cancelkillcamsafespawnbutton() //checked matches cerberus output
{
return self fragbuttonpressed();
}
cancelkillcamcallback()
cancelkillcamcallback() //checked matches cerberus output
{
self.cancelkillcam = 1;
}
cancelkillcamsafespawncallback()
cancelkillcamsafespawncallback() //checked matches cerberus output
{
self.cancelkillcam = 1;
self.wantsafespawn = 1;
}
cancelkillcamonuse()
cancelkillcamonuse() //checked matches cerberus output
{
self thread cancelkillcamonuse_specificbutton( ::cancelkillcamusebutton, ::cancelkillcamcallback );
}
cancelkillcamonuse_specificbutton( pressingbuttonfunc, finishedfunc )
cancelkillcamonuse_specificbutton( pressingbuttonfunc, finishedfunc ) //checked changed at own discretion
{
self endon( "death_delay_finished" );
self endon( "disconnect" );
level endon( "game_ended" );
for ( ;; )
{
if ( !( self [[ pressingbuttonfunc ]]() ) )
if ( !self [[ pressingbuttonfunc ]]() )
{
wait 0,05;
wait 0.05;
continue;
}
else buttontime = 0;
buttontime = 0;
while ( self [[ pressingbuttonfunc ]]() )
{
buttontime += 0,05;
wait 0,05;
buttontime += 0.05;
wait 0.05;
}
if ( buttontime >= 0,5 )
if ( buttontime >= 0.5 )
{
continue;
}
else buttontime = 0;
while ( !( self [[ pressingbuttonfunc ]]() ) && buttontime < 0,5 )
buttontime = 0;
while ( !( self [[ pressingbuttonfunc ]]() ) && buttontime < 0.5 )
{
buttontime += 0,05;
wait 0,05;
buttontime += 0.05;
wait 0.05;
}
if ( buttontime >= 0,5 )
if ( buttontime >= 0.5 )
{
continue;
}
@ -476,10 +457,11 @@ cancelkillcamonuse_specificbutton( pressingbuttonfunc, finishedfunc )
self [[ finishedfunc ]]();
return;
}
wait 0.05;
}
}
finalkillcam( winner )
finalkillcam( winner ) //checked changed to match cerberus output
{
self endon( "disconnect" );
level endon( "game_ended" );
@ -493,6 +475,7 @@ finalkillcam( winner )
setmatchflag( "final_killcam", 0 );
setmatchflag( "round_end_killcam", 1 );
}
/*
/#
if ( getDvarInt( "scr_force_finalkillcam" ) == 1 )
{
@ -500,6 +483,7 @@ finalkillcam( winner )
setmatchflag( "round_end_killcam", 0 );
#/
}
*/
if ( level.console )
{
self maps/mp/gametypes/_globallogic_spawn::setthirdperson( 0 );
@ -510,7 +494,7 @@ finalkillcam( winner )
camtime = calckillcamtime( killcamsettings.weapon, killcamsettings.entitystarttime, predelay, 0, undefined );
postdelay = calcpostdelay();
killcamoffset = camtime + predelay;
killcamlength = ( camtime + postdelay ) - 0,05;
killcamlength = ( camtime + postdelay ) - 0.05;
killcamstarttime = getTime() - ( killcamoffset * 1000 );
self notify( "begin_killcam" );
self.sessionstate = "spectator";
@ -524,18 +508,14 @@ finalkillcam( winner )
self.archivetime = killcamoffset;
self.killcamlength = killcamlength;
self.psoffsettime = killcamsettings.offsettime;
_a613 = level.teams;
_k613 = getFirstArrayKey( _a613 );
while ( isDefined( _k613 ) )
foreach ( team in level.teams )
{
team = _a613[ _k613 ];
self allowspectateteam( team, 1 );
_k613 = getNextArrayKey( _a613, _k613 );
}
self allowspectateteam( "freelook", 1 );
self allowspectateteam( "none", 1 );
self thread endedfinalkillcamcleanup();
wait 0,05;
wait 0.05;
if ( self.archivetime <= predelay )
{
self.sessionstate = "dead";
@ -561,13 +541,13 @@ finalkillcam( winner )
self spawnendoffinalkillcam();
}
spawnendoffinalkillcam()
spawnendoffinalkillcam() //checked matches cerberus output
{
[[ level.spawnspectator ]]();
self freezecontrols( 1 );
}
iskillcamentityweapon( sweapon )
iskillcamentityweapon( sweapon ) //checked matches cerberus output
{
if ( sweapon == "planemortar_mp" )
{
@ -576,44 +556,35 @@ iskillcamentityweapon( sweapon )
return 0;
}
iskillcamgrenadeweapon( sweapon )
iskillcamgrenadeweapon( sweapon ) //checked changed to match cerberus output
{
if ( sweapon == "frag_grenade_mp" )
{
return 1;
}
else
else if ( sweapon == "frag_grenade_short_mp" )
{
if ( sweapon == "frag_grenade_short_mp" )
{
return 1;
}
else
{
if ( sweapon == "sticky_grenade_mp" )
{
return 1;
}
else
{
if ( sweapon == "tabun_gas_mp" )
{
return 1;
}
}
}
return 1;
}
else if ( sweapon == "sticky_grenade_mp" )
{
return 1;
}
else if ( sweapon == "tabun_gas_mp" )
{
return 1;
}
return 0;
}
calckillcamtime( sweapon, entitystarttime, predelay, respawn, maxtime )
calckillcamtime( sweapon, entitystarttime, predelay, respawn, maxtime ) //checked matches cerberus output dvars found in another dump
{
camtime = 0;
if ( getDvar( #"C45D9077" ) == "" )
if ( getDvar( "scr_killcam_time" ) == "" )
{
if ( iskillcamentityweapon( sweapon ) )
{
camtime = ( ( getTime() - entitystarttime ) / 1000 ) - predelay - 0,1;
camtime = ( ( getTime() - entitystarttime ) / 1000 ) - predelay - 0.1;
}
else if ( !respawn )
{
@ -621,16 +592,16 @@ calckillcamtime( sweapon, entitystarttime, predelay, respawn, maxtime )
}
else if ( iskillcamgrenadeweapon( sweapon ) )
{
camtime = 4,25;
camtime = 4.25;
}
else
{
camtime = 2,5;
camtime = 2.5;
}
}
else
{
camtime = getDvarFloat( #"C45D9077" );
{
camtime = getDvarFloat( "scr_killcam_time" );
}
if ( isDefined( maxtime ) )
{
@ -638,33 +609,33 @@ calckillcamtime( sweapon, entitystarttime, predelay, respawn, maxtime )
{
camtime = maxtime;
}
if ( camtime < 0,05 )
if ( camtime < 0.05 )
{
camtime = 0,05;
camtime = 0.05;
}
}
return camtime;
}
calcpostdelay()
calcpostdelay() //checked matches cerberus output dvars found in another dump
{
postdelay = 0;
if ( getDvar( #"0D34D95D" ) == "" )
if ( getDvar( "scr_killcam_posttime" ) == "" )
{
postdelay = 2;
}
else
{
postdelay = getDvarFloat( #"0D34D95D" );
if ( postdelay < 0,05 )
postdelay = getDvarFloat( "scr_killcam_posttime" );
if ( postdelay < 0.05 )
{
postdelay = 0,05;
postdelay = 0.05;
}
}
return postdelay;
}
addkillcamskiptext( respawn )
addkillcamskiptext( respawn ) //checked matches cerberus output
{
if ( !isDefined( self.kc_skiptext ) )
{
@ -681,7 +652,7 @@ addkillcamskiptext( respawn )
if ( self issplitscreen() )
{
self.kc_skiptext.y = -100;
self.kc_skiptext.fontscale = 1,4;
self.kc_skiptext.fontscale = 1.4;
}
else
{
@ -699,11 +670,11 @@ addkillcamskiptext( respawn )
self.kc_skiptext.alpha = 1;
}
addkillcamtimer( camtime )
addkillcamtimer( camtime ) //checked matches cerberus output
{
}
initkcelements()
initkcelements() //checked matches cerberus output
{
if ( !isDefined( self.kc_skiptext ) )
{
@ -721,12 +692,12 @@ initkcelements()
if ( self issplitscreen() )
{
self.kc_skiptext.y = 20;
self.kc_skiptext.fontscale = 1,2;
self.kc_skiptext.fontscale = 1.2;
}
else
{
self.kc_skiptext.y = 32;
self.kc_skiptext.fontscale = 1,8;
self.kc_skiptext.fontscale = 1.8;
}
}
if ( !isDefined( self.kc_othertext ) )
@ -745,12 +716,12 @@ initkcelements()
if ( self issplitscreen() )
{
self.kc_othertext.x = 16;
self.kc_othertext.fontscale = 1,2;
self.kc_othertext.fontscale = 1.2;
}
else
{
self.kc_othertext.x = 32;
self.kc_othertext.fontscale = 1,6;
self.kc_othertext.fontscale = 1.6;
}
}
if ( !isDefined( self.kc_icon ) )
@ -782,8 +753,9 @@ initkcelements()
self.kc_timer.sort = 1;
self.kc_timer.font = "hudbig";
self.kc_timer.foreground = 1;
self.kc_timer.color = vectorScale( ( 1, 1, 1 ), 0,85 );
self.kc_timer.color = vectorScale( ( 1, 1, 1 ), 0.85 );
self.kc_timer.hidewheninmenu = 1;
}
}
}

View File

@ -1,7 +1,8 @@
//checked includes match cerberus output
#include maps/mp/gametypes/_hud_util;
#include maps/mp/_utility;
init()
init() //checked matches cerberus output
{
precacheshader( "objpoint_default" );
level.objpointnames = [];
@ -14,18 +15,20 @@ init()
{
level.objpointsize = 8;
}
level.objpoint_alpha_default = 0,5;
level.objpoint_alpha_default = 0.5;
level.objpointscale = 1;
}
createteamobjpoint( name, origin, team, shader, alpha, scale )
createteamobjpoint( name, origin, team, shader, alpha, scale ) //checked matches cerberus output
{
/*
/#
if ( !isDefined( level.teams[ team ] ) )
{
assert( team == "all" );
}
#/
*/
objpoint = getobjpointbyname( name );
if ( isDefined( objpoint ) )
{
@ -73,19 +76,23 @@ createteamobjpoint( name, origin, team, shader, alpha, scale )
return objpoint;
}
deleteobjpoint( oldobjpoint )
deleteobjpoint( oldobjpoint ) //checked changed to match cerberus output
{
/*
/#
assert( level.objpoints.size == level.objpointnames.size );
#/
*/
if ( level.objpoints.size == 1 )
{
/*
/#
assert( level.objpointnames[ 0 ] == oldobjpoint.name );
#/
/#
assert( isDefined( level.objpoints[ oldobjpoint.name ] ) );
#/
*/
level.objpoints = [];
level.objpointnames = [];
oldobjpoint destroy();
@ -96,10 +103,12 @@ deleteobjpoint( oldobjpoint )
objpoint = getobjpointbyindex( oldindex );
level.objpointnames[ newindex ] = objpoint.name;
objpoint.index = newindex;
level.objpointnames[oldindex] = undefined;
level.objpoints[oldobjpoint.name] = undefined;
oldobjpoint destroy();
}
updateorigin( origin )
updateorigin( origin ) //checked matches cerberus output
{
if ( self.x != origin[ 0 ] )
{
@ -115,13 +124,13 @@ updateorigin( origin )
}
}
setoriginbyname( name, origin )
setoriginbyname( name, origin ) //checked matches cerberus output
{
objpoint = getobjpointbyname( name );
objpoint updateorigin( origin );
}
getobjpointbyname( name )
getobjpointbyname( name ) //checked matches cerberus output
{
if ( isDefined( level.objpoints[ name ] ) )
{
@ -133,7 +142,7 @@ getobjpointbyname( name )
}
}
getobjpointbyindex( index )
getobjpointbyindex( index ) //checked matches cerberus output
{
if ( isDefined( level.objpointnames[ index ] ) )
{
@ -145,7 +154,7 @@ getobjpointbyindex( index )
}
}
startflashing()
startflashing() //checked matches cerberus output
{
self endon( "stop_flashing_thread" );
if ( self.isflashing )
@ -155,17 +164,17 @@ startflashing()
self.isflashing = 1;
while ( self.isflashing )
{
self fadeovertime( 0,75 );
self.alpha = 0,35 * self.basealpha;
wait 0,75;
self fadeovertime( 0,75 );
self fadeovertime( 0.75 );
self.alpha = 0.35 * self.basealpha;
wait 0.75;
self fadeovertime( 0.75 );
self.alpha = self.basealpha;
wait 0,75;
wait 0.75;
}
self.alpha = self.basealpha;
}
stopflashing()
stopflashing() //checked matches cerberus output
{
if ( !self.isflashing )
{
@ -173,3 +182,4 @@ stopflashing()
}
self.isflashing = 0;
}

View File

@ -1,3 +1,4 @@
//checked includes match cerberus output
#include maps/mp/gametypes/_globallogic;
#include maps/mp/gametypes/_hud;
#include maps/mp/gametypes/_hud_util;
@ -5,7 +6,7 @@
#include maps/mp/_utility;
#include common_scripts/utility;
init()
init() //checked partially changed to match cerberus output changed at own discretion
{
level.scoreinfo = [];
level.xpscale = getDvarFloat( "scr_xpscale" );
@ -18,9 +19,9 @@ init()
level.usingscorestreaks = getDvarInt( "scr_scorestreaks" ) != 0;
level.scorestreaksmaxstacking = getDvarInt( "scr_scorestreaks_maxstacking" );
level.maxinventoryscorestreaks = getdvarintdefault( "scr_maxinventory_scorestreaks", 3 );
if ( isDefined( level.usingscorestreaks ) )
if ( !isDefined( level.usingscorestreaks ) || !level.usingscorestreaks )
{
level.usingrampage = !level.usingscorestreaks;
level.usingrampage = 1;
}
level.rampagebonusscale = getDvarFloat( "scr_rampagebonusscale" );
level.ranktable = [];
@ -38,27 +39,23 @@ init()
}
level.maxrank = int( tablelookup( "mp/rankTable.csv", 0, "maxrank", 1 ) );
level.maxprestige = int( tablelookup( "mp/rankIconTable.csv", 0, "maxprestige", 1 ) );
pid = 0;
rid = 0;
pid = 0;
while ( pid <= level.maxprestige )
for ( pid = 0; pid <= level.maxprestige; pid++ )
{
rid = 0;
while ( rid <= level.maxrank )
for ( rid = 0; rid <= level.maxrank; rid++ )
{
precacheshader( tablelookup( "mp/rankIconTable.csv", 0, rid, pid + 1 ) );
rid++;
}
pid++;
}
rankid = 0;
rankname = tablelookup( "mp/ranktable.csv", 0, rankid, 1 );
/*
/#
if ( isDefined( rankname ) )
{
assert( rankname != "" );
}
#/
*/
while ( isDefined( rankname ) && rankname != "" )
{
level.ranktable[ rankid ][ 1 ] = tablelookup( "mp/ranktable.csv", 0, rankid, 1 );
@ -73,34 +70,39 @@ init()
level thread onplayerconnect();
}
initscoreinfo()
initscoreinfo() //checked changed to match cerberus output
{
scoreinfotableid = getscoreeventtableid();
/*
/#
assert( isDefined( scoreinfotableid ) );
#/
*/
if ( !isDefined( scoreinfotableid ) )
{
return;
}
scorecolumn = getscoreeventcolumn( level.gametype );
xpcolumn = getxpeventcolumn( level.gametype );
/*
/#
assert( scorecolumn >= 0 );
#/
*/
if ( scorecolumn < 0 )
{
return;
}
/*
/#
assert( xpcolumn >= 0 );
#/
*/
if ( xpcolumn < 0 )
{
return;
}
row = 1;
while ( row < 512 )
for ( row = 1; row < 512; row++ )
{
type = tablelookupcolumnforrow( scoreinfotableid, row, 0 );
if ( type != "" )
@ -141,11 +143,10 @@ initscoreinfo()
level.scoreinfo[ type ][ "allowKillstreakWeapons" ] = 1;
}
}
row++;
}
}
getrankxpcapped( inrankxp )
getrankxpcapped( inrankxp ) //checked matches cerberus output
{
if ( isDefined( level.rankxpcap ) && level.rankxpcap && level.rankxpcap <= inrankxp )
{
@ -154,7 +155,7 @@ getrankxpcapped( inrankxp )
return inrankxp;
}
getcodpointscapped( incodpoints )
getcodpointscapped( incodpoints ) //checked matches cerberus output
{
if ( isDefined( level.codpointscap ) && level.codpointscap && level.codpointscap <= incodpoints )
{
@ -163,7 +164,7 @@ getcodpointscapped( incodpoints )
return incodpoints;
}
registerscoreinfo( type, value, label )
registerscoreinfo( type, value, label ) //checked matches cerberus output
{
overridedvar = "scr_" + level.gametype + "_score_" + type;
if ( getDvar( overridedvar ) != "" )
@ -186,7 +187,7 @@ registerscoreinfo( type, value, label )
}
}
getscoreinfovalue( type )
getscoreinfovalue( type ) //checked matches cerberus output
{
if ( isDefined( level.scoreinfo[ type ] ) )
{
@ -194,12 +195,12 @@ getscoreinfovalue( type )
}
}
getscoreinfolabel( type )
getscoreinfolabel( type ) //checked matches cerberus output
{
return level.scoreinfo[ type ][ "label" ];
}
killstreakweaponsallowedscore( type )
killstreakweaponsallowedscore( type ) //checked matches cerberus output
{
if ( isDefined( level.scoreinfo[ type ][ "allowKillstreakWeapons" ] ) && level.scoreinfo[ type ][ "allowKillstreakWeapons" ] == 1 )
{
@ -211,50 +212,51 @@ killstreakweaponsallowedscore( type )
}
}
doesscoreinfocounttowardrampage( type )
doesscoreinfocounttowardrampage( type ) //checked changed at own discretion
{
if ( isDefined( level.scoreinfo[ type ][ "rampage" ] ) )
if ( isDefined( level.scoreinfo[ type ][ "rampage" ] ) && level.scoreinfo[ type ][ "rampage" ] )
{
return level.scoreinfo[ type ][ "rampage" ];
return 1;
}
return 0;
}
getrankinfominxp( rankid )
getrankinfominxp( rankid ) //checked matches cerberus output
{
return int( level.ranktable[ rankid ][ 2 ] );
}
getrankinfoxpamt( rankid )
getrankinfoxpamt( rankid ) //checked matches cerberus output
{
return int( level.ranktable[ rankid ][ 3 ] );
}
getrankinfomaxxp( rankid )
getrankinfomaxxp( rankid ) //checked matches cerberus output
{
return int( level.ranktable[ rankid ][ 7 ] );
}
getrankinfofull( rankid )
getrankinfofull( rankid ) //checked matches cerberus output
{
return tablelookupistring( "mp/ranktable.csv", 0, rankid, 16 );
}
getrankinfoicon( rankid, prestigeid )
getrankinfoicon( rankid, prestigeid ) //checked matches cerberus output
{
return tablelookup( "mp/rankIconTable.csv", 0, rankid, prestigeid + 1 );
}
getrankinfolevel( rankid )
getrankinfolevel( rankid ) //checked matches cerberus output
{
return int( tablelookup( "mp/ranktable.csv", 0, rankid, 13 ) );
}
getrankinfocodpointsearned( rankid )
getrankinfocodpointsearned( rankid ) //checked matches cerberus output
{
return int( tablelookup( "mp/ranktable.csv", 0, rankid, 17 ) );
}
shouldkickbyrank()
shouldkickbyrank() //checked matches cerberus output
{
if ( self ishost() )
{
@ -275,7 +277,7 @@ shouldkickbyrank()
return 0;
}
getcodpointsstat()
getcodpointsstat() //checked matches cerberus output
{
codpoints = self getdstat( "playerstatslist", "CODPOINTS", "StatValue" );
codpointscapped = getcodpointscapped( codpoints );
@ -286,12 +288,12 @@ getcodpointsstat()
return codpointscapped;
}
setcodpointsstat( codpoints )
setcodpointsstat( codpoints ) //checked matches cerberus output
{
self setdstat( "PlayerStatsList", "CODPOINTS", "StatValue", getcodpointscapped( codpoints ) );
}
getrankxpstat()
getrankxpstat() //checked matches cerberus output
{
rankxp = self getdstat( "playerstatslist", "RANKXP", "StatValue" );
rankxpcapped = getrankxpcapped( rankxp );
@ -302,7 +304,7 @@ getrankxpstat()
return rankxpcapped;
}
onplayerconnect()
onplayerconnect() //checked changed to match cerberus output
{
for ( ;; )
{
@ -318,50 +320,49 @@ onplayerconnect()
kick( player getentitynumber() );
continue;
}
else
if ( !isDefined( player.pers[ "participation" ] ) || level.gametype == "twar" && game[ "roundsplayed" ] >= 0 && player.pers[ "participation" ] >= 0 )
{
if ( !isDefined( player.pers[ "participation" ] ) || level.gametype == "twar" && game[ "roundsplayed" ] >= 0 && player.pers[ "participation" ] >= 0 )
{
player.pers[ "participation" ] = 0;
}
player.rankupdatetotal = 0;
player.cur_ranknum = rankid;
/#
assert( isDefined( player.cur_ranknum ), "rank: " + rankid + " does not have an index, check mp/ranktable.csv" );
#/
prestige = player getdstat( "playerstatslist", "plevel", "StatValue" );
player setrank( rankid, prestige );
player.pers[ "prestige" ] = prestige;
if ( !isDefined( player.pers[ "summary" ] ) )
{
player.pers[ "summary" ] = [];
player.pers[ "summary" ][ "xp" ] = 0;
player.pers[ "summary" ][ "score" ] = 0;
player.pers[ "summary" ][ "challenge" ] = 0;
player.pers[ "summary" ][ "match" ] = 0;
player.pers[ "summary" ][ "misc" ] = 0;
player.pers[ "summary" ][ "codpoints" ] = 0;
}
if ( !level.rankedmatch || level.wagermatch && level.leaguematch )
{
player setdstat( "AfterActionReportStats", "lobbyPopup", "none" );
}
if ( level.rankedmatch )
{
player setdstat( "playerstatslist", "rank", "StatValue", rankid );
player setdstat( "playerstatslist", "minxp", "StatValue", getrankinfominxp( rankid ) );
player setdstat( "playerstatslist", "maxxp", "StatValue", getrankinfomaxxp( rankid ) );
player setdstat( "playerstatslist", "lastxp", "StatValue", getrankxpcapped( player.pers[ "rankxp" ] ) );
}
player.explosivekills[ 0 ] = 0;
player thread onplayerspawned();
player thread onjoinedteam();
player thread onjoinedspectators();
player.pers[ "participation" ] = 0;
}
player.rankupdatetotal = 0;
player.cur_ranknum = rankid;
/*
/#
assert( isDefined( player.cur_ranknum ), "rank: " + rankid + " does not have an index, check mp/ranktable.csv" );
#/
*/
prestige = player getdstat( "playerstatslist", "plevel", "StatValue" );
player setrank( rankid, prestige );
player.pers[ "prestige" ] = prestige;
if ( !isDefined( player.pers[ "summary" ] ) )
{
player.pers[ "summary" ] = [];
player.pers[ "summary" ][ "xp" ] = 0;
player.pers[ "summary" ][ "score" ] = 0;
player.pers[ "summary" ][ "challenge" ] = 0;
player.pers[ "summary" ][ "match" ] = 0;
player.pers[ "summary" ][ "misc" ] = 0;
player.pers[ "summary" ][ "codpoints" ] = 0;
}
if ( !level.rankedmatch || level.wagermatch && level.leaguematch )
{
player setdstat( "AfterActionReportStats", "lobbyPopup", "none" );
}
if ( level.rankedmatch )
{
player setdstat( "playerstatslist", "rank", "StatValue", rankid );
player setdstat( "playerstatslist", "minxp", "StatValue", getrankinfominxp( rankid ) );
player setdstat( "playerstatslist", "maxxp", "StatValue", getrankinfomaxxp( rankid ) );
player setdstat( "playerstatslist", "lastxp", "StatValue", getrankxpcapped( player.pers[ "rankxp" ] ) );
}
player.explosivekills[ 0 ] = 0;
player thread onplayerspawned();
player thread onjoinedteam();
player thread onjoinedspectators();
}
}
onjoinedteam()
onjoinedteam() //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -371,7 +372,7 @@ onjoinedteam()
}
}
onjoinedspectators()
onjoinedspectators() //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -381,7 +382,7 @@ onjoinedspectators()
}
}
onplayerspawned()
onplayerspawned() //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -406,7 +407,7 @@ onplayerspawned()
self.hud_rankscroreupdate.font = "default";
self.hud_rankscroreupdate.fontscale = 2;
self.hud_rankscroreupdate.archived = 0;
self.hud_rankscroreupdate.color = ( 1, 1, 0,5 );
self.hud_rankscroreupdate.color = ( 1, 1, 0.5 );
self.hud_rankscroreupdate.alpha = 0;
self.hud_rankscroreupdate.sort = 50;
self.hud_rankscroreupdate maps/mp/gametypes/_hud::fontpulseinit();
@ -414,7 +415,7 @@ onplayerspawned()
}
}
inccodpoints( amount )
inccodpoints( amount ) //checked matches cerberus output
{
if ( !isrankenabled() )
{
@ -433,23 +434,19 @@ inccodpoints( amount )
setcodpointsstat( int( newcodpoints ) );
}
atleastoneplayeroneachteam()
atleastoneplayeroneachteam() //checked changed to match cerberus output
{
_a507 = level.teams;
_k507 = getFirstArrayKey( _a507 );
while ( isDefined( _k507 ) )
foreach ( team in level.teams )
{
team = _a507[ _k507 ];
if ( !level.playercount[ team ] )
{
return 0;
}
_k507 = getNextArrayKey( _a507, _k507 );
}
return 1;
}
giverankxp( type, value, devadd )
giverankxp( type, value, devadd ) //checked changed to match cerberus output
{
self endon( "disconnect" );
if ( sessionmodeiszombiesgame() )
@ -460,12 +457,9 @@ giverankxp( type, value, devadd )
{
return;
}
else
else if ( !level.teambased && maps/mp/gametypes/_globallogic::totalplayercount() < 2 && !isDefined( devadd ) )
{
if ( !level.teambased && maps/mp/gametypes/_globallogic::totalplayercount() < 2 && !isDefined( devadd ) )
{
return;
}
return;
}
if ( !isrankenabled() )
{
@ -582,13 +576,13 @@ giverankxp( type, value, devadd )
pixendevent();
}
round_this_number( value )
round_this_number( value ) //checked matches cerberus output
{
value = int( value + 0,5 );
value = int( value + 0.5 );
return value;
}
updaterank()
updaterank() //checked matches cerberus output
{
newrankid = self getrank();
if ( newrankid == self.pers[ "rank" ] )
@ -625,7 +619,7 @@ updaterank()
return 1;
}
codecallback_rankup( rank, prestige, unlocktokensadded )
codecallback_rankup( rank, prestige, unlocktokensadded ) //checked matches cerberus output
{
if ( rank > 8 )
{
@ -635,21 +629,23 @@ codecallback_rankup( rank, prestige, unlocktokensadded )
self luinotifyeventtospectators( &"rank_up", 3, rank, prestige, unlocktokensadded );
}
getitemindex( refstring )
getitemindex( refstring ) //checked matches cerberus output
{
itemindex = int( tablelookup( "mp/statstable.csv", 4, refstring, 0 ) );
/*
/#
assert( itemindex > 0, "statsTable refstring " + refstring + " has invalid index: " + itemindex );
#/
*/
return itemindex;
}
endgameupdate()
endgameupdate() //checked matches cerberus output
{
player = self;
}
updaterankscorehud( amount )
updaterankscorehud( amount ) //checked matches cerberus output
{
self endon( "disconnect" );
self endon( "joined_team" );
@ -665,30 +661,30 @@ updaterankscorehud( amount )
self notify( "update_score" );
self endon( "update_score" );
self.rankupdatetotal += amount;
wait 0,05;
wait 0.05;
if ( isDefined( self.hud_rankscroreupdate ) )
{
if ( self.rankupdatetotal < 0 )
{
self.hud_rankscroreupdate.label = &"";
self.hud_rankscroreupdate.color = ( 0,73, 0,19, 0,19 );
self.hud_rankscroreupdate.color = ( 0.73, 0.19, 0.19 );
}
else
{
self.hud_rankscroreupdate.label = &"MP_PLUS";
self.hud_rankscroreupdate.color = ( 1, 1, 0,5 );
self.hud_rankscroreupdate.color = ( 1, 1, 0.5 );
}
self.hud_rankscroreupdate setvalue( self.rankupdatetotal );
self.hud_rankscroreupdate.alpha = 0,85;
self.hud_rankscroreupdate.alpha = 0.85;
self.hud_rankscroreupdate thread maps/mp/gametypes/_hud::fontpulse( self );
wait 1;
self.hud_rankscroreupdate fadeovertime( 0,75 );
self.hud_rankscroreupdate fadeovertime( 0.75 );
self.hud_rankscroreupdate.alpha = 0;
self.rankupdatetotal = 0;
}
}
updatemomentumhud( amount, reason, reasonvalue )
updatemomentumhud( amount, reason, reasonvalue ) //checked matches cerberus output
{
self endon( "disconnect" );
self endon( "joined_team" );
@ -705,15 +701,15 @@ updatemomentumhud( amount, reason, reasonvalue )
if ( self.rankupdatetotal < 0 )
{
self.hud_rankscroreupdate.label = &"";
self.hud_rankscroreupdate.color = ( 0,73, 0,19, 0,19 );
self.hud_rankscroreupdate.color = ( 0.73, 0.19, 0.19 );
}
else
{
self.hud_rankscroreupdate.label = &"MP_PLUS";
self.hud_rankscroreupdate.color = ( 1, 1, 0,5 );
self.hud_rankscroreupdate.color = ( 1, 1, 0.5 );
}
self.hud_rankscroreupdate setvalue( self.rankupdatetotal );
self.hud_rankscroreupdate.alpha = 0,85;
self.hud_rankscroreupdate.alpha = 0.85;
self.hud_rankscroreupdate thread maps/mp/gametypes/_hud::fontpulse( self );
if ( isDefined( self.hud_momentumreason ) )
{
@ -729,29 +725,29 @@ updatemomentumhud( amount, reason, reasonvalue )
self.hud_momentumreason.label = reason;
self.hud_momentumreason setvalue( amount );
}
self.hud_momentumreason.alpha = 0,85;
self.hud_momentumreason.alpha = 0.85;
self.hud_momentumreason thread maps/mp/gametypes/_hud::fontpulse( self );
}
else
{
self.hud_momentumreason fadeovertime( 0,01 );
self.hud_momentumreason fadeovertime( 0.01 );
self.hud_momentumreason.alpha = 0;
}
}
wait 1;
self.hud_rankscroreupdate fadeovertime( 0,75 );
self.hud_rankscroreupdate fadeovertime( 0.75 );
self.hud_rankscroreupdate.alpha = 0;
if ( isDefined( self.hud_momentumreason ) && isDefined( reason ) )
{
self.hud_momentumreason fadeovertime( 0,75 );
self.hud_momentumreason fadeovertime( 0.75 );
self.hud_momentumreason.alpha = 0;
}
wait 0,75;
wait 0.75;
self.rankupdatetotal = 0;
}
}
removerankhud()
removerankhud() //checked matches cerberus output
{
if ( isDefined( self.hud_rankscroreupdate ) )
{
@ -763,7 +759,7 @@ removerankhud()
}
}
getrank()
getrank() //checked matches cerberus output
{
rankxp = getrankxpcapped( self.pers[ "rankxp" ] );
rankid = self.pers[ "rank" ];
@ -777,13 +773,15 @@ getrank()
}
}
getrankforxp( xpval )
getrankforxp( xpval ) //checked matches cerberus output
{
rankid = 0;
rankname = level.ranktable[ rankid ][ 1 ];
/*
/#
assert( isDefined( rankname ) );
#/
*/
while ( isDefined( rankname ) && rankname != "" )
{
if ( xpval < ( getrankinfominxp( rankid ) + getrankinfoxpamt( rankid ) ) )
@ -806,18 +804,18 @@ getrankforxp( xpval )
return rankid;
}
getspm()
getspm() //checked matches cerberus output
{
ranklevel = self getrank() + 1;
return ( 3 + ( ranklevel * 0,5 ) ) * 10;
return ( 3 + ( ranklevel * 0.5 ) ) * 10;
}
getrankxp()
getrankxp() //checked matches cerberus output
{
return getrankxpcapped( self.pers[ "rankxp" ] );
}
incrankxp( amount )
incrankxp( amount ) //checked matches cerberus output
{
if ( !level.rankedmatch )
{
@ -838,10 +836,11 @@ incrankxp( amount )
return xpincrease;
}
syncxpstat()
syncxpstat() //checked matches cerberus output
{
xp = getrankxpcapped( self getrankxp() );
cp = getcodpointscapped( int( self.pers[ "codpoints" ] ) );
self setdstat( "playerstatslist", "rankxp", "StatValue", xp );
self setdstat( "playerstatslist", "codpoints", "StatValue", cp );
}

View File

@ -1,5 +1,5 @@
init()
init() //checked matches cerberus output
{
if ( level.createfx_enabled )
{

View File

@ -1,18 +1,14 @@
init()
init() //checked changed to match cerberus output
{
_a3 = level.teams;
_k3 = getFirstArrayKey( _a3 );
while ( isDefined( _k3 ) )
foreach ( team in level.teams )
{
team = _a3[ _k3 ];
level.spectateoverride[ team ] = spawnstruct();
_k3 = getNextArrayKey( _a3, _k3 );
}
level thread onplayerconnect();
}
onplayerconnect()
onplayerconnect() //checked matches cerberus output
{
for ( ;; )
{
@ -23,7 +19,7 @@ onplayerconnect()
}
}
onplayerspawned()
onplayerspawned() //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -33,7 +29,7 @@ onplayerspawned()
}
}
onjoinedteam()
onjoinedteam() //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -43,7 +39,7 @@ onjoinedteam()
}
}
onjoinedspectators()
onjoinedspectators() //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -53,18 +49,16 @@ onjoinedspectators()
}
}
updatespectatesettings()
updatespectatesettings() //checked changed to match cerberus output
{
level endon( "game_ended" );
index = 0;
while ( index < level.players.size )
for ( index = 0; index < level.players.size; index++ )
{
level.players[ index ] setspectatepermissions();
index++;
}
}
getsplitscreenteam()
getsplitscreenteam() //checked partially changed to match cerberus output did not change while loop to for loop see github for more info
{
index = 0;
while ( index < level.players.size )
@ -74,30 +68,27 @@ getsplitscreenteam()
index++;
continue;
}
else if ( level.players[ index ] == self )
if ( level.players[ index ] == self )
{
index++;
continue;
}
else if ( !self isplayeronsamemachine( level.players[ index ] ) )
if ( !self isplayeronsamemachine( level.players[ index ] ) )
{
index++;
continue;
}
else
team = level.players[ index ].sessionteam;
if ( team != "spectator" )
{
team = level.players[ index ].sessionteam;
if ( team != "spectator" )
{
return team;
}
return team;
}
index++;
}
return self.sessionteam;
}
otherlocalplayerstillalive()
otherlocalplayerstillalive() //checked partially changed to match cerberus output did not change while loop to for loop see github for more info
{
index = 0;
while ( index < level.players.size )
@ -107,47 +98,37 @@ otherlocalplayerstillalive()
index++;
continue;
}
else if ( level.players[ index ] == self )
if ( level.players[ index ] == self )
{
index++;
continue;
}
else if ( !self isplayeronsamemachine( level.players[ index ] ) )
if ( !self isplayeronsamemachine( level.players[ index ] ) )
{
index++;
continue;
}
else
if ( isalive( level.players[ index ] ) )
{
if ( isalive( level.players[ index ] ) )
{
return 1;
}
return 1;
}
index++;
}
return 0;
}
allowspectateallteams( allow )
allowspectateallteams( allow ) //checked changed to match cerberus output
{
_a114 = level.teams;
_k114 = getFirstArrayKey( _a114 );
while ( isDefined( _k114 ) )
foreach ( team in level.teams )
{
team = _a114[ _k114 ];
self allowspectateteam( team, allow );
_k114 = getNextArrayKey( _a114, _k114 );
}
}
allowspectateallteamsexceptteam( skip_team, allow )
allowspectateallteamsexceptteam( skip_team, allow ) //checked partially changed to match cerberus output did not use continue in foreach see github for more info
{
_a122 = level.teams;
_k122 = getFirstArrayKey( _a122 );
while ( isDefined( _k122 ) )
foreach ( team in level.teams )
{
team = _a122[ _k122 ];
if ( team == skip_team )
{
}
@ -155,11 +136,10 @@ allowspectateallteamsexceptteam( skip_team, allow )
{
self allowspectateteam( team, allow );
}
_k122 = getNextArrayKey( _a122, _k122 );
}
}
setspectatepermissions()
setspectatepermissions() //checked changed to match cerberus output
{
team = self.sessionteam;
if ( team == "spectator" )
@ -194,40 +174,37 @@ setspectatepermissions()
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "localplayers", 1 );
break;
}
else
{
case 1:
if ( !level.teambased )
{
self allowspectateallteams( 1 );
self allowspectateteam( "none", 1 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "localplayers", 1 );
}
else if ( isDefined( team ) && isDefined( level.teams[ team ] ) )
{
self allowspectateteam( team, 1 );
self allowspectateallteamsexceptteam( team, 0 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "none", 0 );
self allowspectateteam( "localplayers", 1 );
}
else
{
self allowspectateallteams( 0 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "none", 0 );
self allowspectateteam( "localplayers", 1 );
}
break;
case 2:
}
case 1:
if ( !level.teambased )
{
self allowspectateallteams( 1 );
self allowspectateteam( "freelook", 1 );
self allowspectateteam( "none", 1 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "localplayers", 1 );
break;
}
}
else if ( isDefined( team ) && isDefined( level.teams[ team ] ) )
{
self allowspectateteam( team, 1 );
self allowspectateallteamsexceptteam( team, 0 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "none", 0 );
self allowspectateteam( "localplayers", 1 );
}
else
{
self allowspectateallteams( 0 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "none", 0 );
self allowspectateteam( "localplayers", 1 );
}
break;
case 2:
self allowspectateallteams( 1 );
self allowspectateteam( "freelook", 1 );
self allowspectateteam( "none", 1 );
self allowspectateteam( "localplayers", 1 );
break;
}
if ( isDefined( team ) && isDefined( level.teams[ team ] ) )
{
@ -242,7 +219,7 @@ setspectatepermissions()
}
}
setspectatepermissionsformachine()
setspectatepermissionsformachine() //checked partially changed to match cerberus output did not change while loop to for loop see github for more info
{
self setspectatepermissions();
if ( !self issplitscreen() )
@ -267,10 +244,8 @@ setspectatepermissionsformachine()
index++;
continue;
}
else
{
level.players[ index ] setspectatepermissions();
}
level.players[ index ] setspectatepermissions();
index++;
}
}

View File

@ -22,16 +22,30 @@ patch_mp/maps/mp/gametypes/_shellshock.gsc
patch_mp/maps/mp/bots/_bot.gsc
patch_mp/maps/mp/bots/_bot_combat.gsc
patch_mp/maps/mp/bots/_bot_loadout.gsc
patch_mp/maps/mp/bots/_bot_conf.gsc
patch_mp/maps/mp/bots/_bot_ctf.gsc
patch_mp/maps/mp/bots/_bot_dem.gsc
patch_mp/maps/mp/bots/_bot_dom.gsc
patch_mp/maps/mp/bots/_bot_hack.gsc
patch_mp/maps/mp/bots/_bot_hq.gsc
patch_mp/maps/mp/bots/_bot_koth.gsc
patch_mp/maps/mp/bots/_bot_sd.gsc
patch_mp/maps/mp/gametypes/_callbacksetup.gsc
patch_mp/maps/mp/gametypes/_damagefeedback.gsc
patch_mp/maps/mp/gametypes/_deathicons.gsc
patch_mp/maps/mp/gametypes/_friendicons.gsc
patch_mp/maps/mp/gametypes/_globallogic.gsc
patch_mp/maps/mp/gametypes/_healthoverlay.gsc
patch_mp/maps/mp/gametypes/_hostmigration.gsc
patch_mp/maps/mp/gametypes/_hud.gsc
patch_mp/maps/mp/gametypes/_killcam.gsc
patch_mp/maps/mp/gametypes/_menus.gsc
patch_mp/maps/mp/gametypes/_objpoints.gsc
patch_mp/maps/mp/gametypes/_perplayer.gsc
patch_mp/maps/mp/gametypes/_rank.gsc
patch_mp/maps/mp/gametypes/_serversettings.gsc
patch_mp/maps/mp/gametypes/_spectating.gsc
patch_mp/maps/mp/gametypes/_tweakables.gsc
patch_mp/maps/mp/gametypes/_weapon_utils.gsc
patch_mp/maps/mp/gametypes/conf.gsc
@ -51,20 +65,9 @@ patch_mp/maps/mp/gametypes/tdm.gsc
```
### The following scripts are not checked yet, uploaded to setup a baseline:
```
patch_mp/maps/mp/bots/_bot_conf.gsc
patch_mp/maps/mp/bots/_bot_ctf.gsc
patch_mp/maps/mp/bots/_bot_dem.gsc
patch_mp/maps/mp/bots/_bot_dom.gsc
patch_mp/maps/mp/bots/_bot_hack.gsc
patch_mp/maps/mp/bots/_bot_hq.gsc
patch_mp/maps/mp/bots/_bot_koth.gsc
patch_mp/maps/mp/bots/_bot_sd.gsc
patch_mp/maps/mp/gametypes/_battlechatter.gsc
patch_mp/maps/mp/gametypes/_class.gsc
patch_mp/maps/mp/gametypes/_copter.gsc
patch_mp/maps/mp/gametypes/_deathicons.gsc
patch_mp/maps/mp/gametypes/_friendicons.gsc
patch_mp/maps/mp/gametypes/_gameobjects.gsc
patch_mp/maps/mp/gametypes/_globallogic_actor.gsc
patch_mp/maps/mp/gametypes/_globallogic_audio.gsc
@ -77,14 +80,10 @@ patch_mp/maps/mp/gametypes/_globallogic_utils.gsc
patch_mp/maps/mp/gametypes/_globallogic_vehicle.gsc
patch_mp/maps/mp/gametypes/_hud_message.gsc
patch_mp/maps/mp/gametypes/_hud_util.gsc
patch_mp/maps/mp/gametypes/_killcam.gsc
patch_mp/maps/mp/gametypes/_objpoints.gsc
patch_mp/maps/mp/gametypes/_persistence.gsc
patch_mp/maps/mp/gametypes/_pregame.gsc
patch_mp/maps/mp/gametypes/_rank.gsc
patch_mp/maps/mp/gametypes/_spawning.gsc
patch_mp/maps/mp/gametypes/_spawnlogic.gsc
patch_mp/maps/mp/gametypes/_spectating.gsc
patch_mp/maps/mp/gametypes/_wager.gsc
patch_mp/maps/mp/gametypes/_weaponobjects.gsc
patch_mp/maps/mp/gametypes/_weapons.gsc

View File

@ -1,11 +1,11 @@
init()
init() //checked matches cerberus output
{
level.clientid = 0;
level thread onplayerconnect();
}
onplayerconnect()
onplayerconnect() //checked matches cerberus output
{
for ( ;; )
{

View File

@ -1,5 +1,5 @@
init()
init() //checked matches cerberus output
{
setdvar( "g_ScoresColor_Spectator", ".25 .25 .25" );
setdvar( "g_ScoresColor_Free", ".76 .78 .10" );

View File

@ -1,18 +1,14 @@
init()
init() //checked changed to match cerberus output
{
_a3 = level.teams;
_k3 = getFirstArrayKey( _a3 );
while ( isDefined( _k3 ) )
foreach ( team in level.teams )
{
team = _a3[ _k3 ];
level.spectateoverride[ team ] = spawnstruct();
_k3 = getNextArrayKey( _a3, _k3 );
}
level thread onplayerconnect();
}
onplayerconnect()
onplayerconnect() //checked matches cerberus output
{
for ( ;; )
{
@ -23,7 +19,7 @@ onplayerconnect()
}
}
onplayerspawned()
onplayerspawned() //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -33,7 +29,7 @@ onplayerspawned()
}
}
onjoinedteam()
onjoinedteam() //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -43,7 +39,7 @@ onjoinedteam()
}
}
onjoinedspectators()
onjoinedspectators() //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -53,18 +49,16 @@ onjoinedspectators()
}
}
updatespectatesettings()
updatespectatesettings() //checked changed to match cerberus output
{
level endon( "game_ended" );
index = 0;
while ( index < level.players.size )
for ( index = 0; index < level.players.size; index++ )
{
level.players[ index ] setspectatepermissions();
index++;
}
}
getsplitscreenteam()
getsplitscreenteam() //checked partially changed to match cerberus output did not change while loop to for loop see github for more info
{
index = 0;
while ( index < level.players.size )
@ -74,30 +68,27 @@ getsplitscreenteam()
index++;
continue;
}
else if ( level.players[ index ] == self )
if ( level.players[ index ] == self )
{
index++;
continue;
}
else if ( !self isplayeronsamemachine( level.players[ index ] ) )
if ( !self isplayeronsamemachine( level.players[ index ] ) )
{
index++;
continue;
}
else
team = level.players[ index ].sessionteam;
if ( team != "spectator" )
{
team = level.players[ index ].sessionteam;
if ( team != "spectator" )
{
return team;
}
return team;
}
index++;
}
return self.sessionteam;
}
otherlocalplayerstillalive()
otherlocalplayerstillalive() //checked partially changed to match cerberus output did not change while loop to for loop see github for more info
{
index = 0;
while ( index < level.players.size )
@ -107,47 +98,37 @@ otherlocalplayerstillalive()
index++;
continue;
}
else if ( level.players[ index ] == self )
if ( level.players[ index ] == self )
{
index++;
continue;
}
else if ( !self isplayeronsamemachine( level.players[ index ] ) )
if ( !self isplayeronsamemachine( level.players[ index ] ) )
{
index++;
continue;
}
else
if ( isalive( level.players[ index ] ) )
{
if ( isalive( level.players[ index ] ) )
{
return 1;
}
return 1;
}
index++;
}
return 0;
}
allowspectateallteams( allow )
allowspectateallteams( allow ) //checked changed to match cerberus output
{
_a114 = level.teams;
_k114 = getFirstArrayKey( _a114 );
while ( isDefined( _k114 ) )
foreach ( team in level.teams )
{
team = _a114[ _k114 ];
self allowspectateteam( team, allow );
_k114 = getNextArrayKey( _a114, _k114 );
}
}
allowspectateallteamsexceptteam( skip_team, allow )
allowspectateallteamsexceptteam( skip_team, allow ) //checked partially changed to match cerberus output did not use continue in foreach see github for more info
{
_a122 = level.teams;
_k122 = getFirstArrayKey( _a122 );
while ( isDefined( _k122 ) )
foreach ( team in level.teams )
{
team = _a122[ _k122 ];
if ( team == skip_team )
{
}
@ -155,11 +136,10 @@ allowspectateallteamsexceptteam( skip_team, allow )
{
self allowspectateteam( team, allow );
}
_k122 = getNextArrayKey( _a122, _k122 );
}
}
setspectatepermissions()
setspectatepermissions() //checked changed to match cerberus output
{
team = self.sessionteam;
if ( team == "spectator" )
@ -194,40 +174,37 @@ setspectatepermissions()
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "localplayers", 1 );
break;
}
else
{
case 1:
if ( !level.teambased )
{
self allowspectateallteams( 1 );
self allowspectateteam( "none", 1 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "localplayers", 1 );
}
else if ( isDefined( team ) && isDefined( level.teams[ team ] ) )
{
self allowspectateteam( team, 1 );
self allowspectateallteamsexceptteam( team, 0 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "none", 0 );
self allowspectateteam( "localplayers", 1 );
}
else
{
self allowspectateallteams( 0 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "none", 0 );
self allowspectateteam( "localplayers", 1 );
}
break;
case 2:
}
case 1:
if ( !level.teambased )
{
self allowspectateallteams( 1 );
self allowspectateteam( "freelook", 1 );
self allowspectateteam( "none", 1 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "localplayers", 1 );
break;
}
}
else if ( isDefined( team ) && isDefined( level.teams[ team ] ) )
{
self allowspectateteam( team, 1 );
self allowspectateallteamsexceptteam( team, 0 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "none", 0 );
self allowspectateteam( "localplayers", 1 );
}
else
{
self allowspectateallteams( 0 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "none", 0 );
self allowspectateteam( "localplayers", 1 );
}
break;
case 2:
self allowspectateallteams( 1 );
self allowspectateteam( "freelook", 1 );
self allowspectateteam( "none", 1 );
self allowspectateteam( "localplayers", 1 );
break;
}
if ( isDefined( team ) && isDefined( level.teams[ team ] ) )
{
@ -242,7 +219,7 @@ setspectatepermissions()
}
}
setspectatepermissionsformachine()
setspectatepermissionsformachine() //checked partially changed to match cerberus output did not change while loop to for loop see github for more info
{
self setspectatepermissions();
if ( !self issplitscreen() )
@ -267,10 +244,8 @@ setspectatepermissionsformachine()
index++;
continue;
}
else
{
level.players[ index ] setspectatepermissions();
}
level.players[ index ] setspectatepermissions();
index++;
}
}

View File

@ -57,6 +57,7 @@ patch_zm/maps/mp/gametypes_zm/_hud.gsc
patch_zm/maps/mp/gametypes_zm/_menus.gsc
patch_zm/maps/mp/gametypes_zm/_perplayer.gsc
patch_zm/maps/mp/gametypes_zm/_serversettings.gsc
patch_zm/maps/mp/gametypes_zm/_spectating.gsc
patch_zm/maps/mp/gametypes_zm/_tweakables.gsc
patch_zm/maps/mp/gametypes_zm/_weapon_utils.gsc
patch_zm/maps/mp/zombies/_zm_blockers.gsc
@ -93,7 +94,6 @@ patch_zm/maps/mp/gametypes_zm/_hud_message.gsc
patch_zm/maps/mp/gametypes_zm/_hud_util.gsc
patch_zm/maps/mp/gametypes_zm/_spawning.gsc
patch_zm/maps/mp/gametypes_zm/_spawnlogic.gsc
patch_zm/maps/mp/gametypes_zm/_spectating.gsc
patch_zm/maps/mp/gametypes_zm/_weaponobjects.gsc
patch_zm/maps/mp/gametypes_zm/_weapons.gsc
```