Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: PHP  |  size: 171.41 KB  |  hits: 34  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <engine>
  5. #include <fakemeta>
  6. #include <hamsandwich>
  7. #include <fun>
  8.  
  9. #pragma semicolon 1
  10.  
  11. #define PLUGIN_NAME                             "Blockmaker"
  12. #define PLUGIN_VERSION                          "1.0"
  13. #define PLUGIN_AUTHOR                           "wAnderFAKE"
  14. #define PLUGIN_PREFIX                           "Special"
  15.  
  16. new AwpUsed[42];
  17. new DeagleUsed[42];
  18. new HeUsed[42];
  19. new FlashUsed[42];
  20. new SmokeUsed[42];
  21. new XpUsed[43];
  22. new ScoutUsed[42];
  23. new GlockUsed[42];
  24. new USPUsed[42];
  25. new M4A1Used[42];
  26. new M3Used[42];
  27. new MP5Used[42];
  28. new P90Used[42];
  29. new GalilUsed[42];
  30. new FamasUsed[42];
  31. new AK47Used[42];
  32. new AUGUsed[42];
  33. new SG552Used[42];
  34. new SG550Used[42];
  35. new VestHelmUsed[42];
  36. new g_msgSayText;
  37. new g_MaxPlayers;
  38.  
  39. new const SERVERIP[] = "62.90.138.114:27018";
  40.  
  41. native hnsxp_get_user_xp( id );
  42. native hnsxp_set_user_xp( id, xp );
  43.  
  44. stock hnsxp_add_user_xp( id, xp )
  45. {
  46.         return hnsxp_set_user_xp( id, hnsxp_get_user_xp( id ) + xp );
  47. }
  48.  
  49. new const g_blank[] =                           "";
  50. new const g_a[] =                               "a";
  51. new const g_b[] =                               "b";
  52.  
  53. new const g_block_classname[] =                 "SCM_Block";
  54. new const g_start_classname[] =                 "SCM_TeleportStart";
  55. new const g_destination_classname[] =           "SCM_TeleportDestination";
  56. new const g_light_classname[] =                 "SCM_Light";
  57. //Hudmessage
  58. const gHudRed = 10;
  59. const gHudGreen = 150;
  60. const gHudBlue = 225;
  61. const gHudEffects = 0;
  62. const gHudChannel = 2;
  63. const Float:gfTextX = -1.0;
  64. const Float:gfTextY = 0.84;
  65. const Float:gfHudFxTime = 0.0;
  66. const Float:gfHudHoldTime = 3.00;
  67. const Float:gfHudFadeInTime = 0.75;
  68. const Float:gfHudFadeOutTime = 0.75;
  69.  
  70. new const g_model_platform[] =                  "models/Blockmaker/Normal/igz_platform.mdl";
  71. new const g_model_bunnyhop[] =                  "models/Blockmaker/Normal/igz_bhopv5.mdl";
  72. new const g_model_damage[] =                    "models/Blockmaker/Normal/igz_damage.mdl";
  73. new const g_model_healer[] =                    "models/Blockmaker/Normal/igz_health.mdl";
  74. new const g_model_no_fall_damage[] =            "models/Blockmaker/Normal/igz_nofalldamage.mdl";
  75. new const g_model_ice[] =                       "models/Blockmaker/Normal/igz_ice.mdl";
  76. new const g_model_trampoline[] =                        "models/Blockmaker/Normal/igz_trampoline.mdl";
  77. new const g_model_speed_boost[] =               "models/Blockmaker/Normal/igz_speedboost.mdl";
  78. new const g_model_death[] =                     "models/Blockmaker/Normal/igz_death.mdl";
  79. new const g_model_low_gravity[] =               "models/Blockmaker/Normal/igz_gravity.mdl";
  80. new const g_model_slap[] =                      "models/Blockmaker/Normal/igz_slap.mdl";
  81. new const g_model_honey[] =                     "models/Blockmaker/Normal/igz_honey.mdl";
  82. new const g_model_ct_barrier[] =                        "models/Blockmaker/Normal/igz_ct_barrier.mdl";
  83. new const g_model_t_barrier[] =                 "models/Blockmaker/Normal/igz_t_barrier.mdl";
  84. new const g_model_glass[] =                     "models/Blockmaker/Normal/igz_platform.mdl";
  85. new const g_model_delayed_bunnyhop[] =          "models/Blockmaker/Normal/igz_delay_bhop.mdl";
  86. new const g_model_invincibility[] =             "models/Blockmaker/Normal/igz_invincibility.mdl";
  87. new const g_model_stealth[] =                   "models/Blockmaker/Normal/igz_stealth.mdl";
  88. new const g_model_boots_of_speed[] =            "models/Blockmaker/Normal/igz_boostofspeed.mdl";
  89. new const g_model_duck[] =                      "models/Blockmaker/Normal/igz_duck.mdl";
  90. new const g_model_money[] =                     "models/Blockmaker/Normal/igz_money.mdl";
  91. new const g_model_awp[] =                       "models/Blockmaker/Normal/igz_awp.mdl";
  92. new const g_model_deagle[] =                    "models/Blockmaker/Normal/igz_deagle.mdl";
  93. new const g_model_he[] =                                "models/Blockmaker/Normal/igz_grenade.mdl";
  94. new const g_model_flash[] =                     "models/Blockmaker/Normal/igz_flashbang.mdl";
  95. new const g_model_smoke[] =                     "models/Blockmaker/Normal/igz_frost.mdl";
  96. new const g_model_xp[] =                                "models/Blockmaker/Normal/igz_xp.mdl";
  97. new const g_model_scout[] =                     "models/Blockmaker/Normal/SFU_SCOUT.mdl";
  98. new const g_model_glock[] =                     "models/Blockmaker/Normal/SFU_GLOCK.mdl";
  99. new const g_model_usp[] =                       "models/Blockmaker/Normal/SFU_USP.mdl";
  100. new const g_model_m4a1[] =                      "models/Blockmaker/Normal/SFU_M4A1.mdl";
  101. new const g_model_m3[] =                                "models/Blockmaker/Normal/SFU_M3.mdl";
  102. new const g_model_blind[] =                     "models/Blockmaker/Normal/igz_blind.mdl";
  103. new const g_model_p90[] =                       "models/Blockmaker/Normal/SFU_P90.mdl";
  104. new const g_model_galil[] =                     "models/Blockmaker/Normal/SFU_GALIL.mdl";
  105. new const g_model_famas[] =                     "models/Blockmaker/Normal/SFU_FAMAS.mdl";
  106. new const g_model_ak47[] =                      "models/Blockmaker/Normal/SFU_AK47.mdl";
  107. new const g_model_AUG[] =                       "models/Blockmaker/Normal/SFU_AUG.mdl";
  108. new const g_model_SG552[] =                     "models/Blockmaker/Normal/SFU_SG552.mdl";
  109. new const g_model_SG550[] =                     "models/Blockmaker/Normal/SFU_SG550.mdl";
  110. new const g_model_VestHelm[] =                  "models/Blockmaker/Normal/SFU_VESTHELM.mdl";
  111. new const g_model_IceBhop[] =                   "models/Blockmaker/Normal/igz_bhopv5.mdl";
  112. new const g_model_cam[] =                       "models/Blockmaker/Normal/igz_camouflage.mdl";
  113. new const g_model_superman[] =                  "models/Blockmaker/Normal/igz_superman.mdl";
  114. new const g_model_magic[] =                     "models/Blockmaker/Normal/pg_magiccarpet.mdl";
  115.  
  116. new const g_sprite_light[] =                    "sprites/Blockmaker/light.spr";
  117.  
  118. new const g_sprite_teleport_start[] =           "sprites/Blockmaker/teleport_start.spr";
  119. new const g_sprite_teleport_destination[] =     "sprites/Blockmaker/teleport_end.spr";
  120.  
  121. new const g_sound_invincibility[] =             "warcraft3/divineshield.wav";
  122. new const g_sound_stealth[] =                   "warcraft3/Stealth.wav";
  123. new const g_sound_boots_of_speed[] =            "warcraft3/BootsOfSpeed.wav";
  124. new const g_sound_money[] =                     "warcraft3/money.wav";
  125. new const g_sound_cam[] =                       "warcraft3/antend.wav";
  126. new const g_sound_teleport[] =                  "warcraft3/blinkarrival.wav";
  127.  
  128. new g_sprite_beam;
  129.  
  130. enum ( <<= 1 )
  131. {
  132.         B1 = 1,
  133.         B2,
  134.         B3,
  135.         B4,
  136.         B5,
  137.         B6,
  138.         B7,
  139.         B8,
  140.         B9,
  141.         B0
  142. };
  143.  
  144. enum
  145. {
  146.         K1,
  147.         K2,
  148.         K3,
  149.         K4,
  150.         K5,
  151.         K6,
  152.         K7,
  153.         K8,
  154.         K9,
  155.         K0
  156. };
  157.  
  158. enum
  159. {
  160.         CHOICE_DELETE,
  161.         CHOICE_LOAD
  162. };
  163.  
  164. enum
  165. {
  166.         X,
  167.         Y,
  168.         Z
  169. };
  170.  
  171. enum ( += 1000 )
  172. {
  173.         TASK_SPRITE = 1000,
  174.         TASK_SOLID,
  175.         TASK_SOLIDNOT,
  176.         TASK_ICE,
  177.         TASK_HONEY,
  178.         TASK_NOSLOWDOWN,
  179.         TASK_INVINCIBLE,
  180.         TASK_STEALTH,
  181.         TASK_BOOTSOFSPEED,
  182.         TASK_CAM,
  183.         TASK_SUPER,
  184. };
  185.  
  186. new g_file[64];
  187.  
  188. new g_keys_main_menu;
  189. new g_keys_block_menu;
  190. new g_keys_block_selection_menu;
  191. new g_keys_properties_menu;
  192. new g_keys_move_menu;
  193. new g_keys_teleport_menu;
  194. new g_keys_light_menu;
  195. new g_keys_light_properties_menu;
  196. new g_keys_options_menu;
  197. new g_keys_choice_menu;
  198. new g_keys_commands_menu;
  199.  
  200. new g_main_menu[256];
  201. new g_block_menu[256];
  202. new g_move_menu[256];
  203. new g_teleport_menu[256];
  204. new g_light_menu[128];
  205. new g_light_properties_menu[256];
  206. new g_options_menu[256];
  207. new g_choice_menu[128];
  208. new g_commands_menu[256];
  209.  
  210. new g_viewmodel[33][32];
  211.  
  212. new bool:g_connected[33];
  213. new bool:g_alive[33];
  214. new bool:g_admin[33];
  215. new bool:g_gived_access[33];
  216. new bool:g_snapping[33];
  217. new bool:g_viewing_properties_menu[33];
  218. new bool:g_viewing_light_properties_menu[33];
  219. new bool:g_viewing_commands_menu[33];
  220. new bool:g_no_fall_damage[33];
  221. new bool:g_ice[33];
  222. new bool:g_low_gravity[33];
  223. new bool:g_no_slow_down[33];
  224. new bool:g_has_hud_text[33];
  225. new bool:g_block_status[33];
  226. new bool:g_noclip[33];
  227. new bool:g_godmode[33];
  228. new bool:g_all_godmode;
  229. new bool:g_has_checkpoint[33];
  230. new bool:g_checkpoint_duck[33];
  231. new bool:g_reseted[33];
  232. new bool:gbLowGravity[42];
  233.  
  234. new g_selected_block_size[33];
  235. new g_choice_option[33];
  236. new g_block_selection_page[33];
  237. new g_teleport_start[33];
  238. new g_grabbed[33];
  239. new g_grouped_blocks[33][256];
  240. new g_group_count[33];
  241. new g_property_info[33][2];
  242. new g_light_property_info[33][2];
  243. new g_slap_times[33];
  244. new g_honey[33];
  245. new g_boots_of_speed[33];
  246.  
  247. new Float:g_grid_size[33];
  248. new Float:g_snapping_gap[33];
  249. new Float:g_grab_offset[33][3];
  250. new Float:g_grab_length[33];
  251. new Float:g_next_damage_time[33];
  252. new Float:g_next_heal_time[33];
  253. new Float:g_invincibility_time_out[33];
  254. new Float:g_invincibility_next_use[33];
  255. new Float:g_stealth_time_out[33];
  256. new Float:g_stealth_next_use[33];
  257. new Float:g_cam_time_out[33];
  258. new Float:g_cam_next_use[33];
  259. new Float:g_super_time_out[33];
  260. new Float:g_super_next_use[33];
  261. new Float:g_boots_of_speed_time_out[33];
  262. new Float:g_boots_of_speed_next_use[33];
  263. new Float:g_next_xp_time[33];
  264. new Float:g_set_velocity[33][3];
  265. new Float:g_checkpoint_position[33][3];
  266. new bool:g_money_used[33];
  267. new g_cvar_textures;
  268. new gmsgScreenFade;
  269. new g_max_players;
  270.  
  271. enum
  272. {
  273.         PLATFORM,
  274.         BUNNYHOP,
  275.         DAMAGE,
  276.         HEALER,
  277.         NO_FALL_DAMAGE,
  278.         ICE,
  279.         TRAMPOLINE,
  280.         SPEED_BOOST,
  281.         DEATH,
  282.         LOW_GRAVITY,
  283.         SLAP,
  284.         HONEY,
  285.         CT_BARRIER,
  286.         T_BARRIER,
  287.         GLASS,
  288.         DELAYED_BUNNYHOP,
  289.         INVINCIBILITY,
  290.         STEALTH,
  291.         BOOTS_OF_SPEED,
  292.         DUCK,
  293.         MONEY,
  294.         AWP,
  295.         DEAGLE,
  296.         HE,
  297.         FLASH,
  298.         SMOKE,
  299.         XP,
  300.         SCOUT,
  301.         GLOCK,
  302.         USP,
  303.         M4A1,
  304.         M3,
  305.         BLIND,
  306.         P90,
  307.         GALIL,
  308.         FAMAS,
  309.         AK47,
  310.         AUG,
  311.         SG552,
  312.         SG550,
  313.         VESTHELM,
  314.         ICEBHOP,
  315.         CAM,
  316.         SUPER,
  317.         MAGIC,
  318.  
  319.         TOTAL_BLOCKS
  320. };
  321.  
  322. enum
  323. {
  324.         TELEPORT_START,
  325.         TELEPORT_DESTINATION
  326. };
  327.  
  328. enum
  329. {
  330.         NORMAL,
  331.         TINY,
  332.         LARGE,
  333.         POLE
  334. };
  335.  
  336. enum
  337. {
  338.         NORMAL,
  339.         GLOWSHELL,
  340.         TRANSCOLOR,
  341.         TRANSALPHA,
  342.         TRANSWHITE
  343. };
  344.  
  345. new g_selected_block_type[TOTAL_BLOCKS];
  346. new g_render[TOTAL_BLOCKS];
  347. new g_red[TOTAL_BLOCKS];
  348. new g_green[TOTAL_BLOCKS];
  349. new g_blue[TOTAL_BLOCKS];
  350. new g_alpha[TOTAL_BLOCKS];
  351.  
  352. new const g_block_names[TOTAL_BLOCKS][] =
  353. {
  354.         "Platform",
  355.         "Bunnyhop",
  356.         "Damage",
  357.         "Healer",
  358.         "No Fall Damage",
  359.         "Ice",
  360.         "Trampoline",
  361.         "Speed Boost",
  362.         "Death",
  363.         "Low Gravity",
  364.         "Slap",
  365.         "Honey",
  366.         "CT Barrier",
  367.         "T Barrier",
  368.         "Glass",
  369.         "Delayed Bhop",
  370.         "Invincibility",
  371.         "Stealth",
  372.         "Boots Of Speed",
  373.         "Duck",
  374.         "Money Block",
  375.         "Awp",
  376.         "Deagle",
  377.         "High Explosive",
  378.         "Flash",
  379.         "Smoke",
  380.         "Xp Block",
  381.         "Scout",
  382.         "Glock",
  383.         "USP",
  384.         "M4A1",
  385.         "M3",
  386.         "Blind",
  387.         "P90",
  388.         "Galil",
  389.         "Famas",
  390.         "AK47",
  391.         "AUG",
  392.         "SG552",
  393.         "SG550",
  394.         "vesthelm",
  395.         "Ice Bhop",
  396.         "Camouflage",
  397.         "Super Man",
  398.         "Magic Carpet"
  399. };
  400.  
  401. new const g_property1_name[TOTAL_BLOCKS][] =
  402. {
  403.         "",
  404.         "No Fall Damage",
  405.         "Damage Per Interval",
  406.         "Health Per Interval",
  407.         "",
  408.         "",
  409.         "Upward Speed",
  410.         "Forward Speed",
  411.         "",
  412.         "Gravity",
  413.         "Hardness",
  414.         "Speed In Honey",
  415.         "",
  416.         "",
  417.         "",
  418.         "Delay Before Dissapear",
  419.         "Invincibility Time",
  420.         "Stealth Time",
  421.         "Boots Of Speed Time",
  422.         "",
  423.         "Money",
  424.         "Ammo Amount",
  425.         "Ammo Amount",
  426.         "",
  427.         "",
  428.         "",
  429.         "XP Amount",
  430.         "Ammo Amount",
  431.         "Ammo Amount",
  432.         "Ammo Amount",
  433.         "Ammo Amount",
  434.         "Ammo Amount",
  435.         "",
  436.         "Ammo Amount",
  437.         "Ammo Amount",
  438.         "Ammo Amount",
  439.         "Ammo Amount",
  440.         "Ammo Amount",
  441.         "Ammo Amount",
  442.         "Ammo Amount",
  443.         "",
  444.         "",
  445.         "Camouflage Time",
  446.         "Gravity Time",
  447.         "Time To Back"
  448. };
  449.  
  450. new const g_property1_default_value[TOTAL_BLOCKS][] =
  451. {
  452.         "",
  453.         "0",
  454.         "5",
  455.         "1",
  456.         "",
  457.         "",
  458.         "500",
  459.         "750",
  460.         "",
  461.         "200",
  462.         "2",
  463.         "75",
  464.         "",
  465.         "",
  466.         "",
  467.         "1",
  468.         "10",
  469.         "10",
  470.         "10",
  471.         "",
  472.         "2000",
  473.         "1",
  474.         "1",
  475.         "",
  476.         "",
  477.         "",
  478.         "2",
  479.         "1",
  480.         "1",
  481.         "1",
  482.         "1",
  483.         "1",
  484.         "",
  485.         "1",
  486.         "1",
  487.         "1",
  488.         "1",
  489.         "1",
  490.         "1",
  491.         "1",
  492.         "1",
  493.         "",
  494.         "15",
  495.         "10",
  496.         "10"
  497. };
  498.  
  499. new const g_property2_name[TOTAL_BLOCKS][] =
  500. {
  501.         "",
  502.         "",
  503.         "Interval Between Damage",
  504.         "Interval Between Heals",
  505.         "",
  506.         "",
  507.         "",
  508.         "Upward Speed",
  509.         "",
  510.         "",
  511.         "",
  512.         "",
  513.         "",
  514.         "",
  515.         "",
  516.         "",
  517.         "Delay After Usage",
  518.         "Delay After Usage",
  519.         "Delay After Usage",
  520.         "",
  521.         "",
  522.         "",
  523.         "",
  524.         "",
  525.         "",
  526.         "",
  527.         "Delay After Usage",
  528.         "",
  529.         "",
  530.         "",
  531.         "",
  532.         "",
  533.         "",
  534.         "",
  535.         "",
  536.         "",
  537.         "",
  538.         "",
  539.         "",
  540.         "",
  541.         "",
  542.         "",
  543.         "Delay After Usage",
  544.         "Delay After Usage",
  545.         "Delay After Usage"
  546. };
  547.  
  548. new const g_property2_default_value[TOTAL_BLOCKS][] =
  549. {
  550.         "",
  551.         "",
  552.         "0.5",
  553.         "0.5",
  554.         "",
  555.         "",
  556.         "",
  557.         "250",
  558.         "",
  559.         "",
  560.         "",
  561.         "",
  562.         "",
  563.         "",
  564.         "",
  565.         "",
  566.         "60",
  567.         "60",
  568.         "60",
  569.         "",
  570.         "",
  571.         "",
  572.         "",
  573.         "",
  574.         "",
  575.         "",
  576.         "999",
  577.         "",
  578.         "",
  579.         "",
  580.         "",
  581.         "",
  582.         "",
  583.         "",
  584.         "",
  585.         "",
  586.         "",
  587.         "",
  588.         "",
  589.         "",
  590.         "",
  591.         "",
  592.         "60",
  593.         "60",
  594.         "60"
  595. };
  596.  
  597. new const g_property3_name[TOTAL_BLOCKS][] =
  598. {
  599.         "Transparency",
  600.         "Transparency",
  601.         "Transparency",
  602.         "Transparency",
  603.         "Transparency",
  604.         "Transparency",
  605.         "Transparency",
  606.         "Transparency",
  607.         "Transparency",
  608.         "Transparency",
  609.         "Transparency",
  610.         "Transparency",
  611.         "Transparency",
  612.         "Transparency",
  613.         "",
  614.         "Transparency",
  615.         "",
  616.         "",
  617.         "Speed",
  618.         "Transparency",
  619.         "Transparency",
  620.         "Transparency",
  621.         "Transparency",
  622.         "Transparency",
  623.         "Transparency",
  624.         "Transparency",
  625.         "",
  626.         "Transparency",
  627.         "Transparency",
  628.         "Transparency",
  629.         "Transparency",
  630.         "Transparency",
  631.         "Transparency",
  632.         "Transparency",
  633.         "Transparency",
  634.         "Transparency",
  635.         "Transparency",
  636.         "Transparency",
  637.         "Transparency",
  638.         "Transparency",
  639.         "Transparency",
  640.         "Transparency",
  641.         "Transparency",
  642.         "Gravity",
  643.         ""
  644. };
  645.  
  646. new const g_property3_default_value[TOTAL_BLOCKS][] =
  647. {
  648.         "255",
  649.         "255",
  650.         "255",
  651.         "255",
  652.         "255",
  653.         "255",
  654.         "255",
  655.         "255",
  656.         "255",
  657.         "255",
  658.         "255",
  659.         "255",
  660.         "255",
  661.         "255",
  662.         "",
  663.         "255",
  664.         "255",
  665.         "",
  666.         "",
  667.         "400",
  668.         "255",
  669.         "255",
  670.         "255",
  671.         "255",
  672.         "255",
  673.         "255",
  674.         "",
  675.         "255",
  676.         "255",
  677.         "255",
  678.         "255",
  679.         "255",
  680.         "255",
  681.         "255",
  682.         "255",
  683.         "255",
  684.         "255",
  685.         "255",
  686.         "255",
  687.         "255",
  688.         "255",
  689.         "255",
  690.         "255",
  691.         "500",
  692.         ""
  693. };
  694.  
  695. new const g_property4_name[TOTAL_BLOCKS][] =
  696. {
  697.         "",
  698.         "On Top Only",
  699.         "On Top Only",
  700.         "On Top Only",
  701.         "",
  702.         "",
  703.         "On Top Only",
  704.         "On Top Only",
  705.         "On Top Only",
  706.         "On Top Only",
  707.         "On Top Only",
  708.         "On Top Only",
  709.         "On Top Only",
  710.         "On Top Only",
  711.         "",
  712.         "On Top Only",
  713.         "On Top Only",
  714.         "On Top Only",
  715.         "On Top Only",
  716.         "On Top Only",
  717.         "On Top Only",
  718.         "On Top Only",
  719.         "On Top Only",
  720.         "On Top Only",
  721.         "On Top Only",
  722.         "On Top Only",
  723.         "On Top Only",
  724.         "On Top Only",
  725.         "On Top Only",
  726.         "On Top Only",
  727.         "On Top Only",
  728.         "On Top Only",
  729.         "On Top Only",
  730.         "On Top Only",
  731.         "On Top Only",
  732.         "On Top Only",
  733.         "On Top Only",
  734.         "On Top Only",
  735.         "On Top Only",
  736.         "On Top Only",
  737.         "On Top Only",
  738.         "On Top Only",
  739.         "On Top Only",
  740.         "On Top Only",
  741.         "On Top Only"
  742. };
  743.  
  744. new const g_property4_default_value[TOTAL_BLOCKS][] =
  745. {
  746.         "",
  747.         "0",
  748.         "1",
  749.         "1",
  750.         "",
  751.         "",
  752.         "0",
  753.         "0",
  754.         "1",
  755.         "0",
  756.         "1",
  757.         "0",
  758.         "0",
  759.         "0",
  760.         "",
  761.         "0",
  762.         "0",
  763.         "1",
  764.         "1",
  765.         "1",
  766.         "1",
  767.         "1",
  768.         "1",
  769.         "1",
  770.         "1",
  771.         "1",
  772.         "1",
  773.         "1",
  774.         "1",
  775.         "1",
  776.         "1",
  777.         "1",
  778.         "1",
  779.         "1",
  780.         "1",
  781.         "1",
  782.         "1",
  783.         "1",
  784.         "1",
  785.         "1",
  786.         "1",
  787.         "0",
  788.         "1",
  789.         "1",
  790.         "1"
  791. };
  792.  
  793. new const g_block_save_ids[TOTAL_BLOCKS] =
  794. {
  795.         'A',
  796.         'B',
  797.         'C',
  798.         'D',
  799.         'E',
  800.         'F',
  801.         'G',
  802.         'H',
  803.         'I',
  804.         'J',
  805.         'K',
  806.         'L',
  807.         'M',
  808.         'N',
  809.         'O',
  810.         'P',
  811.         'Q',
  812.         'R',
  813.         'S',
  814.         'T',
  815.         'U',
  816.         'V',
  817.         'W',
  818.         'X',
  819.         'Y',
  820.         'Z',
  821.         '1',
  822.         '2',
  823.         '3',
  824.         '4',
  825.         '5',
  826.         '6',
  827.         '7',
  828.         '8',
  829.         '9',
  830.         '@',
  831.         '#',
  832.         '$',
  833.         '%',
  834.         '(',
  835.         '&',
  836.         ')',
  837.         '|',
  838.         '>',
  839.         '<'
  840. };
  841.  
  842. new g_block_models[TOTAL_BLOCKS][256];
  843.  
  844. new g_block_selection_pages_max;
  845.  
  846. public plugin_precache()
  847. {
  848.         g_block_models[PLATFORM] =              g_model_platform;
  849.         g_block_models[BUNNYHOP] =              g_model_bunnyhop;
  850.         g_block_models[DAMAGE] =                g_model_damage;
  851.         g_block_models[HEALER] =                g_model_healer;
  852.         g_block_models[NO_FALL_DAMAGE] =        g_model_no_fall_damage;
  853.         g_block_models[ICE] =                   g_model_ice;
  854.         g_block_models[TRAMPOLINE] =            g_model_trampoline;
  855.         g_block_models[SPEED_BOOST] =           g_model_speed_boost;
  856.         g_block_models[DEATH] =                 g_model_death;
  857.         g_block_models[LOW_GRAVITY] =           g_model_low_gravity;
  858.         g_block_models[SLAP] =                  g_model_slap;
  859.         g_block_models[HONEY] =                 g_model_honey;
  860.         g_block_models[CT_BARRIER] =            g_model_ct_barrier;
  861.         g_block_models[T_BARRIER] =             g_model_t_barrier;
  862.         g_block_models[GLASS] =                 g_model_glass;
  863.         g_block_models[DELAYED_BUNNYHOP] =      g_model_delayed_bunnyhop;
  864.         g_block_models[INVINCIBILITY] =         g_model_invincibility;
  865.         g_block_models[STEALTH] =               g_model_stealth;
  866.         g_block_models[BOOTS_OF_SPEED] =        g_model_boots_of_speed;
  867.         g_block_models[DUCK] =                  g_model_duck;
  868.         g_block_models[MONEY] =                 g_model_money;
  869.         g_block_models[AWP] =                   g_model_awp;
  870.         g_block_models[DEAGLE] =                g_model_deagle;
  871.         g_block_models[HE] =                    g_model_he;
  872.         g_block_models[FLASH] =                 g_model_flash;
  873.         g_block_models[SMOKE] =                 g_model_smoke;
  874.         g_block_models[XP] =                    g_model_xp;
  875.         g_block_models[SCOUT] =                 g_model_scout;
  876.         g_block_models[GLOCK] =                 g_model_glock;
  877.         g_block_models[USP] =                   g_model_usp;
  878.         g_block_models[M4A1] =                  g_model_m4a1;
  879.         g_block_models[M3] =                    g_model_m3;
  880.         g_block_models[BLIND] =                 g_model_blind;
  881.         g_block_models[P90] =                   g_model_p90;
  882.         g_block_models[GALIL] =                 g_model_galil;
  883.         g_block_models[FAMAS] =                 g_model_famas;
  884.         g_block_models[AK47] =                  g_model_ak47;
  885.         g_block_models[AUG] =                   g_model_AUG;
  886.         g_block_models[SG552] =                 g_model_SG552;
  887.         g_block_models[SG550] =                 g_model_SG550;
  888.         g_block_models[VESTHELM] =              g_model_VestHelm;
  889.         g_block_models[ICEBHOP] =               g_model_IceBhop;
  890.         g_block_models[CAM] =                   g_model_cam;
  891.         g_block_models[SUPER] =                 g_model_superman;
  892.         g_block_models[MAGIC] =                 g_model_magic;
  893.  
  894.         SetupBlockRendering(GLASS, TRANSWHITE, 255, 255, 255, 100);
  895.         SetupBlockRendering(INVINCIBILITY, GLOWSHELL, 255, 255, 255, 16);
  896.         SetupBlockRendering(STEALTH, TRANSWHITE, 255, 255, 255, 100);
  897.  
  898.         new block_model[256];
  899.         for ( new i = 0; i < TOTAL_BLOCKS; ++i )
  900.         {
  901.                 precache_model(g_block_models[i]);
  902.  
  903.                 SetBlockModelName(block_model, g_block_models[i], "Tiny");
  904.                 precache_model(block_model);
  905.  
  906.                 SetBlockModelName(block_model, g_block_models[i], "Large");
  907.                 precache_model(block_model);
  908.  
  909.                 SetBlockModelName(block_model, g_block_models[i], "Pole");
  910.                 precache_model(block_model);
  911.         }
  912.  
  913.         precache_model(g_sprite_light);
  914.  
  915.         precache_model(g_sprite_teleport_start);
  916.         precache_model(g_sprite_teleport_destination);
  917.         g_sprite_beam = precache_model("sprites/zbeam4.spr");
  918.  
  919.         precache_sound(g_sound_invincibility);
  920.         precache_sound(g_sound_stealth);
  921.         precache_sound(g_sound_boots_of_speed);
  922.         precache_sound(g_sound_money);
  923.         precache_sound(g_sound_cam);
  924.         precache_sound(g_sound_teleport);
  925. }
  926.  
  927. public plugin_init()
  928. {
  929.         register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
  930.  
  931.         RegisterSayCmd("/bm",                   "CmdMainMenu");
  932.         register_clcmd("bm",                    "CmdMainMenu");
  933.         register_clcmd("smg", "SlayUser");
  934.         register_cvar("bm_telefrag", "1");
  935.         register_cvar("bm_awpcooldown", "999.0");
  936.         register_cvar("bm_deaglecooldown", "999.0");
  937.         register_cvar("bm_scoutcooldown", "999.0");
  938.         register_cvar("bm_glockcooldown", "999.0");
  939.         register_cvar("bm_uspcooldown", "999.0");
  940.         register_cvar("bm_m4a1cooldown", "999.0");
  941.         register_cvar("bm_m3cooldown", "999.0");
  942.         register_cvar("bm_mp5cooldown", "999.0");
  943.         register_cvar("bm_p90cooldown", "999.0");
  944.         register_cvar("bm_galilcooldown", "999.0");
  945.         register_cvar("bm_famascooldown", "999.0");
  946.         register_cvar("bm_ak47cooldown", "999.0");
  947.         register_cvar("bm_augcooldown", "999.0");
  948.         register_cvar("bm_sg552cooldown", "999.0");
  949.         register_cvar("bm_sg550cooldown", "999.0");
  950.         register_cvar("bm_vesthelmcooldown", "999.0");
  951.  
  952.         new command[32] =                       "CmdShowInfo";
  953.         RegisterSayCmd("BM",                    command);
  954.         RegisterSayCmd("Info",                  command);
  955.         RegisterSayCmd("Help",                  command);
  956.  
  957.         command =                               "CmdSaveCheckpoint";
  958.         RegisterSayCmd("cp",                    command);
  959.         RegisterSayCmd("savecp",                command);
  960.         RegisterSayCmd("checkpoint",            command);
  961.         RegisterSayCmd("savecheckpoint",        command);
  962.  
  963.         command =                               "CmdLoadCheckpoint";
  964.         RegisterSayCmd("tp",                    command);
  965.         RegisterSayCmd("gocheck",               command);
  966.         RegisterSayCmd("teleport",              command);
  967.         RegisterSayCmd("loadcheck",             command);
  968.         RegisterSayCmd("teleportcp",            command);
  969.         RegisterSayCmd("gocheckpoint",          command);
  970.         RegisterSayCmd("loadcheckpoint",        command);
  971.  
  972.         command =                               "CmdReviveYourself";
  973.         RegisterSayCmd("rs",                    command);
  974.         RegisterSayCmd("spawn",                 command);
  975.         RegisterSayCmd("revive",                command);
  976.         RegisterSayCmd("respawn",               command);
  977.         RegisterSayCmd("restart",               command);
  978.  
  979.         register_clcmd("SCM_SetProperty",       "SetPropertyBlock",     -1);
  980.         register_clcmd("SCM_SetLightProperty",  "SetPropertyLight",     -1);
  981.         register_clcmd("SCM_Revive",            "RevivePlayer",         -1);
  982.         register_clcmd("SCM_GiveAccess",        "GiveAccess",           -1);
  983.  
  984.         command =                               "CmdGrab";
  985.         register_clcmd("+bmgrab",               command,                -1, g_blank);
  986.         register_clcmd("+bmgrab",               command,                -1, g_blank);
  987.  
  988.         command =                               "CmdRelease";
  989.         register_clcmd("-bmgrab",               command,                -1, g_blank);
  990.         register_clcmd("-bmgrab",               command,                -1, g_blank);
  991.  
  992.         CreateMenus();
  993.  
  994.         register_menucmd(register_menuid("SCMMainMenu"),                g_keys_main_menu,               "HandleMainMenu");
  995.         register_menucmd(register_menuid("SCMBlockMenu"),               g_keys_block_menu,              "HandleBlockMenu");
  996.         register_menucmd(register_menuid("SCMBlockSelectionMenu"),      g_keys_block_selection_menu,    "HandleBlockSelectionMenu");
  997.         register_menucmd(register_menuid("SCMPropertiesMenu"),          g_keys_properties_menu,         "HandlePropertiesMenu");
  998.         register_menucmd(register_menuid("SCMMoveMenu"),                g_keys_move_menu,               "HandleMoveMenu");
  999.         register_menucmd(register_menuid("SCMTeleportMenu"),            g_keys_teleport_menu,           "HandleTeleportMenu");
  1000.         register_menucmd(register_menuid("SCMLightMenu"),               g_keys_light_menu,              "HandleLightMenu");
  1001.         register_menucmd(register_menuid("SCMLightPropertiesMenu"),     g_keys_light_properties_menu,   "HandleLightPropertiesMenu");
  1002.         register_menucmd(register_menuid("SCMOptionsMenu"),             g_keys_options_menu,            "HandleOptionsMenu");
  1003.         register_menucmd(register_menuid("SCMChoiceMenu"),              g_keys_choice_menu,             "HandleChoiceMenu");
  1004.         register_menucmd(register_menuid("SCMCommandsMenu"),            g_keys_commands_menu,           "HandleCommandsMenu");
  1005.  
  1006.         RegisterHam(Ham_Spawn,          "player",       "FwdPlayerSpawn",       1);
  1007.         RegisterHam(Ham_Killed,         "player",       "FwdPlayerKilled",      1);
  1008.  
  1009.         register_forward(FM_CmdStart,                   "FwdCmdStart");
  1010.  
  1011.         register_think(g_light_classname,               "LightThink");
  1012.  
  1013.         register_event("CurWeapon",                     "EventCurWeapon",       "be");
  1014.         register_event("HLTV", "eventNewRound", "a", "1=0", "2=0");
  1015.  
  1016.         register_message(get_user_msgid("StatusValue"), "MsgStatusValue");
  1017.  
  1018.         g_cvar_textures =       register_cvar("SCM_Textures", "wAnderFAKE", 0, 0.0);
  1019.  
  1020.         g_max_players =         get_maxplayers();
  1021.        
  1022.         gmsgScreenFade =        get_user_msgid("ScreenFade");
  1023.        
  1024.         g_msgSayText = get_user_msgid("SayText");
  1025.        
  1026.         g_MaxPlayers = global_get(glb_maxClients);
  1027.  
  1028.         new dir[64];
  1029.         get_datadir(dir, charsmax(dir));
  1030.  
  1031.         new folder[64];
  1032.         formatex(folder, charsmax(folder), "/%s", PLUGIN_PREFIX);
  1033.  
  1034.         add(dir, charsmax(dir), folder);
  1035.         if ( !dir_exists(dir) ) mkdir(dir);
  1036.  
  1037.         new map[32];
  1038.         get_mapname(map, charsmax(map));
  1039.  
  1040.         formatex(g_file, charsmax(g_file), "%s/%s.%s", dir, map, PLUGIN_PREFIX);
  1041.        
  1042.         set_task( 120.0, "TASK_Advertise", _, _, _, "b" );
  1043.        
  1044. }
  1045.  
  1046. public plugin_cfg()
  1047. {
  1048.         LoadBlocks(0);
  1049. }
  1050.  
  1051.  
  1052. public client_putinserver(id)
  1053. {
  1054.         g_connected[id] =                       bool:!is_user_hltv(id);
  1055.         g_alive[id] =                           false;
  1056.  
  1057.         g_admin[id] =                           bool:access(id, ADMIN_MENU);
  1058.         g_gived_access[id] =                    false;
  1059.  
  1060.         g_viewing_properties_menu[id] =         false;
  1061.         g_viewing_light_properties_menu[id] =   false;
  1062.         g_viewing_commands_menu[id] =           false;
  1063.  
  1064.         g_snapping[id] =                        true;
  1065.  
  1066.         g_grid_size[id] =                       1.0;
  1067.         g_snapping_gap[id] =                    0.0;
  1068.  
  1069.         g_group_count[id] =                     0;
  1070.  
  1071.         g_noclip[id] =                          false;
  1072.         g_godmode[id] =                         false;
  1073.  
  1074.         g_has_checkpoint[id] =                  false;
  1075.         g_checkpoint_duck[id] =                 false;
  1076.  
  1077.         g_reseted[id] =                         false;
  1078.  
  1079.         ResetPlayer(id);
  1080. }
  1081.  
  1082. public client_disconnect(id)
  1083. {
  1084.         g_connected[id] =                       false;
  1085.         g_alive[id] =                           false;
  1086.  
  1087.         ClearGroup(id);
  1088.  
  1089.         if ( g_grabbed[id] )
  1090.         {
  1091.                 if ( is_valid_ent(g_grabbed[id]) )
  1092.                 {
  1093.                         entity_set_int(g_grabbed[id], EV_INT_iuser2, 0);
  1094.                 }
  1095.  
  1096.                 g_grabbed[id] =                 0;
  1097.         }
  1098. }
  1099.  
  1100. public eventNewRound()
  1101. {
  1102.         new iEnt, Float:fOrigin[3];
  1103.         while( (iEnt = find_ent_by_class(iEnt, g_block_classname)) )
  1104.         {
  1105.                 new blockType = pev(iEnt, pev_body);
  1106.                
  1107.                 if( blockType == MAGIC )
  1108.                 {
  1109.                         pev(iEnt, pev_v_angle, fOrigin);
  1110.                         set_pev(iEnt, pev_velocity, Float:{0.0, 0.0, 0.0});
  1111.                        
  1112.                         engfunc(EngFunc_SetOrigin, iEnt, fOrigin);
  1113.                 }
  1114.         }
  1115. }
  1116.  
  1117. RegisterSayCmd(const command[], const handle[])
  1118. {
  1119.         static temp[64];
  1120.  
  1121.         register_clcmd(command, handle, -1, g_blank);
  1122.  
  1123.         formatex(temp, charsmax(temp), "say /bm", command);
  1124.         register_clcmd(temp, handle, -1, g_blank);
  1125.  
  1126.         formatex(temp, charsmax(temp), "say_team /bm", command);
  1127.         register_clcmd(temp, handle, -1, g_blank);
  1128. }
  1129.  
  1130. CreateMenus()
  1131. {
  1132.         g_block_selection_pages_max = floatround((float(TOTAL_BLOCKS) / 8.0), floatround_ceil);
  1133.  
  1134.         new size = charsmax(g_main_menu);
  1135.         add(g_main_menu, size, "\r[%s] \y%s \rv%s^n^n");
  1136.         add(g_main_menu, size, "\r1. \wBlock Menu^n");
  1137.         add(g_main_menu, size, "\r2. \wTeleport Menu^n");
  1138.         add(g_main_menu, size, "\r3. \wLight Menu^n");
  1139.         add(g_main_menu, size, "\r4. \wAdmin Menu^n");
  1140.         add(g_main_menu, size, "\r5. \wMove Menu^n^n");
  1141.         add(g_main_menu, size, "%s6. %sNoclip: %s^n");
  1142.         add(g_main_menu, size, "%s7. %sGodmode: %s^n^n");
  1143.         add(g_main_menu, size, "\r9. \wHelp^n");
  1144.         add(g_main_menu, size, "\r0. \wClose");
  1145.         g_keys_main_menu =              B1 | B2 | B3 | B4 | B5 | B6 | B7 | B9 | B0;
  1146.  
  1147.         size = charsmax(g_block_menu);
  1148.         add(g_block_menu, size, "\r[%s] \yBlock Menu^n^n");
  1149.         add(g_block_menu, size, "\r1. \wBlock Type: \y%s^n");
  1150.         add(g_block_menu, size, "%s2. %s\wCreate^n");
  1151.         add(g_block_menu, size, "%s3. %s\wConvert^n");
  1152.         add(g_block_menu, size, "%s4. %s\wDelete^n");
  1153.         add(g_block_menu, size, "%s5. %s\wRotate^n");
  1154.         add(g_block_menu, size, "\r6. \wNoclip: %s^n^n");
  1155.         add(g_block_menu, size, "%s7. %s\wSet Properties^n");
  1156.         add(g_block_menu, size, "\r8. \wBlock Size: \y%s^n");
  1157.         add(g_block_menu, size, "\r9. \wOptions Menu^n");
  1158.         add(g_block_menu, size, "\r0. \wBack");
  1159.         g_keys_block_menu =             B1 | B2 | B3 | B4 | B5 | B6 | B7 | B8 | B9 | B0;
  1160.         g_keys_block_selection_menu =   B1 | B2 | B3 | B4 | B5 | B6 | B7 | B8 | B9 | B0;
  1161.         g_keys_properties_menu =        B1 | B2 | B3 | B4 | B0;
  1162.  
  1163.         size = charsmax(g_move_menu);
  1164.         add(g_move_menu, size, "\r[%s] \yMove Menu^n^n");
  1165.         add(g_move_menu, size, "\r1. \wGrid Size: \y%.1f^n^n");
  1166.         add(g_move_menu, size, "\r2. \wZ\y+^n");
  1167.         add(g_move_menu, size, "\r3. \wZ\r-^n");
  1168.         add(g_move_menu, size, "\r4. \wX\y+^n");
  1169.         add(g_move_menu, size, "\r5. \wX\r-^n");
  1170.         add(g_move_menu, size, "\r6. \wY\y+^n");
  1171.         add(g_move_menu, size, "\r7. \wY\r-^n^n^n");
  1172.         add(g_move_menu, size, "\r0. \wBack");
  1173.         g_keys_move_menu =              B1 | B2 | B3 | B4 | B5 | B6 | B7 | B0;
  1174.  
  1175.         size = charsmax(g_teleport_menu);
  1176.         add(g_teleport_menu, size, "\r[%s] \yTeleport Menu^n^n");
  1177.         add(g_teleport_menu, size, "%s1. %sCreate Start^n");
  1178.         add(g_teleport_menu, size, "%s2. %sCreate Destination^n^n");
  1179.         add(g_teleport_menu, size, "%s3. %sDelete Teleport^n^n");
  1180.         add(g_teleport_menu, size, "%s4. %sSwap Start/Destination^n^n");
  1181.         add(g_teleport_menu, size, "%s5. %sShow Teleport Path^n^n^n");
  1182.         add(g_teleport_menu, size, "\r0. \wBack");
  1183.         g_keys_teleport_menu =          B1 | B2 | B3 | B4 | B5 | B0;
  1184.  
  1185.         size = charsmax(g_light_menu);
  1186.         add(g_light_menu, size, "\r[%s] \yLights Menu^n^n");
  1187.         add(g_light_menu, size, "%s1. %sCreate Light^n");
  1188.         add(g_light_menu, size, "%s2. %sDelete Light^n^n");
  1189.         add(g_light_menu, size, "%s3. %sChange Color^n^n^n^n^n^n^n");
  1190.         add(g_light_menu, size, "\r0. \wBack");
  1191.         g_keys_light_menu =             B1 | B2 | B3 | B0;
  1192.  
  1193.         size = charsmax(g_light_properties_menu);
  1194.         add(g_light_properties_menu, size, "\r[%s] \ySet Properties^n^n");
  1195.         add(g_light_properties_menu, size, "\r1. \wRadius: \y%s^n");
  1196.         add(g_light_properties_menu, size, "\r2. \wColor Red: \y%s^n");
  1197.         add(g_light_properties_menu, size, "\r3. \wColor Green: \y%s^n");
  1198.         add(g_light_properties_menu, size, "\r4. \wColor Blue: \y%s^n^n^n^n^n^n^n");
  1199.         add(g_light_properties_menu, size, "\r0. \wBack");
  1200.         g_keys_light_properties_menu =  B1 | B2 | B3 | B4 | B0;
  1201.  
  1202.         size = charsmax(g_options_menu);
  1203.         add(g_options_menu, size, "\r[%s] \yOptions Menu^n^n");
  1204.         add(g_options_menu, size, "%s1. %sSnapping: %s^n");
  1205.         add(g_options_menu, size, "%s2. %sSnapping Gap: \y%.1f^n^n");
  1206.         add(g_options_menu, size, "%s3. %sAdd to Group^n");
  1207.         add(g_options_menu, size, "%s4. %sClear Group^n^n");
  1208.         add(g_options_menu, size, "%s5. %sDelete All^n");
  1209.         add(g_options_menu, size, "%s6. %sSave^n");
  1210.         add(g_options_menu, size, "%s7. %sLoad^n^n");
  1211.         add(g_options_menu, size, "\r0. \wBack");
  1212.         g_keys_options_menu =           B1 | B2 | B3 | B4 | B5 | B6 | B7 | B0;
  1213.  
  1214.         size = charsmax(g_choice_menu);
  1215.         add(g_choice_menu, size, "\y%s^n^n");
  1216.         add(g_choice_menu, size, "\r1. \wYes^n");
  1217.         add(g_choice_menu, size, "\r2. \wNo^n^n^n^n^n^n^n^n^n");
  1218.         g_keys_choice_menu =            B1 | B2;
  1219.  
  1220.         size = charsmax(g_commands_menu);
  1221.         add(g_commands_menu, size, "\r[%s] \yAdmin Menu^n^n");
  1222.         add(g_commands_menu, size, "%s1. %sSave Checkpoint^n");
  1223.         add(g_commands_menu, size, "%s2. %sLoad Checkpoint^n^n");
  1224.         add(g_commands_menu, size, "%s3. %sRevive Yourself^n");
  1225.         add(g_commands_menu, size, "%s4. %sRevive Player^n");
  1226.         add(g_commands_menu, size, "%s5. %sRevive Everyone^n^n");
  1227.         add(g_commands_menu, size, "%s6. %s%s Godmode %s Everyone^n");
  1228.         add(g_commands_menu, size, "%s7. %sGive Access to %s^n^n");
  1229.         add(g_commands_menu, size, "\r0. \wBack");
  1230.         g_keys_commands_menu =          B1 | B2 | B3 | B4 | B5 | B6 | B7 | B0;
  1231. }
  1232.  
  1233. SetupBlockRendering(block_type, render_type, red, green, blue, alpha)
  1234. {
  1235.         g_render[block_type] =          render_type;
  1236.         g_red[block_type] =             red;
  1237.         g_green[block_type] =           green;
  1238.         g_blue[block_type] =            blue;
  1239.         g_alpha[block_type] =           alpha;
  1240. }
  1241.  
  1242. SetBlockModelName(model_target[256], model_source[256], const new_name[])
  1243. {
  1244.         model_target = model_source;
  1245.         replace(model_target, charsmax(model_target), "Normal", new_name);
  1246. }
  1247.  
  1248. public FwdPlayerSpawn(id)
  1249. {
  1250.         if ( !is_user_alive(id) ) return HAM_IGNORED;
  1251.  
  1252.         g_alive[id] =                   true;
  1253.  
  1254.         if ( g_noclip[id] )             set_user_noclip(id, 1);
  1255.         if ( g_godmode[id] )            set_user_godmode(id, 1);
  1256.  
  1257.         if ( g_all_godmode )
  1258.         {
  1259.                 for ( new i = 1; i <= g_max_players; i++ )
  1260.                 {
  1261.                         if ( !g_alive[i]
  1262.                         || g_admin[i]
  1263.                         || g_gived_access[i] ) continue;
  1264.  
  1265.                         entity_set_float(i, EV_FL_takedamage, DAMAGE_NO);
  1266.                 }
  1267.         }
  1268.  
  1269.         if ( g_viewing_commands_menu[id] ) ShowCommandsMenu(id);
  1270.  
  1271.         if ( !g_reseted[id] )
  1272.         {
  1273.                 ResetPlayer(id);
  1274.         }
  1275.  
  1276.         g_reseted[id] =                 false;
  1277.  
  1278.         AwpUsed[id] = false;
  1279.  
  1280.         DeagleUsed[id] = false;
  1281.  
  1282.         ScoutUsed[id] = false;
  1283.  
  1284.         GlockUsed[id] = false;
  1285.  
  1286.         USPUsed[id] = false;
  1287.  
  1288.         M4A1Used[id] = false;
  1289.  
  1290.         M3Used[id] = false;
  1291.  
  1292.         MP5Used[id] = false;
  1293.  
  1294.         P90Used[id] = false;
  1295.        
  1296.         GalilUsed[id] = false;
  1297.        
  1298.         FamasUsed[id] = false;
  1299.        
  1300.         AK47Used[id] = false;
  1301.        
  1302.         AUGUsed[id] = false;
  1303.        
  1304.         SG552Used[id] = false;
  1305.        
  1306.         SG550Used[id] = false;
  1307.        
  1308.         VestHelmUsed[id] = false;
  1309.  
  1310.         HeUsed[id] = false;
  1311.  
  1312.         FlashUsed[id] = false;
  1313.  
  1314.         SmokeUsed[id] = false;
  1315.  
  1316.         return HAM_IGNORED;
  1317. }
  1318.  
  1319. public FwdPlayerKilled(id)
  1320. {
  1321.         g_alive[id] = bool:is_user_alive(id);
  1322.  
  1323.         ResetPlayer(id);
  1324.  
  1325.         if ( g_viewing_commands_menu[id] ) ShowCommandsMenu(id);
  1326. }
  1327.  
  1328. public FwdCmdStart(id, handle)
  1329. {
  1330.         if ( !g_connected[id] ) return FMRES_IGNORED;
  1331.  
  1332.         static buttons, oldbuttons;
  1333.         buttons =       get_uc(handle, UC_Buttons);
  1334.         oldbuttons =    entity_get_int(id, EV_INT_oldbuttons);
  1335.  
  1336.         if ( g_alive[id]
  1337.         && ( buttons & IN_USE )
  1338.         && !( oldbuttons & IN_USE )
  1339.         && !g_has_hud_text[id] )
  1340.         {
  1341.                 static ent, body;
  1342.                 get_user_aiming(id, ent, body, 9999);
  1343.  
  1344.                 if ( IsBlock(ent) )
  1345.                 {
  1346.                         static block_type;
  1347.                         block_type = entity_get_int(ent, EV_INT_body);
  1348.  
  1349.                         static property[5];
  1350.  
  1351.                         static message[512], len;
  1352.                         len = format(message, charsmax(message), "Type: %s", g_block_names[block_type]);
  1353.  
  1354.                         if ( g_property1_name[block_type][0] )
  1355.                         {
  1356.                                 GetProperty(ent, 1, property);
  1357.  
  1358.                                 if ( ( block_type == BUNNYHOP )
  1359.                                 && property[0] == '1' )
  1360.                                 {
  1361.                                         len += format(message[len], charsmax(message) - len, "^n%s", g_property1_name[block_type]);
  1362.                                 }
  1363.                                 else if ( block_type == SLAP )
  1364.                                 {
  1365.                                         len += format(message[len], charsmax(message) - len, "^n%s: %s", g_property1_name[block_type], property[0] == '3' ? "High" : property[0] == '2' ? "Medium" : "Low");
  1366.                                 }
  1367.                                 else if ( block_type != BUNNYHOP )
  1368.                                 {
  1369.                                         len += format(message[len], charsmax(message) - len, "^n%s: %s", g_property1_name[block_type], property);
  1370.                                 }
  1371.                         }
  1372.                         if ( g_property2_name[block_type][0] )
  1373.                         {
  1374.                                 GetProperty(ent, 2, property);
  1375.  
  1376.                                 len += format(message[len], charsmax(message) - len, "^n%s: %s", g_property2_name[block_type], property);
  1377.                         }
  1378.                         if ( g_property3_name[block_type][0] )
  1379.                         {
  1380.                                 GetProperty(ent, 3, property);
  1381.  
  1382.                                 if ( block_type == BOOTS_OF_SPEED
  1383.                                 || property[0] != '0'
  1384.                                 && !( property[0] == '2' && property[1] == '5' && property[2] == '5' ) )
  1385.                                 {
  1386.                                         len += format(message[len], charsmax(message) - len, "^n%s: %s", g_property3_name[block_type], property);
  1387.                                 }
  1388.                         }
  1389.                         if ( g_property4_name[block_type][0] )
  1390.                         {
  1391.                                 GetProperty(ent, 4, property);
  1392.  
  1393.                                 len += format(message[len], charsmax(message) - len, "^n%s: %s", g_property4_name[block_type], property[0] == '1' ? "Yes" : "No");
  1394.                         }
  1395.                        
  1396.                         new szCreator[32];
  1397.                         pev(ent, pev_targetname, szCreator, 31);
  1398.                         replace_all(szCreator, 31, "_", " ");
  1399.                         len += format(message[len], charsmax(message) - len, "^nCreator: %s", szCreator);
  1400.                        
  1401.                         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  1402.                         show_hudmessage(id, message);
  1403.                 }
  1404.                 else if ( IsLight(ent) )
  1405.                 {
  1406.                         static property1[5], property2[5], property3[5], property4[5];
  1407.  
  1408.                         GetProperty(ent, 1, property1);
  1409.                         GetProperty(ent, 2, property2);
  1410.                         GetProperty(ent, 3, property3);
  1411.                         GetProperty(ent, 4, property4);
  1412.                        
  1413.                         new szCreator[32];
  1414.                         pev(ent, pev_targetname, szCreator, 31);
  1415.                         replace_all(szCreator, 31, "_", " ");
  1416.                        
  1417.                         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  1418.                         show_hudmessage(id, "Type: Light^nRadius: %s^nColor Red: %s^nColor Green: %s^nColor Blue: %s^nCreator: %s", property1, property2, property3, property4, szCreator);
  1419.                 }
  1420.         }
  1421.  
  1422.         if ( !g_grabbed[id] ) return FMRES_IGNORED;
  1423.  
  1424.         if ( ( buttons & IN_JUMP )
  1425.         && !( oldbuttons & IN_JUMP ) ) if ( g_grab_length[id] > 72.0 ) g_grab_length[id] -= 16.0;
  1426.  
  1427.         if ( ( buttons & IN_DUCK )
  1428.         && !( oldbuttons & IN_DUCK ) ) g_grab_length[id] += 16.0;
  1429.  
  1430.         if ( ( buttons & IN_ATTACK )
  1431.         && !( oldbuttons & IN_ATTACK ) ) CmdAttack(id);
  1432.  
  1433.         if ( ( buttons & IN_ATTACK2 )
  1434.         && !( oldbuttons & IN_ATTACK2 ) ) CmdAttack2(id);
  1435.  
  1436.         if ( ( buttons & IN_RELOAD )
  1437.         && !( oldbuttons & IN_RELOAD ) )
  1438.         {
  1439.                 CmdRotate(id);
  1440.                 set_uc(handle, UC_Buttons, buttons & ~IN_RELOAD);
  1441.         }
  1442.  
  1443.         if ( !is_valid_ent(g_grabbed[id]) )
  1444.         {
  1445.                 CmdRelease(id);
  1446.                 return FMRES_IGNORED;
  1447.         }
  1448.  
  1449.         if ( !IsBlockInGroup(id, g_grabbed[id])
  1450.         || g_group_count[id] < 1 )
  1451.         {
  1452.                 MoveGrabbedEntity(id);
  1453.                 return FMRES_IGNORED;
  1454.         }
  1455.  
  1456.         static block;
  1457.         static Float:move_to[3];
  1458.         static Float:offset[3];
  1459.         static Float:origin[3];
  1460.  
  1461.         MoveGrabbedEntity(id, move_to);
  1462.  
  1463.         for ( new i = 0; i <= g_group_count[id]; ++i )
  1464.         {
  1465.                 block = g_grouped_blocks[id][i];
  1466.  
  1467.                 if ( !IsBlockInGroup(id, block) ) continue;
  1468.  
  1469.                 entity_get_vector(block, EV_VEC_vuser1, offset);
  1470.  
  1471.                 origin[0] = move_to[0] - offset[0];
  1472.                 origin[1] = move_to[1] - offset[1];
  1473.                 origin[2] = move_to[2] - offset[2];
  1474.  
  1475.                 MoveEntity(id, block, origin, false);
  1476.         }
  1477.  
  1478.         return FMRES_IGNORED;
  1479. }
  1480.  
  1481. public EventCurWeapon(id)
  1482. {
  1483.         static block, property[5];
  1484.  
  1485.         if ( g_boots_of_speed[id] )
  1486.         {
  1487.                 block = g_boots_of_speed[id];
  1488.                 GetProperty(block, 3, property);
  1489.  
  1490.                 entity_set_float(id, EV_FL_maxspeed, str_to_float(property));
  1491.         }
  1492.         else if ( g_ice[id] )
  1493.         {
  1494.                 entity_set_float(id, EV_FL_maxspeed, 400.0);
  1495.         }
  1496.         else if ( g_honey[id] )
  1497.         {
  1498.                 block = g_honey[id];
  1499.                 GetProperty(block, 1, property);
  1500.  
  1501.                 entity_set_float(id, EV_FL_maxspeed, str_to_float(property));
  1502.         }
  1503. }
  1504.  
  1505. public pfn_touch(ent, id)
  1506. {
  1507.         if ( !( 1 <= id <= g_max_players )
  1508.         || !g_alive[id]
  1509.         || !IsBlock(ent) ) return PLUGIN_CONTINUE;
  1510.  
  1511.         new block_type =        entity_get_int(ent, EV_INT_body);
  1512.         if ( block_type == PLATFORM
  1513.         || block_type == GLASS ) return PLUGIN_CONTINUE;
  1514.  
  1515.         new flags =             entity_get_int(id, EV_INT_flags);
  1516.         new groundentity =      entity_get_edict(id, EV_ENT_groundentity);
  1517.  
  1518.         static property[5];
  1519.         GetProperty(ent, 4, property);
  1520.  
  1521.         if ( property[0] == '0'
  1522.         || ( ( !property[0]
  1523.                 || property[0] == '1'
  1524.                 || property[0] == '/' )
  1525.         && ( flags & FL_ONGROUND )
  1526.         && groundentity == ent ) )
  1527.         {
  1528.                 switch ( block_type )
  1529.                 {
  1530.                         case BUNNYHOP:                          ActionBhop(ent);
  1531.                         case DAMAGE:                            ActionDamage(id, ent);
  1532.                         case HEALER:                            ActionHeal(id, ent);
  1533.                         case TRAMPOLINE:                        ActionTrampoline(id, ent);
  1534.                         case SPEED_BOOST:                       ActionSpeedBoost(id, ent);
  1535.                         case DEATH:
  1536.                         {
  1537.                                 if ( !get_user_godmode(id) )
  1538.                                 {
  1539.                                         fakedamage(id, "The Block of Death", 10000.0, DMG_GENERIC);
  1540.                                 }
  1541.                         }
  1542.                         case SLAP:
  1543.                         {
  1544.                                 GetProperty(ent, 1, property);
  1545.                                 g_slap_times[id] = str_to_num(property) * 2;
  1546.                         }
  1547.                         case LOW_GRAVITY:                       ActionLowGravity(id, ent);
  1548.                         case HONEY:                             ActionHoney(id, ent);
  1549.                         case CT_BARRIER:                        ActionBarrier(id, ent, true);
  1550.                         case T_BARRIER:                         ActionBarrier(id, ent, false);
  1551.                         case DELAYED_BUNNYHOP:                  ActionDelayedBhop(ent);
  1552.                         case STEALTH:                           ActionStealth(id, ent);
  1553.                         case INVINCIBILITY:                     ActionInvincibility(id, ent);
  1554.                         case BOOTS_OF_SPEED:                    ActionBootsOfSpeed(id, ent);
  1555.                         case DUCK:                              ActionDuck(id, ent);
  1556.                         case MONEY:                             ActionMoney(id, ent);
  1557.                         case AWP:                               ActionAwp(id, ent);
  1558.                         case DEAGLE:                            ActionDeagle(id, ent);
  1559.                         case SCOUT:                             ActionScout(id, ent);
  1560.                         case GLOCK:                             ActionGlock(id, ent);
  1561.                         case USP:                               ActionUSP(id, ent);
  1562.                         case M4A1:                              ActionM4A1(id, ent);
  1563.                         case M3:                                ActionM3(id, ent);
  1564.                         case BLIND:                             ActionBlind(id);
  1565.                         case P90:                               ActionP90(id, ent);
  1566.                         case GALIL:                             ActionGalil(id, ent);
  1567.                         case FAMAS:                             ActionFamas(id, ent);
  1568.                         case AK47:                              ActionAK47(id, ent);
  1569.                         case AUG:                               ActionAUG(id, ent);
  1570.                         case SG552:                             ActionSG552(id, ent);
  1571.                         case SG550:                             ActionSG550(id, ent);
  1572.                         case VESTHELM:                          ActionVestHelm(id, ent);
  1573.                         case HE:                                ActionHe(id, ent);
  1574.                         case FLASH:                             ActionFlash(id, ent);
  1575.                         case SMOKE:                             ActionSmoke(id, ent);
  1576.                         case XP:                                ActionXp(id, ent);
  1577.                         case ICEBHOP:                           ActionIceBhop(id, ent);
  1578.                         case CAM:                               ActionCam(id, ent);
  1579.                         case SUPER:                             ActionSuper(id, ent);
  1580.                         case MAGIC:                             ActionMagic(id, ent);
  1581.                 }
  1582.         }
  1583.  
  1584.         if ( ( flags & FL_ONGROUND )
  1585.         && groundentity == ent )
  1586.         {
  1587.                 switch ( block_type )
  1588.                 {
  1589.                         case BUNNYHOP:
  1590.                         {
  1591.                                 GetProperty(ent, 1, property);
  1592.                                 if ( property[0] == '1' )
  1593.                                 {
  1594.                                         g_no_fall_damage[id] = true;
  1595.                                 }
  1596.                         }
  1597.                         case NO_FALL_DAMAGE:                    g_no_fall_damage[id] = true;
  1598.                         case ICE:                               ActionIce(id);
  1599.                 }
  1600.         }
  1601.  
  1602.         return PLUGIN_CONTINUE;
  1603. }
  1604.  
  1605. public server_frame()
  1606. {
  1607.         for ( new id = 1; id <= g_max_players; ++id )
  1608.         {
  1609.                 if ( !g_alive[id] ) continue;
  1610.  
  1611.                 if ( g_ice[id] || g_no_slow_down[id] )
  1612.                 {
  1613.                         entity_set_float(id, EV_FL_fuser2, 0.0);
  1614.                 }
  1615.  
  1616.                 if ( g_set_velocity[id][0] != 0.0
  1617.                 || g_set_velocity[id][1] != 0.0
  1618.                 || g_set_velocity[id][2] != 0.0 )
  1619.                 {
  1620.                         entity_set_vector(id, EV_VEC_velocity, g_set_velocity[id]);
  1621.  
  1622.                         g_set_velocity[id][0] = 0.0;
  1623.                         g_set_velocity[id][1] = 0.0;
  1624.                         g_set_velocity[id][2] = 0.0;
  1625.                 }
  1626.  
  1627.                 if ( g_low_gravity[id] )
  1628.                 {
  1629.                         if ( entity_get_int(id, EV_INT_flags) & FL_ONGROUND )
  1630.                         {
  1631.                                 entity_set_float(id, EV_FL_gravity, 1.0);
  1632.                                 g_low_gravity[id] = false;
  1633.                         }
  1634.                 }
  1635.  
  1636.                 if ( g_honey[id] )
  1637.                 {
  1638.                         if ( entity_get_int(id, EV_INT_flags) & FL_ONGROUND )
  1639.                         {
  1640.                                 entity_set_float(id, EV_FL_speed, 250.0);
  1641.                                 g_honey[id] = false;
  1642.                         }
  1643.                 }
  1644.  
  1645.                 while ( g_slap_times[id] )
  1646.                 {
  1647.                         user_slap(id, 0);
  1648.                         g_slap_times[id]--;
  1649.                 }
  1650.         }
  1651.  
  1652.         static ent;
  1653.         static entinsphere;
  1654.         static Float:origin[3];
  1655.  
  1656.         while ( ( ent = find_ent_by_class(ent, g_start_classname) ) )
  1657.         {
  1658.                 entity_get_vector(ent, EV_VEC_origin, origin);
  1659.  
  1660.                 entinsphere = -1;
  1661.                 while ( ( entinsphere = find_ent_in_sphere(entinsphere, origin, 40.0) ) )
  1662.                 {
  1663.                         static classname[32];
  1664.                         entity_get_string(entinsphere, EV_SZ_classname, classname, charsmax(classname));
  1665.  
  1666.                         if ( 1 <= entinsphere <= g_max_players && g_alive[entinsphere] )
  1667.                         {
  1668.                                 ActionTeleport(entinsphere, ent);
  1669.                         }
  1670.                         else if ( equal(classname, "grenade") )
  1671.                         {
  1672.                                 entity_set_int(ent, EV_INT_solid, SOLID_NOT);
  1673.                                 entity_set_float(ent, EV_FL_ltime, get_gametime() + 2.0);
  1674.                         }
  1675.                         else if ( get_gametime() >= entity_get_float(ent, EV_FL_ltime) )
  1676.                         {
  1677.                                 entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
  1678.                         }
  1679.                 }
  1680.         }
  1681.  
  1682.         static bool:ent_near;
  1683.  
  1684.         ent_near = false;
  1685.         while ( ( ent = find_ent_by_class(ent, g_destination_classname) ) )
  1686.         {
  1687.                 entity_get_vector(ent, EV_VEC_origin, origin);
  1688.  
  1689.                 entinsphere = -1;
  1690.                 while ( ( entinsphere = find_ent_in_sphere(entinsphere, origin, 64.0) ) )
  1691.                 {
  1692.                         static classname[32];
  1693.                         entity_get_string(entinsphere, EV_SZ_classname, classname, charsmax(classname));
  1694.  
  1695.                         if ( 1 <= entinsphere <= g_max_players && g_alive[entinsphere]
  1696.                         || equal(classname, "grenade") )
  1697.                         {
  1698.                                 ent_near = true;
  1699.                                 break;
  1700.                         }
  1701.                 }
  1702.  
  1703.                 if ( ent_near )
  1704.                 {
  1705.                         if ( !entity_get_int(ent, EV_INT_iuser2) )
  1706.                         {
  1707.                                 entity_set_int(ent, EV_INT_solid, SOLID_NOT);
  1708.                         }
  1709.                 }
  1710.                 else
  1711.                 {
  1712.                         entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
  1713.                 }
  1714.         }
  1715. }
  1716.  
  1717. public client_PreThink(id)
  1718. {
  1719.         if ( !g_alive[id] ) return PLUGIN_CONTINUE;
  1720.  
  1721.         new Float:gametime =                    get_gametime();
  1722.         new Float:timeleft_invincibility =      g_invincibility_time_out[id] - gametime;
  1723.         new Float:timeleft_stealth =            g_stealth_time_out[id] - gametime;
  1724.         new Float:timeleft_boots_of_speed =     g_boots_of_speed_time_out[id] - gametime;
  1725.         new Float:timeleft_cam =                g_cam_time_out[id] - gametime;
  1726.         new Float:timeleft_super =              g_super_time_out[id] - gametime;
  1727.  
  1728.         if ( timeleft_invincibility >= 0.0
  1729.         || timeleft_stealth >= 0.0
  1730.         || timeleft_boots_of_speed >= 0.0
  1731.         || timeleft_cam >= 0.0
  1732.         || timeleft_super >= 0.0 )
  1733.  
  1734.         {
  1735.                 new text[48], text_to_show[256];
  1736.  
  1737.                 format(text, charsmax(text), "");
  1738.                 add(text_to_show, charsmax(text_to_show), text);
  1739.  
  1740.                 if ( timeleft_invincibility >= 0.0 )
  1741.                 {
  1742.                         format(text, charsmax(text), "^nInvincible %.1f", timeleft_invincibility);
  1743.                         add(text_to_show, charsmax(text_to_show), text);
  1744.                 }
  1745.  
  1746.                 if ( timeleft_stealth >= 0.0 )
  1747.                 {
  1748.                         format(text, charsmax(text), "^nStealth %.1f", timeleft_stealth);
  1749.                         add(text_to_show, charsmax(text_to_show), text);
  1750.                 }
  1751.  
  1752.                 if ( timeleft_boots_of_speed >= 0.0 )
  1753.                 {
  1754.                         format(text, charsmax(text), "^nBoots Of Speed %.1f", timeleft_boots_of_speed);
  1755.                         add(text_to_show, charsmax(text_to_show), text);
  1756.                 }
  1757.                
  1758.                 if ( timeleft_cam >= 0.0 )
  1759.                 {
  1760.                         format(text, charsmax(text), "^nCamouflage %.1f", timeleft_cam);
  1761.                         add(text_to_show, charsmax(text_to_show), text);
  1762.                 }
  1763.                
  1764.                 if ( timeleft_super >= 0.0 )
  1765.                 {
  1766.                         format(text, charsmax(text), "^nSuper Man %.1f", timeleft_super);
  1767.                         add(text_to_show, charsmax(text_to_show), text);
  1768.                 }
  1769.                
  1770.                 set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  1771.                 show_hudmessage(id, text_to_show);
  1772.  
  1773.                 g_has_hud_text[id] = true;
  1774.         }
  1775.         else
  1776.         {
  1777.                 g_has_hud_text[id] = false;
  1778.         }
  1779.         if (is_user_alive(id))
  1780.             {
  1781.             //if player has low gravity
  1782.             if (gbLowGravity[id])
  1783.                 {
  1784.                 //get players flags
  1785.                 new flags = entity_get_int(id, EV_INT_flags);
  1786.  
  1787.                 //if player has feet on the ground, set gravity to normal
  1788.                 if (flags & FL_ONGROUND)
  1789.                     {
  1790.                     set_user_gravity(id);
  1791.  
  1792.                     gbLowGravity[id] = false;
  1793.                 }
  1794.             }
  1795.         }
  1796.         return PLUGIN_HANDLED;
  1797. }
  1798.  
  1799. public client_PostThink(id)
  1800. {
  1801.         if ( !g_alive[id] ) return PLUGIN_CONTINUE;
  1802.  
  1803.         if ( g_no_fall_damage[id] )
  1804.         {
  1805.                 entity_set_int(id,  EV_INT_watertype, -3);
  1806.                 g_no_fall_damage[id] = false;
  1807.         }
  1808.  
  1809.         return PLUGIN_CONTINUE;
  1810. }
  1811.  
  1812. ActionBhop(ent)
  1813. {
  1814.         if ( task_exists(TASK_SOLIDNOT + ent)
  1815.         || task_exists(TASK_SOLID + ent) ) return PLUGIN_HANDLED;
  1816.  
  1817.         set_task(0.1, "TaskSolidNot", TASK_SOLIDNOT + ent);
  1818.         return PLUGIN_HANDLED;
  1819. }
  1820.  
  1821. ActionDamage(id, ent)
  1822. {
  1823.         new Float:gametime = get_gametime();
  1824.         if ( !( gametime >= g_next_damage_time[id] )
  1825.         || get_user_health(id) <= 0
  1826.         || get_user_godmode(id) ) return PLUGIN_HANDLED;
  1827.  
  1828.         static property[5];
  1829.  
  1830.         GetProperty(ent, 1, property);
  1831.         fakedamage(id, "Damage Block", str_to_float(property), DMG_CRUSH);
  1832.  
  1833.         GetProperty(ent, 2, property);
  1834.         g_next_damage_time[id] = gametime + str_to_float(property);
  1835.  
  1836.         return PLUGIN_HANDLED;
  1837. }
  1838.  
  1839. ActionIceBhop(id, ent)
  1840. {
  1841.         if ( !g_ice[id] )
  1842.         {
  1843.                 entity_set_float(id, EV_FL_friction, 0.15);
  1844.                 entity_set_float(id, EV_FL_maxspeed, 400.0);
  1845.  
  1846.                 g_ice[id] = true;
  1847.         }
  1848.  
  1849.         new task_id = TASK_ICE + id;
  1850.         if ( task_exists(task_id) ) remove_task(task_id);
  1851.  
  1852.         set_task(0.1, "TaskNotOnIce", task_id);
  1853.  
  1854.         if ( task_exists(TASK_SOLIDNOT + ent)
  1855.         || task_exists(TASK_SOLID + ent) ) return PLUGIN_HANDLED;
  1856.  
  1857.         set_task(0.1, "TaskSolidNot", TASK_SOLIDNOT + ent);
  1858.         return PLUGIN_HANDLED;
  1859. }
  1860.  
  1861.  
  1862. ActionHeal(id, ent)
  1863. {
  1864.         new Float:gametime = get_gametime();
  1865.         if ( !( gametime >= g_next_heal_time[id] ) ) return PLUGIN_HANDLED;
  1866.  
  1867.         new health = get_user_health(id);
  1868.         if ( health >= 100 ) return PLUGIN_HANDLED;
  1869.  
  1870.         static property[5];
  1871.  
  1872.         GetProperty(ent, 1, property);
  1873.         health += str_to_num(property);
  1874.         set_user_health(id, min(100, health));
  1875.  
  1876.         GetProperty(ent, 2, property);
  1877.         g_next_heal_time[id] = gametime + str_to_float(property);
  1878.  
  1879.         return PLUGIN_HANDLED;
  1880. }
  1881.  
  1882. ActionIce(id)
  1883. {
  1884.         if ( !g_ice[id] )
  1885.         {
  1886.                 entity_set_float(id, EV_FL_friction, 0.15);
  1887.                 entity_set_float(id, EV_FL_maxspeed, 400.0);
  1888.  
  1889.                 g_ice[id] = true;
  1890.         }
  1891.  
  1892.         new task_id = TASK_ICE + id;
  1893.         if ( task_exists(task_id) ) remove_task(task_id);
  1894.  
  1895.         set_task(0.1, "TaskNotOnIce", task_id);
  1896. }
  1897.  
  1898. ActionTrampoline(id, ent)
  1899. {
  1900.         static property1[5];
  1901.         GetProperty(ent, 1, property1);
  1902.  
  1903.         entity_get_vector(id, EV_VEC_velocity, g_set_velocity[id]);
  1904.  
  1905.         g_set_velocity[id][2] = str_to_float(property1);
  1906.  
  1907.         entity_set_int(id, EV_INT_gaitsequence, 6);
  1908.  
  1909.         g_no_fall_damage[id] = true;
  1910. }
  1911.  
  1912. ActionSpeedBoost(id, ent)
  1913. {
  1914.         static property[5];
  1915.  
  1916.         GetProperty(ent, 1, property);
  1917.         velocity_by_aim(id, str_to_num(property), g_set_velocity[id]);
  1918.  
  1919.         GetProperty(ent, 2, property);
  1920.         g_set_velocity[id][2] = str_to_float(property);
  1921.  
  1922.         entity_set_int(id, EV_INT_gaitsequence, 6);
  1923. }
  1924.  
  1925. ActionLowGravity(id, ent)
  1926. {
  1927.         if (gbLowGravity[id]) return PLUGIN_HANDLED;
  1928.  
  1929.         static property1[5];
  1930.         GetProperty(ent, 1, property1);
  1931.  
  1932.         entity_set_float(id, EV_FL_gravity, str_to_float(property1) / 800);
  1933.  
  1934.         gbLowGravity[id] = true;
  1935.  
  1936.         return PLUGIN_HANDLED;
  1937. }
  1938.  
  1939. ActionHoney(id, ent)
  1940. {
  1941.         if ( g_honey[id] != ent)
  1942.         {
  1943.                 static property1[5];
  1944.                 GetProperty(ent, 1, property1);
  1945.  
  1946.                 new Float:speed = str_to_float(property1);
  1947.                 entity_set_float(id, EV_FL_maxspeed, speed == 0 ? 450.0 : speed);
  1948.                 g_honey[id] = ent;
  1949.  
  1950.         }
  1951.  
  1952.         new task_id = TASK_HONEY + id;
  1953.         if ( task_exists(task_id) )
  1954.         {
  1955.                 remove_task(task_id);
  1956.         }
  1957.         else
  1958.         {
  1959.                 static Float:velocity[3];
  1960.                 entity_get_vector(id, EV_VEC_velocity, velocity);
  1961.  
  1962.                 velocity[0] /= 2.0;
  1963.                 velocity[1] /= 2.0;
  1964.  
  1965.                 entity_set_vector(id, EV_VEC_velocity, velocity);
  1966.         }
  1967.         set_task(0.1, "TaskNotInHoney", task_id);
  1968.         return PLUGIN_HANDLED;
  1969. }
  1970. ActionBarrier(id, ent, bool:block_terrorists)
  1971. {
  1972.         if ( task_exists(TASK_SOLIDNOT + ent)
  1973.         || task_exists(TASK_SOLID + ent) ) return PLUGIN_HANDLED;
  1974.  
  1975.         new CsTeams:team = block_terrorists ? CS_TEAM_T : CS_TEAM_CT;
  1976.         if ( cs_get_user_team(id) == team ) TaskSolidNot(TASK_SOLIDNOT + ent);
  1977.  
  1978.         return PLUGIN_HANDLED;
  1979. }
  1980.  
  1981. ActionDelayedBhop(ent)
  1982. {
  1983.         if ( task_exists(TASK_SOLIDNOT + ent)
  1984.         || task_exists(TASK_SOLID + ent) ) return PLUGIN_HANDLED;
  1985.  
  1986.         static property1[5];
  1987.         GetProperty(ent, 1, property1);
  1988.  
  1989.         set_task(str_to_float(property1), "TaskSolidNot", TASK_SOLIDNOT + ent);
  1990.  
  1991.         return PLUGIN_HANDLED;
  1992. }
  1993.  
  1994. ActionInvincibility(id, ent)
  1995. {
  1996.         new Float:gametime = get_gametime();
  1997.         if ( !( gametime >= g_invincibility_next_use[id] ) )
  1998.         {
  1999.                 if ( !g_has_hud_text[id] )
  2000.                 {
  2001.                         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2002.                         show_hudmessage(id, "^nInvincibility^nNext Use %.1f",g_invincibility_next_use[id] - gametime);
  2003.                 }
  2004.  
  2005.                 return PLUGIN_HANDLED;
  2006.         }
  2007.  
  2008.         static property[5];
  2009.  
  2010.         entity_set_float(id, EV_FL_takedamage, DAMAGE_NO);
  2011.  
  2012.         if ( gametime >= g_stealth_time_out[id] )
  2013.         {
  2014.                 set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 16);
  2015.         }
  2016.  
  2017.         emit_sound(id, CHAN_STATIC, g_sound_invincibility, 1.0, ATTN_NORM, 0, PITCH_NORM);
  2018.  
  2019.         static Float:time_out;
  2020.         GetProperty(ent, 1, property);
  2021.         time_out = str_to_float(property);
  2022.         set_task(time_out, "TaskRemoveInvincibility", TASK_INVINCIBLE + id, g_blank, 0, g_a, 1);
  2023.  
  2024.         GetProperty(ent, 2, property);
  2025.  
  2026.         g_invincibility_time_out[id] = gametime + time_out;
  2027.         g_invincibility_next_use[id] = gametime + time_out + str_to_float(property);
  2028.  
  2029.         return PLUGIN_HANDLED;
  2030. }
  2031.  
  2032. ActionStealth(id, ent)
  2033. {
  2034.         new Float:gametime = get_gametime();
  2035.         if ( !( gametime >= g_stealth_next_use[id] ) )
  2036.         {
  2037.                 if ( !g_has_hud_text[id] )
  2038.                 {
  2039.                         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2040.                         show_hudmessage(id, "^nStealth^nNext Use %.1f", g_stealth_next_use[id] - gametime);
  2041.                 }
  2042.  
  2043.                 return PLUGIN_HANDLED;
  2044.         }
  2045.  
  2046.         static property[5];
  2047.  
  2048.         set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 0);
  2049.  
  2050.         emit_sound(id, CHAN_STATIC, g_sound_stealth, 1.0, ATTN_NORM, 0, PITCH_NORM);
  2051.  
  2052.         g_block_status[id] = true;
  2053.  
  2054.         static Float:time_out;
  2055.         GetProperty(ent, 1, property);
  2056.         time_out = str_to_float(property);
  2057.         set_task(time_out, "TaskRemoveStealth", TASK_STEALTH + id, g_blank, 0, g_a, 1);
  2058.         set_task(time_out + 1.0, "TaskRemoveStealth", TASK_STEALTH + id, g_blank, 0, g_a, 1);
  2059.  
  2060.         GetProperty(ent, 2, property);
  2061.  
  2062.         g_stealth_time_out[id] = gametime + time_out;
  2063.         g_stealth_next_use[id] = gametime + time_out + str_to_float(property);
  2064.  
  2065.         return PLUGIN_HANDLED;
  2066. }
  2067.  
  2068. ActionBootsOfSpeed(id, ent)
  2069. {
  2070.         new Float:gametime = get_gametime();
  2071.         if ( !( gametime >= g_boots_of_speed_next_use[id] ) )
  2072.         {
  2073.                 if ( !g_has_hud_text[id] )
  2074.                 {
  2075.                         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2076.                         show_hudmessage(id, "^nBoots Of Speed^nNext Use %.1f", g_boots_of_speed_next_use[id] - gametime);
  2077.                 }
  2078.  
  2079.                 return PLUGIN_HANDLED;
  2080.         }
  2081.  
  2082.         static property[5];
  2083.  
  2084.         GetProperty(ent, 3, property);
  2085.         entity_set_float(id, EV_FL_maxspeed, str_to_float(property));
  2086.  
  2087.         g_boots_of_speed[id] = ent;
  2088.  
  2089.         emit_sound(id, CHAN_STATIC, g_sound_boots_of_speed, 1.0, ATTN_NORM, 0, PITCH_NORM);
  2090.  
  2091.         static Float:time_out;
  2092.         GetProperty(ent, 1, property);
  2093.         time_out = str_to_float(property);
  2094.         set_task(time_out, "TaskRemoveBootsOfSpeed", TASK_BOOTSOFSPEED + id, g_blank, 0, g_a, 1);
  2095.  
  2096.         GetProperty(ent, 2, property);
  2097.  
  2098.         g_boots_of_speed_time_out[id] = gametime + time_out;
  2099.         g_boots_of_speed_next_use[id] = gametime + time_out + str_to_float(property);
  2100.  
  2101.         return PLUGIN_HANDLED;
  2102. }
  2103.  
  2104. ActionDuck(id, ent)
  2105. {
  2106.         if (is_user_alive(id)) {
  2107.         static property[5];
  2108.         GetProperty(ent, 1, property);
  2109.         entity_set_int(id, EV_INT_bInDuck, 15);
  2110.         }
  2111. }
  2112.  
  2113. ActionMoney(id, ent)
  2114. {
  2115.         if(g_money_used[id])
  2116.         {
  2117.                 static property[5];
  2118.                 new AddValue, playerMoney;
  2119.                 GetProperty(ent, 1, property);
  2120.                 playerMoney = cs_get_user_money(id);
  2121.                 AddValue = str_to_num(property) + playerMoney;
  2122.                 cs_set_user_money(id, AddValue);
  2123.                 g_money_used[id] = false;
  2124.                 emit_sound(id, CHAN_STATIC, g_sound_money, 1.0, ATTN_NORM, 0, PITCH_NORM);
  2125.                 SCM_Print(id, "You have been given %s $!", property);
  2126.         }
  2127.         else{
  2128.                 set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2129.                 show_hudmessage(id, "Next Use: Next Round");
  2130.         }
  2131.  
  2132.         if (is_user_alive(id) && get_user_team(id) == 2)
  2133.         {
  2134.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2135.         show_hudmessage(id, "This block is for Terrorists Only !");
  2136.         }
  2137. }
  2138.  
  2139. ActionAwp(id, ent)
  2140. {
  2141.         if(user_has_weapon(id, CSW_AWP))
  2142.                 return PLUGIN_HANDLED;
  2143.  
  2144.         if (is_user_alive(id) && !AwpUsed[id] && get_user_team(id) == 1)
  2145.         {
  2146.         static property[5];
  2147.         GetProperty(ent, 1, property);
  2148.         give_item(id, "weapon_awp");
  2149.         cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_awp", id), str_to_num(property));
  2150.         AwpUsed[id] = true;
  2151.         new name[42];
  2152.         get_user_name(id, name, 32);
  2153.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2154.         show_hudmessage(0, "%s has picked up an Awp!", name);
  2155.         SCM_Print(0, "^1%s^3 has picked up an^4 Awp!", name);
  2156.         }
  2157.  
  2158.         else
  2159.         {
  2160.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2161.         show_hudmessage(id, "Next Use: Next Round");
  2162.  
  2163.         }
  2164.  
  2165.         if (is_user_alive(id) && get_user_team(id) == 2)
  2166.         {
  2167.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2168.         show_hudmessage(id, "This block is for Terrorists Only !");
  2169.         }
  2170.         return PLUGIN_HANDLED;
  2171. }
  2172.  
  2173. ActionDeagle(id, ent)
  2174. {
  2175.         if(user_has_weapon(id, CSW_DEAGLE))
  2176.                 return PLUGIN_HANDLED;
  2177.        
  2178.         if (is_user_alive(id) && !DeagleUsed[id] && get_user_team(id) == 1)
  2179.         {
  2180.         static property[5];
  2181.         GetProperty(ent, 1, property);
  2182.         give_item(id, "weapon_deagle");
  2183.         cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_deagle", id), str_to_num(property));
  2184.         DeagleUsed[id] = true;
  2185.         new name[42];
  2186.         get_user_name(id, name, 32);
  2187.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2188.         show_hudmessage(0, "%s has picked up an Deagle!", name);
  2189.         SCM_Print(0, "^1%s^3 has picked up an^4 Deagle!", name);
  2190.         }
  2191.  
  2192.         else
  2193.         {
  2194.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2195.         show_hudmessage(id, "Next Use: Next Round");
  2196.         }
  2197.  
  2198.         if (is_user_alive(id) && get_user_team(id) == 2)
  2199.         {
  2200.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2201.         show_hudmessage(id, "This block is for Terrorists Only !");
  2202.         }
  2203.         return PLUGIN_HANDLED;
  2204. }
  2205.  
  2206. ActionHe(id, ent)
  2207. {
  2208.         if (HeUsed[id])
  2209.         {
  2210.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2211.         show_hudmessage(id, "Next Use: Next Round");
  2212.         }
  2213.         else if (user_has_weapon( id, CSW_HEGRENADE ))
  2214.         {
  2215.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2216.         show_hudmessage(id, "Use Your HE Grenade before you take another one ..");
  2217.         }
  2218.  
  2219.         else if (get_user_team(id) == 1 && !HeUsed[id] && !user_has_weapon( id, CSW_HEGRENADE ))
  2220.         {
  2221.         static property[5];
  2222.         GetProperty(ent, 1, property);
  2223.         give_item(id, "weapon_hegrenade");
  2224.         HeUsed[id] = true;
  2225.         }
  2226.  
  2227.         if (is_user_alive(id) && get_user_team(id) == 2)
  2228.         {
  2229.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2230.         show_hudmessage(id, "This block is for Terrorists Only !");
  2231.         }
  2232.         return PLUGIN_HANDLED;
  2233. }
  2234. ActionFlash(id, ent)
  2235. {
  2236.         if (FlashUsed[id])
  2237.         {
  2238.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2239.         show_hudmessage(id, "Next Use: Next Round");
  2240.         }
  2241.         else if (user_has_weapon( id, CSW_FLASHBANG ))
  2242.         {
  2243.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2244.         show_hudmessage(id, "Use Your Flashbang before you take another one ..");
  2245.         }
  2246.  
  2247.         if(cs_get_user_bpammo(id, CSW_FLASHBANG) < 2 && !FlashUsed[id] && get_user_team(id) == 1)
  2248.         {
  2249.         static property[5];
  2250.         GetProperty(ent, 1, property);
  2251.         give_item(id, "weapon_flashbang");
  2252.         FlashUsed[id] = true;
  2253.         }
  2254.  
  2255.         if (is_user_alive(id) && get_user_team(id) == 2)
  2256.         {
  2257.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2258.         show_hudmessage(id, "This block is for Terrorists Only !");
  2259.         }
  2260.         return PLUGIN_HANDLED;
  2261. }
  2262.  
  2263. ActionScout(id, ent)
  2264. {
  2265.         if (is_user_alive(id) && !ScoutUsed[id] && get_user_team(id) == 1)
  2266.         {
  2267.         static property[5];
  2268.         GetProperty(ent, 1, property);
  2269.         give_item(id, "weapon_scout");
  2270.         cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_scout", id), str_to_num(property));
  2271.         ScoutUsed[id] = true;
  2272.         new name[42];
  2273.         get_user_name(id, name, 32);
  2274.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2275.         show_hudmessage(0, "%s has picked up a Scout!", name);
  2276.         SCM_Print(0, "^1%s^3 has picked up a^4 Scout!", name);
  2277.         }
  2278.  
  2279.         else
  2280.         {
  2281.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2282.         show_hudmessage(id, "Next Use: Next Round");
  2283.  
  2284.         }
  2285.  
  2286.         if (is_user_alive(id) && get_user_team(id) == 2)
  2287.         {
  2288.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2289.         show_hudmessage(id, "This block is for Terrorists Only !");
  2290.         }
  2291.         return PLUGIN_HANDLED;
  2292. }
  2293.  
  2294. ActionGlock(id, ent)
  2295. {
  2296.         if (is_user_alive(id) && !GlockUsed[id] && get_user_team(id) == 1)
  2297.         {
  2298.         static property[5];
  2299.         GetProperty(ent, 1, property);
  2300.         give_item(id, "weapon_glock18");
  2301.         cs_set_weapon_ammo(find_ent_by_owner(3, "weapon_glock18", id), str_to_num(property));
  2302.         GlockUsed[id] = true;
  2303.         new name[42];
  2304.         get_user_name(id, name, 32);
  2305.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2306.         show_hudmessage(0, "%s has picked up a Glock!", name);
  2307.         SCM_Print(0, "^1%s^3 has picked up a^4 Glock!", name);
  2308.         }
  2309.  
  2310.         else
  2311.         {
  2312.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2313.         show_hudmessage(id, "Next Use: Next Round");
  2314.  
  2315.         }
  2316.  
  2317.         if (is_user_alive(id) && get_user_team(id) == 2)
  2318.         {
  2319.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2320.         show_hudmessage(id, "This block is for Terrorists Only !");
  2321.         }
  2322.         return PLUGIN_HANDLED;
  2323. }
  2324.  
  2325. ActionUSP(id, ent)
  2326. {
  2327.         if (is_user_alive(id) && !USPUsed[id] && get_user_team(id) == 1)
  2328.         {
  2329.         static property[5];
  2330.         GetProperty(ent, 1, property);
  2331.         give_item(id, "weapon_usp");
  2332.         cs_set_weapon_ammo(find_ent_by_owner(3, "weapon_usp", id), str_to_num(property));
  2333.         USPUsed[id] = true;
  2334.         new name[42];
  2335.         get_user_name(id, name, 32);
  2336.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2337.         show_hudmessage(0, "%s has picked up an USP!", name);
  2338.         SCM_Print(0, "^1%s^3 has picked up an^4 USP!", name);
  2339.         }
  2340.  
  2341.         else
  2342.         {
  2343.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2344.         show_hudmessage(id, "Next Use: Next Round");
  2345.  
  2346.         }
  2347.  
  2348.         if (is_user_alive(id) && get_user_team(id) == 2)
  2349.         {
  2350.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2351.         show_hudmessage(id, "This block is for Terrorists Only !");
  2352.         }
  2353.         return PLUGIN_HANDLED;
  2354. }
  2355.  
  2356. ActionM4A1(id, ent)
  2357. {
  2358.         if (is_user_alive(id) && !M4A1Used[id] && get_user_team(id) == 1)
  2359.         {
  2360.         static property[5];
  2361.         GetProperty(ent, 1, property);
  2362.         give_item(id, "weapon_m4a1");
  2363.         cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_m4a1", id), str_to_num(property));
  2364.         M4A1Used[id] = true;
  2365.         new name[42];
  2366.         get_user_name(id, name, 32);
  2367.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2368.         show_hudmessage(0, "%s has picked up a M4A1!", name);
  2369.         SCM_Print(0, "^1%s^3 has picked up a^4 M4A1!", name);
  2370.         }
  2371.  
  2372.         else
  2373.         {
  2374.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2375.         show_hudmessage(id, "Next Use: Next Round");
  2376.  
  2377.         }
  2378.  
  2379.         if (is_user_alive(id) && get_user_team(id) == 2)
  2380.         {
  2381.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2382.         show_hudmessage(id, "This block is for Terrorists Only !");
  2383.         }
  2384.         return PLUGIN_HANDLED;
  2385. }
  2386.  
  2387. ActionM3(id, ent)
  2388. {
  2389.         if (is_user_alive(id) && !M3Used[id] && get_user_team(id) == 1)
  2390.         {
  2391.         static property[5];
  2392.         GetProperty(ent, 1, property);
  2393.         give_item(id, "weapon_m3");
  2394.         cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_m3", id), str_to_num(property));
  2395.         M3Used[id] = true;
  2396.         new name[42];
  2397.         get_user_name(id, name, 32);
  2398.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2399.         show_hudmessage(0, "%s has picked up a M3!", name);
  2400.         SCM_Print(0, "^1%s^3 has picked up a^4 M3!", name);
  2401.         }
  2402.  
  2403.         else
  2404.         {
  2405.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2406.         show_hudmessage(id, "Next Use: Next Round");
  2407.  
  2408.         }
  2409.  
  2410.         if (is_user_alive(id) && get_user_team(id) == 2)
  2411.         {
  2412.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2413.         show_hudmessage(id, "This block is for Terrorists Only !");
  2414.         }
  2415.         return PLUGIN_HANDLED;
  2416. }
  2417.  
  2418. ActionBlind(id)
  2419. {
  2420.         message_begin(MSG_ONE, gmsgScreenFade, {0,0,0}, id);
  2421.         write_short(4096*1);    // Duration
  2422.         write_short(4096*1);    // Hold time
  2423.         write_short(4096);    // Fade type
  2424.         write_byte(0);        // Red
  2425.         write_byte(0);        // Green
  2426.         write_byte(0);        // Blue
  2427.         write_byte(255);    // Alpha
  2428.         message_end();
  2429. }
  2430.  
  2431. ActionP90(id, ent)
  2432. {
  2433.         if (is_user_alive(id) && !P90Used[id] && get_user_team(id) == 1)
  2434.         {
  2435.         static property[5];
  2436.         GetProperty(ent, 1, property);
  2437.         give_item(id, "weapon_p90");
  2438.         cs_set_weapon_ammo(find_ent_by_owner(3, "weapon_p90", id), str_to_num(property));
  2439.         P90Used[id] = true;
  2440.         new name[42];
  2441.         get_user_name(id, name, 32);
  2442.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2443.         show_hudmessage(0, "%s has picked up a P90!", name);
  2444.         SCM_Print(0, "^1%s^3 has picked up a^4 P90!", name);
  2445.         }
  2446.  
  2447.         else
  2448.         {
  2449.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2450.         show_hudmessage(id, "Next Use: Next Round");
  2451.  
  2452.         }
  2453.  
  2454.         if (is_user_alive(id) && get_user_team(id) == 2)
  2455.         {
  2456.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2457.         show_hudmessage(id, "This block is for Terrorists Only !");
  2458.         }
  2459.         return PLUGIN_HANDLED;
  2460. }
  2461.  
  2462. ActionGalil(id, ent)
  2463. {
  2464.         if (is_user_alive(id) && !GalilUsed[id] && get_user_team(id) == 1)
  2465.         {
  2466.         static property[5];
  2467.         GetProperty(ent, 1, property);
  2468.         give_item(id, "weapon_galil");
  2469.         cs_set_weapon_ammo(find_ent_by_owner(3, "weapon_galil", id), str_to_num(property));
  2470.         GalilUsed[id] = true;
  2471.         new name[42];
  2472.         get_user_name(id, name, 32);
  2473.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2474.         show_hudmessage(0, "%s has picked up a Galil!", name);
  2475.         SCM_Print(0, "^1%s^3 has picked up a^4 Galil!", name);
  2476.         }
  2477.  
  2478.         else
  2479.         {
  2480.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2481.         show_hudmessage(id, "Next Use: Next Round");
  2482.  
  2483.         }
  2484.  
  2485.         if (is_user_alive(id) && get_user_team(id) == 2)
  2486.         {
  2487.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2488.         show_hudmessage(id, "This block is for Terrorists Only !");
  2489.         }
  2490.         return PLUGIN_HANDLED;
  2491. }
  2492.  
  2493. ActionFamas(id, ent)
  2494. {
  2495.         if (is_user_alive(id) && !FamasUsed[id] && get_user_team(id) == 1)
  2496.         {
  2497.         static property[5];
  2498.         GetProperty(ent, 1, property);
  2499.         give_item(id, "weapon_famas");
  2500.         cs_set_weapon_ammo(find_ent_by_owner(3, "weapon_famas", id), str_to_num(property));
  2501.         FamasUsed[id] = true;
  2502.         new name[42];
  2503.         get_user_name(id, name, 32);
  2504.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2505.         show_hudmessage(0, "%s has picked up a Famas!", name);
  2506.         SCM_Print(0, "^1%s^3 has picked up a^4 Famas!", name);
  2507.         }
  2508.  
  2509.         else
  2510.         {
  2511.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2512.         show_hudmessage(id, "Next Use: Next Round");
  2513.  
  2514.         }
  2515.  
  2516.         if (is_user_alive(id) && get_user_team(id) == 2)
  2517.         {
  2518.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2519.         show_hudmessage(id, "This block is for Terrorists Only !");
  2520.         }
  2521.         return PLUGIN_HANDLED;
  2522. }
  2523.  
  2524. ActionAK47(id, ent)
  2525. {
  2526.         if (is_user_alive(id) && !AK47Used[id] && get_user_team(id) == 1)
  2527.         {
  2528.         static property[5];
  2529.         GetProperty(ent, 1, property);
  2530.         give_item(id, "weapon_ak47");
  2531.         cs_set_weapon_ammo(find_ent_by_owner(3, "weapon_ak47", id), str_to_num(property));
  2532.         AK47Used[id] = true;
  2533.         new name[42];
  2534.         get_user_name(id, name, 32);
  2535.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2536.         show_hudmessage(0, "%s has picked up a AK47!", name);
  2537.         SCM_Print(0, "^1%s^3 has picked up a^4 AK47!", name);
  2538.         }
  2539.  
  2540.         else
  2541.         {
  2542.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2543.         show_hudmessage(id, "Next Use: Next Round");
  2544.  
  2545.         }
  2546.  
  2547.         if (is_user_alive(id) && get_user_team(id) == 2)
  2548.         {
  2549.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2550.         show_hudmessage(id, "This block is for Terrorists Only !");
  2551.         }
  2552.         return PLUGIN_HANDLED;
  2553. }
  2554.  
  2555. ActionAUG(id, ent)
  2556. {
  2557.         if (is_user_alive(id) && !AUGUsed[id] && get_user_team(id) == 1)
  2558.         {
  2559.         static property[5];
  2560.         GetProperty(ent, 1, property);
  2561.         give_item(id, "weapon_aug");
  2562.         cs_set_weapon_ammo(find_ent_by_owner(3, "weapon_aug", id), str_to_num(property));
  2563.         AUGUsed[id] = true;
  2564.         new name[42];
  2565.         get_user_name(id, name, 32);
  2566.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2567.         show_hudmessage(0, "%s has picked up a AUG!", name);
  2568.         SCM_Print(0, "^1%s^3 has picked up a^4 AUG!", name);
  2569.         }
  2570.  
  2571.         else
  2572.         {
  2573.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2574.         show_hudmessage(id, "Next Use: Next Round");
  2575.  
  2576.         }
  2577.  
  2578.         if (is_user_alive(id) && get_user_team(id) == 2)
  2579.         {
  2580.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2581.         show_hudmessage(id, "This block is for Terrorists Only !");
  2582.         }
  2583.         return PLUGIN_HANDLED;
  2584. }
  2585.  
  2586. ActionSG552(id, ent)
  2587. {
  2588.         if (is_user_alive(id) && !SG552Used[id] && get_user_team(id) == 1)
  2589.         {
  2590.         static property[5];
  2591.         GetProperty(ent, 1, property);
  2592.         give_item(id, "weapon_sg552");
  2593.         cs_set_weapon_ammo(find_ent_by_owner(3, "weapon_sg552", id), str_to_num(property));
  2594.         SG552Used[id] = true;
  2595.         new name[42];
  2596.         get_user_name(id, name, 32);
  2597.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2598.         show_hudmessage(0, "%s has picked up a SG552!", name);
  2599.         SCM_Print(0, "^1%s^3 has picked up a^4 SG552!", name);
  2600.         }
  2601.  
  2602.         else
  2603.         {
  2604.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2605.         show_hudmessage(id, "Next Use: Next Round");
  2606.  
  2607.         }
  2608.  
  2609.         if (is_user_alive(id) && get_user_team(id) == 2)
  2610.         {
  2611.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2612.         show_hudmessage(id, "This block is for Terrorists Only !");
  2613.         }
  2614.         return PLUGIN_HANDLED;
  2615. }
  2616.  
  2617. ActionSG550(id, ent)
  2618. {
  2619.         if (is_user_alive(id) && !SG550Used[id] && get_user_team(id) == 1)
  2620.         {
  2621.         static property[5];
  2622.         GetProperty(ent, 1, property);
  2623.         give_item(id, "weapon_sg550");
  2624.         cs_set_weapon_ammo(find_ent_by_owner(2, "weapon_sg550", id), str_to_num(property));
  2625.         SG550Used[id] = true;
  2626.         new name[42];
  2627.         get_user_name(id, name, 32);
  2628.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2629.         show_hudmessage(0, "%s has picked up a SG550!", name);
  2630.         SCM_Print(0, "^1%s^3 has picked up a^4 SG550!", name);
  2631.         }
  2632.  
  2633.         else
  2634.         {
  2635.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2636.         show_hudmessage(id, "Next Use: Next Round");
  2637.  
  2638.         }
  2639.  
  2640.         if (is_user_alive(id) && get_user_team(id) == 2)
  2641.         {
  2642.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2643.         show_hudmessage(id, "This block is for Terrorists Only !");
  2644.         }
  2645.         return PLUGIN_HANDLED;
  2646. }
  2647.  
  2648. ActionVestHelm(id, ent)
  2649. {
  2650.         if (is_user_alive(id) && !VestHelmUsed[id] && get_user_team(id) == 1)
  2651.         {
  2652.         static property[5];
  2653.         GetProperty(ent, 1, property);
  2654.         give_item(id, "item_vesthelm");
  2655.         VestHelmUsed[id] = true;
  2656.         new name[42];
  2657.         get_user_name(id, name, 32);
  2658.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2659.         show_hudmessage(0, "%s has picked up a Vest+Helm!", name);
  2660.         SCM_Print(0, "^1%s^3 has picked up a^4 Vest+Helm!", name);
  2661.         }
  2662.  
  2663.         else
  2664.         {
  2665.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2666.         show_hudmessage(id, "Next Use: Next Round");
  2667.  
  2668.         }
  2669.  
  2670.         if (is_user_alive(id) && get_user_team(id) == 2)
  2671.         {
  2672.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2673.         show_hudmessage(id, "This block is for Terrorists Only !");
  2674.         }
  2675.         return PLUGIN_HANDLED;
  2676. }
  2677.  
  2678. ActionSmoke(id, ent)
  2679. {
  2680.         if (SmokeUsed[id])
  2681.         {
  2682.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2683.         show_hudmessage(id, "Next Use: Next Round");
  2684.         }
  2685.         else if (user_has_weapon( id, CSW_SMOKEGRENADE ))
  2686.         {
  2687.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2688.         show_hudmessage(id, "Use Your Frostnade before you take another one ..");
  2689.         }
  2690.  
  2691.         else if (get_user_team(id) == 1 && !SmokeUsed[id] && !user_has_weapon( id, CSW_SMOKEGRENADE ))
  2692.         {
  2693.         static property[5];
  2694.         GetProperty(ent, 1, property);
  2695.         give_item(id, "weapon_smokegrenade");
  2696.         SmokeUsed[id] = true;
  2697.         }
  2698.  
  2699.         if (is_user_alive(id) && get_user_team(id) == 2)
  2700.         {
  2701.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2702.         show_hudmessage(id, "This block is for Terrorists Only !");
  2703.         }
  2704.         return PLUGIN_HANDLED;
  2705. }
  2706.  
  2707. ActionXp(id, ent)
  2708. {
  2709.         new Float:gametime = get_gametime();
  2710.         if ( !( gametime >= g_next_xp_time[id] ) )
  2711.         {
  2712.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2713.         show_hudmessage(id, "Xp Block^nNext Use: %.1f", g_next_xp_time[id] - gametime);
  2714.  
  2715.         return PLUGIN_HANDLED;
  2716.         }
  2717.  
  2718.         static property[5];
  2719.         GetProperty(ent, 1, property);
  2720.  
  2721.         if (cs_get_user_team(id) == CS_TEAM_CT)
  2722.         {
  2723.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2724.         show_hudmessage(id, "This Block is for Terrorists Only");
  2725.         }
  2726.  
  2727.         if (cs_get_user_team(id) == CS_TEAM_T && !XpUsed[id])
  2728.         {
  2729.         new xp = str_to_num(property);
  2730.         hnsxp_add_user_xp( id, xp );
  2731.         SCM_Print(id, "^3 Youve Gaind^4 %s^3 Xp", property);
  2732.         }
  2733.  
  2734.         GetProperty(ent, 2, property);
  2735.         g_next_xp_time[id] = gametime + str_to_float(property);
  2736.  
  2737.         return PLUGIN_HANDLED;
  2738. }
  2739.  
  2740. ActionCam(id, ent)
  2741. {
  2742.         new Float:gametime = get_gametime();
  2743.         if ( !( gametime >= g_cam_next_use[id] ) )
  2744.         {
  2745.                 if ( !g_has_hud_text[id] )
  2746.                 {
  2747.                         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2748.                         show_hudmessage(id, "^nCamouflage^nNext Use %.1f", g_cam_next_use[id] - gametime);
  2749.                 }
  2750.  
  2751.                 return PLUGIN_HANDLED;
  2752.         }
  2753.  
  2754.         static property[5];
  2755.        
  2756.         new team;
  2757.         team = get_user_team(id);
  2758.         if (team == 1)
  2759.         {
  2760.                 cs_set_user_model(id, "gsg9");
  2761.         }
  2762.         else
  2763.         {
  2764.                 cs_set_user_model(id, "leet");
  2765.         }
  2766.  
  2767.         emit_sound(id, CHAN_STATIC, g_sound_cam, 1.0, ATTN_NORM, 0, PITCH_NORM);
  2768.  
  2769.         g_block_status[id] = true;
  2770.  
  2771.         static Float:time_out;
  2772.         GetProperty(ent, 1, property);
  2773.         time_out = str_to_float(property);
  2774.         set_task(time_out, "TaskRemoveCam", TASK_CAM + id, g_blank, 0, g_a, 1);
  2775.  
  2776.         GetProperty(ent, 2, property);
  2777.  
  2778.         g_cam_time_out[id] = gametime + time_out;
  2779.         g_cam_next_use[id] = gametime + time_out + str_to_float(property);
  2780.  
  2781.         return PLUGIN_HANDLED;
  2782. }
  2783.  
  2784. ActionSuper(id, ent)
  2785. {
  2786.         new Float:gametime = get_gametime();
  2787.         if ( !( gametime >= g_super_next_use[id] ) )
  2788.         {
  2789.                 if ( !g_has_hud_text[id] )
  2790.                 {
  2791.                         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2792.                         show_hudmessage(id, "^nSuper Man^nNext Use %.1f", g_super_next_use[id] - gametime);
  2793.                 }
  2794.  
  2795.                 return PLUGIN_HANDLED;
  2796.         }
  2797.  
  2798.         static property[5];
  2799.  
  2800.         GetProperty(ent, 3, property);
  2801.         entity_set_float(id, EV_FL_gravity, str_to_float(property) / 800);
  2802.  
  2803.         g_boots_of_speed[id] = ent;
  2804.  
  2805.         static Float:time_out;
  2806.         GetProperty(ent, 1, property);
  2807.         time_out = str_to_float(property);
  2808.         set_task(time_out, "TaskRemoveSuper", TASK_SUPER + id, g_blank, 0, g_a, 1);
  2809.  
  2810.         GetProperty(ent, 2, property);
  2811.  
  2812.         g_super_time_out[id] = gametime + time_out;
  2813.         g_super_next_use[id] = gametime + time_out + str_to_float(property);
  2814.  
  2815.         return PLUGIN_HANDLED;
  2816. }
  2817.  
  2818. ActionMagic(id, ent)
  2819. {
  2820.         new szProperty[5], Float:vVelocity[3];
  2821.         GetProperty(ent, 1, szProperty);
  2822.  
  2823.         pev(id, pev_velocity, vVelocity);
  2824.         vVelocity[2] = 0.0;
  2825.         set_pev(ent, pev_velocity, vVelocity);
  2826.  
  2827.         static Float:time_out2;
  2828.         static property[20];
  2829.         GetProperty(ent, 1, property);
  2830.         time_out2 = str_to_float(property);
  2831.         set_task(time_out2, "remove_magic");
  2832.  
  2833.         return PLUGIN_HANDLED;
  2834. }
  2835.  
  2836. ActionTeleport(id, ent)
  2837. {
  2838.         //get end entity id
  2839.     new tele = entity_get_int(ent, EV_INT_iuser1);
  2840.    
  2841.     //if teleport end id is valid
  2842.     if (tele)
  2843.         {
  2844.         //get end entity origin
  2845.         new Float:vTele[3];
  2846.         entity_get_vector(tele, EV_VEC_origin, vTele);
  2847.        
  2848.         //if id of entity being teleported is a player and telefrags CVAR is set then kill any nearby players
  2849.         if ((id > 0 && id <= 32) && get_cvar_num("bm_telefrags") > 0)
  2850.             {
  2851.             new player = -1;
  2852.            
  2853.             do
  2854.             {
  2855.                 player = find_ent_in_sphere(player, vTele, 16.0);
  2856.                
  2857.                 //if entity found is a player
  2858.                 if (player > 0 && player <= 32)
  2859.                     {
  2860.                     //if player is alive, and is not the player that went through the teleport
  2861.                     if (is_user_alive(player) && player != id)
  2862.                         {
  2863.                         //kill the player
  2864.                         user_kill(player, 1);
  2865.                     }
  2866.                 }
  2867.             }while(player);
  2868.         }
  2869.        
  2870.         //get origin of the start of the teleport
  2871.         new Float:vOrigin[3];
  2872.         new origin[3];
  2873.         entity_get_vector(ent, EV_VEC_origin, vOrigin);
  2874.         FVecIVec(vOrigin, origin);
  2875.        
  2876.         //show some teleporting effects
  2877.         message_begin(MSG_PVS, SVC_TEMPENTITY, origin);
  2878.         write_byte(TE_IMPLOSION);
  2879.         write_coord(origin[0]);
  2880.         write_coord(origin[1]);
  2881.         write_coord(origin[2]);
  2882.         write_byte(64);        // radius
  2883.         write_byte(100);    // count
  2884.         write_byte(6);        // life
  2885.         message_end();
  2886.        
  2887.         //teleport player
  2888.         entity_set_vector(id, EV_VEC_origin, vTele);
  2889.        
  2890.         //reverse players Z velocity
  2891.         new Float:vVelocity[3];
  2892.         entity_get_vector(id, EV_VEC_velocity, vVelocity);
  2893.         vVelocity[2] = floatabs(vVelocity[2]);
  2894.         entity_set_vector(id, EV_VEC_velocity, vVelocity);
  2895.         emit_sound(id, CHAN_STATIC, g_sound_teleport, 1.0, ATTN_NORM, 0, PITCH_NORM);
  2896.     }
  2897. }
  2898.  
  2899. public TaskSolidNot(ent)
  2900. {
  2901.         ent -= TASK_SOLIDNOT;
  2902.  
  2903.         if ( !is_valid_ent(ent)
  2904.         || entity_get_int(ent, EV_INT_iuser2) ) return PLUGIN_HANDLED;
  2905.  
  2906.         entity_set_int(ent, EV_INT_solid, SOLID_NOT);
  2907.         set_rendering(ent, kRenderFxNone, 255, 255, 255, kRenderTransAdd, 25);
  2908.         set_task(1.0, "TaskSolid", TASK_SOLID + ent);
  2909.  
  2910.         return PLUGIN_HANDLED;
  2911. }
  2912.  
  2913. public TaskSolid(ent)
  2914. {
  2915.         ent -= TASK_SOLID;
  2916.  
  2917.         if ( !IsBlock(ent) ) return PLUGIN_HANDLED;
  2918.  
  2919.         entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
  2920.  
  2921.         if ( entity_get_int(ent, EV_INT_iuser1) > 0 )
  2922.         {
  2923.                 GroupBlock(0, ent);
  2924.         }
  2925.         else
  2926.         {
  2927.                 static property3[5];
  2928.                 GetProperty(ent, 3, property3);
  2929.  
  2930.                 new transparency = str_to_num(property3);
  2931.                 if ( !transparency
  2932.                 || transparency == 255 )
  2933.                 {
  2934.                         new block_type = entity_get_int(ent, EV_INT_body);
  2935.                         SetBlockRendering(ent, g_render[block_type], g_red[block_type], g_green[block_type], g_blue[block_type], g_alpha[block_type]);
  2936.                 }
  2937.                 else
  2938.                 {
  2939.                         SetBlockRendering(ent, TRANSALPHA, 255, 255, 255, transparency);
  2940.                 }
  2941.         }
  2942.  
  2943.         return PLUGIN_HANDLED;
  2944. }
  2945.  
  2946. public TaskNotOnIce(id)
  2947. {
  2948.         id -= TASK_ICE;
  2949.  
  2950.         g_ice[id] = false;
  2951.  
  2952.         if ( !g_alive[id] ) return PLUGIN_HANDLED;
  2953.  
  2954.         if ( g_boots_of_speed[id] )
  2955.         {
  2956.                 static block, property3[5];
  2957.                 block = g_boots_of_speed[id];
  2958.                 GetProperty(block, 3, property3);
  2959.  
  2960.                 entity_set_float(id, EV_FL_maxspeed, str_to_float(property3));
  2961.         }
  2962.         else
  2963.         {
  2964.                 ResetMaxspeed(id);
  2965.         }
  2966.  
  2967.         entity_set_float(id, EV_FL_friction, 1.0);
  2968.  
  2969.         return PLUGIN_HANDLED;
  2970. }
  2971.  
  2972. public TaskNotInHoney(id)
  2973. {
  2974.         id -= TASK_HONEY;
  2975.  
  2976.         g_honey[id] = 0;
  2977.  
  2978.         if ( !g_alive[id] ) return PLUGIN_HANDLED;
  2979.  
  2980.         if ( g_boots_of_speed[id] )
  2981.         {
  2982.                 static block, property3[5];
  2983.                 block = g_boots_of_speed[id];
  2984.                 GetProperty(block, 3, property3);
  2985.  
  2986.                 entity_set_float(id, EV_FL_maxspeed, str_to_float(property3));
  2987.         }
  2988.         else
  2989.         {
  2990.                 ResetMaxspeed(id);
  2991.         }
  2992.  
  2993.         return PLUGIN_HANDLED;
  2994. }
  2995.  
  2996. public TaskRemoveCam(id)
  2997. {
  2998.         id -= TASK_CAM;
  2999.  
  3000.         if ( g_connected[id] )
  3001.         {
  3002.                 cs_reset_user_model(id);
  3003.         }
  3004. }
  3005.  
  3006. public TaskRemoveInvincibility(id)
  3007. {
  3008.         id -= TASK_INVINCIBLE;
  3009.  
  3010.         if ( !g_alive[id] ) return PLUGIN_HANDLED;
  3011.  
  3012.         if ( ( g_admin[id] || g_gived_access[id] ) && !g_godmode[id]
  3013.         || ( !g_admin[id] && !g_gived_access[id] ) && !g_all_godmode )
  3014.         {
  3015.                 set_user_godmode(id, 0);
  3016.         }
  3017.  
  3018.         if ( get_gametime() >= g_stealth_time_out[id] )
  3019.         {
  3020.                 set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 16);
  3021.         }
  3022.  
  3023.         return PLUGIN_HANDLED;
  3024. }
  3025.  
  3026. public TaskRemoveStealth(id)
  3027. {
  3028.         id -= TASK_STEALTH;
  3029.  
  3030.         if ( g_connected[id] )
  3031.         {
  3032.                 if ( get_gametime() <= g_stealth_time_out[id] )
  3033.                 {
  3034.                         set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderTransColor, 16);
  3035.                 }
  3036.                 else
  3037.                 {
  3038.                         set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 255);
  3039.                 }
  3040.         }
  3041.         g_block_status[id] = false;
  3042. }
  3043.  
  3044. public TaskRemoveBootsOfSpeed(id)
  3045. {
  3046.         id -= TASK_BOOTSOFSPEED;
  3047.  
  3048.         g_boots_of_speed[id] = 0;
  3049.  
  3050.         if ( !g_alive[id] ) return PLUGIN_HANDLED;
  3051.  
  3052.         if ( g_ice[id] )
  3053.         {
  3054.                 entity_set_float(id, EV_FL_maxspeed, 400.0);
  3055.         }
  3056.         else if ( g_honey[id] )
  3057.         {
  3058.                 static block, property1[5];
  3059.                 block = g_honey[id];
  3060.                 GetProperty(block, 1, property1);
  3061.  
  3062.                 entity_set_float(id, EV_FL_maxspeed, str_to_float(property1));
  3063.         }
  3064.         else
  3065.         {
  3066.                 ResetMaxspeed(id);
  3067.         }
  3068.  
  3069.         return PLUGIN_HANDLED;
  3070. }
  3071.  
  3072. public TaskRemoveSuper(id)
  3073. {
  3074.         id -= TASK_SUPER;
  3075.  
  3076.         if ( g_connected[id] )
  3077.         {
  3078.                 if ( get_gametime() <= g_super_time_out[id] )
  3079.                 {
  3080.                         entity_set_float(id, EV_FL_gravity, 800.0 / 800.0);
  3081.                 }
  3082.                 else
  3083.                 {
  3084.                         static property[5];
  3085.                         new ent;
  3086.                         GetProperty(ent, 3, property);
  3087.                         entity_set_float(id, EV_FL_gravity, str_to_float(property) / 800);
  3088.                 }
  3089.         }
  3090. }
  3091.  
  3092. public TaskSpriteNextFrame(params[])
  3093. {
  3094.         new ent = params[0];
  3095.         if ( !is_valid_ent(ent) )
  3096.         {
  3097.                 remove_task(TASK_SPRITE + ent);
  3098.                 return PLUGIN_HANDLED;
  3099.         }
  3100.  
  3101.         new frames = params[1];
  3102.         new Float:current_frame = entity_get_float(ent, EV_FL_frame);
  3103.  
  3104.         if ( current_frame < 0.0
  3105.         || current_frame >= frames )
  3106.         {
  3107.                 entity_set_float(ent, EV_FL_frame, 1.0);
  3108.         }
  3109.         else
  3110.         {
  3111.                 entity_set_float(ent, EV_FL_frame, current_frame + 1.0);
  3112.         }
  3113.  
  3114.         return PLUGIN_HANDLED;
  3115. }
  3116.  
  3117. public remove_magic( id )
  3118. {
  3119.         new iEnt, Float:fOrigin[3];
  3120.         while( (iEnt = find_ent_by_class(iEnt, g_block_classname)) )
  3121.         {
  3122.                 new blockType = pev(iEnt, pev_body);
  3123.  
  3124.                 if( blockType == MAGIC )
  3125.                 {
  3126.                         pev(iEnt, pev_v_angle, fOrigin);
  3127.                         set_pev(iEnt, pev_velocity, Float:{0.0, 0.0, 0.0});
  3128.                         engfunc(EngFunc_SetOrigin, iEnt, fOrigin);
  3129.                 }
  3130.         }
  3131. }
  3132.  
  3133. public MsgStatusValue()
  3134. {
  3135.         if ( get_msg_arg_int(1) == 2
  3136.         && g_block_status[get_msg_arg_int(2)] )
  3137.         {
  3138.                 set_msg_arg_int(1, get_msg_argtype(1), 1);
  3139.                 set_msg_arg_int(2, get_msg_argtype(2), 0);
  3140.         }
  3141. }
  3142.  
  3143. public CmdAttack(id)
  3144. {
  3145.         if ( !IsBlock(g_grabbed[id]) ) return PLUGIN_HANDLED;
  3146.  
  3147.         if ( IsBlockInGroup(id, g_grabbed[id]) && g_group_count[id] > 1 )
  3148.         {
  3149.                 static block;
  3150.                 for ( new i = 0; i <= g_group_count[id]; ++i )
  3151.                 {
  3152.                         block = g_grouped_blocks[id][i];
  3153.                         if ( !IsBlockInGroup(id, block) ) continue;
  3154.  
  3155.                         if ( !IsBlockStuck(block) )
  3156.                         {
  3157.                                 CopyBlock(id, block);
  3158.                         }
  3159.                 }
  3160.         }
  3161.         else
  3162.         {
  3163.                 if ( IsBlockStuck(g_grabbed[id]) )
  3164.                 {
  3165.                         SCM_Print(id, "You cannot copy a block that is in a stuck position!");
  3166.                         return PLUGIN_HANDLED;
  3167.                 }
  3168.  
  3169.                 new new_block = CopyBlock(id, g_grabbed[id]);
  3170.                 if ( !new_block ) return PLUGIN_HANDLED;
  3171.  
  3172.                 entity_set_int(g_grabbed[id], EV_INT_iuser2, 0);
  3173.                 entity_set_int(new_block, EV_INT_iuser2, id);
  3174.                 g_grabbed[id] = new_block;
  3175.         }
  3176.  
  3177.         return PLUGIN_HANDLED;
  3178. }
  3179.  
  3180. public CmdAttack2(id)
  3181. {
  3182.         if ( !IsBlock(g_grabbed[id]) )
  3183.         {
  3184.                 DeleteTeleport(id, g_grabbed[id]);
  3185.                 return PLUGIN_HANDLED;
  3186.         }
  3187.  
  3188.         if ( !IsBlockInGroup(id, g_grabbed[id])
  3189.         || g_group_count[id] < 2 )
  3190.         {
  3191.                 DeleteBlock(g_grabbed[id]);
  3192.                 return PLUGIN_HANDLED;
  3193.         }
  3194.  
  3195.         static block;
  3196.         for ( new i = 0; i <= g_group_count[id]; ++i )
  3197.         {
  3198.                 block = g_grouped_blocks[id][i];
  3199.                 if ( !is_valid_ent(block)
  3200.                 || !IsBlockInGroup(id, block) ) continue;
  3201.  
  3202.                 DeleteBlock(block);
  3203.         }
  3204.  
  3205.         return PLUGIN_HANDLED;
  3206. }
  3207.  
  3208. public CmdRotate(id)
  3209. {
  3210.         if ( !IsBlock(g_grabbed[id]) ) return PLUGIN_HANDLED;
  3211.  
  3212.         if ( !IsBlockInGroup(id, g_grabbed[id])
  3213.         || g_group_count[id] < 2 )
  3214.         {
  3215.                 RotateBlock(g_grabbed[id]);
  3216.                 return PLUGIN_HANDLED;
  3217.         }
  3218.  
  3219.         static block;
  3220.         for ( new i = 0; i <= g_group_count[id]; ++i )
  3221.         {
  3222.                 block = g_grouped_blocks[id][i];
  3223.                 if ( !is_valid_ent(block)
  3224.                 || !IsBlockInGroup(id, block) ) continue;
  3225.  
  3226.                 RotateBlock(block);
  3227.         }
  3228.  
  3229.         return PLUGIN_HANDLED;
  3230. }
  3231.  
  3232. public CmdGrab(id)
  3233. {
  3234.         if ( !g_admin[id] && !g_gived_access[id] )
  3235.         {
  3236.                 console_print(id, "You have no access to that command");
  3237.                 return PLUGIN_HANDLED;
  3238.         }
  3239.  
  3240.         static ent, body;
  3241.         g_grab_length[id] = get_user_aiming(id, ent, body);
  3242.  
  3243.         new bool:is_block = IsBlock(ent);
  3244.  
  3245.         if ( !is_block && !IsTeleport(ent) && !IsLight(ent) ) return PLUGIN_HANDLED;
  3246.  
  3247.         new grabber = entity_get_int(ent, EV_INT_iuser2);
  3248.         if ( grabber && grabber != id ) return PLUGIN_HANDLED;
  3249.  
  3250.         if ( !is_block )
  3251.         {
  3252.                 SetGrabbed(id, ent);
  3253.                 return PLUGIN_HANDLED;
  3254.         }
  3255.  
  3256.         new player = entity_get_int(ent, EV_INT_iuser1);
  3257.         if ( player && player != id )
  3258.         {
  3259.                 new player_name[32];
  3260.                 get_user_name(player, player_name, charsmax(player_name));
  3261.  
  3262.                 SCM_Print(id, "^1%s3 currently has this block in their group!", player_name);
  3263.                 return PLUGIN_HANDLED;
  3264.         }
  3265.  
  3266.         SetGrabbed(id, ent);
  3267.  
  3268.         if ( g_group_count[id] < 2 ) return PLUGIN_HANDLED;
  3269.  
  3270.         static Float:grabbed_origin[3];
  3271.  
  3272.         entity_get_vector(ent, EV_VEC_origin, grabbed_origin);
  3273.  
  3274.         static block, Float:origin[3], Float:offset[3];
  3275.         for ( new i = 0; i <= g_group_count[id]; ++i )
  3276.         {
  3277.                 block = g_grouped_blocks[id][i];
  3278.                 if ( !is_valid_ent(block) ) continue;
  3279.  
  3280.                 entity_get_vector(block, EV_VEC_origin, origin);
  3281.  
  3282.                 offset[0] = grabbed_origin[0] - origin[0];
  3283.                 offset[1] = grabbed_origin[1] - origin[1];
  3284.                 offset[2] = grabbed_origin[2] - origin[2];
  3285.  
  3286.                 entity_set_vector(block, EV_VEC_vuser1, offset);
  3287.                 entity_set_int(block, EV_INT_iuser2, id);
  3288.         }
  3289.  
  3290.         return PLUGIN_HANDLED;
  3291. }
  3292.  
  3293. SetGrabbed(id, ent)
  3294. {
  3295.         entity_get_string(id, EV_SZ_viewmodel, g_viewmodel[id], charsmax(g_viewmodel));
  3296.         entity_set_string(id, EV_SZ_viewmodel, g_blank);
  3297.  
  3298.         static aiming[3], Float:origin[3];
  3299.  
  3300.         get_user_origin(id, aiming, 3);
  3301.         entity_get_vector(ent, EV_VEC_origin, origin);
  3302.  
  3303.         g_grabbed[id] = ent;
  3304.         g_grab_offset[id][0] = origin[0] - aiming[0];
  3305.         g_grab_offset[id][1] = origin[1] - aiming[1];
  3306.         g_grab_offset[id][2] = origin[2] - aiming[2];
  3307.  
  3308.         entity_set_int(ent, EV_INT_iuser2, id);
  3309. }
  3310.  
  3311. public CmdRelease(id)
  3312. {
  3313.         if ( !g_admin[id] && !g_gived_access[id] )
  3314.         {
  3315.                 console_print(id, "You have no access to that command");
  3316.                 return PLUGIN_HANDLED;
  3317.         }
  3318.         else if ( !g_grabbed[id] )
  3319.         {
  3320.                 return PLUGIN_HANDLED;
  3321.         }
  3322.  
  3323.         if ( IsBlock(g_grabbed[id]) )
  3324.         {
  3325.                 if ( IsBlockInGroup(id, g_grabbed[id]) && g_group_count[id] > 1 )
  3326.                 {
  3327.                         static i, block;
  3328.  
  3329.                         new bool:group_is_stuck = true;
  3330.  
  3331.                         for ( i = 0; i <= g_group_count[id]; ++i )
  3332.                         {
  3333.                                 block = g_grouped_blocks[id][i];
  3334.                                 if ( IsBlockInGroup(id, block) )
  3335.                                 {
  3336.                                         entity_set_int(block, EV_INT_iuser2, 0);
  3337.  
  3338.                                         if ( group_is_stuck && !IsBlockStuck(block) )
  3339.                                         {
  3340.                                                 group_is_stuck = false;
  3341.                                                 break;
  3342.                                         }
  3343.                                 }
  3344.                         }
  3345.  
  3346.                         if ( group_is_stuck )
  3347.                         {
  3348.                                 for ( i = 0; i <= g_group_count[id]; ++i )
  3349.                                 {
  3350.                                         block = g_grouped_blocks[id][i];
  3351.                                         if ( IsBlockInGroup(id, block) ) DeleteBlock(block);
  3352.                                 }
  3353.  
  3354.                                 SCM_Print(id, "Group deleted because all the blocks were stuck!");
  3355.                         }
  3356.                 }
  3357.                 else
  3358.                 {
  3359.                         if ( is_valid_ent(g_grabbed[id]) )
  3360.                         {
  3361.                                 if ( IsBlockStuck(g_grabbed[id]) )
  3362.                                 {
  3363.                                         new bool:deleted = DeleteBlock(g_grabbed[id]);
  3364.                                         if ( deleted ) SCM_Print(id, "Block deleted because it was stuck!");
  3365.                                 }
  3366.                                 else
  3367.                                 {
  3368.                                         entity_set_int(g_grabbed[id], EV_INT_iuser2, 0);
  3369.                                 }
  3370.                         }
  3371.                 }
  3372.         }
  3373.         else if ( IsTeleport(g_grabbed[id]) )
  3374.         {
  3375.                 entity_set_int(g_grabbed[id], EV_INT_iuser2, 0);
  3376.         }
  3377.  
  3378.         entity_get_string(id, EV_SZ_viewmodel, g_viewmodel[id], charsmax(g_viewmodel));
  3379.         entity_set_string(id, EV_SZ_viewmodel, g_blank);
  3380.  
  3381.         g_grabbed[id] = 0;
  3382.  
  3383.         return PLUGIN_HANDLED;
  3384. }
  3385.  
  3386. public CmdMainMenu(id)
  3387. {
  3388.         ShowMainMenu(id);
  3389.         return PLUGIN_HANDLED;
  3390. }
  3391.  
  3392. ShowMainMenu(id)
  3393. {
  3394.         new menu[256], col1[3], col2[3];
  3395.  
  3396.         col1 = g_admin[id] || g_gived_access[id] ? "\r" : "\d";
  3397.         col2 = g_admin[id] || g_gived_access[id] ? "\w" : "\d";
  3398.  
  3399.         format(menu, charsmax(menu),\
  3400.                 g_main_menu,\
  3401.                 PLUGIN_PREFIX,\
  3402.                 PLUGIN_NAME,\
  3403.                 PLUGIN_VERSION,\
  3404.                 col1,\
  3405.                 col2,\
  3406.                 g_noclip[id] ? "\yOn" : "\rOff",\
  3407.                 col1,\
  3408.                 col2,\
  3409.                 g_godmode[id] ? "\yOn" : "\rOff"
  3410.                 );
  3411.  
  3412.         show_menu(id, g_keys_main_menu, menu, -1, "SCMMainMenu");
  3413. }
  3414.  
  3415. ShowBlockMenu(id)
  3416. {
  3417.         new menu[256], col1[3], col2[3], size[8];
  3418.  
  3419.         col1 = g_admin[id] || g_gived_access[id] ? "\r" : "\d";
  3420.         col2 = g_admin[id] || g_gived_access[id] ? "\w" : "\d";
  3421.  
  3422.         switch ( g_selected_block_size[id] )
  3423.         {
  3424.                 case TINY:      size = "Small";
  3425.                 case NORMAL:    size = "Normal";
  3426.                 case LARGE:     size = "Large";
  3427.                 case POLE:      size = "Pole";
  3428.         }
  3429.  
  3430.         format(menu, charsmax(menu),\
  3431.                 g_block_menu,\
  3432.                 PLUGIN_PREFIX,\
  3433.                 g_block_names[g_selected_block_type[id]],\
  3434.                 col1,\
  3435.                 col2,\
  3436.                 col1,\
  3437.                 col2,\
  3438.                 col1,\
  3439.                 col2,\
  3440.                 col1,\
  3441.                 col2,\
  3442.                 g_noclip[id] ? "\yOn" : "\rOff",\
  3443.                 col1,\
  3444.                 col2,\
  3445.                 size,\
  3446.                 col1,\
  3447.                 col2
  3448.                 );
  3449.  
  3450.         show_menu(id, g_keys_block_menu, menu, -1, "SCMBlockMenu");
  3451. }
  3452.  
  3453. ShowBlockSelectionMenu(id)
  3454. {
  3455.         new menu[256], title[32], entry[32], num;
  3456.  
  3457.         format(title, charsmax(title), "\r[Ex BM] \yBlock Selection %d^n^n", g_block_selection_page[id]);
  3458.         add(menu, charsmax(menu), title);
  3459.  
  3460.         new start_block = ( g_block_selection_page[id] - 1 ) * 8;
  3461.  
  3462.         for ( new i = start_block; i < start_block + 8; ++i )
  3463.         {
  3464.                 if ( i < TOTAL_BLOCKS )
  3465.                 {
  3466.                         num = ( i - start_block ) + 1;
  3467.  
  3468.                         format(entry, charsmax(entry), "\r%d. \w%s^n", num, g_block_names[i]);
  3469.                 }
  3470.                 else
  3471.                 {
  3472.                         format(entry, charsmax(entry), "^n");
  3473.                 }
  3474.  
  3475.                 add(menu, charsmax(menu), entry);
  3476.         }
  3477.  
  3478.         if ( g_block_selection_page[id] < g_block_selection_pages_max )
  3479.         {
  3480.                 add(menu, charsmax(menu), "^n\r9. \wMore");
  3481.         }
  3482.         else
  3483.         {
  3484.                 add(menu, charsmax(menu), "^n");
  3485.         }
  3486.  
  3487.         add(menu, charsmax(menu), "^n\r0. \wBack");
  3488.  
  3489.         show_menu(id, g_keys_block_selection_menu, menu, -1, "SCMBlockSelectionMenu");
  3490. }
  3491.  
  3492. ShowPropertiesMenu(id, ent)
  3493. {
  3494.         new menu[256], title[32], entry[64], property[5], line1[3], line2[3], line3[3], line4[3], num, block_type;
  3495.  
  3496.         block_type = entity_get_int(ent, EV_INT_body);
  3497.  
  3498.         format(title, charsmax(title), "\r[%s] \ySet Properties^n^n", PLUGIN_PREFIX);
  3499.         add(menu, charsmax(menu), title);
  3500.  
  3501.         if ( g_property1_name[block_type][0] )
  3502.         {
  3503.                 GetProperty(ent, 1, property);
  3504.  
  3505.                 if ( block_type == BUNNYHOP )
  3506.                 {
  3507.                         format(entry, charsmax(entry), "\r1. \w%s: %s^n", g_property1_name[block_type], property[0] == '1' ? "\yOn" : "\rOff");
  3508.                 }
  3509.                 else if ( block_type == SLAP )
  3510.                 {
  3511.                         format(entry, charsmax(entry), "\r1. \w%s: \y%s^n", g_property1_name[block_type], property[0] == '3' ? "High" : property[0] == '2' ? "Medium" : "Low");
  3512.                 }
  3513.                 else
  3514.                 {
  3515.                         format(entry, charsmax(entry), "\r1. \w%s: \y%s^n", g_property1_name[block_type], property);
  3516.                 }
  3517.  
  3518.                 add(menu, charsmax(menu), entry);
  3519.         }
  3520.         else
  3521.         {
  3522.                 format(line1, charsmax(line1), "^n");
  3523.         }
  3524.  
  3525.         if ( g_property2_name[block_type][0] )
  3526.         {
  3527.                 if ( g_property1_name[block_type][0] )
  3528.                 {
  3529.                         num = 2;
  3530.                 }
  3531.                 else
  3532.                 {
  3533.                         num = 1;
  3534.                 }
  3535.  
  3536.                 GetProperty(ent, 2, property);
  3537.  
  3538.                 format(entry, charsmax(entry), "\r%d. \w%s: \y%s^n", num, g_property2_name[block_type], property);
  3539.  
  3540.                 add(menu, charsmax(menu), entry);
  3541.         }
  3542.         else
  3543.         {
  3544.                 format(line2, charsmax(line2), "^n");
  3545.         }
  3546.  
  3547.         if ( g_property3_name[block_type][0] )
  3548.         {
  3549.                 if ( g_property1_name[block_type][0] && g_property2_name[block_type][0] )
  3550.                 {
  3551.                         num = 3;
  3552.                 }
  3553.                 else if ( g_property1_name[block_type][0]
  3554.                 || g_property2_name[block_type][0] )
  3555.                 {
  3556.                         num = 2;
  3557.                 }
  3558.                 else
  3559.                 {
  3560.                         num = 1;
  3561.                 }
  3562.  
  3563.                 GetProperty(ent, 3, property);
  3564.  
  3565.                 if ( block_type == BOOTS_OF_SPEED
  3566.                 || property[0] != '0' && !( property[0] == '2' && property[1] == '5' && property[2] == '5' ) )
  3567.                 {
  3568.                         format(entry, charsmax(entry), "\r%d. \w%s: \y%s^n", num, g_property3_name[block_type], property);
  3569.                 }
  3570.                 else
  3571.                 {
  3572.                         format(entry, charsmax(entry), "\r%d. \w%s: \rOff^n", num, g_property3_name[block_type]);
  3573.                 }
  3574.  
  3575.                 add(menu, charsmax(menu), entry);
  3576.         }
  3577.         else
  3578.         {
  3579.                 format(line3, charsmax(line3), "^n");
  3580.         }
  3581.  
  3582.         if ( g_property4_name[block_type][0] )
  3583.         {
  3584.                 if ( g_property1_name[block_type][0] && g_property2_name[block_type][0] && g_property3_name[block_type][0] )
  3585.                 {
  3586.                         num = 4;
  3587.                 }
  3588.                 else if ( g_property1_name[block_type][0] && g_property2_name[block_type][0]
  3589.                 || g_property1_name[block_type][0] && g_property3_name[block_type][0]
  3590.                 || g_property2_name[block_type][0] && g_property3_name[block_type][0] )
  3591.                 {
  3592.                         num = 3;
  3593.                 }
  3594.                 else if ( g_property1_name[block_type][0]
  3595.                 || g_property2_name[block_type][0]
  3596.                 || g_property3_name[block_type][0] )
  3597.                 {
  3598.                         num = 2;
  3599.                 }
  3600.                 else
  3601.                 {
  3602.                         num = 1;
  3603.                 }
  3604.  
  3605.                 GetProperty(ent, 4, property);
  3606.  
  3607.                 format(entry, charsmax(entry), "\r%d. \w%s: %s^n", num, g_property4_name[block_type], property[0] == '1' ? "\yYes" : "\rNo");
  3608.                 add(menu, charsmax(menu), entry);
  3609.         }
  3610.         else
  3611.         {
  3612.                 format(line4, charsmax(line4), "^n");
  3613.         }
  3614.  
  3615.         g_property_info[id][1] = ent;
  3616.  
  3617.         add(menu, charsmax(menu), line1);
  3618.         add(menu, charsmax(menu), line2);
  3619.         add(menu, charsmax(menu), line3);
  3620.         add(menu, charsmax(menu), line4);
  3621.         add(menu, charsmax(menu), "^n^n^n^n^n^n\r0. \wBack");
  3622.  
  3623.         show_menu(id, g_keys_properties_menu, menu, -1, "SCMPropertiesMenu");
  3624. }
  3625.  
  3626. ShowMoveMenu(id)
  3627. {
  3628.         if ( !g_admin[id] && !g_gived_access[id] )
  3629.         {
  3630.                 ShowBlockMenu(id);
  3631.                 return PLUGIN_HANDLED;
  3632.         }
  3633.  
  3634.         new menu[256];
  3635.  
  3636.         format(menu, charsmax(menu), g_move_menu, PLUGIN_PREFIX, g_grid_size[id]);
  3637.  
  3638.         show_menu(id, g_keys_move_menu, menu, -1, "SCMMoveMenu");
  3639.  
  3640.         return PLUGIN_HANDLED;
  3641. }
  3642.  
  3643. ShowTeleportMenu(id)
  3644. {
  3645.         new menu[256], col1[3], col2[3];
  3646.  
  3647.         col1 = g_admin[id] || g_gived_access[id] ? "\r" : "\d";
  3648.         col2 = g_admin[id] || g_gived_access[id] ? "\w" : "\d";
  3649.  
  3650.         format(menu, charsmax(menu),\
  3651.                 g_teleport_menu,\
  3652.                 PLUGIN_PREFIX,\
  3653.                 col1,\
  3654.                 col2,\
  3655.                 g_teleport_start[id] ? "\r" : "\d",\
  3656.                 g_teleport_start[id] ? "\w" : "\d",\
  3657.                 col1,\
  3658.                 col2,\
  3659.                 col1,\
  3660.                 col2,\
  3661.                 col1,\
  3662.                 col2
  3663.                 );
  3664.  
  3665.         show_menu(id, g_keys_teleport_menu, menu, -1, "SCMTeleportMenu");
  3666. }
  3667.  
  3668. ShowLightMenu(id)
  3669. {
  3670.         new menu[256], col1[3], col2[3];
  3671.  
  3672.         col1 = g_admin[id] || g_gived_access[id] ? "\r" : "\d";
  3673.         col2 = g_admin[id] || g_gived_access[id] ? "\w" : "\d";
  3674.  
  3675.         format(menu, charsmax(menu),\
  3676.                 g_light_menu,\
  3677.                 PLUGIN_PREFIX,\
  3678.                 col1,\
  3679.                 col2,\
  3680.                 col1,\
  3681.                 col2,\
  3682.                 col1,\
  3683.                 col2
  3684.                 );
  3685.  
  3686.         show_menu(id, g_keys_light_menu, menu, -1, "SCMLightMenu");
  3687. }
  3688.  
  3689. ShowLightPropertiesMenu(id, ent)
  3690. {
  3691.         new menu[256], radius[5], color_red[5], color_green[5], color_blue[5];
  3692.  
  3693.         GetProperty(ent, 1, radius);
  3694.         GetProperty(ent, 2, color_red);
  3695.         GetProperty(ent, 3, color_green);
  3696.         GetProperty(ent, 4, color_blue);
  3697.  
  3698.         format(menu, charsmax(menu),\
  3699.                 g_light_properties_menu,\
  3700.                 PLUGIN_PREFIX,\
  3701.                 radius,\
  3702.                 color_red,\
  3703.                 color_green,\
  3704.                 color_blue
  3705.                 );
  3706.  
  3707.         g_light_property_info[id][1] = ent;
  3708.  
  3709.         show_menu(id, g_keys_light_properties_menu, menu, -1, "SCMLightPropertiesMenu");
  3710. }
  3711.  
  3712. ShowOptionsMenu(id)
  3713. {
  3714.         new menu[256], col1[3], col2[3], col3[3], col4[3];
  3715.  
  3716.         col1 = g_admin[id] || g_gived_access[id] ? "\r" : "\d";
  3717.         col2 = g_admin[id] || g_gived_access[id] ? "\w" : "\d";
  3718.         col3 = g_admin[id] ? "\r" : "\d";
  3719.         col4 = g_admin[id] ? "\w" : "\d";
  3720.  
  3721.         format(menu, charsmax(menu),\
  3722.                 g_options_menu,\
  3723.                 PLUGIN_PREFIX,\
  3724.                 col1,\
  3725.                 col2,\
  3726.                 g_snapping[id] ? "\yOn" : "\rOff",\
  3727.                 col1,\
  3728.                 col2,\
  3729.                 g_snapping_gap[id],\
  3730.                 col1,\
  3731.                 col2,\
  3732.                 col1,\
  3733.                 col2,\
  3734.                 col3,\
  3735.                 col4,\
  3736.                 col3,\
  3737.                 col4,\
  3738.                 col3,\
  3739.                 col4
  3740.                 );
  3741.  
  3742.         show_menu(id, g_keys_options_menu, menu, -1, "SCMOptionsMenu");
  3743. }
  3744.  
  3745. ShowChoiceMenu(id, choice, const title[96])
  3746. {
  3747.         new menu[128];
  3748.  
  3749.         g_choice_option[id] = choice;
  3750.  
  3751.         format(menu, charsmax(menu), g_choice_menu, title);
  3752.  
  3753.         show_menu(id, g_keys_choice_menu, menu, -1, "SCMChoiceMenu");
  3754. }
  3755.  
  3756. ShowCommandsMenu(id)
  3757. {
  3758.         new menu[256], col1[3], col2[3], col3[3], col4[3];
  3759.  
  3760.         col1 = g_admin[id] ? "\r" : "\d";
  3761.         col2 = g_admin[id] ? "\w" : "\d";
  3762.         col3 = ( g_admin[id] || g_gived_access[id] ) && g_alive[id] ? "\r" : "\d";
  3763.         col4 = ( g_admin[id] || g_gived_access[id] ) && g_alive[id] ? "\w" : "\d";
  3764.  
  3765.         format(menu, charsmax(menu),\
  3766.                 g_commands_menu,\
  3767.                 PLUGIN_PREFIX,\
  3768.                 col3,\
  3769.                 col4,\
  3770.                 g_alive[id] && g_has_checkpoint[id] ? "\r" : "\d",\
  3771.                 g_alive[id] && g_has_checkpoint[id] ? "\w" : "\d",\
  3772.                 ( g_admin[id] || g_gived_access[id] ) && !g_alive[id] ? "\r" : "\d",\
  3773.                 ( g_admin[id] || g_gived_access[id] ) && !g_alive[id] ? "\w" : "\d",\
  3774.                 col1,\
  3775.                 col2,\
  3776.                 col1,\
  3777.                 col2,\
  3778.                 col1,\
  3779.                 col2,\
  3780.                 g_all_godmode ? "Remove" : "Set",\
  3781.                 g_all_godmode ? "from" : "on",\
  3782.                 col1,\
  3783.                 col2,\
  3784.                 PLUGIN_PREFIX
  3785.                 );
  3786.  
  3787.         show_menu(id, g_keys_commands_menu, menu, -1, "SCMCommandsMenu");
  3788. }
  3789.  
  3790. public HandleMainMenu(id, key)
  3791. {
  3792.         switch ( key )
  3793.         {
  3794.                 case K1: ShowBlockMenu(id);
  3795.                 case K2: ShowTeleportMenu(id);
  3796.                 case K3: ShowLightMenu(id);
  3797.                 case K4:
  3798.                 {
  3799.                         g_viewing_commands_menu[id] = true;
  3800.                         ShowCommandsMenu(id);
  3801.                 }
  3802.                 case K5: ShowMoveMenu(id);
  3803.                 case K6: ToggleNoclip(id);
  3804.                 case K7: ToggleGodmode(id);
  3805.                 case K9: CmdShowInfo(id);
  3806.                 case K0: return;
  3807.         }
  3808.  
  3809.         if ( key == K6 || key == K7 || key == K9 ) ShowMainMenu(id);
  3810. }
  3811.  
  3812. public HandleBlockMenu(id, key)
  3813. {
  3814.         switch ( key )
  3815.         {
  3816.                 case K1:
  3817.                 {
  3818.                         g_block_selection_page[id] = 1;
  3819.                         ShowBlockSelectionMenu(id);
  3820.                 }
  3821.                 case K2: CreateBlockAiming(id, g_selected_block_type[id]);
  3822.                 case K3: ConvertBlockAiming(id, g_selected_block_type[id]);
  3823.                 case K4: DeleteBlockAiming(id);
  3824.                 case K5: RotateBlockAiming(id);
  3825.                 case K6: ToggleNoclip(id);
  3826.                 case K7: SetPropertiesBlockAiming(id);
  3827.                 case K8: ChangeBlockSize(id);
  3828.                 case K9: ShowOptionsMenu(id);
  3829.                 case K0: ShowMainMenu(id);
  3830.         }
  3831.  
  3832.         if ( key != K1 && key != K6 && key != K7 && key != K9 && key != K0 ) ShowBlockMenu(id);
  3833. }
  3834.  
  3835. public HandleBlockSelectionMenu(id, key)
  3836. {
  3837.         switch ( key )
  3838.         {
  3839.                 case K9:
  3840.                 {
  3841.                         ++g_block_selection_page[id];
  3842.  
  3843.                         if ( g_block_selection_page[id] > g_block_selection_pages_max )
  3844.                         {
  3845.                                 g_block_selection_page[id] = g_block_selection_pages_max;
  3846.                         }
  3847.  
  3848.                         ShowBlockSelectionMenu(id);
  3849.                 }
  3850.                 case K0:
  3851.                 {
  3852.                         --g_block_selection_page[id];
  3853.  
  3854.                         if ( g_block_selection_page[id] < 1 )
  3855.                         {
  3856.                                 ShowBlockMenu(id);
  3857.                         }
  3858.                         else
  3859.                         {
  3860.                                 ShowBlockSelectionMenu(id);
  3861.                         }
  3862.                 }
  3863.                 default:
  3864.                 {
  3865.                         key += ( g_block_selection_page[id] - 1 ) * 8;
  3866.  
  3867.                         if ( key < TOTAL_BLOCKS )
  3868.                         {
  3869.                                 g_selected_block_type[id] = key;
  3870.                                 ShowBlockMenu(id);
  3871.                         }
  3872.                         else
  3873.                         {
  3874.                                 ShowBlockSelectionMenu(id);
  3875.                         }
  3876.                 }
  3877.         }
  3878. }
  3879.  
  3880. public HandlePropertiesMenu(id, key)
  3881. {
  3882.         new ent = g_property_info[id][1];
  3883.         if ( !is_valid_ent(ent) )
  3884.         {
  3885.                 SCM_Print(id, "That block has been deleted!");
  3886.                 g_viewing_properties_menu[id] = false;
  3887.                 ShowBlockMenu(id);
  3888.                 return PLUGIN_HANDLED;
  3889.         }
  3890.  
  3891.         new block_type = entity_get_int(ent, EV_INT_body);
  3892.  
  3893.         switch ( key )
  3894.         {
  3895.                 case K1:
  3896.                 {
  3897.                         if ( g_property1_name[block_type][0] )
  3898.                         {
  3899.                                 g_property_info[id][0] = 1;
  3900.                         }
  3901.                         else if ( g_property2_name[block_type][0] )
  3902.                         {
  3903.                                 g_property_info[id][0] = 2;
  3904.                         }
  3905.                         else if ( g_property3_name[block_type][0] )
  3906.                         {
  3907.                                 g_property_info[id][0] = 3;
  3908.                         }
  3909.                         else
  3910.                         {
  3911.                                 g_property_info[id][0] = 4;
  3912.                         }
  3913.  
  3914.                         if ( g_property_info[id][0] == 1
  3915.                         && ( block_type == BUNNYHOP
  3916.                         || block_type == SLAP ) )
  3917.                         {
  3918.                                 ToggleProperty(id, 1);
  3919.                         }
  3920.                         else if ( g_property_info[id][0] == 4 )
  3921.                         {
  3922.                                 ToggleProperty(id, 4);
  3923.                         }
  3924.                         else
  3925.                         {
  3926.                                 SCM_Print(id, "Type the new property value for the block.%s", g_property_info[id][0] == 3 && block_type != BOOTS_OF_SPEED ? "^1 0^3 and^1 255^3 will turn transparency off." : g_blank);
  3927.                                 client_cmd(id, "messagemode SCM_SetProperty");
  3928.                         }
  3929.                 }
  3930.                 case K2:
  3931.                 {
  3932.                         if ( g_property1_name[block_type][0] && g_property2_name[block_type][0]
  3933.                         || g_property1_name[block_type][0] && g_property3_name[block_type][0]
  3934.                         || g_property1_name[block_type][0] && g_property4_name[block_type][0]
  3935.                         || g_property2_name[block_type][0] && g_property3_name[block_type][0]
  3936.                         || g_property2_name[block_type][0] && g_property4_name[block_type][0]
  3937.                         || g_property3_name[block_type][0] && g_property4_name[block_type][0] )
  3938.                         {
  3939.                                 if ( g_property1_name[block_type][0] && g_property2_name[block_type][0] )
  3940.                                 {
  3941.                                         g_property_info[id][0] = 2;
  3942.                                 }
  3943.                                 else if ( g_property1_name[block_type][0] && g_property3_name[block_type][0]
  3944.                                 || g_property2_name[block_type][0] && g_property3_name[block_type][0] )
  3945.                                 {
  3946.                                         g_property_info[id][0] = 3;
  3947.                                 }
  3948.                                 else
  3949.                                 {
  3950.                                         g_property_info[id][0] = 4;
  3951.                                 }
  3952.  
  3953.                                 if ( g_property_info[id][0] == 4 )
  3954.                                 {
  3955.                                         ToggleProperty(id, 4);
  3956.                                 }
  3957.                                 else
  3958.                                 {
  3959.                                         SCM_Print(id, "Type the new property value for the block.%s", g_property_info[id][0] == 3 && block_type != BOOTS_OF_SPEED ? "^1 0^3 and^1 255^3 will turn transparency off." : g_blank);
  3960.                                         client_cmd(id, "messagemode SCM_SetProperty");
  3961.                                 }
  3962.                         }
  3963.                 }
  3964.                 case K3:
  3965.                 {
  3966.                         if ( g_property1_name[block_type][0] && g_property2_name[block_type][0] && g_property3_name[block_type][0]
  3967.                         || g_property1_name[block_type][0] && g_property2_name[block_type][0] && g_property4_name[block_type][0]
  3968.                         || g_property1_name[block_type][0] && g_property3_name[block_type][0] && g_property4_name[block_type][0]
  3969.                         || g_property2_name[block_type][0] && g_property3_name[block_type][0] && g_property4_name[block_type][0] )
  3970.                         {
  3971.                                 if ( g_property1_name[block_type][0] && g_property2_name[block_type][0] && g_property3_name[block_type][0] )
  3972.                                 {
  3973.                                         g_property_info[id][0] = 3;
  3974.                                 }
  3975.                                 else
  3976.                                 {
  3977.                                         g_property_info[id][0] = 4;
  3978.                                 }
  3979.  
  3980.                                 if ( g_property_info[id][0] == 4 )
  3981.                                 {
  3982.                                         ToggleProperty(id, 4);
  3983.                                 }
  3984.                                 else
  3985.                                 {
  3986.                                         SCM_Print(id, "Type the new property value for the block.%s", g_property_info[id][0] == 3 && block_type != BOOTS_OF_SPEED && block_type != SUPER ? "^1 0^3 and^1 255^3 will turn transparency off." : g_blank);
  3987.                                         client_cmd(id, "messagemode SCM_SetProperty");
  3988.                                 }
  3989.                         }
  3990.                 }
  3991.                 case K4:
  3992.                 {
  3993.                         if ( g_property1_name[block_type][0] && g_property2_name[block_type][0] && g_property3_name[block_type][0] && g_property4_name[block_type][0] )
  3994.                         {
  3995.                                 ToggleProperty(id, 4);
  3996.                         }
  3997.                 }
  3998.                 case K0:
  3999.                 {
  4000.                         g_viewing_properties_menu[id] = false;
  4001.                         ShowBlockMenu(id);
  4002.                 }
  4003.         }
  4004.  
  4005.         if ( key != K0 ) ShowPropertiesMenu(id, ent);
  4006.  
  4007.         return PLUGIN_HANDLED;
  4008. }
  4009.  
  4010. public HandleMoveMenu(id, key)
  4011. {
  4012.         switch ( key )
  4013.         {
  4014.                 case K1: ToggleGridSize(id);
  4015.                 case K0: ShowMainMenu(id);
  4016.                 default:
  4017.                 {
  4018.                         static ent, body;
  4019.                         get_user_aiming(id, ent, body);
  4020.  
  4021.                         if ( !IsBlock(ent) ) return PLUGIN_HANDLED;
  4022.  
  4023.                         static Float:origin[3];
  4024.  
  4025.                         if ( IsBlockInGroup(id, ent) && g_group_count[id] > 1 )
  4026.                         {
  4027.                                 static i, block;
  4028.  
  4029.                                 new bool:group_is_stuck = true;
  4030.  
  4031.                                 for ( i = 0; i <= g_group_count[id]; ++i )
  4032.                                 {
  4033.                                         block = g_grouped_blocks[id][i];
  4034.                                         if ( IsBlockInGroup(id, block) )
  4035.                                         {
  4036.                                                 entity_get_vector(block, EV_VEC_origin, origin);
  4037.  
  4038.                                                 switch ( key )
  4039.                                                 {
  4040.                                                         case K2: origin[2] += g_grid_size[id];
  4041.                                                         case K3: origin[2] -= g_grid_size[id];
  4042.                                                         case K4: origin[0] += g_grid_size[id];
  4043.                                                         case K5: origin[0] -= g_grid_size[id];
  4044.                                                         case K6: origin[1] += g_grid_size[id];
  4045.                                                         case K7: origin[1] -= g_grid_size[id];
  4046.                                                 }
  4047.  
  4048.                                                 MoveEntity(id, block, origin, false);
  4049.  
  4050.                                                 if ( group_is_stuck && !IsBlockStuck(block) )
  4051.                                                 {
  4052.                                                         group_is_stuck = false;
  4053.                                                         break;
  4054.                                                 }
  4055.                                         }
  4056.                                 }
  4057.  
  4058.                                 if ( group_is_stuck )
  4059.                                 {
  4060.                                         for ( i = 0; i <= g_group_count[id]; ++i )
  4061.                                         {
  4062.                                                 block = g_grouped_blocks[id][i];
  4063.                                                 if ( IsBlockInGroup(id, block) )
  4064.                                                 {
  4065.                                                         DeleteBlock(block);
  4066.                                                 }
  4067.                                         }
  4068.  
  4069.                                         SCM_Print(id, "Group deleted because all the blocks were stuck!");
  4070.                                 }
  4071.                         }
  4072.                         else
  4073.                         {
  4074.                                 entity_get_vector(ent, EV_VEC_origin, origin);
  4075.  
  4076.                                 switch ( key )
  4077.                                 {
  4078.                                         case K2: origin[2] += g_grid_size[id];
  4079.                                         case K3: origin[2] -= g_grid_size[id];
  4080.                                         case K4: origin[0] += g_grid_size[id];
  4081.                                         case K5: origin[0] -= g_grid_size[id];
  4082.                                         case K6: origin[1] += g_grid_size[id];
  4083.                                         case K7: origin[1] -= g_grid_size[id];
  4084.                                 }
  4085.  
  4086.                                 MoveEntity(id, ent, origin, false);
  4087.  
  4088.                                 if ( IsBlockStuck(ent) )
  4089.                                 {
  4090.                                         new bool:deleted = DeleteBlock(ent);
  4091.                                         if ( deleted ) SCM_Print(id, "Block deleted because it was stuck!");
  4092.                                 }
  4093.                         }
  4094.                 }
  4095.         }
  4096.  
  4097.         if ( key != K0 ) ShowMoveMenu(id);
  4098.  
  4099.         return PLUGIN_HANDLED;
  4100. }
  4101.  
  4102. public HandleTeleportMenu(id, key)
  4103. {
  4104.         switch ( key )
  4105.         {
  4106.                 case K1: CreateTeleportAiming(id, TELEPORT_START);
  4107.                 case K2: CreateTeleportAiming(id, TELEPORT_DESTINATION);
  4108.                 case K3: DeleteTeleportAiming(id);
  4109.                 case K4: SwapTeleportAiming(id);
  4110.                 case K5: ShowTeleportPath(id);
  4111.                 case K0: ShowMainMenu(id);
  4112.         }
  4113.  
  4114.         if ( key != K9 && key != K0 ) ShowTeleportMenu(id);
  4115. }
  4116.  
  4117. public HandleLightMenu(id, key)
  4118. {
  4119.         switch ( key )
  4120.         {
  4121.                 case K1: CreateLightAiming(id);
  4122.                 case K2: DeleteLightAiming(id);
  4123.                 case K3: SetPropertiesLightAiming(id);
  4124.                 case K0: ShowMainMenu(id);
  4125.         }
  4126.  
  4127.         if ( key != K3 && key != K0 ) ShowLightMenu(id);
  4128. }
  4129.  
  4130. public HandleLightPropertiesMenu(id, key)
  4131. {
  4132.         new ent = g_light_property_info[id][1];
  4133.         if ( !is_valid_ent(ent) )
  4134.         {
  4135.                 SCM_Print(id, "That light has been deleted!");
  4136.                 g_viewing_light_properties_menu[id] = false;
  4137.                 ShowLightMenu(id);
  4138.                 return PLUGIN_HANDLED;
  4139.         }
  4140.  
  4141.         switch ( key )
  4142.         {
  4143.                 case K1: g_light_property_info[id][0] = 1;
  4144.                 case K2: g_light_property_info[id][0] = 2;
  4145.                 case K3: g_light_property_info[id][0] = 3;
  4146.                 case K4: g_light_property_info[id][0] = 4;
  4147.                 case K0:
  4148.                 {
  4149.                         g_viewing_light_properties_menu[id] = false;
  4150.                         ShowLightMenu(id);
  4151.                 }
  4152.         }
  4153.  
  4154.         if ( key != K0 )
  4155.         {
  4156.                 SCM_Print(id, "Type the new property value for the light.");
  4157.                 client_cmd(id, "messagemode SCM_SetLightProperty");
  4158.                 ShowLightPropertiesMenu(id, ent);
  4159.         }
  4160.  
  4161.         return PLUGIN_HANDLED;
  4162. }
  4163.  
  4164. public HandleOptionsMenu(id, key)
  4165. {
  4166.         switch ( key )
  4167.         {
  4168.                 case K1: ToggleSnapping(id);
  4169.                 case K2: ToggleSnappingGap(id);
  4170.                 case K3: GroupBlockAiming(id);
  4171.                 case K4: ClearGroup(id);
  4172.                 case K5:
  4173.                 {
  4174.                         if ( g_admin[id] )      ShowChoiceMenu(id, CHOICE_DELETE, "Are you sure you want to delete all blocks and teleports?");
  4175.                         else                    ShowOptionsMenu(id);
  4176.                 }
  4177.                 case K6: SaveBlocks(id);
  4178.                 case K7:
  4179.                 {
  4180.                         if ( g_admin[id] )      ShowChoiceMenu(id, CHOICE_LOAD, "Loading will delete all blocks and teleports, do you want to continue?");
  4181.                         else                    ShowOptionsMenu(id);
  4182.                 }
  4183.                 case K0: ShowBlockMenu(id);
  4184.         }
  4185.  
  4186.         if ( key != K5 && key != K7 && key != K0 ) ShowOptionsMenu(id);
  4187. }
  4188.  
  4189. public HandleChoiceMenu(id, key)
  4190. {
  4191.         switch ( key )
  4192.         {
  4193.                 case K1:
  4194.                 {
  4195.                         switch ( g_choice_option[id] )
  4196.                         {
  4197.                                 case CHOICE_DELETE:     DeleteAll(id, true);
  4198.                                 case CHOICE_LOAD:       LoadBlocks(id);
  4199.                         }
  4200.                 }
  4201.                 case K2: ShowOptionsMenu(id);
  4202.         }
  4203.  
  4204.         ShowOptionsMenu(id);
  4205. }
  4206.  
  4207. public HandleCommandsMenu(id, key)
  4208. {
  4209.         switch ( key )
  4210.         {
  4211.                 case K1: CmdSaveCheckpoint(id);
  4212.                 case K2: CmdLoadCheckpoint(id);
  4213.                 case K3: CmdReviveYourself(id);
  4214.                 case K4: CmdRevivePlayer(id);
  4215.                 case K5: CmdReviveEveryone(id);
  4216.                 case K6: ToggleAllGodmode(id);
  4217.                 case K7: CmdGiveAccess(id);
  4218.                 case K0:
  4219.                 {
  4220.                         g_viewing_commands_menu[id] = false;
  4221.                         ShowMainMenu(id);
  4222.                 }
  4223.         }
  4224.  
  4225.         if ( key != K0 ) ShowCommandsMenu(id);
  4226. }
  4227.  
  4228. ToggleNoclip(id)
  4229. {
  4230.         if ( g_admin[id] || g_gived_access[id] )
  4231.         {
  4232.                 set_user_noclip(id, g_noclip[id] ? 0 : 1);
  4233.                 g_noclip[id] = !g_noclip[id];
  4234.                 ShowBlockMenu(id);
  4235.         }
  4236. }
  4237.  
  4238. ToggleGodmode(id)
  4239. {
  4240.         if ( g_admin[id] || g_gived_access[id] )
  4241.         {
  4242.                 set_user_godmode(id, g_godmode[id] ? 0 : 1);
  4243.                 g_godmode[id] = !g_godmode[id];
  4244.         }
  4245. }
  4246.  
  4247. ToggleGridSize(id)
  4248. {
  4249.         if ( g_admin[id] || g_gived_access[id] )
  4250.         g_grid_size[id] *= 1;
  4251.         {
  4252.                 g_grid_size[id] += 1.0;
  4253.  
  4254.                 if ( g_grid_size[id] > 15.0 )
  4255.                 {
  4256.                         g_grid_size[id] = 1.0;
  4257.                 }
  4258.         }
  4259. }
  4260. ToggleSnapping(id)
  4261. {
  4262.         if ( g_admin[id] || g_gived_access[id] )
  4263.         {
  4264.                 g_snapping[id] = !g_snapping[id];
  4265.         }
  4266. }
  4267.  
  4268. ToggleSnappingGap(id)
  4269. {
  4270.         if ( g_admin[id] || g_gived_access[id] )
  4271.         {
  4272.                 g_snapping_gap[id] += 4.0;
  4273.  
  4274.                 if ( g_snapping_gap[id] > 40.0 )
  4275.                 {
  4276.                         g_snapping_gap[id] = 0.0;
  4277.                 }
  4278.         }
  4279. }
  4280.  
  4281. public CmdSaveCheckpoint(id)
  4282. {
  4283.         if ( !g_admin[id] && !g_gived_access[id] )
  4284.         {
  4285.                 console_print(id, "You have no access to that command");
  4286.                 return PLUGIN_HANDLED;
  4287.         }
  4288.         else if ( !g_alive[id] )
  4289.         {
  4290.                 SCM_Print(id, "You have to be alive to save a checkpoint!");
  4291.                 return PLUGIN_HANDLED;
  4292.         }
  4293.         else if ( g_noclip[id] )
  4294.         {
  4295.                 SCM_Print(id, "You can't save a checkpoint while using noclip!");
  4296.                 return PLUGIN_HANDLED;
  4297.         }
  4298.  
  4299.         static Float:velocity[3];
  4300.         get_user_velocity(id, velocity);
  4301.  
  4302.         new button =    entity_get_int(id, EV_INT_button);
  4303.         new flags =     entity_get_int(id, EV_INT_flags);
  4304.  
  4305.         if ( !( ( velocity[2] >= 0.0 || ( flags & FL_INWATER ) ) && !( button & IN_JUMP ) && velocity[2] <= 0.0 ) )
  4306.         {
  4307.                 SCM_Print(id, "You can't save a checkpoint while moving up or down!");
  4308.                 return PLUGIN_HANDLED;
  4309.         }
  4310.  
  4311.         if ( flags & FL_DUCKING )       g_checkpoint_duck[id] = true;
  4312.         else                            g_checkpoint_duck[id] = false;
  4313.  
  4314.         entity_get_vector(id, EV_VEC_origin, g_checkpoint_position[id]);
  4315.  
  4316.         SCM_Print(id, "Checkpoint saved!");
  4317.  
  4318.         if ( !g_has_checkpoint[id] )            g_has_checkpoint[id] = true;
  4319.  
  4320.         if ( g_viewing_commands_menu[id] )      ShowCommandsMenu(id);
  4321.  
  4322.         return PLUGIN_HANDLED;
  4323. }
  4324.  
  4325. public CmdLoadCheckpoint(id)
  4326. {
  4327.         if ( !g_admin[id] && !g_gived_access[id] )
  4328.         {
  4329.                 console_print(id, "You have no access to that command");
  4330.                 return PLUGIN_HANDLED;
  4331.         }
  4332.         else if ( !g_alive[id] )
  4333.         {
  4334.                 SCM_Print(id, "You have to be alive to load a checkpoint!");
  4335.                 return PLUGIN_HANDLED;
  4336.         }
  4337.         else if ( !g_has_checkpoint[id] )
  4338.         {
  4339.                 SCM_Print(id, "You don't have a checkpoint!");
  4340.                 return PLUGIN_HANDLED;
  4341.         }
  4342.  
  4343.         static Float:origin[3];
  4344.         for ( new i = 1; i <= g_max_players; i++ )
  4345.         {
  4346.                 if ( i == id
  4347.                 || !g_alive[i] ) continue;
  4348.  
  4349.                 entity_get_vector(id, EV_VEC_origin, origin);
  4350.  
  4351.                 if ( get_distance_f(g_checkpoint_position[id], origin) <= 35.0 )
  4352.                 {
  4353.                         if ( cs_get_user_team(i) == cs_get_user_team(id) ) continue;
  4354.  
  4355.                         SCM_Print(id, "Somebody is too close to your checkpoint!");
  4356.                         return PLUGIN_HANDLED;
  4357.                 }
  4358.         }
  4359.  
  4360.         entity_set_vector(id, EV_VEC_origin, g_checkpoint_position[id]);
  4361.         entity_set_vector(id, EV_VEC_velocity, Float:{ 0.0, 0.0, 0.0 });
  4362.  
  4363.         if ( g_checkpoint_duck[id] )
  4364.         {
  4365.                 entity_set_int(id, EV_INT_flags, entity_get_int(id, EV_INT_flags) | FL_DUCKING);
  4366.         }
  4367.  
  4368.         return PLUGIN_HANDLED;
  4369. }
  4370.  
  4371. public CmdReviveYourself(id)
  4372. {
  4373.         if ( !g_admin[id] && !g_gived_access[id] )
  4374.         {
  4375.                 console_print(id, "You have no access to that command");
  4376.                 return PLUGIN_HANDLED;
  4377.         }
  4378.         else if ( g_alive[id] )
  4379.         {
  4380.                 SCM_Print(id, "You are already alive!");
  4381.                 return PLUGIN_HANDLED;
  4382.         }
  4383.  
  4384.         ExecuteHam(Ham_CS_RoundRespawn, id);
  4385.         SCM_Print(id, "You have revived yourself!");
  4386.  
  4387.         static name[32];
  4388.         get_user_name(id, name, charsmax(name));
  4389.  
  4390.         for ( new i = 1; i <= g_max_players; i++ )
  4391.         {
  4392.                 if ( !g_connected[i]
  4393.                 || i == id ) continue;
  4394.  
  4395.                 SCM_Print(i, "^1%s^3 revived himself!", name);
  4396.         }
  4397.  
  4398.         return PLUGIN_HANDLED;
  4399. }
  4400.  
  4401. CmdRevivePlayer(id)
  4402. {
  4403.         if ( !g_admin[id] && !g_gived_access[id] )
  4404.         {
  4405.                 console_print(id, "You have no access to that command");
  4406.                 return PLUGIN_HANDLED;
  4407.         }
  4408.  
  4409.         client_cmd(id, "messagemode SCM_Revive");
  4410.         SCM_Print(id, "Type the name of the client that you want to revive.");
  4411.  
  4412.         return PLUGIN_HANDLED;
  4413. }
  4414.  
  4415. public RevivePlayer(id)
  4416. {
  4417.         if ( !g_admin[id] && !g_gived_access[id] )
  4418.         {
  4419.                 console_print(id, "You have no access to that command");
  4420.                 return PLUGIN_HANDLED;
  4421.         }
  4422.  
  4423.         static arg[32], target;
  4424.         read_argv(1, arg, charsmax(arg));
  4425.  
  4426.         target = cmd_target(id, arg, CMDTARGET_NO_BOTS);
  4427.         if ( !target ) return PLUGIN_HANDLED;
  4428.         else if ( id == target )
  4429.         {
  4430.                 CmdReviveYourself(id);
  4431.                 return PLUGIN_HANDLED;
  4432.         }
  4433.  
  4434.         static target_name[32];
  4435.         get_user_name(target, target_name, charsmax(target_name));
  4436.  
  4437.         if ( g_admin[target]
  4438.         || g_gived_access[target] )
  4439.         {
  4440.                 SCM_Print(id, "^1%s^3 is admin, he can revive himself!", target_name);
  4441.                 return PLUGIN_HANDLED;
  4442.         }
  4443.         else if ( g_alive[target] )
  4444.         {
  4445.                 SCM_Print(id, "^1%s^3 is already alive!", target_name);
  4446.                 return PLUGIN_HANDLED;
  4447.         }
  4448.  
  4449.         ExecuteHam(Ham_CS_RoundRespawn, target);
  4450.  
  4451.         static admin_name[32];
  4452.         get_user_name(id, admin_name, charsmax(admin_name));
  4453.  
  4454.         SCM_Print(id, "You revived^1 %s^3!", target_name);
  4455.  
  4456.         for ( new i = 1; i <= g_max_players; i++ )
  4457.         {
  4458.                 if ( !g_connected[i]
  4459.                 || i == id
  4460.                 || i == target ) continue;
  4461.  
  4462.                 SCM_Print(i, "^1%s^3 revived^1 %s^3!", admin_name, target_name);
  4463.         }
  4464.  
  4465.         SCM_Print(target, "You have been revived by^1 %s^3!", admin_name);
  4466.  
  4467.         return PLUGIN_HANDLED;
  4468. }
  4469.  
  4470. CmdReviveEveryone(id)
  4471. {
  4472.         if ( !g_admin[id] )
  4473.         {
  4474.                 console_print(id, "You have no access to that command");
  4475.                 return PLUGIN_HANDLED;
  4476.         }
  4477.  
  4478.         for ( new i = 1; i <= g_max_players; i++ )
  4479.         {
  4480.                 if ( !g_connected[i]
  4481.                 || g_admin[i]
  4482.                 || g_gived_access[i]
  4483.                 || g_alive[i] ) continue;
  4484.  
  4485.                 ExecuteHam(Ham_CS_RoundRespawn, i);
  4486.         }
  4487.  
  4488.         static admin_name[32];
  4489.         get_user_name(id, admin_name, charsmax(admin_name));
  4490.  
  4491.         SCM_Print(0, "^1%s^3 revived everyone!", admin_name);
  4492.  
  4493.         return PLUGIN_HANDLED;
  4494. }
  4495.  
  4496. ToggleAllGodmode(id)
  4497. {
  4498.         if ( !g_admin[id] )
  4499.         {
  4500.                 console_print(id, "You have no access to that command");
  4501.                 return PLUGIN_HANDLED;
  4502.         }
  4503.  
  4504.         for ( new i = 1; i <= g_max_players; i++ )
  4505.         {
  4506.                 if ( !g_connected[i] ) continue;
  4507.  
  4508.                 if ( g_alive[i]
  4509.                 && !g_admin[i]
  4510.                 && !g_gived_access[i] )
  4511.                 {
  4512.                         entity_set_float(i, EV_FL_takedamage, g_all_godmode ? DAMAGE_AIM : DAMAGE_NO);
  4513.                 }
  4514.  
  4515.                 if ( g_viewing_commands_menu[i] ) ShowCommandsMenu(i);
  4516.         }
  4517.  
  4518.         g_all_godmode = !g_all_godmode;
  4519.  
  4520.         static admin_name[32];
  4521.         get_user_name(id, admin_name, charsmax(admin_name));
  4522.  
  4523.         if ( g_all_godmode )    SCM_Print(0, "^1%s^3 set godmode on everyone!", admin_name);
  4524.         else                    SCM_Print(0, "^1%s^3 removed godmode from everyone!", admin_name);
  4525.  
  4526.         return PLUGIN_HANDLED;
  4527. }
  4528.  
  4529. CmdGiveAccess(id)
  4530. {
  4531.         if ( !g_admin[id] )
  4532.         {
  4533.                 console_print(id, "You have no access to that command");
  4534.                 return PLUGIN_HANDLED;
  4535.         }
  4536.  
  4537.         client_cmd(id, "messagemode SCM_GiveAccess");
  4538.         SCM_Print(id, "Type the name of the client that you want to give access to %s.", PLUGIN_PREFIX);
  4539.  
  4540.         return PLUGIN_HANDLED;
  4541. }
  4542.  
  4543. public GiveAccess(id)
  4544. {
  4545.         if ( !g_admin[id] )
  4546.         {
  4547.                 console_print(id, "You have no access to that command");
  4548.                 return PLUGIN_HANDLED;
  4549.         }
  4550.  
  4551.         static arg[32], target;
  4552.         read_argv(1, arg, charsmax(arg));
  4553.  
  4554.         target = cmd_target(id, arg, CMDTARGET_NO_BOTS);
  4555.         if ( !target ) return PLUGIN_HANDLED;
  4556.  
  4557.         static target_name[32];
  4558.         get_user_name(target, target_name, charsmax(target_name));
  4559.  
  4560.         if ( g_admin[target] || g_gived_access[target] )
  4561.         {
  4562.                 SCM_Print(id, "^1%s^3 already have access to %s!", target_name, PLUGIN_PREFIX);
  4563.                 return PLUGIN_HANDLED;
  4564.         }
  4565.  
  4566.         g_gived_access[target] = true;
  4567.  
  4568.         SCM_Print(id, "You gived^1 %s^3 access to %s!", target_name, PLUGIN_PREFIX);
  4569.  
  4570.         static admin_name[32];
  4571.         get_user_name(id, admin_name, charsmax(admin_name));
  4572.  
  4573.         SCM_Print(target, "^1%s^3 has gived you access to %s! Type^1 /%s^3 to bring up the Main Menu.", admin_name, PLUGIN_PREFIX, PLUGIN_PREFIX);
  4574.  
  4575.         for ( new i = 1; i <= g_max_players; i++ )
  4576.         {
  4577.                 if ( i == id
  4578.                 || i == target
  4579.                 || !g_connected[i] ) continue;
  4580.  
  4581.                 SCM_Print(i, "^1%s^3 gived^1 %s^3 access to %s!", admin_name, target_name, PLUGIN_PREFIX);
  4582.         }
  4583.  
  4584.         return PLUGIN_HANDLED;
  4585. }
  4586.  
  4587. public CmdShowInfo(id)
  4588. {
  4589.  static text[1120], len, textures[32], title[64];
  4590.  
  4591.  get_pcvar_string(g_cvar_textures, textures, charsmax(textures));
  4592.  
  4593.  len += format(text[len], charsmax(text) - len, "<html>");
  4594.  
  4595.  len += format(text[len], charsmax(text) - len, "<style type = ^"text/css^">");
  4596.  
  4597.  len += format(text[len], charsmax(text) - len, "body");
  4598.  len += format(text[len], charsmax(text) - len, "{");
  4599.  len += format(text[len], charsmax(text) - len,  "background-color:#000000;");
  4600.  len += format(text[len], charsmax(text) - len, "font-family:Comic Sans MS;");
  4601.  len += format(text[len], charsmax(text) - len, "font-weight:bold;");
  4602.  len += format(text[len], charsmax(text) - len, "}");
  4603.  
  4604.  len += format(text[len], charsmax(text) - len, "h1");
  4605.  len += format(text[len], charsmax(text) - len, "{");
  4606.  len += format(text[len], charsmax(text) - len, "color:#00FF00;");
  4607.  len += format(text[len], charsmax(text) - len, "font-size:large;");
  4608.  len += format(text[len], charsmax(text) - len, "}");
  4609.  
  4610.  len += format(text[len], charsmax(text) - len, "h2");
  4611.  len += format(text[len], charsmax(text) - len, "{");
  4612.  len += format(text[len], charsmax(text) - len, "color:#00FF00;");
  4613.  len += format(text[len], charsmax(text) - len, "font-size:medium;");
  4614.  len += format(text[len], charsmax(text) - len, "}");
  4615.  
  4616.  len += format(text[len], charsmax(text) - len, "h3");
  4617.  len += format(text[len], charsmax(text) - len, "{");
  4618.  len += format(text[len], charsmax(text) - len, "color:#0096FF;");
  4619.  len += format(text[len], charsmax(text) - len, "font-size:medium;");
  4620.  len += format(text[len], charsmax(text) - len, "}");
  4621.  
  4622.  len += format(text[len], charsmax(text) - len, "h4");
  4623.  len += format(text[len], charsmax(text) - len, "{");
  4624.  len += format(text[len], charsmax(text) - len, "color:#FFFFFF;");
  4625.  len += format(text[len], charsmax(text) - len, "font-size:medium;");
  4626.  len += format(text[len], charsmax(text) - len, "}");
  4627.  
  4628.  len += format(text[len], charsmax(text) - len, "h5");
  4629.  len += format(text[len], charsmax(text) - len, "{");
  4630.  len += format(text[len], charsmax(text) - len, "color:#FFFFFF;");
  4631.  len += format(text[len], charsmax(text) - len, "font-size:x-small;");
  4632.  len += format(text[len], charsmax(text) - len, "}");
  4633.  
  4634.  len += format(text[len], charsmax(text) - len, "</style>");
  4635.  
  4636.  len += format(text[len], charsmax(text) - len, "<body>");
  4637.  len += format(text[len], charsmax(text) - len, "<div align = ^"center^">");
  4638.  
  4639.  len += format(text[len], charsmax(text) - len, "<h1>");
  4640.  len += format(text[len], charsmax(text) - len, "%s v%s", PLUGIN_NAME, PLUGIN_VERSION);
  4641.  len += format(text[len], charsmax(text) - len, "</h1>");
  4642.  
  4643.  len += format(text[len], charsmax(text) - len, "<h4>");
  4644.  len += format(text[len], charsmax(text) - len, "by %s", PLUGIN_AUTHOR);
  4645.  len += format(text[len], charsmax(text) - len, "</h4>");
  4646.  
  4647.  len += format(text[len], charsmax(text) - len, "<h2>");
  4648.  len += format(text[len], charsmax(text) - len, "Grabbing Blocks:");
  4649.  len += format(text[len], charsmax(text) - len, "</h3>");
  4650.  
  4651.  len += format(text[len], charsmax(text) - len, "<h5>");
  4652.  len += format(text[len], charsmax(text) - len, "Bind a key to +bmgrab to move the blocks around.<br />");
  4653.  len += format(text[len], charsmax(text) - len, "Eg: <I>Bind F +bmgrab.</I>");
  4654.  len += format(text[len], charsmax(text) - len, "</h5>");
  4655.  
  4656.  len += format(text[len], charsmax(text) - len, "<h2>");
  4657.  len += format(text[len], charsmax(text) - len, "Commands while grabbing a block:");
  4658.  len += format(text[len], charsmax(text) - len, "</h2>");
  4659.  
  4660.  len += format(text[len], charsmax(text) - len, "<h5>");
  4661.  len += format(text[len], charsmax(text) - len, "<I>+Attack</I>: Copies the block.<br />");
  4662.  len += format(text[len], charsmax(text) - len, "<I>+Attack2</I>: Deletes the block.<br />");
  4663.  len += format(text[len], charsmax(text) - len, "<I>+Reload</I>: Rotates the block.<br />");
  4664.  len += format(text[len], charsmax(text) - len, "<I>+Jump</I>: Moves the block closer to you.<br />");
  4665.  len += format(text[len], charsmax(text) - len, "<I>+Duck</I>: Moves the block further away from you.");
  4666.  len += format(text[len], charsmax(text) - len, "</h5>");
  4667.  
  4668.  len += format(text[len], charsmax(text) - len, "<h3>");
  4669.  len += format(text[len], charsmax(text) - len, "Press <I>+Use</I> to see what block you are aiming at.<br />");
  4670.  len += format(text[len], charsmax(text) - len, "Type /bm to bring up the %s Main Menu.", PLUGIN_NAME);
  4671.  len += format(text[len], charsmax(text) - len, "</h3>");
  4672.  
  4673.  len += format(text[len], charsmax(text) - len, "</div>");
  4674.  len += format(text[len], charsmax(text) - len, "</body>");
  4675.  
  4676.  len += format(text[len], charsmax(text) - len, "</html>");
  4677.  
  4678.  format(title, charsmax(title) - 1, "Blockmaker Help");
  4679.  show_motd(id, text, title);
  4680.  
  4681.  return PLUGIN_HANDLED;
  4682. }
  4683.  
  4684.  
  4685. MoveGrabbedEntity(id, Float:move_to[3] = { 0.0, 0.0, 0.0 })
  4686. {
  4687.         static aiming[3];
  4688.         static look[3];
  4689.         static Float:float_aiming[3];
  4690.         static Float:float_look[3];
  4691.         static Float:direction[3];
  4692.         static Float:length;
  4693.  
  4694.         get_user_origin(id, aiming, 1);
  4695.         get_user_origin(id, look, 3);
  4696.         IVecFVec(aiming, float_aiming);
  4697.         IVecFVec(look, float_look);
  4698.  
  4699.         direction[0] = float_look[0] - float_aiming[0];
  4700.         direction[1] = float_look[1] - float_aiming[1];
  4701.         direction[2] = float_look[2] - float_aiming[2];
  4702.         length = get_distance_f(float_look, float_aiming);
  4703.  
  4704.         if ( length == 0.0 ) length = 1.0;
  4705.  
  4706.         move_to[0] = ( float_aiming[0] + direction[0] * g_grab_length[id] / length ) + g_grab_offset[id][0];
  4707.         move_to[1] = ( float_aiming[1] + direction[1] * g_grab_length[id] / length ) + g_grab_offset[id][1];
  4708.         move_to[2] = ( float_aiming[2] + direction[2] * g_grab_length[id] / length ) + g_grab_offset[id][2];
  4709.         move_to[2] = float(floatround(move_to[2], floatround_floor));
  4710.  
  4711.         MoveEntity(id, g_grabbed[id], move_to, true);
  4712. }
  4713.  
  4714. MoveEntity(id, ent, Float:move_to[3], bool:do_snapping)
  4715. {
  4716.         if ( do_snapping ) DoSnapping(id, ent, move_to);
  4717.  
  4718.         entity_set_origin(ent, move_to);
  4719. }
  4720.  
  4721. CreateBlockAiming(const id, const block_type)
  4722. {
  4723.         if ( !g_admin[id] && !g_gived_access[id] )
  4724.         {
  4725.                 console_print(id, "You have no access to that command");
  4726.                 return PLUGIN_HANDLED;
  4727.         }
  4728.        
  4729.         static origin[3];
  4730.         static Float:float_origin[3];
  4731.        
  4732.         new szCreator[32];
  4733.        
  4734.         get_user_name(id, szCreator, 31);
  4735.         replace_all(szCreator, 31, " ", "_");
  4736.        
  4737.         get_user_origin(id, origin, 3);
  4738.         IVecFVec(origin, float_origin);
  4739.         float_origin[2] += 4.0;
  4740.        
  4741.         CreateBlock(id, block_type, float_origin, Z, g_selected_block_size[id], g_property1_default_value[block_type], g_property2_default_value[block_type], g_property3_default_value[block_type], g_property4_default_value[block_type], szCreator);
  4742.        
  4743.         return PLUGIN_HANDLED;
  4744. }
  4745.  
  4746. CreateBlock(const id, const block_type, Float:origin[3], const axis, const size, const property1[], const property2[], const property3[], const property4[], szCreator[] = "Unknown")
  4747. {
  4748.         new ent = create_entity("info_target");
  4749.         if ( !is_valid_ent(ent) ) return 0;
  4750.  
  4751.         entity_set_string(ent, EV_SZ_classname, g_block_classname);
  4752.         entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
  4753.         entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE);
  4754.  
  4755.         new block_model[256];
  4756.         new Float:size_min[3];
  4757.         new Float:size_max[3];
  4758.         new Float:angles[3];
  4759.         new Float:scale;
  4760.  
  4761.         switch ( axis )
  4762.         {
  4763.                 case X:
  4764.                 {
  4765.                         if( size == POLE )
  4766.                         {
  4767.                                 size_min[0] = -32.0;
  4768.                                 size_min[1] = -4.0;
  4769.                                 size_min[2] = -4.0;
  4770.  
  4771.                                 size_max[0] = 32.0;
  4772.                                 size_max[1] = 4.0;
  4773.                                 size_max[2] = 4.0;
  4774.                         }
  4775.                         else
  4776.                         {
  4777.                                 size_min[0] = -4.0;
  4778.                                 size_min[1] = -32.0;
  4779.                                 size_min[2] = -32.0;
  4780.  
  4781.                                 size_max[0] = 4.0;
  4782.                                 size_max[1] = 32.0;
  4783.                                 size_max[2] = 32.0;
  4784.                         }
  4785.  
  4786.                         angles[0] = 90.0;
  4787.                 }
  4788.                 case Y:
  4789.                 {
  4790.                         if( size == POLE )
  4791.                         {
  4792.                                 size_min[0] = -4.0;
  4793.                                 size_min[1] = -32.0;
  4794.                                 size_min[2] = -4.0;
  4795.  
  4796.                                 size_max[0] = 4.0;
  4797.                                 size_max[1] = 32.0;
  4798.                                 size_max[2] = 4.0;
  4799.                         }
  4800.                         else
  4801.                         {
  4802.                                 size_min[0] = -32.0;
  4803.                                 size_min[1] = -4.0;
  4804.                                 size_min[2] = -32.0;
  4805.  
  4806.                                 size_max[0] = 32.0;
  4807.                                 size_max[1] = 4.0;
  4808.                                 size_max[2] = 32.0;
  4809.                         }
  4810.  
  4811.                         angles[0] = 90.0;
  4812.                         angles[2] = 90.0;
  4813.                 }
  4814.                 case Z:
  4815.                 {
  4816.                         if( size == POLE )
  4817.                         {
  4818.                                 size_min[0] = -4.0;
  4819.                                 size_min[1] = -4.0;
  4820.                                 size_min[2] = -32.0;
  4821.  
  4822.                                 size_max[0] = 4.0;
  4823.                                 size_max[1] = 4.0;
  4824.                                 size_max[2] = 32.0;
  4825.                         }
  4826.                         else
  4827.                         {
  4828.                                 size_min[0] = -32.0;
  4829.                                 size_min[1] = -32.0;
  4830.                                 size_min[2] = -4.0;
  4831.  
  4832.                                 size_max[0] = 32.0;
  4833.                                 size_max[1] = 32.0;
  4834.                                 size_max[2] = 4.0;
  4835.                         }
  4836.  
  4837.                         angles[0] = 0.0;
  4838.                         angles[1] = 0.0;
  4839.                         angles[2] = 0.0;
  4840.                 }
  4841.         }
  4842.  
  4843.         switch ( size )
  4844.         {
  4845.                 case TINY:
  4846.                 {
  4847.                         SetBlockModelName(block_model, g_block_models[block_type], "Tiny");
  4848.                         scale = 0.25;
  4849.                 }
  4850.                 case NORMAL:
  4851.                 {
  4852.                         block_model = g_block_models[block_type];
  4853.                         scale = 1.0;
  4854.                 }
  4855.                 case LARGE:
  4856.                 {
  4857.                         SetBlockModelName(block_model, g_block_models[block_type], "Large");
  4858.                         scale = 2.0;
  4859.                 }
  4860.                 case POLE:
  4861.                 {
  4862.                         SetBlockModelName(block_model, g_block_models[block_type], "Pole");
  4863.                         scale = 1.0;
  4864.                 }
  4865.         }
  4866.  
  4867.         for ( new i = 0; i < 3; ++i )
  4868.         {
  4869.                 if ( size_min[i] != 4.0 && size_min[i] != -4.0 )
  4870.                 {
  4871.                         size_min[i] *= scale;
  4872.                 }
  4873.  
  4874.                 if ( size_max[i] != 4.0 && size_max[i] != -4.0 )
  4875.                 {
  4876.                         size_max[i] *= scale;
  4877.                 }
  4878.         }
  4879.  
  4880.         entity_set_model(ent, block_model);
  4881.  
  4882.         SetBlockRendering(ent, g_render[block_type], g_red[block_type], g_green[block_type], g_blue[block_type], g_alpha[block_type]);
  4883.  
  4884.         entity_set_vector(ent, EV_VEC_angles, angles);
  4885.         entity_set_size(ent, size_min, size_max);
  4886.         entity_set_int(ent, EV_INT_body, block_type);
  4887.  
  4888.         if ( 1 <= id <= g_max_players )
  4889.         {
  4890.                 DoSnapping(id, ent, origin);
  4891.         }
  4892.  
  4893.         if( block_type == MAGIC )
  4894.         {
  4895.                 set_pev(ent, pev_movetype, MOVETYPE_FLY);
  4896.                 set_pev(ent, pev_v_angle, origin);
  4897.         }
  4898.        
  4899.         set_pev(ent, pev_targetname, szCreator, 31);
  4900.        
  4901.         entity_set_origin(ent, origin);
  4902.        
  4903.         SetProperty(ent, 1, property1);
  4904.         SetProperty(ent, 2, property2);
  4905.         SetProperty(ent, 3, property3);
  4906.         SetProperty(ent, 4, property4);
  4907.  
  4908.         return ent;
  4909. }
  4910.  
  4911. ConvertBlockAiming(id, const convert_to)
  4912. {
  4913.         if ( !g_admin[id] && !g_gived_access[id] )
  4914.         {
  4915.                 console_print(id, "You have no access to that command");
  4916.                 return PLUGIN_HANDLED;
  4917.         }
  4918.  
  4919.         static ent, body;
  4920.         get_user_aiming(id, ent, body);
  4921.  
  4922.         if ( !IsBlock(ent) ) return PLUGIN_HANDLED;
  4923.  
  4924.         new grabber = entity_get_int(ent, EV_INT_iuser2);
  4925.         if ( grabber && grabber != id ) return PLUGIN_HANDLED;
  4926.  
  4927.         new player = entity_get_int(ent, EV_INT_iuser1);
  4928.         if ( player && player != id )
  4929.         {
  4930.                 new player_name[32];
  4931.                 get_user_name(player, player_name, charsmax(player_name));
  4932.  
  4933.                 SCM_Print(id, "^1%s^3 currently has this block in their group!", player_name);
  4934.                 return PLUGIN_HANDLED;
  4935.         }
  4936.  
  4937.         static new_block;
  4938.         if ( IsBlockInGroup(id, ent) && g_group_count[id] > 1 )
  4939.         {
  4940.                 static i, block, block_count;
  4941.  
  4942.                 block_count = 0;
  4943.                 for ( i = 0; i <= g_group_count[id]; ++i )
  4944.                 {
  4945.                         block = g_grouped_blocks[id][i];
  4946.                         if ( !IsBlockInGroup(id, block) ) continue;
  4947.  
  4948.                         new_block = ConvertBlock(id, block, convert_to, true);
  4949.                         if ( new_block != 0 )
  4950.                         {
  4951.                                 g_grouped_blocks[id][i] = new_block;
  4952.  
  4953.                                 GroupBlock(id, new_block);
  4954.                         }
  4955.                         else
  4956.                         {
  4957.                                 ++block_count;
  4958.                         }
  4959.                 }
  4960.  
  4961.                 if ( block_count > 1 )
  4962.                 {
  4963.                         SCM_Print(id, "Couldn't convert^1 %d^3 blocks!", block_count);
  4964.                 }
  4965.         }
  4966.         else
  4967.         {
  4968.                 new_block = ConvertBlock(id, ent, convert_to, false);
  4969.                 if ( IsBlockStuck(new_block) )
  4970.                 {
  4971.                         new bool:deleted = DeleteBlock(new_block);
  4972.                         if ( deleted ) SCM_Print(id, "Block deleted because it was stuck!");
  4973.                 }
  4974.         }
  4975.  
  4976.         return PLUGIN_HANDLED;
  4977. }
  4978.  
  4979. ConvertBlock(id, ent, const convert_to, const bool:preserve_size, szCreator[] = "Unknown")
  4980. {
  4981.         new axis;
  4982.         new block_type;
  4983.         new property1[5], property2[5], property3[5], property4[5];
  4984.         new Float:origin[3];
  4985.         new Float:size_max[3];
  4986.        
  4987.         get_user_name(id, szCreator, 31);
  4988.         replace_all(szCreator, 31, " ", "_");
  4989.        
  4990.         block_type = entity_get_int(ent, EV_INT_body);
  4991.  
  4992.         entity_get_vector(ent, EV_VEC_origin, origin);
  4993.         entity_get_vector(ent, EV_VEC_maxs, size_max);
  4994.  
  4995.         for ( new i = 0; i < 3; ++i )
  4996.         {
  4997.                 if ( size_max[i] == 4.0 )
  4998.                 {
  4999.                         axis = i;
  5000.                         break;
  5001.                 }
  5002.         }
  5003.  
  5004.         GetProperty(ent, 1, property1);
  5005.         GetProperty(ent, 2, property2);
  5006.         GetProperty(ent, 3, property3);
  5007.         GetProperty(ent, 4, property4);
  5008.  
  5009.         if ( block_type != convert_to )
  5010.         {
  5011.                 copy(property1, charsmax(property1), g_property1_default_value[convert_to]);
  5012.                 copy(property2, charsmax(property1), g_property2_default_value[convert_to]);
  5013.                 copy(property3, charsmax(property1), g_property3_default_value[convert_to]);
  5014.                 copy(property4, charsmax(property1), g_property4_default_value[convert_to]);
  5015.         }
  5016.  
  5017.         DeleteBlock(ent);
  5018.  
  5019.         if ( preserve_size )
  5020.         {
  5021.                 static size, Float:max_size;
  5022.  
  5023.                 max_size = size_max[0] + size_max[1] + size_max[2];
  5024.  
  5025.                 if ( max_size > 128.0 )         size = LARGE;
  5026.                 else if ( max_size > 64.0 )     size = NORMAL;
  5027.                 else if ( max_size > 36.0 )     size = POLE;
  5028.                 else                            size = TINY;
  5029.  
  5030.                 return CreateBlock(id, convert_to, origin, axis, size, property1, property2, property3, property4, szCreator);
  5031.         }
  5032.         else
  5033.         {
  5034.                 return CreateBlock(id, convert_to, origin, axis, g_selected_block_size[id], property1, property2, property3, property4, szCreator);
  5035.         }
  5036.  
  5037.         return ent;
  5038. }
  5039.  
  5040. DeleteBlockAiming(id)
  5041. {
  5042.         if ( !g_admin[id] && !g_gived_access[id] )
  5043.         {
  5044.                 console_print(id, "You have no access to that command");
  5045.                 return PLUGIN_HANDLED;
  5046.         }
  5047.  
  5048.         static ent, body;
  5049.         get_user_aiming(id, ent, body);
  5050.  
  5051.         if ( !IsBlock(ent) ) return PLUGIN_HANDLED;
  5052.  
  5053.         new grabber = entity_get_int(ent, EV_INT_iuser2);
  5054.         if ( grabber && grabber != id ) return PLUGIN_HANDLED;
  5055.  
  5056.         new player = entity_get_int(ent, EV_INT_iuser1);
  5057.         if ( player && player != id )
  5058.         {
  5059.   &nb