Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- #include < cstrike >
- #include < engine >
- #include < hamsandwich >
- #include < fakemeta_util >
- //#pragma semicolon 1
- ShowMenu[ 33 ] = 0;
- #define Plugin "Xarea VIP"
- #define Version "1.0"
- #define Author "Sorinel"
- #define VIP_FLAG ADMIN_LEVEL_H
- #define VIP_PARACHUTE read_flags( "r" )
- #define VIP_SPEED_KNIFE read_flags( "s" )
- #define KILL_HP 10 // cat hp primeste pe kill
- #define HS_HP 20 // cat hp primeste cand da hs
- #define FRAG_HP_LIMIT 100 // limita hp la kill
- new const restricted_maps[ ][ ] =
- {
- "35hp",
- "31hp", // Poti adauga tu mai multe mape dupa model
- "1hp",
- "awp_garden",
- "awp_bycastor32",
- "awp_zigzag",
- "awp_bycastor",
- "css_bycastor",
- "css_india2",
- "css_india_go",
- "css_deagle",
- // "fy_snow",
- "fy_cluj",
- "fy_buzzkill"
- };
- /*
- enum {
- SCOREATTRIB_ARG_PLAYERID = 1,
- SCOREATTRIB_ARG_FLAGS
- }
- enum ( <<= 1 ) {
- SCOREATTRIB_FLAG_NONE = 0,
- SCOREATTRIB_FLAG_DEAD = 1,
- SCOREATTRIB_FLAG_BOMB,
- SCOREATTRIB_FLAG_VIP
- }*/
- const WEAPON_BITSUM = (1<<CSW_SCOUT) | (1<<CSW_XM1014) | (1<<CSW_MAC10) | (1<<CSW_AUG) | (1<<CSW_UMP45) | (1<<CSW_SG550) | (1<<CSW_P90) |
- (1<<CSW_FAMAS) | (1<<CSW_AWP) | (1<<CSW_MP5NAVY) | (1<<CSW_M249) | (1<<CSW_M3) | (1<<CSW_M4A1) | (1<<CSW_TMP) | (1<<CSW_G3SG1) | (1<<CSW_SG552) |
- (1<<CSW_AK47) | (1<<CSW_GALIL) | (1<<CSW_GLOCK18) | (1<<CSW_USP);
- public plugin_init( ) {
- register_plugin( Plugin, Version, Author );
- register_event("DeathMsg", "death_msg", "a", "1>0");
- RegisterHam( Ham_Spawn, "player", "PlayerSpawn", 1 );
- register_event( "CurWeapon","CheckWeapon","be","1=1" );
- // register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib" );
- }
- public client_putinserver( id ) {
- new map_name[32], i;
- get_mapname(map_name, charsmax(map_name));
- for(i = 0; i < sizeof(restricted_maps); i++)
- {
- if(equali(map_name, restricted_maps[i]))
- {
- remove_user_flags(id, VIP_FLAG);
- }
- }
- }
- public DisplayMenu( id ) {
- new menu = menu_create( "Equipment", "menu_handler" );
- menu_additem( menu, "M4A1", "", 0, ADMIN_LEVEL_H );
- menu_additem( menu, "AK47", "", 0, ADMIN_LEVEL_H );
- menu_additem( menu, "AWP \r(Only in round 3)", "", 0, ADMIN_LEVEL_H );
- menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
- menu_display( id, menu, 0 );
- }
- public menu_handler( id, menu, item )
- {
- switch( item )
- {
- case 0:
- {
- drop_wpn( id );
- fm_give_item(id, "weapon_m4a1" );
- cs_set_user_bpammo(id, CSW_M4A1, 90 );
- fm_give_item(id, "weapon_deagle" );
- cs_set_user_bpammo(id, CSW_DEAGLE, 35 );
- }
- case 1:
- {
- drop_wpn( id );
- fm_give_item(id, "weapon_ak47" );
- cs_set_user_bpammo(id, CSW_AK47, 90 );
- fm_give_item(id, "weapon_deagle" );
- cs_set_user_bpammo(id, CSW_DEAGLE, 35 );
- }
- case 2:
- if( ShowMenu[id] >= 3 )
- {
- drop_wpn( id );
- fm_give_item(id, "weapon_awp" );
- cs_set_user_bpammo(id, CSW_AWP, 90 );
- fm_give_item(id, "weapon_deagle" );
- cs_set_user_bpammo(id, CSW_DEAGLE, 35 );
- }
- else
- {
- ShowMenu[id]++;
- }
- }
- menu_destroy( menu ); return PLUGIN_HANDLED;
- }
- bonus_health(id, health)
- {
- if( is_user_bot(id) )
- return PLUGIN_HANDLED;
- static limit;
- limit = FRAG_HP_LIMIT;
- if( is_user_alive( id ) && get_user_flags( id ) & VIP_FLAG )
- {
- limit = FRAG_HP_LIMIT;
- }
- fm_set_user_health(id, clamp((get_user_health(id) + health), 1, limit) );
- return PLUGIN_HANDLED;
- }
- public PlayerSpawn( id ) {
- if( is_user_alive( id ) && get_user_flags( id ) & VIP_FLAG) {
- if( ShowMenu[id] >= 2 )
- {
- DisplayMenu( id );
- fm_give_item(id, "weapon_hegrenade" );
- fm_give_item(id, "weapon_flashbang" );
- cs_set_user_bpammo(id, CSW_FLASHBANG, 2 );
- }
- else
- {
- ShowMenu[id]++;
- }
- }
- }
- /*
- public MessageScoreAttrib(iMsgId, iDest, iReceiver)
- {
- new iPlayer = get_msg_arg_int(SCOREATTRIB_ARG_PLAYERID);
- if(get_user_flags(iPlayer) & VIP_FLAG )
- set_msg_arg_int(SCOREATTRIB_ARG_FLAGS, ARG_BYTE, SCOREATTRIB_FLAG_VIP);
- }*/
- public death_msg()
- {
- new killer = read_data(1);
- new victim = read_data(2);
- new headshot = read_data(3);
- if(killer == victim || !is_user_connected(victim) || !is_user_alive(killer))
- return PLUGIN_HANDLED;
- if (headshot)
- {
- bonus_health(killer, HS_HP);
- }
- else
- {
- bonus_health(killer, KILL_HP);
- }
- return PLUGIN_CONTINUE;
- }
- public CheckWeapon( id ) {
- new Weapon;
- Weapon = get_user_weapon(id);
- if( Weapon == CSW_KNIFE ) {
- if( is_user_alive( id ) && get_user_flags( id ) & VIP_SPEED_KNIFE ) {
- fm_set_user_maxspeed(id, 350.0 );
- }
- }
- }
- public client_PreThink(id)
- {
- if( is_user_alive( id ) && get_user_flags( id ) & VIP_PARACHUTE ) {
- new Float:fallspeed = 100.0 * -1.0;
- new button = get_user_button(id);
- if(button & IN_USE)
- {
- new Float:velocity[3];
- entity_get_vector(id, EV_VEC_velocity, velocity);
- if (velocity[2] < 0.0)
- {
- entity_set_int(id, EV_INT_sequence, 3);
- entity_set_int(id, EV_INT_gaitsequence, 1);
- entity_set_float(id, EV_FL_frame, 1.0);
- entity_set_float(id, EV_FL_framerate, 1.0);
- velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed;
- entity_set_vector(id, EV_VEC_velocity, velocity);
- }
- }
- }
- }
- drop_wpn( id )
- {
- static weapons[32], num;
- get_user_weapons(id, weapons, num);
- for (new i = 0; i < num; i++)
- {
- if (WEAPON_BITSUM & (1<<weapons[i]))
- {
- static wname[32];
- get_weaponname(weapons[i], wname, sizeof wname - 1);
- engclient_cmd(id, "drop", wname);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement