Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define PLUGIN "VIP Menu"
- #define VERSION "0.1"
- #define AUTHOR "laymon91"
- #include <amxmodx>
- #include <reapi>
- #include <hamsandwich>
- #include <weapon_skin_system>
- #pragma semicolon 1
- enum SkinInfo { SkinIndex, SkinWeaponid };
- enum Skins { SKIN_M4A1 };
- new g_iWeaponSkins[Skins][SkinInfo];
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR);
- register_clcmd("say /respawn", "Respawn");
- RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_SpawnPost", 1);
- }
- public wss_loaded_skin(index, weaponid, name[])
- {
- if(equal(name, "M4A1 Arena"))
- {
- g_iWeaponSkins[SKIN_M4A1][SkinIndex] = index;
- g_iWeaponSkins[SKIN_M4A1][SkinWeaponid] = weaponid;
- }
- }
- public Respawn(player)
- {
- ExecuteHamB(Ham_CS_RoundRespawn, player);
- }
- public CBasePlayer_SpawnPost(const id)
- {
- new user_has_prim = get_member(id, m_rgpPlayerItems, PRIMARY_WEAPON_SLOT);
- if(wss_get_weapon_skin_index(user_has_prim) != g_iWeaponSkins[SKIN_M4A1][SkinIndex])
- {
- rg_remove_items_by_slot(id, PRIMARY_WEAPON_SLOT);
- wss_set_user_skin(id, g_iWeaponSkins[SKIN_M4A1][SkinWeaponid], g_iWeaponSkins[SKIN_M4A1][SkinIndex]);
- rg_give_item(id, "weapon_m4a1", GT_APPEND);
- rg_set_user_bpammo(id, WEAPON_M4A1, 90);
- client_print_color(id, 0, "Weapon Index: %d", user_has_prim); // don't show index
- }
- else client_print_color(id, 0, "Weapon Index else: %d", user_has_prim); rg_set_user_bpammo(id, WEAPON_M4A1, 90); // index -1
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement