Advertisement
Sugisaki

[AMXX] Chat color base

Jun 24th, 2015
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.86 KB | None | 0 0
  1. /*
  2. Include: "http://pastebin.com/ZUrWWheV"
  3. */
  4.  
  5. #include <amxmodx>
  6.  
  7. #define PLUGIN "Chat Color Base"
  8. #define VERSION "1.0"
  9. #define AUTHOR "Sugisaki"
  10.  
  11. new MsgIdSayText
  12.  
  13. public plugin_init()
  14. {
  15.     register_plugin(PLUGIN, VERSION, AUTHOR)
  16.     MsgIdSayText = get_user_msgid("SayText")
  17. }
  18. public plugin_natives()
  19. {
  20.     register_native("chat_color", "native_chat_color")
  21. }
  22. public native_chat_color(plugin, params)
  23. {
  24.     new id = get_param(1), msg_type = get_param(2), buffer[192]
  25.     get_string(3, buffer, charsmax(buffer))
  26.    
  27.     vdformat(buffer, charsmax(buffer), 3, 4)
  28.    
  29.     replace_all(buffer, charsmax(buffer), "!t", "^3")
  30.     replace_all(buffer, charsmax(buffer), "!n", "^1")
  31.     replace_all(buffer, charsmax(buffer), "!g", "^4")
  32.    
  33.     message_begin(id ? msg_type : MSG_ALL, MsgIdSayText, {0, 0, 0}, id ? id : 0)
  34.     write_byte(id ? id : 33)
  35.     write_string(buffer)
  36.     message_end()
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement