Advertisement
Guest User

Untitled

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