1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-07 21:58:06 -05:00

feat: add basic integration support for IW6x (#320)

Co-authored-by: RaidMax <raidmax@live.com>
Co-authored-by: Edo <edoardo.sanguineti222@gmail.com>
This commit is contained in:
yfbsei 2024-02-13 05:32:16 -05:00 committed by GitHub
parent 265bb1fbf6
commit 1dd125c579
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,58 @@
Init()
{
thread Setup();
}
Setup()
{
level endon( "game_ended" );
waittillframeend;
level waittill( level.notifyTypes.sharedFunctionsInitialized );
scripts\_integration_base::RegisterLogger( ::Log2Console );
level.overrideMethods[level.commonFunctions.getTotalShotsFired] = ::GetTotalShotsFired;
level.overrideMethods[level.commonFunctions.setDvar] = ::SetDvarIfUninitializedWrapper;
level.overrideMethods[level.commonFunctions.waittillNotifyOrTimeout] = ::WaitillNotifyOrTimeoutWrapper;
level.overrideMethods[level.commonFunctions.isBot] = ::IsBotWrapper;
level.overrideMethods[level.commonFunctions.getXuid] = ::GetXuidWrapper;
level.overrideMethods[level.commonFunctions.waitTillAnyTimeout] = ::WaitTillAnyTimeout;
level notify( level.notifyTypes.gameFunctionsInitialized );
}
GetTotalShotsFired()
{
return maps\mp\_utility::getPlayerStat( "mostshotsfired" );
}
SetDvarIfUninitializedWrapper( dvar, value )
{
SetDvarIfUninitialized( dvar, value );
}
WaitillNotifyOrTimeoutWrapper( _notify, timeout )
{
common_scripts\utility::waittill_notify_or_timeout( _notify, timeout );
}
Log2Console( logLevel, message )
{
Print( "[" + logLevel + "] " + message + "\n" );
}
IsBotWrapper( client )
{
return IsBot( client );
}
GetXuidWrapper()
{
return self GetXUID();
}
WaitTillAnyTimeout( timeOut, string1, string2, string3, string4, string5 )
{
return common_scripts\utility::waittill_any_timeout( timeOut, string1, string2, string3, string4, string5 );
}