Advertisement
Filiq_

vipgold

Dec 13th, 2018
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.95 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fakemeta_util>
  4. #include <hamsandwich>
  5. #include <cstrike>
  6.  
  7.  
  8. #define PLUGIN "VIP"
  9. #define VERSION "1.0"
  10. #define AUTHOR "Truth*/Filip"
  11.  
  12.  
  13. #define VIP_ACCESS ADMIN_LEVEL_H
  14.  
  15. new const Models[][] = {
  16. "models/v_golden_ak47.mdl",
  17. "models/p_golden_ak47.mdl",
  18. "models/v_golden_m4a1.mdl",
  19. "models/p_golden_m4a1.mdl",
  20. "models/v_golden_mp5.mdl",
  21. "models/p_golden_mp5.mdl",
  22. "models/v_golden_deagle.mdl",
  23. "models/p_golden_deagle.mdl"
  24. };
  25.  
  26. new HaveWeapon[ 33 ] = 0
  27.  
  28. public plugin_init() {
  29. register_plugin(PLUGIN, VERSION, AUTHOR)
  30.  
  31.  
  32. register_event( "CurWeapon", "CurrWeapon", "be", "1=1" );
  33.  
  34. RegisterHam( Ham_Spawn, "player", "Spawn", true );
  35.  
  36. register_clcmd( "say_team /vipmenu", "VipMenu" );
  37. register_clcmd( "say_team /vipinfo", "VipMOTD" );
  38.  
  39.  
  40. register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib" );
  41.  
  42. // Add your code here...
  43. }
  44.  
  45. public VipMOTD(id) show_motd(id, "addons/amxmodx/configs/vip.html", "VIP");
  46.  
  47. public plugin_precache( )
  48. {
  49. for(new i = 0; i < sizeof Models; i++) precache_model(Models[i])
  50.  
  51. }
  52.  
  53. public Spawn ( id )
  54. {
  55. HaveWeapon[ id ] = 0
  56.  
  57. if( is_user_alive(id) && get_user_flags(id) & VIP_ACCESS )
  58. {
  59. fm_give_item( id, "weapon_hegrenade" );
  60. fm_give_item( id, "weapon_flashbang" );
  61. fm_give_item( id, "weapon_smokegrenade" );
  62. }
  63.  
  64.  
  65. }
  66.  
  67. public CurrWeapon ( id ) {
  68. new Arma = read_data( 2 )
  69.  
  70. if( Arma == CSW_AK47 && HaveWeapon[ id ] == 1 )
  71. {
  72. set_pev( id, pev_viewmodel2, Models[0] )
  73. set_pev( id, pev_weaponmodel2, Models[1] )
  74. }
  75.  
  76. if( Arma == CSW_M4A1 && HaveWeapon[ id ] == 2 )
  77. {
  78. set_pev( id, pev_viewmodel2, Models[2] )
  79. set_pev( id, pev_weaponmodel2, Models[3] )
  80. }
  81.  
  82. if( Arma == CSW_AWP && HaveWeapon[ id ] == 3 )
  83. {
  84. set_pev( id, pev_viewmodel2, Models[4] )
  85. set_pev( id, pev_weaponmodel2, Models[5] )
  86. }
  87.  
  88. if ( Arma == CSW_DEAGLE && HaveWeapon[ id ] != 0 ) {
  89.  
  90. set_pev ( id, pev_viewmodel2, Models[6] );
  91. set_pev ( id, pev_weaponmodel2, Models[7] );
  92.  
  93. }
  94. }
  95.  
  96. public VipMenuCMD( id ) {
  97. new MeniuVIP = menu_create( "\r* V.I.P. * \yMenu", "VipMenuCMDHandler" )
  98.  
  99. new gString[256]
  100.  
  101. formatex(gString, 100, "%sGolden [\r AK47\y ]", ((get_user_flags(id) & VIP_ACCESS) ? "\y" : "\d")), menu_additem( MeniuVIP, gString, "1", 0 )
  102. formatex(gString, 100, "%sGolden [\r M4A1\y ]", ((get_user_flags(id) & VIP_ACCESS) ? "\y" : "\d")), menu_additem( MeniuVIP, gString, "2", 0 )
  103. formatex(gString, 100, "%sGolden [\r AWP\y ]", ((get_user_flags(id) & VIP_ACCESS) ? "\y" : "\d")), menu_additem( MeniuVIP, gString, "3", 0 )
  104.  
  105. menu_setprop( MeniuVIP, MPROP_EXIT, MEXIT_ALL )
  106. menu_display( id, MeniuVIP, 0 )
  107. }
  108.  
  109. public VipMenuCMDHandler( id, MeniuVIP, item )
  110. {
  111. if( !is_user_alive( id ) )
  112. {
  113. ColorChat( id, "^x01[^x04 Vip Menu^x01 ] Nu poti accesa meniul cand esti mort!" )
  114. return PLUGIN_HANDLED
  115. }
  116.  
  117. if( item == MENU_EXIT ) {
  118. menu_destroy( MeniuVIP )
  119. return PLUGIN_HANDLED
  120. }
  121.  
  122. if(get_user_flags(id) & VIP_ACCESS) return ColorChat(id, "^x01[^x04 Vip Menu^x01 ] Nu ai acces la acest meniu !" );
  123.  
  124. switch( item )
  125. {
  126. case 0 :
  127. {
  128. fm_give_item(id, "weapon_ak47" );
  129. cs_set_user_bpammo( id, CSW_AK47, 90 );
  130. }
  131. case 1 :
  132. {
  133. fm_give_item(id, "weapon_m4a1");
  134. cs_set_user_bpammo( id, CSW_M4A1, 90 );
  135. }
  136. case 2 :
  137. {
  138. fm_give_item(id, "weapon_mp5navy");
  139. cs_set_user_bpammo( id, CSW_AWP, 90 );
  140. }
  141. }
  142.  
  143. fm_strip_user_weapons(id);
  144. fm_give_item(id, "weapon_knife");
  145. fm_give_item( id, "weapon_hegrenade" );
  146. fm_give_item( id, "weapon_flashbang" );
  147. fm_give_item( id, "weapon_smokegrenade" );
  148. fm_give_item(id, "weapon_deagle");
  149. cs_set_user_bpammo( id, CSW_DEAGLE, 70 );
  150. CurrWeapon( id );
  151. HaveWeapon[ id ] = item+1
  152.  
  153. menu_destroy( MeniuVIP )
  154. return PLUGIN_HANDLED
  155. }
  156.  
  157. public VipMenu( id )
  158. {
  159. if( !is_user_alive( id ) ) return ColorChat( id, "^x01[^x04 Vip Menu^x01 ] Nu poti accesa meniul cand esti mort !" );
  160. if( HaveWeapon[ id ] != 0 ) return ColorChat( id, "^x01[^x04 Vip Menu^x01 ] Ti-ai ales deja arma pe runda aceasta." );
  161.  
  162. VipMenuCMD( id );
  163.  
  164. return true
  165. }
  166.  
  167.  
  168. public MessageScoreAttrib( iMsgID, iDest, iReceiver ) {
  169. new iPlayer = get_msg_arg_int( 1 );
  170. if( is_user_connected( iPlayer ) && ( get_user_flags( iPlayer ) & VIP_ACCESS ) )
  171. {
  172. set_msg_arg_int( 2, ARG_BYTE, is_user_alive( iPlayer ) ? ( 1 << 2 ) : ( 1 << 0 ) );
  173. }
  174. }
  175.  
  176. stock ColorChat(const id, const input[], any:...) {
  177. new count = 1, players[32];
  178. static msg[191];
  179. vformat(msg, 190, input, 3);
  180.  
  181. replace_all(msg, 190, "!x04", "^4");
  182. replace_all(msg, 190, "!x01", "^1");
  183. replace_all(msg, 190, "!x03", "^3");
  184.  
  185. if(id) players[0] = id;
  186. else get_players(players, count, "ch"); {
  187. for(new i = 0; i < count; i++) {
  188. if(is_user_connected(players[i])) {
  189. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  190. write_byte(players[i]);
  191. write_string(msg);
  192. message_end();
  193. }
  194. }
  195. }
  196.  
  197. return true
  198. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement