Merge branch 'develop' of github.com:RaidMax/IW4M-Admin into develop
This commit is contained in:
commit
d4e266ed94
@ -161,6 +161,8 @@ _SetDvarIfUninitialized( dvarName, dvarValue )
|
|||||||
|
|
||||||
_GetPlayerFromClientNum( clientNum )
|
_GetPlayerFromClientNum( clientNum )
|
||||||
{
|
{
|
||||||
|
assertEx( clientNum >= 0, "clientNum cannot be negative" );
|
||||||
|
|
||||||
if ( clientNum < 0 )
|
if ( clientNum < 0 )
|
||||||
{
|
{
|
||||||
return undefined;
|
return undefined;
|
||||||
@ -540,6 +542,7 @@ AddClientCommand( commandName, shouldRunAsTarget, callback, shouldOverwrite )
|
|||||||
|
|
||||||
OnClientDataReceived( event )
|
OnClientDataReceived( event )
|
||||||
{
|
{
|
||||||
|
assertEx( isDefined( self ), "player entity is not defined");
|
||||||
clientData = self.pers[level.clientDataKey];
|
clientData = self.pers[level.clientDataKey];
|
||||||
|
|
||||||
if ( event.subtype == "Fail" )
|
if ( event.subtype == "Fail" )
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#include common_scripts\utility;
|
#include common_scripts\utility;
|
||||||
|
|
||||||
|
#inline scripts\_integration_utility;
|
||||||
|
|
||||||
Init()
|
Init()
|
||||||
{
|
{
|
||||||
thread Setup();
|
thread Setup();
|
||||||
@ -82,10 +84,7 @@ WaitTillAnyTimeout( timeOut, string1, string2, string3, string4, string5 )
|
|||||||
|
|
||||||
GiveWeaponImpl( event, data )
|
GiveWeaponImpl( event, data )
|
||||||
{
|
{
|
||||||
if ( !IsAlive( self ) )
|
_IS_ALIVE( self );
|
||||||
{
|
|
||||||
return self.name + "^7 is not alive";
|
|
||||||
}
|
|
||||||
|
|
||||||
self IPrintLnBold( "You have been given a new weapon" );
|
self IPrintLnBold( "You have been given a new weapon" );
|
||||||
self GiveWeapon( data["weaponName"] );
|
self GiveWeapon( data["weaponName"] );
|
||||||
@ -96,10 +95,7 @@ GiveWeaponImpl( event, data )
|
|||||||
|
|
||||||
TakeWeaponsImpl()
|
TakeWeaponsImpl()
|
||||||
{
|
{
|
||||||
if ( !IsAlive( self ) )
|
_IS_ALIVE( self );
|
||||||
{
|
|
||||||
return self.name + "^7 is not alive";
|
|
||||||
}
|
|
||||||
|
|
||||||
self TakeAllWeapons();
|
self TakeAllWeapons();
|
||||||
self IPrintLnBold( "All your weapons have been taken" );
|
self IPrintLnBold( "All your weapons have been taken" );
|
||||||
@ -109,10 +105,7 @@ TakeWeaponsImpl()
|
|||||||
|
|
||||||
TeamSwitchImpl()
|
TeamSwitchImpl()
|
||||||
{
|
{
|
||||||
if ( !IsAlive( self ) )
|
_IS_ALIVE( self );
|
||||||
{
|
|
||||||
return self + "^7 is not alive";
|
|
||||||
}
|
|
||||||
|
|
||||||
team = level.allies;
|
team = level.allies;
|
||||||
|
|
||||||
@ -130,10 +123,7 @@ TeamSwitchImpl()
|
|||||||
|
|
||||||
LockControlsImpl()
|
LockControlsImpl()
|
||||||
{
|
{
|
||||||
if ( !IsAlive( self ) )
|
_IS_ALIVE( self );
|
||||||
{
|
|
||||||
return self.name + "^7 is not alive";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !IsDefined ( self.isControlLocked ) )
|
if ( !IsDefined ( self.isControlLocked ) )
|
||||||
{
|
{
|
||||||
@ -170,6 +160,8 @@ LockControlsImpl()
|
|||||||
|
|
||||||
NoClipImpl()
|
NoClipImpl()
|
||||||
{
|
{
|
||||||
|
_VERIFY_PLAYER_ENT( self );
|
||||||
|
|
||||||
if ( !IsAlive( self ) )
|
if ( !IsAlive( self ) )
|
||||||
{
|
{
|
||||||
self IPrintLnBold( "You are not alive" );
|
self IPrintLnBold( "You are not alive" );
|
||||||
@ -215,10 +207,11 @@ NoClipImpl()
|
|||||||
|
|
||||||
HideImpl()
|
HideImpl()
|
||||||
{
|
{
|
||||||
|
_VERIFY_PLAYER_ENT( self );
|
||||||
|
|
||||||
if ( !IsAlive( self ) )
|
if ( !IsAlive( self ) )
|
||||||
{
|
{
|
||||||
self IPrintLnBold( "You are not alive" );
|
self IPrintLnBold( "You are not alive" );
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !IsDefined ( self.isHidden ) )
|
if ( !IsDefined ( self.isHidden ) )
|
||||||
@ -274,6 +267,8 @@ GotoImpl( event, data )
|
|||||||
|
|
||||||
GotoCoordImpl( data )
|
GotoCoordImpl( data )
|
||||||
{
|
{
|
||||||
|
_VERIFY_PLAYER_ENT( self );
|
||||||
|
|
||||||
if ( !IsAlive( self ) )
|
if ( !IsAlive( self ) )
|
||||||
{
|
{
|
||||||
self IPrintLnBold( "You are not alive" );
|
self IPrintLnBold( "You are not alive" );
|
||||||
@ -287,6 +282,8 @@ GotoCoordImpl( data )
|
|||||||
|
|
||||||
GotoPlayerImpl( target )
|
GotoPlayerImpl( target )
|
||||||
{
|
{
|
||||||
|
_VERIFY_PLAYER_ENT( self );
|
||||||
|
|
||||||
if ( !IsAlive( target ) )
|
if ( !IsAlive( target ) )
|
||||||
{
|
{
|
||||||
self IPrintLnBold( target.name + " is not alive" );
|
self IPrintLnBold( target.name + " is not alive" );
|
||||||
@ -299,10 +296,7 @@ GotoPlayerImpl( target )
|
|||||||
|
|
||||||
PlayerToMeImpl( event )
|
PlayerToMeImpl( event )
|
||||||
{
|
{
|
||||||
if ( !IsAlive( self ) )
|
_IS_ALIVE( self );
|
||||||
{
|
|
||||||
return self.name + " is not alive";
|
|
||||||
}
|
|
||||||
|
|
||||||
self SetOrigin( event.origin GetOrigin() );
|
self SetOrigin( event.origin GetOrigin() );
|
||||||
return "Moved here " + self.name;
|
return "Moved here " + self.name;
|
||||||
@ -310,10 +304,7 @@ PlayerToMeImpl( event )
|
|||||||
|
|
||||||
KillImpl()
|
KillImpl()
|
||||||
{
|
{
|
||||||
if ( !IsAlive( self ) )
|
_IS_ALIVE( self );
|
||||||
{
|
|
||||||
return self.name + " is not alive";
|
|
||||||
}
|
|
||||||
|
|
||||||
self Suicide();
|
self Suicide();
|
||||||
self IPrintLnBold( "You were killed by " + self.name );
|
self IPrintLnBold( "You were killed by " + self.name );
|
||||||
@ -323,6 +314,8 @@ KillImpl()
|
|||||||
|
|
||||||
SetSpectatorImpl()
|
SetSpectatorImpl()
|
||||||
{
|
{
|
||||||
|
_VERIFY_PLAYER_ENT( self );
|
||||||
|
|
||||||
if ( self.pers["team"] == "spectator" )
|
if ( self.pers["team"] == "spectator" )
|
||||||
{
|
{
|
||||||
return self.name + " is already spectating";
|
return self.name + " is already spectating";
|
||||||
|
40
GameFiles/GameInterface/_integration_utility.gsh
Normal file
40
GameFiles/GameInterface/_integration_utility.gsh
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* This file contains reusable preprocessor directives meant to be used on
|
||||||
|
* Plutonium & AlterWare clients that are up to date with the latest version.
|
||||||
|
* Older versions of Plutonium or other clients do not have support for loading
|
||||||
|
* or parsing "gsh" files.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Turn off assertions by removing the following define
|
||||||
|
* gsc-tool will only emit assertions if developer_script dvar is set to 1
|
||||||
|
* In short, you should not need to remove this define. Just turn them off
|
||||||
|
* by using the dvar
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _INTEGRATION_DEBUG
|
||||||
|
|
||||||
|
#ifdef _INTEGRATION_DEBUG
|
||||||
|
|
||||||
|
#define _VERIFY( cond, msg ) \
|
||||||
|
assertEx( cond, msg )
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
// This works as an "empty" define here with gsc-tool
|
||||||
|
#define _VERIFY( cond, msg )
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// This function is meant to be used inside "client commands"
|
||||||
|
// If the client is not alive it shall return an error message
|
||||||
|
#define _IS_ALIVE( ent ) \
|
||||||
|
_VERIFY( ent, "player entity is not defined" ); \
|
||||||
|
if ( !IsAlive( ent ) ) \
|
||||||
|
{ \
|
||||||
|
return ent.name + "^7 is not alive"; \
|
||||||
|
}
|
||||||
|
|
||||||
|
// This function should be used to verify if a player entity is defined
|
||||||
|
#define _VERIFY_PLAYER_ENT( ent ) \
|
||||||
|
_VERIFY( ent, "player entity is not defined" )
|
@ -3,14 +3,7 @@
|
|||||||
Allows integration of IW4M-Admin to GSC, mainly used for special commands that need to use GSC in order to work.
|
Allows integration of IW4M-Admin to GSC, mainly used for special commands that need to use GSC in order to work.
|
||||||
But can also be used to read / write metadata from / to a profile and to get the player permission level.
|
But can also be used to read / write metadata from / to a profile and to get the player permission level.
|
||||||
|
|
||||||
|
## Installation Guide
|
||||||
## Installation Plutonium IW5
|
|
||||||
|
|
||||||
|
|
||||||
Move `_integration.gsc` to `%localappdata%\Plutonium\storage\iw5\scripts\`
|
The documentation can be found here: [GameInterface](https://github.com/RaidMax/IW4M-Admin/wiki/GameInterface)
|
||||||
|
|
||||||
|
|
||||||
## Installation IW4x
|
|
||||||
|
|
||||||
|
|
||||||
Move `_integration.gsc` to `IW4x/userraw/scripts`, `IW4x` being the root folder of your game server.
|
|
||||||
|
@ -4,6 +4,7 @@ ECHO "Pluto IW5"
|
|||||||
xcopy /y .\GameInterface\_integration_base.gsc "%LOCALAPPDATA%\Plutonium\storage\iw5\scripts"
|
xcopy /y .\GameInterface\_integration_base.gsc "%LOCALAPPDATA%\Plutonium\storage\iw5\scripts"
|
||||||
xcopy /y .\GameInterface\_integration_shared.gsc "%LOCALAPPDATA%\Plutonium\storage\iw5\scripts"
|
xcopy /y .\GameInterface\_integration_shared.gsc "%LOCALAPPDATA%\Plutonium\storage\iw5\scripts"
|
||||||
xcopy /y .\GameInterface\_integration_iw5.gsc "%LOCALAPPDATA%\Plutonium\storage\iw5\scripts"
|
xcopy /y .\GameInterface\_integration_iw5.gsc "%LOCALAPPDATA%\Plutonium\storage\iw5\scripts"
|
||||||
|
xcopy /y .\GameInterface\_integration_utility.gsh "%LOCALAPPDATA%\Plutonium\storage\iw5\scripts"
|
||||||
xcopy /y .\AntiCheat\IW5\storage\iw5\scripts\_customcallbacks.gsc "%LOCALAPPDATA%\Plutonium\storage\iw5\scripts\mp"
|
xcopy /y .\AntiCheat\IW5\storage\iw5\scripts\_customcallbacks.gsc "%LOCALAPPDATA%\Plutonium\storage\iw5\scripts\mp"
|
||||||
|
|
||||||
ECHO "Pluto T5"
|
ECHO "Pluto T5"
|
||||||
@ -13,8 +14,8 @@ xcopy /y .\GameInterface\_integration_t5.gsc "%LOCALAPPDATA%\Plutonium\storage\t
|
|||||||
xcopy /y .\GameInterface\_integration_t5zm.gsc "%LOCALAPPDATA%\Plutonium\storage\t5\scripts\sp\zom"
|
xcopy /y .\GameInterface\_integration_t5zm.gsc "%LOCALAPPDATA%\Plutonium\storage\t5\scripts\sp\zom"
|
||||||
|
|
||||||
ECHO "Pluto T6"
|
ECHO "Pluto T6"
|
||||||
xcopy /y .\AntiCheat\PT6\storage\t6\scripts\mp\_customcallbacks.gsc "%LOCALAPPDATA%\Plutonium\storage\t6\scripts\mp"
|
|
||||||
xcopy /y .\GameInterface\_integration_base.gsc "%LOCALAPPDATA%\Plutonium\storage\t6\scripts"
|
xcopy /y .\GameInterface\_integration_base.gsc "%LOCALAPPDATA%\Plutonium\storage\t6\scripts"
|
||||||
xcopy /y .\GameInterface\_integration_shared.gsc "%LOCALAPPDATA%\Plutonium\storage\t6\scripts"
|
xcopy /y .\GameInterface\_integration_shared.gsc "%LOCALAPPDATA%\Plutonium\storage\t6\scripts"
|
||||||
xcopy /y .\GameInterface\_integration_t6.gsc "%LOCALAPPDATA%\Plutonium\storage\t6\scripts"
|
xcopy /y .\GameInterface\_integration_t6.gsc "%LOCALAPPDATA%\Plutonium\storage\t6\scripts"
|
||||||
xcopy /y .\GameInterface\_integration_t6zm_helper.gsc "%LOCALAPPDATA%\Plutonium\storage\t6\scripts\zm"
|
xcopy /y .\GameInterface\_integration_t6zm_helper.gsc "%LOCALAPPDATA%\Plutonium\storage\t6\scripts\zm"
|
||||||
|
xcopy /y .\AntiCheat\PT6\storage\t6\scripts\mp\_customcallbacks.gsc "%LOCALAPPDATA%\Plutonium\storage\t6\scripts\mp"
|
||||||
|
Loading…
Reference in New Issue
Block a user