Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- #include < fun >
- #include < engine >
- #include < cstrike >
- #include < fakemeta >
- #include < hamsandwich >
- new cvar_jump, jumpnum[33], round[33];
- new bool: dojump[33];
- 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);
- enum {
- SCOREATTRIB_ARG_PLAYERID = 1, SCOREATTRIB_ARG_FLAGS
- }
- enum ( <<= 1 ) {
- SCOREATTRIB_FLAG_NONE = 0, SCOREATTRIB_FLAG_DEAD = 1, SCOREATTRIB_FLAG_BOMB, SCOREATTRIB_FLAG_VIP
- }
- #define PLUGIN "GOLD & SILVER VIP"
- #define VERSION "1.0"
- #define AUTHOR "A k c 3 n 7"
- #define VIP_GOLD read_flags ( "h")
- #define KILL_BONUS_HP 10
- #define KILL_BONUS_AP 10
- #define KILL_BONUS_HP_HS 15
- #define KILL_BONUS_AP_HS 15
- public plugin_init() {
- register_plugin( PLUGIN, VERSION, AUTHOR);
- RegisterHam(Ham_Spawn, "player", "PlayerSpawn", 1);
- register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib")
- cvar_jump = register_cvar("vip_jump", "1");
- }
- public menu_gold(id) {
- if(!is_user_alive(id) && get_user_flags(id) & VIP_GOLD)
- return;
- new menu = menu_create( "\rVIP \yGOLD \wChose Your \rArmoury", "vip_gold")
- menu_additem( menu, "\rM4A1 \wAnd Grenades");
- menu_additem( menu, "\rAK47 \wAnd Grenades");
- menu_additem( menu, "\rAWP \wAnd Grenades");
- menu_setprop( menu, MPROP_EXIT, MEXIT_ALL)
- menu_display( id, menu, 0 );
- }
- public menu_silver(id) {
- if(is_user_alive(id) && get_user_flags(id) & VIP_GOLD)
- return;
- new menu = menu_create( "\rVIP \wSilver \yChose Your \rArmoury", "vip_silver")
- menu_additem( menu, "\rM4A1 \wAnd Grenades");
- menu_additem( menu, "\rAK47 \wAnd Grenades");
- menu_setprop( menu, MPROP_EXIT, MEXIT_ALL)
- menu_display( id, menu, 0 );
- }
- public MessageScoreAttrib(iMsgId, iDest, iReceiver) {
- new iPlayer = get_msg_arg_int(SCOREATTRIB_ARG_PLAYERID)
- if(get_user_flags(iPlayer) & VIP_GOLD)
- set_msg_arg_int(SCOREATTRIB_ARG_FLAGS, ARG_BYTE, SCOREATTRIB_FLAG_VIP);
- }
- public client_death(killer, victim, wpnindex, hitplace, TK)
- {
- if(!(get_user_flags(killer) & VIP_GOLD))
- return;
- set_user_health(killer, get_user_health(killer) + KILL_BONUS_HP);
- set_user_armor(killer, get_user_armor(killer) + KILL_BONUS_AP);
- if(hitplace == HIT_HEAD)
- {
- set_user_health(killer, get_user_health(killer) + KILL_BONUS_HP_HS);
- set_user_armor(killer, get_user_armor(killer) + KILL_BONUS_AP_HS);
- }
- }
- public PlayerSpawn( id ) {
- if(!is_user_alive(id))
- return;
- if(round[id] > 3 )
- {
- menu_gold(id), menu_silver(id);
- }
- else {
- round[id]++;
- }
- give_item(id, "weapon_deagle"), cs_set_user_bpammo(id, CSW_DEAGLE, 35);
- give_item(id, "weapon_hegrenade"), give_item(id, "weapon_flashgbang");
- cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM);
- switch(cs_get_user_team(id))
- {
- case CS_TEAM_T: fm_strip_user_gun(id, CSW_GLOCK18, "weapon_glock18");
- case CS_TEAM_CT: fm_strip_user_gun(id, CSW_USP, "weapon_usp"), give_item(id, "item_thighpack");
- }
- }
- public vip_gold( id, menu, item )
- {
- switch( item )
- {
- case 0:
- {
- drop_wpn(id);
- give_item(id, "weapon_m4a1");
- cs_set_user_bpammo(id, CSW_M4A1, 90);
- give_item(id, "weapon_hegrenade"), give_item(id, "weapon_flashbang");
- }
- case 1:
- {
- drop_wpn(id);
- give_item(id,"weapon_ak47" );
- cs_set_user_bpammo(id, CSW_AK47, 90);
- give_item(id, "weapon_hegrenade"), give_item(id, "weapon_flashbang");
- }
- case 2:
- {
- drop_wpn(id);
- give_item( id,"weapon_awp");
- cs_set_user_bpammo(id, CSW_AWP, 90);
- give_item(id, "weapon_hegrenade"), give_item(id, "weapon_flashbang");
- }
- }
- menu_destroy( menu )
- return;
- }
- public vip_silver( id, menu, item )
- {
- switch( item )
- {
- case 0:
- {
- drop_wpn(id);
- give_item(id, "weapon_m4a1");
- cs_set_user_bpammo(id, CSW_M4A1, 90);
- give_item(id, "weapon_hegrenade"), give_item(id, "weapon_flashbang");
- }
- case 1:
- {
- drop_wpn(id);
- give_item(id,"weapon_ak47" );
- cs_set_user_bpammo(id, CSW_AK47, 90);
- give_item(id, "weapon_hegrenade"), give_item(id, "weapon_flashbang");
- }
- }
- menu_destroy( menu )
- return;
- }
- public client_PreThink(id)
- {
- if(is_user_alive(id)) {
- new BUTON = get_user_button(id)
- new OLDBUTON = get_user_oldbutton(id)
- new JUMP_VIP = get_pcvar_num(cvar_jump)
- if((BUTON & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(OLDBUTON & IN_JUMP))
- {
- if(((get_user_flags(id) & VIP_GOLD) && (jumpnum[id] < JUMP_VIP)))
- {
- dojump[id] = true
- jumpnum[id]++
- }
- }
- if((BUTON & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
- {
- jumpnum[id] = 0
- }
- }
- }
- public client_PostThink(id)
- {
- if(is_user_alive(id)) {
- if(dojump[id] == true)
- {
- new Float: velocity[3]
- entity_get_vector(id, EV_VEC_velocity, velocity)
- velocity[2] = random_float(265.0, 285.0)
- entity_set_vector(id, EV_VEC_velocity, velocity)
- dojump[id] = false
- }
- }
- }
- 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)
- }
- }
- }
- /* Fakemeta util */
- /*===========================================================================*/
- stock fm_find_ent_by_owner(index, const classname[], owner, jghgtype = 0) {
- new strtype[11] = "classname", ent = index;
- switch (jghgtype) {
- case 1: strtype = "target";
- case 2: strtype = "targetname";
- }
- while ((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner) {}
- return ent;
- }
- /*===========================================================================*/
- stock bool:fm_strip_user_gun(index, wid = 0, const wname[] = "") {
- new ent_class[32];
- if (!wid && wname[0])
- copy(ent_class, sizeof ent_class - 1, wname);
- else {
- new weapon = wid, clip, ammo;
- if (!weapon && !(weapon = get_user_weapon(index, clip, ammo)))
- return false;
- get_weaponname(weapon, ent_class, sizeof ent_class - 1);
- }
- new ent_weap = fm_find_ent_by_owner(-1, ent_class, index);
- if (!ent_weap)
- return false;
- engclient_cmd(index, "drop", ent_class);
- new ent_box = pev(ent_weap, pev_owner);
- if (!ent_box || ent_box == index)
- return false;
- dllfunc(DLLFunc_Think, ent_box);
- return true;
- }
- /*=============================================================================*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement