Advertisement
Guest User

Untitled

a guest
Jul 20th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. /* CSO Print Color
  2. *
  3. *
  4. * This file is provided as is (no warranties).
  5. */
  6.  
  7. #if defined _print_included
  8. #endinput
  9. #endif
  10.  
  11. #define _print_included
  12.  
  13. #define CHAT_TAG "^x04[Points SQLx]^x01"
  14.  
  15. stock print_message(const Player, const Message[], any:...)
  16. {
  17. // Some information
  18. new i_CountPlayer = 1, i_MsgSayText, a;
  19. new i_PlayersNum[32], i_FinalMsgString[191], i_MsgVFormat[191];
  20. vformat(i_MsgVFormat, charsmax (i_MsgVFormat), Message, 3);
  21.  
  22. // Formatting last message send
  23. replace_all(i_MsgVFormat, charsmax(i_MsgVFormat), "^x01", "");
  24. formatex(i_FinalMsgString, charsmax(i_FinalMsgString), "%s %s", CHAT_TAG, i_MsgVFormat);
  25.  
  26. // Send message info
  27. i_MsgSayText = get_user_msgid("SayText");
  28.  
  29. // Sending message to one or more players?
  30. if(Player)
  31. {
  32. message_begin(MSG_ONE_UNRELIABLE, i_MsgSayText, _, Player);
  33. write_byte(Player);
  34. write_string(i_FinalMsgString);
  35. message_end();
  36. }
  37. else
  38. {
  39. for(a = 0; a < i_CountPlayer; a++)
  40. {
  41. new i_Players = i_PlayersNum[a];
  42.  
  43. if(!is_user_connected(i_Players))
  44. continue;
  45.  
  46. message_begin(MSG_ONE_UNRELIABLE, i_MsgSayText, _, i_Players);
  47. write_byte(i_Players);
  48. write_string(i_FinalMsgString);
  49. message_end();
  50. }
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement