Guest User

Untitled

a guest
Nov 6th, 2017
49
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Max players constant
  2. #define MAX_PLAYERS 64
  3.  
  4. // Zandronum's unique event script
  5. script "main event script" (int type, int arg1, int arg2) EVENT
  6. {
  7.     switch (type)
  8.     {
  9.         // Player sends a chat message
  10.         case GAMEEVENT_CHAT:
  11.  
  12.             // Variables used
  13.             int playerId = arg1;
  14.             str message = arg2;
  15.  
  16.             // Full message that's send as a fake chat message
  17.             str fullMessage = StrParam(n:playerId-1, s:": ", s:message);
  18.  
  19.             for (int i = 0; i < MAX_PLAYERS; ++i)
  20.             {
  21.                 // Is the player i near the player that triggered the event script?
  22.                 if (!playerIsNearChatter(i, playerId)) {
  23.                     continue;
  24.                 }
  25.                
  26.                 // This will log to a specific player (function not included since this is just an example)
  27.                 LogTo(i, fullMessage);
  28.             }
  29.             terminate;
  30.     }
  31. }
RAW Paste Data