Advertisement
Guest User

Untitled

a guest
May 22nd, 2020
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <fun>
  4. #include <hamsandwich>
  5.  
  6. forward amxbans_admin_connect(id);
  7.  
  8. new CsArmorType:armortype, bool:g_Vip[33], g_Hudmsg;
  9.  
  10. public plugin_init(){
  11. register_plugin("VIP Ultimate", "12.3.0.2", "benio101 & speedkill");
  12. RegisterHam(Ham_Spawn, "player", "SpawnedEventPre", 1);
  13. register_event("DeathMsg", "DeathMsg", "a");
  14. register_clcmd("say /vip", "ShowMotd");
  15. register_message(get_user_msgid("SayText"),"handleSayText");
  16. g_Hudmsg=CreateHudSyncObj();
  17. }
  18. public client_authorized(id , const authid[]){
  19. if(get_user_flags(id) & 524288 == 524288){
  20. client_authorized_vip(id);
  21. }
  22. }
  23. public client_authorized_vip(id){
  24. g_Vip[id]=true;
  25. new g_Name[64];
  26. get_user_name(id,g_Name,charsmax(g_Name));
  27. set_hudmessage(24, 190, 220, 0.25, 0.2, 0, 6.0, 6.0);
  28. ShowSyncHudMsg(0, g_Hudmsg, "Vip %s wbija na serwer !",g_Name);
  29. }
  30. public client_disconnected(id){
  31. if(g_Vip[id]){
  32. client_disconnect_vip(id);
  33. }
  34. }
  35. public client_disconnect_vip(id){
  36. g_Vip[id]=false;
  37. }
  38. public SpawnedEventPre(id){
  39. if(g_Vip[id]){
  40. if(is_user_alive(id)){
  41. SpawnedEventPreVip(id);
  42. }
  43. }
  44. }
  45. public SpawnedEventPreVip(id){
  46. cs_set_user_armor(id, cs_get_user_armor(id,armortype)+100, CS_ARMOR_VESTHELM);
  47. new g_Model[64];
  48. formatex(g_Model,charsmax(g_Model),"%s",get_user_team(id) == 1 ? "VipTT" : "VipCT");
  49. cs_set_user_model(id,g_Model);
  50. }
  51. public DeathMsg(){
  52. new killer=read_data(1);
  53. new victim=read_data(2);
  54.  
  55. if(is_user_alive(killer) && g_Vip[killer] && get_user_team(killer) != get_user_team(victim)){
  56. DeathMsgVip(killer,victim,read_data(3));
  57. }
  58. }
  59. public DeathMsgVip(kid,vid,hs){
  60. set_user_health(kid, min(get_user_health(kid)+(hs?10:5),100));
  61. }
  62. public ShowMotd(id){
  63. show_motd(id, "vip.txt", "Informacje o vipie");
  64. }
  65. public handleSayText(msgId,msgDest,msgEnt){
  66. new id = get_msg_arg_int(1);
  67.  
  68. if(is_user_connected(id) && g_Vip[id]){
  69. new szTmp[256],szTmp2[256];
  70. get_msg_arg_string(2,szTmp, charsmax(szTmp))
  71.  
  72. new szPrefix[64] = "^x04[VIP]";
  73.  
  74. if(!equal(szTmp,"#Cstrike_Chat_All")){
  75. add(szTmp2,charsmax(szTmp2),szPrefix);
  76. add(szTmp2,charsmax(szTmp2)," ");
  77. add(szTmp2,charsmax(szTmp2),szTmp);
  78. }
  79. else{
  80. add(szTmp2,charsmax(szTmp2),szPrefix);
  81. add(szTmp2,charsmax(szTmp2),"^x03 %s1^x01 : %s2");
  82. }
  83. set_msg_arg_string(2,szTmp2);
  84. }
  85. return PLUGIN_CONTINUE;
  86. }
  87. public plugin_precache(){
  88. precache_model("models/player/VipCT/VipCT.mdl");
  89. precache_model("models/player/VipTT/VipTT.mdl");
  90. }
  91. public amxbans_admin_connect(id){
  92. client_authorized(id,"");
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement