Skip to content

Commit

Permalink
Improvements to game scripts (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
diamante0018 authored Jul 16, 2022
1 parent 790b508 commit d746ca0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions GameFiles/IW4x/userraw/scripts/_customcallbacks.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ onPlayerConnect( player )
for( ;; )
{
level waittill( "connected", player );
player setClientDvar("cl_autorecord", 1);
player setClientDvar("cl_demosKeep", 200);
player setClientDvars( "cl_autorecord", 1,
"cl_demosKeep", 200 );

player thread waitForFrameThread();
player thread waitForAttack();
}
Expand Down Expand Up @@ -60,7 +61,7 @@ getHttpString( url )

runRadarUpdates()
{
interval = int(getDvar("sv_printradar_updateinterval"));
interval = getDvarInt( "sv_printradar_updateinterval", 500 );

for ( ;; )
{
Expand Down Expand Up @@ -191,7 +192,7 @@ waitForAdditionalAngles( logString, beforeFrameCount, afterFrameCount )
i++;
}

lastAttack = int(getTime()) - int(self.lastAttackTime);
lastAttack = getTime() - self.lastAttackTime;
isAlive = isAlive(self);

logPrint(logString + ";" + anglesStr + ";" + isAlive + ";" + lastAttack + "\n" );
Expand Down
4 changes: 2 additions & 2 deletions GameFiles/IW5/storage/iw5/scripts/_customcallbacks.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ waitForAttack()

runRadarUpdates()
{
interval = int(getDvar("sv_printradar_updateinterval"));
interval = getDvarInt( "sv_printradar_updateinterval", 500 );

for ( ;; )
{
Expand Down Expand Up @@ -183,7 +183,7 @@ waitForAdditionalAngles( logString, beforeFrameCount, afterFrameCount )
i++;
}

lastAttack = int(getTime()) - int(self.lastAttackTime);
lastAttack = getTime() - self.lastAttackTime;
isAlive = isAlive(self);

logPrint(logString + ";" + anglesStr + ";" + isAlive + ";" + lastAttack + "\n" );
Expand Down
4 changes: 2 additions & 2 deletions GameFiles/PT6/storage/t6/scripts/mp/_customcallbacks.gsc.src
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ waitForAttack()

runRadarUpdates()
{
interval = int(getDvar("sv_printradar_updateinterval"));
interval = getDvarInt( "sv_printradar_updateinterval" );

for ( ;; )
{
Expand Down Expand Up @@ -190,7 +190,7 @@ waitForAdditionalAngles( logString, beforeFrameCount, afterFrameCount )
i++;
}

lastAttack = int(getTime()) - int(self.lastAttackTime);
lastAttack = getTime() - self.lastAttackTime;
isAlive = isAlive(self);

logPrint(logString + ";" + anglesStr + ";" + isAlive + ";" + lastAttack + "\n" );
Expand Down

0 comments on commit d746ca0

Please sign in to comment.