seroff

Auto Steam VIP 1.0 By Seroff

Jan 10th, 2017
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. #include <amxmodx>
  2. #define VIP_FLAG ADMIN_IMMUNITY
  3. new sConnected,PLUGIN[][]={"Auto Steam VIP","1.0","Seroff"};
  4. #define get_bit(%1,%2) ( %1 & 1 << ( %2 & 31 ) )
  5. #define set_bit(%1,%2) ( %1 |= ( 1 << ( %2 & 31 ) ) )
  6. #define clear_bit(%1,%2) ( %1 &= ~( 1 << ( %2 & 31 ) ) )
  7.  
  8. public plugin_init(){ register_plugin(PLUGIN[0], PLUGIN[1], PLUGIN[2]); }
  9. public client_disconnect(id){clear_bit(sConnected, id);}
  10.  
  11. public client_putinserver(id){
  12. set_bit(sConnected, id);
  13. if(is_user_steam(id)){
  14. set_task(2.0,"set_vip",id);
  15. }
  16. }
  17.  
  18. public set_vip(id){
  19. set_user_flags(id, VIP_FLAG);
  20. ColorChat(id, "^3Вам ^1выданы ^4vip ^1права за [^4Steam^1]");
  21. }
  22.  
  23. bool:is_user_steam(id){
  24. static dp_pointer;
  25. if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider"))) {
  26. server_cmd("dp_clientinfo %d", id);
  27. server_exec();
  28. return (get_pcvar_num(dp_pointer) == 2) ? true : false;
  29. }
  30. return false;
  31. }
  32.  
  33. stock ColorChat(const id, const input[], any:...){
  34. static count = 1, players[32],msg[191];
  35. vformat(msg, 190, input, 3);
  36. replace_all(msg, 190, "!g", "^4"); // Зелёный
  37. replace_all(msg, 190, "!y", "^1"); // Стандартный
  38. replace_all(msg, 190, "!t", "^3"); // Цвет команды
  39. if (id) players[0] = id; else get_players(players, count, "ch")
  40. {
  41. for(new i = 0; i < count; i++){
  42. if(get_bit(sConnected,players[i])){
  43. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  44. write_byte(players[i]);
  45. write_string(msg);
  46. message_end();
  47. }
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment