Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.89 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fakemeta>
  4. #include <engine>
  5. #include <cstrike>
  6. #include <fun>
  7.  
  8. stock update_scoreboard(id, attrib = 0)
  9. {
  10.     // 0 == Nothing
  11.     // 1 == DEAD
  12.     // 2 == BOMB
  13.     // 4 == VIP
  14.     message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"));
  15.     write_byte(id);
  16.     write_byte(attrib);
  17.     message_end();
  18.    
  19.     return PLUGIN_HANDLED;
  20. }
  21.  
  22. new const PLUGIN[] = "HideNSeek: Pain on Top";
  23. new const VERSION[] = "1.0";
  24.  
  25. new Float:gfNextHurtTime[33];
  26. new g_MaxPlayers;
  27. new blood
  28.  
  29. public plugin_precache()
  30. {
  31.     blood = precache_model("sprites/blood.spr")
  32. }
  33.  
  34. public plugin_init( )
  35. {
  36.     register_plugin( PLUGIN, VERSION, "r4nDoMz" );
  37.     register_forward(FM_Touch, "fwdTouch", 0);
  38.  
  39.     g_MaxPlayers = global_get(glb_maxClients);
  40. }
  41.  
  42. native hnsxp_get_user_xp(client);
  43.  
  44. native hnsxp_set_user_xp(client, xp);
  45.  
  46. stock hnsxp_add_user_xp(client, xp)
  47. {
  48.     return hnsxp_set_user_xp(client, hnsxp_get_user_xp(client) + xp);
  49. }
  50.  
  51. public fwdTouch(id, attacker)
  52. {
  53.     if( !pev_valid(id) || !pev_valid(attacker)
  54.     || !(0 < id <= g_MaxPlayers) || !(0 < attacker <= g_MaxPlayers)
  55.     || !is_user_alive(id) || !is_user_alive(attacker) )
  56.     {
  57.         return FMRES_IGNORED;
  58.     }
  59.  
  60.     if( cs_get_user_team(id) == cs_get_user_team(attacker) )
  61.     {
  62.         return FMRES_IGNORED;
  63.     }
  64.    
  65.     new Float:vidOrigin[3], Float:vattackerOrigin[3];
  66.     pev(id, pev_origin, vidOrigin);
  67.     pev(attacker, pev_origin, vattackerOrigin);
  68.    
  69.     if( !(49.0 < (vattackerOrigin[2] - vidOrigin[2]) < 73.0) )
  70.     {
  71.         return FMRES_IGNORED;
  72.     }
  73.  
  74.     if (halflife_time() >= gfNextHurtTime[attacker])
  75.     {
  76.         if (get_user_health(id) > 10)
  77.         {
  78.             message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  79.             write_byte(TE_BLOODSPRITE);
  80.             write_coord(vidOrigin[0]);
  81.             write_coord(vidOrigin[1]);
  82.             write_coord(vidOrigin[2]);
  83.             write_short(blood);
  84.             write_short(blood);
  85.             write_byte(229);
  86.             write_byte(12);
  87.             message_end();
  88.  
  89.             fakedamage(id, "player", 5.0, DMG_GENERIC);
  90.         }
  91.         else
  92.         {
  93.         new name1[42];
  94.         new name2[42];
  95.         static Float:fFrags;
  96.         get_user_name(attacker, name1, 32);
  97.         get_user_name(id, name2, 32);
  98.         set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 4.0);
  99.         show_hudmessage(0, "%s just goomba stomped %s!", name1, name2);
  100.          make_deathmsg(attacker,id,0,"goomba");
  101.         pev(id, pev_frags, fFrags);
  102.         set_pev(id, pev_frags, fFrags + float(1));
  103.         fakedamage(id, "Goomba Stomp", 10000.0, DMG_GENERIC);
  104.        
  105.         hnsxp_add_user_xp(attacker, 50);
  106.         client_print(attacker,print_chat, "***You got 50 XP for Goomba Stomping!***");
  107.        
  108.         for( new i = 0; i < g_MaxPlayers; i++ )
  109.          update_scoreboard(i, 0);
  110.      
  111.         }
  112.        
  113.         gfNextHurtTime[attacker] = halflife_time() + 0.5;
  114.     }
  115.  
  116.     return FMRES_IGNORED;
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement