SHARE
TWEET

Untitled

a guest Aug 19th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define DAMAGE_RECIEVED
  2. #include <amxmodx>
  3. #include <amxmisc>
  4. #include <cstrike>
  5. #include <fun>
  6.  
  7. static const COLOR[] = "^x04" //green
  8. static const CONTACT[] = ""
  9. new maxplayers
  10. new gmsgSayText
  11. new mpd, mkb, mhb
  12. new g_MsgSync
  13. new health_add
  14. new health_hs_add
  15. new health_max
  16. new nKiller
  17. new nKiller_hp
  18. new nHp_add
  19. new nHp_max
  20. new g_awp_active
  21. new g_menu_active
  22. new CurrentRound
  23. new bool:HasC4[33]
  24. #define Keysrod (1<<0)|(1<<1)|(1<<9) // Keys: 1234567890
  25. #if defined DAMAGE_RECIEVED
  26.     new g_MsgSync2
  27. #endif
  28.  
  29. public plugin_init()
  30. {
  31.     register_plugin("VIP Eng Version", "3.0", "Dunno")
  32.     mpd = register_cvar("money_per_damage","3")
  33.     mkb = register_cvar("money_kill_bonus","200")
  34.     mhb = register_cvar("money_hs_bonus","500")
  35.     health_max = register_cvar("amx_vip_max_hp", "100")
  36.     g_awp_active = register_cvar("awp_active", "1")
  37.     g_menu_active = register_cvar("menu_active", "1")
  38.     register_event("Damage","Damage","b")
  39.     register_event("DeathMsg","death_msg","a")
  40.     register_menucmd(register_menuid("rod"), Keysrod, "Pressedrod")
  41.     register_clcmd("awp","HandleCmd")
  42.         register_clcmd("sg550","HandleCmd")
  43.         register_clcmd("g3sg1","HandleCmd")
  44.     register_clcmd("say /kolibavip","ShowMotd")
  45.     maxplayers = get_maxplayers()
  46.     gmsgSayText = get_user_msgid("SayText")
  47.     register_clcmd("say", "handle_say")
  48.     register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
  49.     register_logevent("LogEvent_RoundStart", 2, "1=Round_Start" );
  50.     register_event("TextMsg","Event_RoundRestart","a","2&#Game_w")
  51.     register_event("TextMsg","Event_RoundRestart","a","2&#Game_C");
  52.     register_event("DeathMsg", "hook_death", "a", "1>0")
  53.     register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
  54.     g_MsgSync = CreateHudSyncObj()
  55. #if defined DAMAGE_RECIEVED
  56.     g_MsgSync2 = CreateHudSyncObj()
  57. #endif 
  58. }
  59.  
  60. public on_damage(id)
  61. {
  62.     new attacker = get_user_attacker(id)
  63.  
  64. #if defined DAMAGE_RECIEVED
  65.     // id should be connected if this message is sent, but lets check anyway
  66.     if ( is_user_connected(id) && is_user_connected(attacker) )
  67.     if (get_user_flags(attacker) & ADMIN_LEVEL_H)
  68.     {
  69.         new damage = read_data(2)
  70.  
  71.         set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
  72.         ShowSyncHudMsg(id, g_MsgSync2, "%i^n", damage)
  73. #else
  74.     if ( is_user_connected(attacker) && if (get_user_flags(attacker) & ADMIN_LEVEL_H) )
  75.     {
  76.         new damage = read_data(2)
  77. #endif
  78.         set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
  79.         ShowSyncHudMsg(attacker, g_MsgSync, "%i^n", damage)
  80.     }
  81. }
  82.  
  83. public Damage(id)
  84. {
  85.     new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
  86.     if(attacker<=maxplayers && is_user_alive(attacker) && attacker!=id)
  87.     if (get_user_flags(attacker) & ADMIN_LEVEL_H)
  88.     {
  89.         new money = read_data(2) * get_pcvar_num(mpd)
  90.         if(hitpoint==1) money += get_pcvar_num(mhb)
  91.         cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
  92.     }
  93. }
  94.  
  95. public death_msg()
  96. {
  97.     if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
  98. }
  99.  
  100. public LogEvent_RoundStart()
  101. {
  102.     CurrentRound++;
  103.     new players[32], player, pnum;
  104.     get_players(players, pnum, "a");
  105.     for(new i = 0; i < pnum; i++)
  106.     {
  107.         player = players[i];
  108.         if(is_user_alive(player) && get_user_flags(player) & ADMIN_LEVEL_H)
  109.         {
  110.             give_item(player, "weapon_hegrenade")
  111.             give_item(player, "weapon_flashbang")
  112.             give_item(player, "weapon_flashbang")
  113.             give_item(player, "weapon_smokegrenade")
  114.             give_item(player, "item_assaultsuit")
  115.             give_item(player, "item_thighpack")
  116.            
  117.             if (!get_pcvar_num(g_menu_active))
  118.                 return PLUGIN_CONTINUE
  119.            
  120.             if(CurrentRound >= 3)
  121.             {
  122.                 Showrod(player);
  123.             }
  124.         }
  125.     }
  126.     return PLUGIN_HANDLED
  127. }
  128.  
  129. public Event_RoundRestart()
  130. {
  131.     CurrentRound=0;
  132. }
  133.  
  134. public hook_death()
  135. {
  136.    // Killer id
  137.    nKiller = read_data(1)
  138.    
  139.    if ( (read_data(3) == 1) && (read_data(5) == 0) )
  140.    {
  141.       nHp_add = get_pcvar_num (health_hs_add)
  142.    }
  143.    else
  144.       nHp_add = get_pcvar_num (health_add)
  145.    nHp_max = get_pcvar_num (health_max)
  146.    // Updating Killer HP
  147.    if(!(get_user_flags(nKiller) & ADMIN_LEVEL_H))
  148.    return;
  149.  
  150.    nKiller_hp = get_user_health(nKiller)
  151.    nKiller_hp += nHp_add
  152.    // Maximum HP check
  153.    if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
  154.    set_user_health(nKiller, nKiller_hp)
  155.    // Hud message "Healed +15/+30 hp"
  156.    set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
  157.    show_hudmessage(nKiller, "Healed +%d hp", nHp_add)
  158.    // Screen fading
  159.    message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
  160.    write_short(1<<10)
  161.    write_short(1<<10)
  162.    write_short(0x0000)
  163.    write_byte(0)
  164.    write_byte(0)
  165.    write_byte(200)
  166.    write_byte(75)
  167.    message_end()
  168.  
  169. }
  170.  
  171. public Showrod(id) {
  172.     show_menu(id, Keysrod, "Free VIP Puske^n\w1. uzmi M4A1+Deagle ^n\w2. Uzmi AK47+Deagle^n0. Izlaz^n", -1, "rod") // Display menu
  173. }
  174. public Pressedrod(id, key) {
  175.     /* Menu:
  176.     * VIP Menu
  177.     * 1. Get M4A1+Deagle
  178.     * 2. Get AK47+Deagle
  179.     * 0. Exit
  180.     */
  181.     switch (key) {
  182.         case 0: {
  183.             if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
  184.                 HasC4[id] = true;
  185.             else
  186.                 HasC4[id] = false;
  187.            
  188.             strip_user_weapons (id)
  189.             give_item(id,"weapon_m4a1")
  190.             give_item(id,"ammo_556nato")
  191.             give_item(id,"ammo_556nato")
  192.             give_item(id,"ammo_556nato")
  193.             give_item(id,"weapon_deagle")
  194.             give_item(id,"ammo_50ae")
  195.             give_item(id,"ammo_50ae")
  196.             give_item(id,"ammo_50ae")
  197.             give_item(id,"ammo_50ae")
  198.             give_item(id,"ammo_50ae")
  199.             give_item(id,"ammo_50ae")
  200.             give_item(id,"ammo_50ae")
  201.             give_item(id,"weapon_knife")
  202.             give_item(id,"weapon_hegrenade")
  203.             give_item(id, "weapon_flashbang");
  204.             give_item(id, "weapon_flashbang");
  205.             give_item(id, "weapon_smokegrenade");
  206.             give_item(id, "item_assaultsuit");
  207.             give_item(id, "item_thighpack");
  208.             client_print(id, print_center, "Uzeo si Free M4A1 i Deagle!")
  209.            
  210.             if (HasC4[id])
  211.             {
  212.                 give_item(id, "weapon_c4");
  213.                 cs_set_user_plant( id );
  214.             }
  215.             }
  216.         case 1: {
  217.             if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
  218.                 HasC4[id] = true;
  219.             else
  220.                 HasC4[id] = false;
  221.            
  222.             strip_user_weapons (id)
  223.             give_item(id,"weapon_ak47")
  224.             give_item(id,"ammo_762nato")
  225.             give_item(id,"ammo_762nato")
  226.             give_item(id,"ammo_762nato")
  227.             give_item(id,"weapon_deagle")
  228.             give_item(id,"ammo_50ae")
  229.             give_item(id,"ammo_50ae")
  230.             give_item(id,"ammo_50ae")
  231.             give_item(id,"ammo_50ae")
  232.             give_item(id,"ammo_50ae")
  233.             give_item(id,"ammo_50ae")
  234.             give_item(id,"ammo_50ae")
  235.             give_item(id,"weapon_knife")
  236.             give_item(id,"weapon_hegrenade")
  237.             give_item(id, "weapon_flashbang");
  238.             give_item(id, "weapon_flashbang");
  239.             give_item(id, "weapon_smokegrenade");
  240.             give_item(id, "item_assaultsuit");
  241.             give_item(id, "item_thighpack");
  242.             client_print(id, print_center, "Uzeo si Free AK47 i Deagle!")
  243.            
  244.             if (HasC4[id])
  245.             {
  246.                 give_item(id, "weapon_c4");
  247.                 cs_set_user_plant( id );
  248.             }
  249.             }
  250.         case 9: {          
  251.         }
  252.     }
  253.     return PLUGIN_CONTINUE
  254. }
  255.  
  256. public HandleCmd(id){
  257.     if (!get_pcvar_num(g_awp_active))
  258.       return PLUGIN_CONTINUE
  259.     if(get_user_flags(id) & ADMIN_LEVEL_H)
  260.         return PLUGIN_CONTINUE
  261.     client_print(id, print_center, "Snajperi su samo za Vipove!")
  262.     return PLUGIN_HANDLED
  263. }
  264.  
  265. public ShowMotd(id)
  266. {
  267.  show_motd(id, "vip.txt")
  268. }
  269. public client_authorized(id)
  270. {
  271.  set_task(30.0, "PrintText" ,id)
  272. }
  273. public PrintText(id)
  274. {
  275.  client_print(id, print_chat, "[Koliba BIG] Kucaj /kolibavip da vidis vip mogucnosti!")
  276. }
  277.  
  278. public handle_say(id) {
  279.     new said[192]
  280.     read_args(said,192)
  281.     if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 )
  282.         set_task(0.1,"print_adminlist",id)
  283.     return PLUGIN_CONTINUE
  284. }
  285.  
  286. public print_adminlist(user)
  287. {
  288.     new adminnames[33][32]
  289.     new message[256]
  290.     new contactinfo[256], contact[112]
  291.     new id, count, x, len
  292.    
  293.     for(id = 1 ; id <= maxplayers ; id++)
  294.         if(is_user_connected(id))
  295.             if(get_user_flags(id) & ADMIN_LEVEL_H)
  296.                 get_user_name(id, adminnames[count++], 31)
  297.  
  298.     len = format(message, 255, "%s Vipovi Online: ",COLOR)
  299.     if(count > 0) {
  300.         for(x = 0 ; x < count ; x++) {
  301.             len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
  302.             if(len > 96 ) {
  303.                 print_message(user, message)
  304.                 len = format(message, 255, "%s ",COLOR)
  305.             }
  306.         }
  307.         print_message(user, message)
  308.     }
  309.     else {
  310.         len += format(message[len], 255-len, "Nema Online Vipova.")
  311.         print_message(user, message)
  312.     }
  313.    
  314.     get_cvar_string("amx_contactinfo", contact, 63)
  315.     if(contact[0])  {
  316.         format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
  317.         print_message(user, contactinfo)
  318.     }
  319. }
  320.  
  321. print_message(id, msg[]) {
  322.     message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
  323.     write_byte(id)
  324.     write_string(msg)
  325.     message_end()
  326. }
  327.  
  328. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  329. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1063\\ f0\\ fs16 \n\\ par }
  330. */
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top