2022-07-24 03:48:13 -07:00
|
|
|
/*
|
|
|
|
=============
|
|
|
|
///ScriptDocBegin
|
|
|
|
"Name: noclip()"
|
|
|
|
"Summary: noclip used on a player entity will make them fly and clip through walls."
|
|
|
|
"Module: IW4x Utility"
|
|
|
|
"CallOn: An entity"
|
|
|
|
"Example: level.player noclip();"
|
|
|
|
"SPMP: multiplayer"
|
|
|
|
///ScriptDocEnd
|
|
|
|
=============
|
|
|
|
*/
|
|
|
|
noclip()
|
|
|
|
{
|
|
|
|
if ( self.clientflags & 1 )
|
|
|
|
{
|
|
|
|
self iprintln( &"GAME_NOCLIPOFF" );
|
|
|
|
self.clientflags &= ~1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
self iprintln( &"GAME_NOCLIPON" );
|
|
|
|
self.clientflags |= 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
=============
|
|
|
|
///ScriptDocBegin
|
|
|
|
"Name: ufo()"
|
|
|
|
"Summary: ufo used on a player entity will make them fly and clip through walls."
|
|
|
|
"Module: IW4x Utility"
|
|
|
|
"CallOn: An entity"
|
|
|
|
"Example: level.player ufo();"
|
|
|
|
"SPMP: multiplayer"
|
|
|
|
///ScriptDocEnd
|
|
|
|
=============
|
|
|
|
*/
|
|
|
|
ufo()
|
|
|
|
{
|
|
|
|
if ( self.clientflags & 2 )
|
|
|
|
{
|
|
|
|
self iprintln( &"GAME_UFOOFF" );
|
|
|
|
self.clientflags &= ~2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
self iprintln( &"GAME_UFOON" );
|
|
|
|
self.clientflags |= 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
=============
|
|
|
|
///ScriptDocBegin
|
|
|
|
"Name: god()"
|
|
|
|
"Summary: god used on a entity will make them immune to damage."
|
|
|
|
"Module: IW4x Utility"
|
|
|
|
"CallOn: An entity"
|
|
|
|
"Example: level.player god();"
|
|
|
|
"SPMP: multiplayer"
|
|
|
|
///ScriptDocEnd
|
|
|
|
=============
|
|
|
|
*/
|
|
|
|
god()
|
|
|
|
{
|
|
|
|
FL_GODMODE = 1 << 0;
|
2022-07-24 11:45:49 -07:00
|
|
|
msg = &"";
|
2022-07-24 03:48:13 -07:00
|
|
|
|
|
|
|
if ( self.entityflags & FL_GODMODE )
|
|
|
|
{
|
2022-07-24 11:45:49 -07:00
|
|
|
msg = &"GAME_GODMODE_OFF";
|
2022-07-24 03:48:13 -07:00
|
|
|
self.entityflags &= ~FL_GODMODE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-07-24 11:45:49 -07:00
|
|
|
msg = &"GAME_GODMODE_ON";
|
2022-07-24 03:48:13 -07:00
|
|
|
self.entityflags |= FL_GODMODE;
|
|
|
|
}
|
2022-07-24 11:45:49 -07:00
|
|
|
|
|
|
|
if ( isPlayer( self ) )
|
|
|
|
{
|
|
|
|
self iprintln( msg );
|
|
|
|
}
|
2022-07-24 03:48:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
=============
|
|
|
|
///ScriptDocBegin
|
|
|
|
"Name: demiGod()"
|
|
|
|
"Summary: demiGod used on a entity will make them immune to damage but will still flinch."
|
|
|
|
"Module: IW4x Utility"
|
|
|
|
"CallOn: An entity"
|
|
|
|
"Example: level.player demiGod();"
|
|
|
|
"SPMP: multiplayer"
|
|
|
|
///ScriptDocEnd
|
|
|
|
=============
|
|
|
|
*/
|
|
|
|
demiGod()
|
|
|
|
{
|
|
|
|
FL_DEMI_GODMODE = 1 << 1;
|
2022-07-24 11:45:49 -07:00
|
|
|
msg = &"";
|
2022-07-24 03:48:13 -07:00
|
|
|
|
|
|
|
if ( self.entityflags & FL_DEMI_GODMODE )
|
|
|
|
{
|
2022-07-24 11:45:49 -07:00
|
|
|
msg = &"GAME_DEMI_GODMODE_OFF";
|
2022-07-24 03:48:13 -07:00
|
|
|
self.entityflags &= ~FL_DEMI_GODMODE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-07-24 11:45:49 -07:00
|
|
|
msg = &"GAME_DEMI_GODMODE_ON";
|
2022-07-24 03:48:13 -07:00
|
|
|
self.entityflags |= FL_DEMI_GODMODE;
|
|
|
|
}
|
2022-07-24 11:45:49 -07:00
|
|
|
|
|
|
|
if ( isPlayer( self ) )
|
|
|
|
{
|
|
|
|
self iprintln( msg );
|
|
|
|
}
|
2022-07-24 03:48:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
=============
|
|
|
|
///ScriptDocBegin
|
|
|
|
"Name: noTarget()"
|
|
|
|
"Summary: noTarget used on a entity will make the AI ignore them."
|
|
|
|
"Module: IW4x Utility"
|
|
|
|
"CallOn: An entity"
|
|
|
|
"Example: level.player noTarget();"
|
|
|
|
"SPMP: singleplayer"
|
|
|
|
///ScriptDocEnd
|
|
|
|
=============
|
|
|
|
*/
|
|
|
|
noTarget()
|
|
|
|
{
|
|
|
|
FL_NOTARGET = 1 << 2;
|
2022-07-24 11:45:49 -07:00
|
|
|
msg = &"";
|
2022-07-24 03:48:13 -07:00
|
|
|
|
|
|
|
if ( self.entityflags & FL_NOTARGET )
|
|
|
|
{
|
2022-07-24 11:45:49 -07:00
|
|
|
msg = &"GAME_NOTARGETOFF";
|
2022-07-24 03:48:13 -07:00
|
|
|
self.entityflags &= ~FL_NOTARGET;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-07-24 11:45:49 -07:00
|
|
|
msg = &"GAME_NOTARGETON";
|
2022-07-24 03:48:13 -07:00
|
|
|
self.entityflags |= FL_NOTARGET;
|
|
|
|
}
|
2022-07-24 11:45:49 -07:00
|
|
|
|
|
|
|
if ( isPlayer( self ) )
|
|
|
|
{
|
|
|
|
self iprintln( msg );
|
|
|
|
}
|
2022-07-24 03:48:13 -07:00
|
|
|
}
|