From 7715b339b2476732285e923f51415d386edf19e6 Mon Sep 17 00:00:00 2001 From: FutureRave Date: Thu, 16 Mar 2023 14:54:25 +0000 Subject: [PATCH] maint: add a new macro --- _utility.gsh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/_utility.gsh b/_utility.gsh index 0bae437..294c0a2 100644 --- a/_utility.gsh +++ b/_utility.gsh @@ -23,6 +23,17 @@ thread onPlayerConnect(); \ } +/* 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 avaiable */ @@ -85,7 +96,7 @@ #if defined(IW4MP) || defined(IW5x) #define BOT_CHK(ent) \ - if ( ent isBot() ) \ + if ( ent isTestClient() ) \ { \ CHK_ACTION; \ }