Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <fun>
- #include <cstrike>
- #include <colorchat>
- #include <hamsandwich>
- #include <fakemeta>
- #define SLOT_PRIMARY 1
- #define SLOT_SECONDARY 2
- enum _:WeaponInfo
- {
- slot,
- ammo
- }
- new g_Weapons[][WeaponInfo] =
- {
- {0, 0}, // ------
- {2, 52}, //CSW_P228
- {0, 0}, // ------
- {1, 90}, //CSW_SCOUT
- {4, 1}, //CSW_HEGRENADE
- {1, 32}, //CSW_XM1014
- {5, 1}, //CSW_C4
- {1, 100}, //CSW_MAC10
- {1, 90}, //CSW_AUG
- {4, 1}, //CSW_SMOKEGRENADE
- {2, 120}, //CSW_ELITE
- {2, 100}, //CSW_FIVESEVEN
- {1, 100}, //CSW_UMP45
- {1, 90}, //CSW_SG550
- {1, 90}, //CSW_GALIL
- {1, 90}, //CSW_FAMAS
- {2, 100}, //CSW_USP
- {2, 120}, //CSW_GLOCK18
- {1, 30}, //CSW_AWP
- {1, 120}, //CSW_MP5NAVY
- {1, 200}, //CSW_M249
- {1, 32}, //CSW_M3
- {1, 90}, //CSW_M4A1
- {1, 120}, //CSW_TMP
- {1, 90}, //CSW_G3SG1
- {4, 2}, //CSW_FLASHBANG
- {2, 35}, //CSW_DEAGLE
- {1, 90}, //CSW_SG552
- {1, 90}, //CSW_AK47
- {3, 0}, //CSW_KNIFE
- {1, 100} //CSW_P90
- };
- #define PLUGIN "Shop Bonus"
- #define VERSION "1.0"
- #define AUTHOR "lol"
- #define HEALTH 50
- #define SPEED 300.0
- new Float:normal_speed = 240.0
- new bool:hasSpeed[33]
- new bool:g_bHasCF[33]
- new bool:g_hasulti[33]
- new bool:g_hasNorc[33]
- new const Prefix[] = "[Shop_bonus]"
- #define MODEL_T "gsg9"
- #define MODEL_CT "leet"
- #define MODEL_T_END "leet"
- #define MODEL_CT_END "gsg9"
- new const Items[][]=
- {
- "Health",
- "10 Extra Frag",
- "Speed",
- "Gravity",
- "Camouflage-[change skin model]",
- "Invisibility",
- "Unlimited Ammo For All Weapons",
- "No Recoil"
- }
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_event("DeathMsg", "Death", "a")
- register_event("CurWeapon", "Weapon", "be", "1=1")
- RegisterHam(Ham_Spawn, "player", "Spawn", 1)
- register_clcmd("say /shop", "cmdTest")
- register_event("CurWeapon", "onCurWeaponEvent", "be", "1=1")
- register_forward(FM_PlayerPreThink,"func_prethink");
- }
- public Spawn(id)
- {
- if(!is_user_alive(id))
- return PLUGIN_HANDLED
- hasSpeed[id] = false
- g_bHasCF[id] = false
- g_hasulti[id] = false
- g_hasNorc[id] = false
- set_user_rendering(id)
- return PLUGIN_CONTINUE
- }
- public cmdTest(id)
- {
- if(is_user_alive(id))
- {
- MenuDisplay(id)
- }
- else
- {
- ColorChat(id,GREY,"^4]-=[T[S]K]=-[ ^1For use shop, ^4you need to alive!!")
- }
- }
- public MenuDisplay(id)
- {
- if(!is_user_alive(id))
- {
- remove_task(id)
- return PLUGIN_HANDLED
- }
- new Title[64]
- formatex(Title, charsmax(Title), "Shop XP Menu")
- new menu = menu_create(Title, "HandlerMenu")
- for(new i = 0; i < sizeof Items; i++)
- menu_additem(menu, Items[i], "", 0)
- menu_display(id, menu, 0)
- set_task(10.0, "CancelMenu", id)
- return PLUGIN_CONTINUE
- }
- public HandlerMenu(id, menu, item)
- {
- if(item == MENU_EXIT)
- {
- menu_destroy(menu)
- return PLUGIN_HANDLED
- }
- switch(item)
- {
- case 0:
- {
- set_user_health(id, get_user_health(id) + HEALTH)
- }
- case 1:
- {
- set_user_frags( id, get_user_frags(id) + 10 );
- }
- case 2:
- {
- set_user_maxspeed(id, SPEED)
- hasSpeed[id] = true
- set_task(10.0, "remove_speed", id)
- }
- case 3:
- {
- set_user_gravity(id, 0.7)
- }
- case 4:
- {
- g_bHasCF[id] = true
- cs_set_user_model(id, cs_get_user_team(id) == CS_TEAM_T ? MODEL_T : MODEL_CT)
- set_task(20.0, "func_RemoveCF", id)
- }
- case 5:
- {
- set_user_rendering( id, kRenderFxNone, 0,0,0, kRenderTransAdd, 50);
- set_task(10.0, "remove_invis", id)
- }
- case 6:
- {
- g_hasulti[id] = true
- }
- case 7:
- {
- g_hasNorc[id] = true
- }
- }
- ColorChat(id, GREEN, "^4%s^1 You got bonus ^3%s^1 for used shop!!", Prefix, Items[item])
- menu_destroy(menu)
- return PLUGIN_CONTINUE
- }
- public CancelMenu(id)
- if(is_user_connected(id))
- client_cmd(id, "slot1")
- public Weapon(id)
- if(is_user_alive(id) && hasSpeed[id])
- set_user_maxspeed(id, SPEED)
- public remove_invis(id)
- {
- if(!is_user_alive(id))
- return PLUGIN_HANDLED
- set_user_rendering(id)
- ColorChat(id, GREEN, "%s^1 Your ^3%s^1 has been removed^4!", Prefix, Items[5])
- return PLUGIN_CONTINUE
- }
- public remove_speed(id)
- {
- if(!is_user_alive(id))
- return PLUGIN_HANDLED
- set_user_maxspeed(id, normal_speed)
- hasSpeed[id] = false
- ColorChat(id, GREEN, "%s^1 Your ^3%s^1 has been removed^4!", Prefix, Items[2])
- return PLUGIN_CONTINUE
- }
- public func_RemoveCF(id)
- {
- if(!is_user_alive(id))
- return PLUGIN_HANDLED
- cs_set_user_model(id, cs_get_user_team(id) == CS_TEAM_T ? MODEL_T_END : MODEL_CT_END)
- g_bHasCF[id] = false
- ColorChat(id, GREEN, "%s^1 Your ^3%s^1 has been removed^4!", Prefix, Items[5])
- return PLUGIN_CONTINUE
- }
- public func_prethink(id)
- {
- if(!is_user_alive(id) && !g_hasNorc[id])
- return;
- set_pev(id,pev_punchangle,{ 0.0,0.0,0.0 });
- }
- public onCurWeaponEvent(id)
- {
- if (!g_hasulti[id])
- return PLUGIN_HANDLED
- new iWeapon = read_data(2)
- if (g_Weapons[iWeapon][slot] == SLOT_PRIMARY || g_Weapons[iWeapon][slot] == SLOT_SECONDARY)
- if (cs_get_user_bpammo(id, iWeapon) < g_Weapons[iWeapon][ammo])
- cs_set_user_bpammo(id, iWeapon, g_Weapons[iWeapon][ammo])
- return PLUGIN_CONTINUE
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement