This commit is contained in:
parent
8091ca53bb
commit
706408d20f
@ -12,11 +12,7 @@
|
|||||||
|
|
||||||
GENERIC_INIT;
|
GENERIC_INIT;
|
||||||
|
|
||||||
onPlayerConnect()
|
_ON_PLAYER_CNCT_BEGIN
|
||||||
{
|
|
||||||
while ( true )
|
|
||||||
{
|
|
||||||
level waittill( "connected", player );
|
|
||||||
|
|
||||||
#if defined(TOOL)
|
#if defined(TOOL)
|
||||||
waittillframeend;
|
waittillframeend;
|
||||||
@ -35,8 +31,8 @@ onPlayerConnect()
|
|||||||
player thread jumper();
|
player thread jumper();
|
||||||
player thread displaySpeed();
|
player thread displaySpeed();
|
||||||
player thread onPlayerSpawned();
|
player thread onPlayerSpawned();
|
||||||
}
|
|
||||||
}
|
_ON_PLAYER_CNCT_END
|
||||||
|
|
||||||
displaySpeed()
|
displaySpeed()
|
||||||
{
|
{
|
||||||
|
@ -26,6 +26,12 @@
|
|||||||
|
|
||||||
#define TEMP_DVAR "temp_dvar_util"
|
#define TEMP_DVAR "temp_dvar_util"
|
||||||
|
|
||||||
|
#if defined(T4)
|
||||||
|
#define CLIENT_FIELD_NAME playername
|
||||||
|
#else
|
||||||
|
#define CLIENT_FIELD_NAME name
|
||||||
|
#endif
|
||||||
|
|
||||||
#define GENERIC_INIT \
|
#define GENERIC_INIT \
|
||||||
init() \
|
init() \
|
||||||
{ \
|
{ \
|
||||||
@ -36,6 +42,17 @@
|
|||||||
level endon( "game_ended" ); \
|
level endon( "game_ended" ); \
|
||||||
self endon( "disconnect" );
|
self endon( "disconnect" );
|
||||||
|
|
||||||
|
/* Captures a "connected" event. Perform your action(s) using the "player" variable */
|
||||||
|
#define _ON_PLAYER_CNCT_BEGIN onPlayerConnect() \
|
||||||
|
{ \
|
||||||
|
while ( true ) \
|
||||||
|
{ \
|
||||||
|
level waittill( "connected", player );
|
||||||
|
|
||||||
|
#define _ON_PLAYER_CNCT_END \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
/* IW4x MP has printConsole Built-in. __VA_OPT__ requires C++20 compliant preprocessor */
|
/* IW4x MP has printConsole Built-in. __VA_OPT__ requires C++20 compliant preprocessor */
|
||||||
/* Do not use the + to concatenate strings, let the GSC VM do it for you */
|
/* Do not use the + to concatenate strings, let the GSC VM do it for you */
|
||||||
/* Other clients will have print available */
|
/* Other clients will have print available */
|
||||||
@ -112,14 +129,14 @@
|
|||||||
#define BOT_CHK(ent) \
|
#define BOT_CHK(ent) \
|
||||||
if ( ent isTestClient() ) \
|
if ( ent isTestClient() ) \
|
||||||
{ \
|
{ \
|
||||||
DEBUG_PRINT( ent.name + " is a bot\n" ); \
|
DEBUG_PRINT( ent.CLIENT_FIELD_NAME + " is a bot\n" ); \
|
||||||
CHK_ACTION; \
|
CHK_ACTION; \
|
||||||
}
|
}
|
||||||
#else /* Valid for other clients */
|
#else /* Valid for other clients */
|
||||||
#define BOT_CHK(ent) \
|
#define BOT_CHK(ent) \
|
||||||
if ( isDefined( ent.pers["isBot"] ) && ent.pers["isBot"] ) \
|
if ( isDefined( ent.pers["isBot"] ) && ent.pers["isBot"] ) \
|
||||||
{ \
|
{ \
|
||||||
DEBUG_PRINT( ent.name + " is a bot\n" ); \
|
DEBUG_PRINT( ent.CLIENT_FIELD_NAME + " is a bot\n" ); \
|
||||||
CHK_ACTION; \
|
CHK_ACTION; \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user