Dr-Strange

scan_say

May 11th, 2020
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define PLUGIN "Scan_Say"
  5. #define VERSION "12/May/2020"
  6. #define AUTHOR "General Memer"
  7.  
  8. new Float:g_fCooldown[33];
  9.  
  10.  
  11. public plugin_init() {
  12. register_plugin(PLUGIN, VERSION, AUTHOR)
  13. register_clcmd("say", "fwSayHandle");
  14. }
  15.  
  16.  
  17. public client_connect(iClient)
  18. {
  19. g_fCooldown[iClient] = 0.0;
  20. }
  21.  
  22.  
  23. public client_disconnected(iClient)
  24. {
  25. g_fCooldown[iClient] = 0.0;
  26. }
  27.  
  28.  
  29. public fwSayHandle(const iClient)
  30. {
  31. new sArg[194];
  32.  
  33. read_args( sArg, charsmax(sArg) );
  34. remove_quotes(sArg);
  35.  
  36. new sCmd[32];
  37. argbreak( sArg, sCmd, charsmax(sCmd), sArg, charsmax(sArg) );
  38.  
  39. if( equali(sCmd, "/scan") )
  40. {
  41. static Float:fGametime;
  42. fGametime = get_gametime();
  43.  
  44. if( g_fCooldown[iClient] > fGametime )
  45. return PLUGIN_HANDLED;
  46.  
  47. if( sArg[0] )
  48. {
  49. new sName[32];
  50. get_user_name( iClient, sName, charsmax(sName) );
  51.  
  52. new iPlayers[32], iPnum;
  53. get_players(iPlayers, iPnum;
  54.  
  55. for(new i, iPlayer; i < iPnum; i++)
  56. {
  57. iPlayer = iPlayers[i];
  58.  
  59. if( get_user_flags(iPlayer) & ADMIN_CHAT )
  60. {
  61. client_print_color(iPlayer, print_team_default, "^4[PSL] A Scan From (%s)^1: '%s'", sName, sArg);
  62. }
  63. }
  64. client_print_color(iClient, print_team_default, "^4[PSL] ^3Your message has been sent.");
  65. }
  66.  
  67. g_fCooldown[iClient] = fGametime + 2.0;
  68. return PLUGIN_HANDLED;
  69. }
  70. return PLUGIN_CONTINUE;
  71. }
Add Comment
Please, Sign In to add comment