Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <fakemeta>
- #include <engine>
- #include <cstrike>
- #include <fun>
- stock update_scoreboard(id, attrib = 0)
- {
- // 0 == Nothing
- // 1 == DEAD
- // 2 == BOMB
- // 4 == VIP
- message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"));
- write_byte(id);
- write_byte(attrib);
- message_end();
- return PLUGIN_HANDLED;
- }
- new const PLUGIN[] = "HideNSeek: Pain on Top";
- new const VERSION[] = "1.0";
- new Float:gfNextHurtTime[33];
- new g_MaxPlayers;
- new blood
- public plugin_precache()
- {
- blood = precache_model("sprites/blood.spr")
- }
- public plugin_init( )
- {
- register_plugin( PLUGIN, VERSION, "r4nDoMz" );
- register_forward(FM_Touch, "fwdTouch", 0);
- g_MaxPlayers = global_get(glb_maxClients);
- }
- native hnsxp_get_user_xp(client);
- native hnsxp_set_user_xp(client, xp);
- stock hnsxp_add_user_xp(client, xp)
- {
- return hnsxp_set_user_xp(client, hnsxp_get_user_xp(client) + xp);
- }
- public fwdTouch(id, attacker)
- {
- if( !pev_valid(id) || !pev_valid(attacker)
- || !(0 < id <= g_MaxPlayers) || !(0 < attacker <= g_MaxPlayers)
- || !is_user_alive(id) || !is_user_alive(attacker) )
- {
- return FMRES_IGNORED;
- }
- if( cs_get_user_team(id) == cs_get_user_team(attacker) )
- {
- return FMRES_IGNORED;
- }
- new Float:vidOrigin[3], Float:vattackerOrigin[3];
- pev(id, pev_origin, vidOrigin);
- pev(attacker, pev_origin, vattackerOrigin);
- if( !(49.0 < (vattackerOrigin[2] - vidOrigin[2]) < 73.0) )
- {
- return FMRES_IGNORED;
- }
- if (halflife_time() >= gfNextHurtTime[attacker])
- {
- if (get_user_health(id) > 10)
- {
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
- write_byte(TE_BLOODSPRITE);
- write_coord(vidOrigin[0]);
- write_coord(vidOrigin[1]);
- write_coord(vidOrigin[2]);
- write_short(blood);
- write_short(blood);
- write_byte(229);
- write_byte(12);
- message_end();
- fakedamage(id, "player", 5.0, DMG_GENERIC);
- }
- else
- {
- new name1[42];
- new name2[42];
- static Float:fFrags;
- get_user_name(attacker, name1, 32);
- get_user_name(id, name2, 32);
- set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 4.0);
- show_hudmessage(0, "%s just goomba stomped %s!", name1, name2);
- make_deathmsg(attacker,id,0,"goomba");
- pev(id, pev_frags, fFrags);
- set_pev(id, pev_frags, fFrags + float(1));
- fakedamage(id, "Goomba Stomp", 10000.0, DMG_GENERIC);
- hnsxp_add_user_xp(attacker, 50);
- client_print(attacker,print_chat, "***You got 50 XP for Goomba Stomping!***");
- for( new i = 0; i < g_MaxPlayers; i++ )
- update_scoreboard(i, 0);
- }
- gfNextHurtTime[attacker] = halflife_time() + 0.5;
- }
- return FMRES_IGNORED;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement