1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

clean-up and make game interface gsc consistent

This commit is contained in:
RaidMax
2023-06-01 20:45:05 -05:00
parent debad66884
commit 13d5dcb8a8
8 changed files with 316 additions and 1036 deletions

View File

@ -1,45 +1,48 @@
init()
Init()
{
level.startmessagedefaultduration = 2;
level.regulargamemessages = spawnstruct();
level.regulargamemessages.waittime = 6;
level thread onplayerconnect();
thread OnPlayerConnect();
}
onplayerconnect()
OnPlayerConnect()
{
for ( ;; )
{
level waittill( "connecting", player );
player thread displaypopupswaiter();
player thread DisplaypopupsWaiter()();
}
}
displaypopupswaiter()
DisplaypopupsWaiter()
{
self endon( "disconnect" );
self.ranknotifyqueue = [];
if ( !isDefined( self.pers[ "challengeNotifyQueue" ] ) )
if ( !IsDefined( self.pers[ "challengeNotifyQueue" ] ) )
{
self.pers[ "challengeNotifyQueue" ] = [];
}
if ( !isDefined( self.pers[ "contractNotifyQueue" ] ) )
if ( !IsDefined( self.pers[ "contractNotifyQueue" ] ) )
{
self.pers[ "contractNotifyQueue" ] = [];
}
self.messagenotifyqueue = [];
self.startmessagenotifyqueue = [];
self.wagernotifyqueue = [];
while ( !level.gameended )
{
if ( self.startmessagenotifyqueue.size == 0 && self.messagenotifyqueue.size == 0 )
{
self waittill( "received award" );
}
waittillframeend;
if ( level.gameended )
{
return;
@ -50,7 +53,7 @@ displaypopupswaiter()
{
nextnotifydata = self.startmessagenotifyqueue[ 0 ];
arrayremoveindex( self.startmessagenotifyqueue, 0, 0 );
if ( isDefined( nextnotifydata.duration ) )
if ( IsDefined( nextnotifydata.duration ) )
{
duration = nextnotifydata.duration;
}
@ -58,15 +61,18 @@ displaypopupswaiter()
{
duration = level.startmessagedefaultduration;
}
self maps\mp\gametypes_zm\_hud_message::shownotifymessage( nextnotifydata, duration );
wait duration;
wait ( duration );
continue;
}
else if ( self.messagenotifyqueue.size > 0 )
{
nextnotifydata = self.messagenotifyqueue[ 0 ];
arrayremoveindex( self.messagenotifyqueue, 0, 0 );
if ( isDefined( nextnotifydata.duration ) )
if ( IsDefined( nextnotifydata.duration ) )
{
duration = nextnotifydata.duration;
}
@ -74,13 +80,14 @@ displaypopupswaiter()
{
duration = level.regulargamemessages.waittime;
}
self maps\mp\gametypes_zm\_hud_message::shownotifymessage( nextnotifydata, duration );
continue;
}
else
{
wait 1;
wait ( 1 );
}
}
}
}
}