This commit is contained in:
parent
8091ca53bb
commit
706408d20f
@ -12,11 +12,7 @@
|
||||
|
||||
GENERIC_INIT;
|
||||
|
||||
onPlayerConnect()
|
||||
{
|
||||
while ( true )
|
||||
{
|
||||
level waittill( "connected", player );
|
||||
_ON_PLAYER_CNCT_BEGIN
|
||||
|
||||
#if defined(TOOL)
|
||||
waittillframeend;
|
||||
@ -35,8 +31,8 @@ onPlayerConnect()
|
||||
player thread jumper();
|
||||
player thread displaySpeed();
|
||||
player thread onPlayerSpawned();
|
||||
}
|
||||
}
|
||||
|
||||
_ON_PLAYER_CNCT_END
|
||||
|
||||
displaySpeed()
|
||||
{
|
||||
|
@ -26,6 +26,12 @@
|
||||
|
||||
#define TEMP_DVAR "temp_dvar_util"
|
||||
|
||||
#if defined(T4)
|
||||
#define CLIENT_FIELD_NAME playername
|
||||
#else
|
||||
#define CLIENT_FIELD_NAME name
|
||||
#endif
|
||||
|
||||
#define GENERIC_INIT \
|
||||
init() \
|
||||
{ \
|
||||
@ -36,6 +42,17 @@
|
||||
level endon( "game_ended" ); \
|
||||
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 */
|
||||
/* Do not use the + to concatenate strings, let the GSC VM do it for you */
|
||||
/* Other clients will have print available */
|
||||
@ -112,14 +129,14 @@
|
||||
#define BOT_CHK(ent) \
|
||||
if ( ent isTestClient() ) \
|
||||
{ \
|
||||
DEBUG_PRINT( ent.name + " is a bot\n" ); \
|
||||
DEBUG_PRINT( ent.CLIENT_FIELD_NAME + " is a bot\n" ); \
|
||||
CHK_ACTION; \
|
||||
}
|
||||
#else /* Valid for other clients */
|
||||
#define BOT_CHK(ent) \
|
||||
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; \
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user