1
0
mirror of https://github.com/XLabsProject/iw4x-rawfiles.git synced 2023-08-02 15:02:11 +02:00
iw4x-rawfiles/iw4x/iw4x_00/common_scripts/iw4x_utility.gsc

154 lines
2.5 KiB
Plaintext
Raw Normal View History

/*
=============
///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 20:45:49 +02:00
msg = &"";
if ( self.entityflags & FL_GODMODE )
{
2022-07-24 20:45:49 +02:00
msg = &"GAME_GODMODE_OFF";
self.entityflags &= ~FL_GODMODE;
}
else
{
2022-07-24 20:45:49 +02:00
msg = &"GAME_GODMODE_ON";
self.entityflags |= FL_GODMODE;
}
2022-07-24 20:45:49 +02:00
if ( isPlayer( self ) )
{
self iprintln( msg );
}
}
/*
=============
///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 20:45:49 +02:00
msg = &"";
if ( self.entityflags & FL_DEMI_GODMODE )
{
2022-07-24 20:45:49 +02:00
msg = &"GAME_DEMI_GODMODE_OFF";
self.entityflags &= ~FL_DEMI_GODMODE;
}
else
{
2022-07-24 20:45:49 +02:00
msg = &"GAME_DEMI_GODMODE_ON";
self.entityflags |= FL_DEMI_GODMODE;
}
2022-07-24 20:45:49 +02:00
if ( isPlayer( self ) )
{
self iprintln( msg );
}
}
/*
=============
///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 20:45:49 +02:00
msg = &"";
if ( self.entityflags & FL_NOTARGET )
{
2022-07-24 20:45:49 +02:00
msg = &"GAME_NOTARGETOFF";
self.entityflags &= ~FL_NOTARGET;
}
else
{
2022-07-24 20:45:49 +02:00
msg = &"GAME_NOTARGETON";
self.entityflags |= FL_NOTARGET;
}
2022-07-24 20:45:49 +02:00
if ( isPlayer( self ) )
{
self iprintln( msg );
}
}