Advertisement
Guest User

Simple Code

a guest
Oct 18th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. #define PLUGIN "VIP Menu"
  2. #define VERSION "0.1"
  3. #define AUTHOR "laymon91"
  4.  
  5. #include <amxmodx>
  6. #include <reapi>
  7. #include <hamsandwich>
  8. #include <weapon_skin_system>
  9.  
  10. #pragma semicolon 1
  11.  
  12. enum SkinInfo { SkinIndex, SkinWeaponid };
  13. enum Skins { SKIN_M4A1 };
  14.  
  15. new g_iWeaponSkins[Skins][SkinInfo];
  16.  
  17. public plugin_init()
  18. {
  19. register_plugin(PLUGIN, VERSION, AUTHOR);
  20. register_clcmd("say /respawn", "Respawn");
  21.  
  22. RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_SpawnPost", 1);
  23. }
  24.  
  25. public wss_loaded_skin(index, weaponid, name[])
  26. {
  27. if(equal(name, "M4A1 Arena"))
  28. {
  29. g_iWeaponSkins[SKIN_M4A1][SkinIndex] = index;
  30. g_iWeaponSkins[SKIN_M4A1][SkinWeaponid] = weaponid;
  31. }
  32. }
  33.  
  34. public Respawn(player)
  35. {
  36. ExecuteHamB(Ham_CS_RoundRespawn, player);
  37. }
  38.  
  39. public CBasePlayer_SpawnPost(const id)
  40. {
  41. new user_has_prim = get_member(id, m_rgpPlayerItems, PRIMARY_WEAPON_SLOT);
  42.  
  43. if(wss_get_weapon_skin_index(user_has_prim) != g_iWeaponSkins[SKIN_M4A1][SkinIndex])
  44. {
  45. rg_remove_items_by_slot(id, PRIMARY_WEAPON_SLOT);
  46. wss_set_user_skin(id, g_iWeaponSkins[SKIN_M4A1][SkinWeaponid], g_iWeaponSkins[SKIN_M4A1][SkinIndex]);
  47. rg_give_item(id, "weapon_m4a1", GT_APPEND);
  48. rg_set_user_bpammo(id, WEAPON_M4A1, 90);
  49.  
  50. client_print_color(id, 0, "Weapon Index: %d", user_has_prim); // don't show index
  51. }
  52. else client_print_color(id, 0, "Weapon Index else: %d", user_has_prim); rg_set_user_bpammo(id, WEAPON_M4A1, 90); // index -1
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement