SHARE
TWEET

Untitled

a guest Feb 19th, 2020 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <aa_reg>
  4. #include <aa_rang>
  5. #include <aa_admin>
  6.  
  7. new maxplayers
  8.  
  9. public plugin_init()
  10. {
  11.     register_plugin("Chat", "1.0", "aarpi")
  12.     register_clcmd("say", "say")
  13.     register_clcmd("say_team", "say_team")
  14.    
  15.     maxplayers = get_maxplayers()
  16. }
  17. public say(id)
  18. {
  19.     new message[192]
  20.     read_args(message, 191)
  21.     remove_quotes(message)
  22.    
  23.     if(message[0] == '@' || message[0] == '/' || message[0] == '!' || equal(message, "") || equali(message, "!y") || equali(message, "!t") || equali(message, "!g"))
  24.         return PLUGIN_HANDLED
  25.    
  26.    
  27.     new nev[40], rang[40], prefix[40], sz[200]
  28.     get_user_name(id, nev, charsmax(nev))
  29.     get_user_rang(id, rang, charsmax(rang))
  30.     get_user_aprefix(id, prefix, charsmax(prefix))
  31.    
  32.     if(is_user_bejelentkezve(id))
  33.     {
  34.         if(access(id, ADMIN_BAN))
  35.             formatex(sz, charsmax(sz), "^x01%s^x04%s[%s] ^x03%s^x01:^x04 %s", (is_user_alive(id) ? "":"*Halott* "), prefix, rang, nev, message)
  36.         else
  37.             formatex(sz, charsmax(sz), "^x01%s^x04[%s] ^x03%s^x01: %s", (is_user_alive(id) ? "":"*Halott* "), rang, nev, message)
  38.     }
  39.     else
  40.         formatex(sz, charsmax(sz), "^x01%s ^x03%s^x01: %s", (is_user_alive(id) ? "":"*Halott* "), nev, message)
  41.    
  42.     print_color(0, "%s", sz)
  43.     return PLUGIN_HANDLED
  44. }
  45. public say_team(id)
  46. {
  47.     new message[192]
  48.     read_args(message, 191)
  49.     remove_quotes(message)
  50.    
  51.     if (message[0] == '@' || message[0] == '/' || message[0] == '!' || equal (message, ""))
  52.         return PLUGIN_HANDLED
  53.    
  54.    
  55.     new nev[40], rang[40], prefix[40], sz[200]
  56.     get_user_name(id, nev, charsmax(nev))
  57.     get_user_rang(id, rang, charsmax(rang))
  58.     get_user_aprefix(id, prefix, charsmax(prefix))
  59.    
  60.     new playerTeam = get_user_team(id)
  61.     new csapat[10]
  62.     switch (playerTeam)
  63.     {
  64.         case 1: copy (csapat, charsmax(csapat), "*T*")
  65.         case 2: copy (csapat, charsmax(csapat), "*CT*")
  66.         default: copy (csapat, charsmax(csapat), "*SPEC*")
  67.     }
  68.    
  69.     if(is_user_bejelentkezve(id))
  70.     {
  71.         if(access(id, ADMIN_BAN))
  72.             formatex(sz, charsmax(sz), "^x01%s %s^x04%s[%s] ^x03%s^x01:^x04 %s", csapat, (is_user_alive(id) ? "":"*Halott* "), prefix, rang, nev, message)
  73.         else
  74.             formatex(sz, charsmax(sz), "^x01%s %s^x04[%s] ^x03%s^x01: %s", csapat, (is_user_alive(id) ? "":"*Halott* "), rang, nev, message)
  75.     }
  76.     else
  77.         formatex(sz, charsmax(sz), "^x01%s %s ^x03%s^x01: %s", csapat, (is_user_alive(id) ? "":"*Halott* "), nev, message)
  78.    
  79.     for(new i = 1; i <= maxplayers; i++)
  80.     {
  81.         if(get_user_team(i) == playerTeam)
  82.             print_color(i, "%s", sz)
  83.     }
  84.     return PLUGIN_HANDLED
  85. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top