Advertisement
Guest User

Untitled

a guest
Nov 6th, 2017
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. #define MAX_PLAYERS 64
  2. script "main event script" (int type, int arg1, int arg2) EVENT
  3. {
  4.     switch (type)
  5.     {
  6.         case GAMEEVENT_CHAT:
  7.             int playerId = arg1;
  8.             str message = arg2;
  9.             str fullMessage = StrParam(n:playerId-1, s:": ", s:message);
  10.             for (int i = 0; i < MAX_PLAYERS; ++i)
  11.             {
  12.                 if (!playerIsNearChatter(i, playerId)) {
  13.                     continue;
  14.                 }
  15.                
  16.                 // This will log to a specific player (function not included since this is just an example)
  17.                 LogTo(i, fullMessage);
  18.             }
  19.             terminate;
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement