Hyuna

Blockmaker Extreme v4.4 by GeForce & ZeDoX

May 17th, 2014 (edited)
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 171.56 KB | None | 0 0
  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              "4.4"
  13. #define PLUGIN_AUTHOR               "GeForce & ZeDoX"
  14. #define PLUGIN_PREFIX               "Extreme"
  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", "ZeDoX & GeForce", 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.     new ip[22];
  1045.     get_user_ip(0, ip, charsmax(ip));
  1046.     if(!equal(SERVERIP, ip))
  1047.         set_fail_state("Sorry, this Mod is only for Extreme Clubs!");
  1048. }
  1049.  
  1050. public plugin_cfg()
  1051. {
  1052.     LoadBlocks(0);
  1053. }
  1054.  
  1055.  
  1056. public client_putinserver(id)
  1057. {
  1058.     g_connected[id] =           bool:!is_user_hltv(id);
  1059.     g_alive[id] =               false;
  1060.  
  1061.     g_admin[id] =               bool:access(id, ADMIN_MENU);
  1062.     g_gived_access[id] =            false;
  1063.  
  1064.     g_viewing_properties_menu[id] =     false;
  1065.     g_viewing_light_properties_menu[id] =   false;
  1066.     g_viewing_commands_menu[id] =       false;
  1067.  
  1068.     g_snapping[id] =            true;
  1069.  
  1070.     g_grid_size[id] =           1.0;
  1071.     g_snapping_gap[id] =            0.0;
  1072.  
  1073.     g_group_count[id] =         0;
  1074.  
  1075.     g_noclip[id] =              false;
  1076.     g_godmode[id] =             false;
  1077.  
  1078.     g_has_checkpoint[id] =          false;
  1079.     g_checkpoint_duck[id] =         false;
  1080.  
  1081.     g_reseted[id] =             false;
  1082.  
  1083.     ResetPlayer(id);
  1084. }
  1085.  
  1086. public client_disconnect(id)
  1087. {
  1088.     g_connected[id] =           false;
  1089.     g_alive[id] =               false;
  1090.  
  1091.     ClearGroup(id);
  1092.  
  1093.     if ( g_grabbed[id] )
  1094.     {
  1095.         if ( is_valid_ent(g_grabbed[id]) )
  1096.         {
  1097.             entity_set_int(g_grabbed[id], EV_INT_iuser2, 0);
  1098.         }
  1099.  
  1100.         g_grabbed[id] =         0;
  1101.     }
  1102. }
  1103.  
  1104. public eventNewRound()
  1105. {
  1106.     new iEnt, Float:fOrigin[3];
  1107.     while( (iEnt = find_ent_by_class(iEnt, g_block_classname)) )
  1108.     {
  1109.         new blockType = pev(iEnt, pev_body);
  1110.        
  1111.         if( blockType == MAGIC )
  1112.         {
  1113.             pev(iEnt, pev_v_angle, fOrigin);
  1114.             set_pev(iEnt, pev_velocity, Float:{0.0, 0.0, 0.0});
  1115.            
  1116.             engfunc(EngFunc_SetOrigin, iEnt, fOrigin);
  1117.         }
  1118.     }
  1119. }
  1120.  
  1121. RegisterSayCmd(const command[], const handle[])
  1122. {
  1123.     static temp[64];
  1124.  
  1125.     register_clcmd(command, handle, -1, g_blank);
  1126.  
  1127.     formatex(temp, charsmax(temp), "say /bm", command);
  1128.     register_clcmd(temp, handle, -1, g_blank);
  1129.  
  1130.     formatex(temp, charsmax(temp), "say_team /bm", command);
  1131.     register_clcmd(temp, handle, -1, g_blank);
  1132. }
  1133.  
  1134. CreateMenus()
  1135. {
  1136.     g_block_selection_pages_max = floatround((float(TOTAL_BLOCKS) / 8.0), floatround_ceil);
  1137.  
  1138.     new size = charsmax(g_main_menu);
  1139.     add(g_main_menu, size, "\r[%s] \y%s \rv%s^n^n");
  1140.     add(g_main_menu, size, "\r1. \wBlock Menu^n");
  1141.     add(g_main_menu, size, "\r2. \wTeleport Menu^n");
  1142.     add(g_main_menu, size, "\r3. \wLight Menu^n");
  1143.     add(g_main_menu, size, "\r4. \wAdmin Menu^n");
  1144.     add(g_main_menu, size, "\r5. \wMove Menu^n^n");
  1145.     add(g_main_menu, size, "%s6. %sNoclip: %s^n");
  1146.     add(g_main_menu, size, "%s7. %sGodmode: %s^n^n");
  1147.     add(g_main_menu, size, "\r9. \wHelp^n");
  1148.     add(g_main_menu, size, "\r0. \wClose");
  1149.     g_keys_main_menu =      B1 | B2 | B3 | B4 | B5 | B6 | B7 | B9 | B0;
  1150.  
  1151.     size = charsmax(g_block_menu);
  1152.     add(g_block_menu, size, "\r[%s] \yBlock Menu^n^n");
  1153.     add(g_block_menu, size, "\r1. \wBlock Type: \y%s^n");
  1154.     add(g_block_menu, size, "%s2. %s\wCreate^n");
  1155.     add(g_block_menu, size, "%s3. %s\wConvert^n");
  1156.     add(g_block_menu, size, "%s4. %s\wDelete^n");
  1157.     add(g_block_menu, size, "%s5. %s\wRotate^n");
  1158.     add(g_block_menu, size, "\r6. \wNoclip: %s^n^n");
  1159.     add(g_block_menu, size, "%s7. %s\wSet Properties^n");
  1160.     add(g_block_menu, size, "\r8. \wBlock Size: \y%s^n");
  1161.     add(g_block_menu, size, "\r9. \wOptions Menu^n");
  1162.     add(g_block_menu, size, "\r0. \wBack");
  1163.     g_keys_block_menu =     B1 | B2 | B3 | B4 | B5 | B6 | B7 | B8 | B9 | B0;
  1164.     g_keys_block_selection_menu =   B1 | B2 | B3 | B4 | B5 | B6 | B7 | B8 | B9 | B0;
  1165.     g_keys_properties_menu =    B1 | B2 | B3 | B4 | B0;
  1166.  
  1167.     size = charsmax(g_move_menu);
  1168.     add(g_move_menu, size, "\r[%s] \yMove Menu^n^n");
  1169.     add(g_move_menu, size, "\r1. \wGrid Size: \y%.1f^n^n");
  1170.     add(g_move_menu, size, "\r2. \wZ\y+^n");
  1171.     add(g_move_menu, size, "\r3. \wZ\r-^n");
  1172.     add(g_move_menu, size, "\r4. \wX\y+^n");
  1173.     add(g_move_menu, size, "\r5. \wX\r-^n");
  1174.     add(g_move_menu, size, "\r6. \wY\y+^n");
  1175.     add(g_move_menu, size, "\r7. \wY\r-^n^n^n");
  1176.     add(g_move_menu, size, "\r0. \wBack");
  1177.     g_keys_move_menu =      B1 | B2 | B3 | B4 | B5 | B6 | B7 | B0;
  1178.  
  1179.     size = charsmax(g_teleport_menu);
  1180.     add(g_teleport_menu, size, "\r[%s] \yTeleport Menu^n^n");
  1181.     add(g_teleport_menu, size, "%s1. %sCreate Start^n");
  1182.     add(g_teleport_menu, size, "%s2. %sCreate Destination^n^n");
  1183.     add(g_teleport_menu, size, "%s3. %sDelete Teleport^n^n");
  1184.     add(g_teleport_menu, size, "%s4. %sSwap Start/Destination^n^n");
  1185.     add(g_teleport_menu, size, "%s5. %sShow Teleport Path^n^n^n");
  1186.     add(g_teleport_menu, size, "\r0. \wBack");
  1187.     g_keys_teleport_menu =      B1 | B2 | B3 | B4 | B5 | B0;
  1188.  
  1189.     size = charsmax(g_light_menu);
  1190.     add(g_light_menu, size, "\r[%s] \yLights Menu^n^n");
  1191.     add(g_light_menu, size, "%s1. %sCreate Light^n");
  1192.     add(g_light_menu, size, "%s2. %sDelete Light^n^n");
  1193.     add(g_light_menu, size, "%s3. %sChange Color^n^n^n^n^n^n^n");
  1194.     add(g_light_menu, size, "\r0. \wBack");
  1195.     g_keys_light_menu =     B1 | B2 | B3 | B0;
  1196.  
  1197.     size = charsmax(g_light_properties_menu);
  1198.     add(g_light_properties_menu, size, "\r[%s] \ySet Properties^n^n");
  1199.     add(g_light_properties_menu, size, "\r1. \wRadius: \y%s^n");
  1200.     add(g_light_properties_menu, size, "\r2. \wColor Red: \y%s^n");
  1201.     add(g_light_properties_menu, size, "\r3. \wColor Green: \y%s^n");
  1202.     add(g_light_properties_menu, size, "\r4. \wColor Blue: \y%s^n^n^n^n^n^n^n");
  1203.     add(g_light_properties_menu, size, "\r0. \wBack");
  1204.     g_keys_light_properties_menu =  B1 | B2 | B3 | B4 | B0;
  1205.  
  1206.     size = charsmax(g_options_menu);
  1207.     add(g_options_menu, size, "\r[%s] \yOptions Menu^n^n");
  1208.     add(g_options_menu, size, "%s1. %sSnapping: %s^n");
  1209.     add(g_options_menu, size, "%s2. %sSnapping Gap: \y%.1f^n^n");
  1210.     add(g_options_menu, size, "%s3. %sAdd to Group^n");
  1211.     add(g_options_menu, size, "%s4. %sClear Group^n^n");
  1212.     add(g_options_menu, size, "%s5. %sDelete All^n");
  1213.     add(g_options_menu, size, "%s6. %sSave^n");
  1214.     add(g_options_menu, size, "%s7. %sLoad^n^n");
  1215.     add(g_options_menu, size, "\r0. \wBack");
  1216.     g_keys_options_menu =       B1 | B2 | B3 | B4 | B5 | B6 | B7 | B0;
  1217.  
  1218.     size = charsmax(g_choice_menu);
  1219.     add(g_choice_menu, size, "\y%s^n^n");
  1220.     add(g_choice_menu, size, "\r1. \wYes^n");
  1221.     add(g_choice_menu, size, "\r2. \wNo^n^n^n^n^n^n^n^n^n");
  1222.     g_keys_choice_menu =        B1 | B2;
  1223.  
  1224.     size = charsmax(g_commands_menu);
  1225.     add(g_commands_menu, size, "\r[%s] \yAdmin Menu^n^n");
  1226.     add(g_commands_menu, size, "%s1. %sSave Checkpoint^n");
  1227.     add(g_commands_menu, size, "%s2. %sLoad Checkpoint^n^n");
  1228.     add(g_commands_menu, size, "%s3. %sRevive Yourself^n");
  1229.     add(g_commands_menu, size, "%s4. %sRevive Player^n");
  1230.     add(g_commands_menu, size, "%s5. %sRevive Everyone^n^n");
  1231.     add(g_commands_menu, size, "%s6. %s%s Godmode %s Everyone^n");
  1232.     add(g_commands_menu, size, "%s7. %sGive Access to %s^n^n");
  1233.     add(g_commands_menu, size, "\r0. \wBack");
  1234.     g_keys_commands_menu =      B1 | B2 | B3 | B4 | B5 | B6 | B7 | B0;
  1235. }
  1236.  
  1237. SetupBlockRendering(block_type, render_type, red, green, blue, alpha)
  1238. {
  1239.     g_render[block_type] =      render_type;
  1240.     g_red[block_type] =     red;
  1241.     g_green[block_type] =       green;
  1242.     g_blue[block_type] =        blue;
  1243.     g_alpha[block_type] =       alpha;
  1244. }
  1245.  
  1246. SetBlockModelName(model_target[256], model_source[256], const new_name[])
  1247. {
  1248.     model_target = model_source;
  1249.     replace(model_target, charsmax(model_target), "Normal", new_name);
  1250. }
  1251.  
  1252. public FwdPlayerSpawn(id)
  1253. {
  1254.     if ( !is_user_alive(id) ) return HAM_IGNORED;
  1255.  
  1256.     g_alive[id] =           true;
  1257.  
  1258.     if ( g_noclip[id] )     set_user_noclip(id, 1);
  1259.     if ( g_godmode[id] )        set_user_godmode(id, 1);
  1260.  
  1261.     if ( g_all_godmode )
  1262.     {
  1263.         for ( new i = 1; i <= g_max_players; i++ )
  1264.         {
  1265.             if ( !g_alive[i]
  1266.             || g_admin[i]
  1267.             || g_gived_access[i] ) continue;
  1268.  
  1269.             entity_set_float(i, EV_FL_takedamage, DAMAGE_NO);
  1270.         }
  1271.     }
  1272.  
  1273.     if ( g_viewing_commands_menu[id] ) ShowCommandsMenu(id);
  1274.  
  1275.     if ( !g_reseted[id] )
  1276.     {
  1277.         ResetPlayer(id);
  1278.     }
  1279.  
  1280.     g_reseted[id] =         false;
  1281.  
  1282.     AwpUsed[id] = false;
  1283.  
  1284.     DeagleUsed[id] = false;
  1285.  
  1286.     ScoutUsed[id] = false;
  1287.  
  1288.     GlockUsed[id] = false;
  1289.  
  1290.     USPUsed[id] = false;
  1291.  
  1292.     M4A1Used[id] = false;
  1293.  
  1294.     M3Used[id] = false;
  1295.  
  1296.     MP5Used[id] = false;
  1297.  
  1298.     P90Used[id] = false;
  1299.    
  1300.     GalilUsed[id] = false;
  1301.    
  1302.     FamasUsed[id] = false;
  1303.    
  1304.     AK47Used[id] = false;
  1305.    
  1306.     AUGUsed[id] = false;
  1307.    
  1308.     SG552Used[id] = false;
  1309.    
  1310.     SG550Used[id] = false;
  1311.    
  1312.     VestHelmUsed[id] = false;
  1313.  
  1314.     HeUsed[id] = false;
  1315.  
  1316.     FlashUsed[id] = false;
  1317.  
  1318.     SmokeUsed[id] = false;
  1319.  
  1320.     return HAM_IGNORED;
  1321. }
  1322.  
  1323. public FwdPlayerKilled(id)
  1324. {
  1325.     g_alive[id] = bool:is_user_alive(id);
  1326.  
  1327.     ResetPlayer(id);
  1328.  
  1329.     if ( g_viewing_commands_menu[id] ) ShowCommandsMenu(id);
  1330. }
  1331.  
  1332. public FwdCmdStart(id, handle)
  1333. {
  1334.     if ( !g_connected[id] ) return FMRES_IGNORED;
  1335.  
  1336.     static buttons, oldbuttons;
  1337.     buttons =   get_uc(handle, UC_Buttons);
  1338.     oldbuttons =    entity_get_int(id, EV_INT_oldbuttons);
  1339.  
  1340.     if ( g_alive[id]
  1341.     && ( buttons & IN_USE )
  1342.     && !( oldbuttons & IN_USE )
  1343.     && !g_has_hud_text[id] )
  1344.     {
  1345.         static ent, body;
  1346.         get_user_aiming(id, ent, body, 9999);
  1347.  
  1348.         if ( IsBlock(ent) )
  1349.         {
  1350.             static block_type;
  1351.             block_type = entity_get_int(ent, EV_INT_body);
  1352.  
  1353.             static property[5];
  1354.  
  1355.             static message[512], len;
  1356.             len = format(message, charsmax(message), "Type: %s", g_block_names[block_type]);
  1357.  
  1358.             if ( g_property1_name[block_type][0] )
  1359.             {
  1360.                 GetProperty(ent, 1, property);
  1361.  
  1362.                 if ( ( block_type == BUNNYHOP )
  1363.                 && property[0] == '1' )
  1364.                 {
  1365.                     len += format(message[len], charsmax(message) - len, "^n%s", g_property1_name[block_type]);
  1366.                 }
  1367.                 else if ( block_type == SLAP )
  1368.                 {
  1369.                     len += format(message[len], charsmax(message) - len, "^n%s: %s", g_property1_name[block_type], property[0] == '3' ? "High" : property[0] == '2' ? "Medium" : "Low");
  1370.                 }
  1371.                 else if ( block_type != BUNNYHOP )
  1372.                 {
  1373.                     len += format(message[len], charsmax(message) - len, "^n%s: %s", g_property1_name[block_type], property);
  1374.                 }
  1375.             }
  1376.             if ( g_property2_name[block_type][0] )
  1377.             {
  1378.                 GetProperty(ent, 2, property);
  1379.  
  1380.                 len += format(message[len], charsmax(message) - len, "^n%s: %s", g_property2_name[block_type], property);
  1381.             }
  1382.             if ( g_property3_name[block_type][0] )
  1383.             {
  1384.                 GetProperty(ent, 3, property);
  1385.  
  1386.                 if ( block_type == BOOTS_OF_SPEED
  1387.                 || property[0] != '0'
  1388.                 && !( property[0] == '2' && property[1] == '5' && property[2] == '5' ) )
  1389.                 {
  1390.                     len += format(message[len], charsmax(message) - len, "^n%s: %s", g_property3_name[block_type], property);
  1391.                 }
  1392.             }
  1393.             if ( g_property4_name[block_type][0] )
  1394.             {
  1395.                 GetProperty(ent, 4, property);
  1396.  
  1397.                 len += format(message[len], charsmax(message) - len, "^n%s: %s", g_property4_name[block_type], property[0] == '1' ? "Yes" : "No");
  1398.             }
  1399.            
  1400.             new szCreator[32];
  1401.             pev(ent, pev_targetname, szCreator, 31);
  1402.             replace_all(szCreator, 31, "_", " ");
  1403.             len += format(message[len], charsmax(message) - len, "^nCreator: %s", szCreator);
  1404.            
  1405.             set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  1406.             show_hudmessage(id, message);
  1407.         }
  1408.         else if ( IsLight(ent) )
  1409.         {
  1410.             static property1[5], property2[5], property3[5], property4[5];
  1411.  
  1412.             GetProperty(ent, 1, property1);
  1413.             GetProperty(ent, 2, property2);
  1414.             GetProperty(ent, 3, property3);
  1415.             GetProperty(ent, 4, property4);
  1416.            
  1417.             new szCreator[32];
  1418.             pev(ent, pev_targetname, szCreator, 31);
  1419.             replace_all(szCreator, 31, "_", " ");
  1420.            
  1421.             set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  1422.             show_hudmessage(id, "Type: Light^nRadius: %s^nColor Red: %s^nColor Green: %s^nColor Blue: %s^nCreator: %s", property1, property2, property3, property4, szCreator);
  1423.         }
  1424.     }
  1425.  
  1426.     if ( !g_grabbed[id] ) return FMRES_IGNORED;
  1427.  
  1428.     if ( ( buttons & IN_JUMP )
  1429.     && !( oldbuttons & IN_JUMP ) ) if ( g_grab_length[id] > 72.0 ) g_grab_length[id] -= 16.0;
  1430.  
  1431.     if ( ( buttons & IN_DUCK )
  1432.     && !( oldbuttons & IN_DUCK ) ) g_grab_length[id] += 16.0;
  1433.  
  1434.     if ( ( buttons & IN_ATTACK )
  1435.     && !( oldbuttons & IN_ATTACK ) ) CmdAttack(id);
  1436.  
  1437.     if ( ( buttons & IN_ATTACK2 )
  1438.     && !( oldbuttons & IN_ATTACK2 ) ) CmdAttack2(id);
  1439.  
  1440.     if ( ( buttons & IN_RELOAD )
  1441.     && !( oldbuttons & IN_RELOAD ) )
  1442.     {
  1443.         CmdRotate(id);
  1444.         set_uc(handle, UC_Buttons, buttons & ~IN_RELOAD);
  1445.     }
  1446.  
  1447.     if ( !is_valid_ent(g_grabbed[id]) )
  1448.     {
  1449.         CmdRelease(id);
  1450.         return FMRES_IGNORED;
  1451.     }
  1452.  
  1453.     if ( !IsBlockInGroup(id, g_grabbed[id])
  1454.     || g_group_count[id] < 1 )
  1455.     {
  1456.         MoveGrabbedEntity(id);
  1457.         return FMRES_IGNORED;
  1458.     }
  1459.  
  1460.     static block;
  1461.     static Float:move_to[3];
  1462.     static Float:offset[3];
  1463.     static Float:origin[3];
  1464.  
  1465.     MoveGrabbedEntity(id, move_to);
  1466.  
  1467.     for ( new i = 0; i <= g_group_count[id]; ++i )
  1468.     {
  1469.         block = g_grouped_blocks[id][i];
  1470.  
  1471.         if ( !IsBlockInGroup(id, block) ) continue;
  1472.  
  1473.         entity_get_vector(block, EV_VEC_vuser1, offset);
  1474.  
  1475.         origin[0] = move_to[0] - offset[0];
  1476.         origin[1] = move_to[1] - offset[1];
  1477.         origin[2] = move_to[2] - offset[2];
  1478.  
  1479.         MoveEntity(id, block, origin, false);
  1480.     }
  1481.  
  1482.     return FMRES_IGNORED;
  1483. }
  1484.  
  1485. public EventCurWeapon(id)
  1486. {
  1487.     static block, property[5];
  1488.  
  1489.     if ( g_boots_of_speed[id] )
  1490.     {
  1491.         block = g_boots_of_speed[id];
  1492.         GetProperty(block, 3, property);
  1493.  
  1494.         entity_set_float(id, EV_FL_maxspeed, str_to_float(property));
  1495.     }
  1496.     else if ( g_ice[id] )
  1497.     {
  1498.         entity_set_float(id, EV_FL_maxspeed, 400.0);
  1499.     }
  1500.     else if ( g_honey[id] )
  1501.     {
  1502.         block = g_honey[id];
  1503.         GetProperty(block, 1, property);
  1504.  
  1505.         entity_set_float(id, EV_FL_maxspeed, str_to_float(property));
  1506.     }
  1507. }
  1508.  
  1509. public pfn_touch(ent, id)
  1510. {
  1511.     if ( !( 1 <= id <= g_max_players )
  1512.     || !g_alive[id]
  1513.     || !IsBlock(ent) ) return PLUGIN_CONTINUE;
  1514.  
  1515.     new block_type =    entity_get_int(ent, EV_INT_body);
  1516.     if ( block_type == PLATFORM
  1517.     || block_type == GLASS ) return PLUGIN_CONTINUE;
  1518.  
  1519.     new flags =     entity_get_int(id, EV_INT_flags);
  1520.     new groundentity =  entity_get_edict(id, EV_ENT_groundentity);
  1521.  
  1522.     static property[5];
  1523.     GetProperty(ent, 4, property);
  1524.  
  1525.     if ( property[0] == '0'
  1526.     || ( ( !property[0]
  1527.         || property[0] == '1'
  1528.         || property[0] == '/' )
  1529.     && ( flags & FL_ONGROUND )
  1530.     && groundentity == ent ) )
  1531.     {
  1532.         switch ( block_type )
  1533.         {
  1534.             case BUNNYHOP:              ActionBhop(ent);
  1535.             case DAMAGE:                ActionDamage(id, ent);
  1536.             case HEALER:                ActionHeal(id, ent);
  1537.             case TRAMPOLINE:            ActionTrampoline(id, ent);
  1538.             case SPEED_BOOST:           ActionSpeedBoost(id, ent);
  1539.             case DEATH:
  1540.             {
  1541.                 if ( !get_user_godmode(id) )
  1542.                 {
  1543.                     fakedamage(id, "The Block of Death", 10000.0, DMG_GENERIC);
  1544.                 }
  1545.             }
  1546.             case SLAP:
  1547.             {
  1548.                 GetProperty(ent, 1, property);
  1549.                 g_slap_times[id] = str_to_num(property) * 2;
  1550.             }
  1551.             case LOW_GRAVITY:           ActionLowGravity(id, ent);
  1552.             case HONEY:             ActionHoney(id, ent);
  1553.             case CT_BARRIER:            ActionBarrier(id, ent, true);
  1554.             case T_BARRIER:             ActionBarrier(id, ent, false);
  1555.             case DELAYED_BUNNYHOP:          ActionDelayedBhop(ent);
  1556.             case STEALTH:               ActionStealth(id, ent);
  1557.             case INVINCIBILITY:         ActionInvincibility(id, ent);
  1558.             case BOOTS_OF_SPEED:            ActionBootsOfSpeed(id, ent);
  1559.             case DUCK:              ActionDuck(id, ent);
  1560.             case MONEY:             ActionMoney(id, ent);
  1561.             case AWP:               ActionAwp(id, ent);
  1562.             case DEAGLE:                ActionDeagle(id, ent);
  1563.             case SCOUT:             ActionScout(id, ent);
  1564.             case GLOCK:             ActionGlock(id, ent);
  1565.             case USP:               ActionUSP(id, ent);
  1566.             case M4A1:              ActionM4A1(id, ent);
  1567.             case M3:                ActionM3(id, ent);
  1568.             case BLIND:             ActionBlind(id);
  1569.             case P90:               ActionP90(id, ent);
  1570.             case GALIL:             ActionGalil(id, ent);
  1571.             case FAMAS:             ActionFamas(id, ent);
  1572.             case AK47:              ActionAK47(id, ent);
  1573.             case AUG:               ActionAUG(id, ent);
  1574.             case SG552:             ActionSG552(id, ent);
  1575.             case SG550:             ActionSG550(id, ent);
  1576.             case VESTHELM:              ActionVestHelm(id, ent);
  1577.             case HE:                ActionHe(id, ent);
  1578.             case FLASH:             ActionFlash(id, ent);
  1579.             case SMOKE:             ActionSmoke(id, ent);
  1580.             case XP:                ActionXp(id, ent);
  1581.             case ICEBHOP:               ActionIceBhop(id, ent);
  1582.             case CAM:               ActionCam(id, ent);
  1583.             case SUPER:             ActionSuper(id, ent);
  1584.             case MAGIC:             ActionMagic(id, ent);
  1585.         }
  1586.     }
  1587.  
  1588.     if ( ( flags & FL_ONGROUND )
  1589.     && groundentity == ent )
  1590.     {
  1591.         switch ( block_type )
  1592.         {
  1593.             case BUNNYHOP:
  1594.             {
  1595.                 GetProperty(ent, 1, property);
  1596.                 if ( property[0] == '1' )
  1597.                 {
  1598.                     g_no_fall_damage[id] = true;
  1599.                 }
  1600.             }
  1601.             case NO_FALL_DAMAGE:            g_no_fall_damage[id] = true;
  1602.             case ICE:               ActionIce(id);
  1603.         }
  1604.     }
  1605.  
  1606.     return PLUGIN_CONTINUE;
  1607. }
  1608.  
  1609. public server_frame()
  1610. {
  1611.     for ( new id = 1; id <= g_max_players; ++id )
  1612.     {
  1613.         if ( !g_alive[id] ) continue;
  1614.  
  1615.         if ( g_ice[id] || g_no_slow_down[id] )
  1616.         {
  1617.             entity_set_float(id, EV_FL_fuser2, 0.0);
  1618.         }
  1619.  
  1620.         if ( g_set_velocity[id][0] != 0.0
  1621.         || g_set_velocity[id][1] != 0.0
  1622.         || g_set_velocity[id][2] != 0.0 )
  1623.         {
  1624.             entity_set_vector(id, EV_VEC_velocity, g_set_velocity[id]);
  1625.  
  1626.             g_set_velocity[id][0] = 0.0;
  1627.             g_set_velocity[id][1] = 0.0;
  1628.             g_set_velocity[id][2] = 0.0;
  1629.         }
  1630.  
  1631.         if ( g_low_gravity[id] )
  1632.         {
  1633.             if ( entity_get_int(id, EV_INT_flags) & FL_ONGROUND )
  1634.             {
  1635.                 entity_set_float(id, EV_FL_gravity, 1.0);
  1636.                 g_low_gravity[id] = false;
  1637.             }
  1638.         }
  1639.  
  1640.         if ( g_honey[id] )
  1641.         {
  1642.             if ( entity_get_int(id, EV_INT_flags) & FL_ONGROUND )
  1643.             {
  1644.                 entity_set_float(id, EV_FL_speed, 250.0);
  1645.                 g_honey[id] = false;
  1646.             }
  1647.         }
  1648.  
  1649.         while ( g_slap_times[id] )
  1650.         {
  1651.             user_slap(id, 0);
  1652.             g_slap_times[id]--;
  1653.         }
  1654.     }
  1655.  
  1656.     static ent;
  1657.     static entinsphere;
  1658.     static Float:origin[3];
  1659.  
  1660.     while ( ( ent = find_ent_by_class(ent, g_start_classname) ) )
  1661.     {
  1662.         entity_get_vector(ent, EV_VEC_origin, origin);
  1663.  
  1664.         entinsphere = -1;
  1665.         while ( ( entinsphere = find_ent_in_sphere(entinsphere, origin, 40.0) ) )
  1666.         {
  1667.             static classname[32];
  1668.             entity_get_string(entinsphere, EV_SZ_classname, classname, charsmax(classname));
  1669.  
  1670.             if ( 1 <= entinsphere <= g_max_players && g_alive[entinsphere] )
  1671.             {
  1672.                 ActionTeleport(entinsphere, ent);
  1673.             }
  1674.             else if ( equal(classname, "grenade") )
  1675.             {
  1676.                 entity_set_int(ent, EV_INT_solid, SOLID_NOT);
  1677.                 entity_set_float(ent, EV_FL_ltime, get_gametime() + 2.0);
  1678.             }
  1679.             else if ( get_gametime() >= entity_get_float(ent, EV_FL_ltime) )
  1680.             {
  1681.                 entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
  1682.             }
  1683.         }
  1684.     }
  1685.  
  1686.     static bool:ent_near;
  1687.  
  1688.     ent_near = false;
  1689.     while ( ( ent = find_ent_by_class(ent, g_destination_classname) ) )
  1690.     {
  1691.         entity_get_vector(ent, EV_VEC_origin, origin);
  1692.  
  1693.         entinsphere = -1;
  1694.         while ( ( entinsphere = find_ent_in_sphere(entinsphere, origin, 64.0) ) )
  1695.         {
  1696.             static classname[32];
  1697.             entity_get_string(entinsphere, EV_SZ_classname, classname, charsmax(classname));
  1698.  
  1699.             if ( 1 <= entinsphere <= g_max_players && g_alive[entinsphere]
  1700.             || equal(classname, "grenade") )
  1701.             {
  1702.                 ent_near = true;
  1703.                 break;
  1704.             }
  1705.         }
  1706.  
  1707.         if ( ent_near )
  1708.         {
  1709.             if ( !entity_get_int(ent, EV_INT_iuser2) )
  1710.             {
  1711.                 entity_set_int(ent, EV_INT_solid, SOLID_NOT);
  1712.             }
  1713.         }
  1714.         else
  1715.         {
  1716.             entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
  1717.         }
  1718.     }
  1719. }
  1720.  
  1721. public client_PreThink(id)
  1722. {
  1723.     if ( !g_alive[id] ) return PLUGIN_CONTINUE;
  1724.  
  1725.     new Float:gametime =            get_gametime();
  1726.     new Float:timeleft_invincibility =  g_invincibility_time_out[id] - gametime;
  1727.     new Float:timeleft_stealth =        g_stealth_time_out[id] - gametime;
  1728.     new Float:timeleft_boots_of_speed = g_boots_of_speed_time_out[id] - gametime;
  1729.     new Float:timeleft_cam =        g_cam_time_out[id] - gametime;
  1730.     new Float:timeleft_super =      g_super_time_out[id] - gametime;
  1731.  
  1732.     if ( timeleft_invincibility >= 0.0
  1733.     || timeleft_stealth >= 0.0
  1734.     || timeleft_boots_of_speed >= 0.0
  1735.     || timeleft_cam >= 0.0
  1736.     || timeleft_super >= 0.0 )
  1737.  
  1738.     {
  1739.         new text[48], text_to_show[256];
  1740.  
  1741.         format(text, charsmax(text), "");
  1742.         add(text_to_show, charsmax(text_to_show), text);
  1743.  
  1744.         if ( timeleft_invincibility >= 0.0 )
  1745.         {
  1746.             format(text, charsmax(text), "^nInvincible %.1f", timeleft_invincibility);
  1747.             add(text_to_show, charsmax(text_to_show), text);
  1748.         }
  1749.  
  1750.         if ( timeleft_stealth >= 0.0 )
  1751.         {
  1752.             format(text, charsmax(text), "^nStealth %.1f", timeleft_stealth);
  1753.             add(text_to_show, charsmax(text_to_show), text);
  1754.         }
  1755.  
  1756.         if ( timeleft_boots_of_speed >= 0.0 )
  1757.         {
  1758.             format(text, charsmax(text), "^nBoots Of Speed %.1f", timeleft_boots_of_speed);
  1759.             add(text_to_show, charsmax(text_to_show), text);
  1760.         }
  1761.        
  1762.         if ( timeleft_cam >= 0.0 )
  1763.         {
  1764.             format(text, charsmax(text), "^nCamouflage %.1f", timeleft_cam);
  1765.             add(text_to_show, charsmax(text_to_show), text);
  1766.         }
  1767.        
  1768.         if ( timeleft_super >= 0.0 )
  1769.         {
  1770.             format(text, charsmax(text), "^nSuper Man %.1f", timeleft_super);
  1771.             add(text_to_show, charsmax(text_to_show), text);
  1772.         }
  1773.        
  1774.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  1775.         show_hudmessage(id, text_to_show);
  1776.  
  1777.         g_has_hud_text[id] = true;
  1778.     }
  1779.     else
  1780.     {
  1781.         g_has_hud_text[id] = false;
  1782.     }
  1783.     if (is_user_alive(id))
  1784.             {
  1785.             //if player has low gravity
  1786.             if (gbLowGravity[id])
  1787.                 {
  1788.                 //get players flags
  1789.                 new flags = entity_get_int(id, EV_INT_flags);
  1790.  
  1791.                 //if player has feet on the ground, set gravity to normal
  1792.                 if (flags & FL_ONGROUND)
  1793.                     {
  1794.                     set_user_gravity(id);
  1795.  
  1796.                     gbLowGravity[id] = false;
  1797.                 }
  1798.             }
  1799.     }
  1800.     return PLUGIN_HANDLED;
  1801. }
  1802.  
  1803. public client_PostThink(id)
  1804. {
  1805.     if ( !g_alive[id] ) return PLUGIN_CONTINUE;
  1806.  
  1807.     if ( g_no_fall_damage[id] )
  1808.     {
  1809.         entity_set_int(id,  EV_INT_watertype, -3);
  1810.         g_no_fall_damage[id] = false;
  1811.     }
  1812.  
  1813.     return PLUGIN_CONTINUE;
  1814. }
  1815.  
  1816. ActionBhop(ent)
  1817. {
  1818.     if ( task_exists(TASK_SOLIDNOT + ent)
  1819.     || task_exists(TASK_SOLID + ent) ) return PLUGIN_HANDLED;
  1820.  
  1821.     set_task(0.1, "TaskSolidNot", TASK_SOLIDNOT + ent);
  1822.     return PLUGIN_HANDLED;
  1823. }
  1824.  
  1825. ActionDamage(id, ent)
  1826. {
  1827.     new Float:gametime = get_gametime();
  1828.     if ( !( gametime >= g_next_damage_time[id] )
  1829.     || get_user_health(id) <= 0
  1830.     || get_user_godmode(id) ) return PLUGIN_HANDLED;
  1831.  
  1832.     static property[5];
  1833.  
  1834.     GetProperty(ent, 1, property);
  1835.     fakedamage(id, "Damage Block", str_to_float(property), DMG_CRUSH);
  1836.  
  1837.     GetProperty(ent, 2, property);
  1838.     g_next_damage_time[id] = gametime + str_to_float(property);
  1839.  
  1840.     return PLUGIN_HANDLED;
  1841. }
  1842.  
  1843. ActionIceBhop(id, ent)
  1844. {
  1845.     if ( !g_ice[id] )
  1846.     {
  1847.         entity_set_float(id, EV_FL_friction, 0.15);
  1848.         entity_set_float(id, EV_FL_maxspeed, 400.0);
  1849.  
  1850.         g_ice[id] = true;
  1851.     }
  1852.  
  1853.     new task_id = TASK_ICE + id;
  1854.     if ( task_exists(task_id) ) remove_task(task_id);
  1855.  
  1856.     set_task(0.1, "TaskNotOnIce", task_id);
  1857.  
  1858.     if ( task_exists(TASK_SOLIDNOT + ent)
  1859.     || task_exists(TASK_SOLID + ent) ) return PLUGIN_HANDLED;
  1860.  
  1861.     set_task(0.1, "TaskSolidNot", TASK_SOLIDNOT + ent);
  1862.     return PLUGIN_HANDLED;
  1863. }
  1864.  
  1865.  
  1866. ActionHeal(id, ent)
  1867. {
  1868.     new Float:gametime = get_gametime();
  1869.     if ( !( gametime >= g_next_heal_time[id] ) ) return PLUGIN_HANDLED;
  1870.  
  1871.     new health = get_user_health(id);
  1872.     if ( health >= 100 ) return PLUGIN_HANDLED;
  1873.  
  1874.     static property[5];
  1875.  
  1876.     GetProperty(ent, 1, property);
  1877.     health += str_to_num(property);
  1878.     set_user_health(id, min(100, health));
  1879.  
  1880.     GetProperty(ent, 2, property);
  1881.     g_next_heal_time[id] = gametime + str_to_float(property);
  1882.  
  1883.     return PLUGIN_HANDLED;
  1884. }
  1885.  
  1886. ActionIce(id)
  1887. {
  1888.     if ( !g_ice[id] )
  1889.     {
  1890.         entity_set_float(id, EV_FL_friction, 0.15);
  1891.         entity_set_float(id, EV_FL_maxspeed, 400.0);
  1892.  
  1893.         g_ice[id] = true;
  1894.     }
  1895.  
  1896.     new task_id = TASK_ICE + id;
  1897.     if ( task_exists(task_id) ) remove_task(task_id);
  1898.  
  1899.     set_task(0.1, "TaskNotOnIce", task_id);
  1900. }
  1901.  
  1902. ActionTrampoline(id, ent)
  1903. {
  1904.     static property1[5];
  1905.     GetProperty(ent, 1, property1);
  1906.  
  1907.     entity_get_vector(id, EV_VEC_velocity, g_set_velocity[id]);
  1908.  
  1909.     g_set_velocity[id][2] = str_to_float(property1);
  1910.  
  1911.     entity_set_int(id, EV_INT_gaitsequence, 6);
  1912.  
  1913.     g_no_fall_damage[id] = true;
  1914. }
  1915.  
  1916. ActionSpeedBoost(id, ent)
  1917. {
  1918.     static property[5];
  1919.  
  1920.     GetProperty(ent, 1, property);
  1921.     velocity_by_aim(id, str_to_num(property), g_set_velocity[id]);
  1922.  
  1923.     GetProperty(ent, 2, property);
  1924.     g_set_velocity[id][2] = str_to_float(property);
  1925.  
  1926.     entity_set_int(id, EV_INT_gaitsequence, 6);
  1927. }
  1928.  
  1929. ActionLowGravity(id, ent)
  1930. {
  1931.     if (gbLowGravity[id]) return PLUGIN_HANDLED;
  1932.  
  1933.     static property1[5];
  1934.     GetProperty(ent, 1, property1);
  1935.  
  1936.     entity_set_float(id, EV_FL_gravity, str_to_float(property1) / 800);
  1937.  
  1938.     gbLowGravity[id] = true;
  1939.  
  1940.     return PLUGIN_HANDLED;
  1941. }
  1942.  
  1943. ActionHoney(id, ent)
  1944. {
  1945.     if ( g_honey[id] != ent)
  1946.     {
  1947.         static property1[5];
  1948.         GetProperty(ent, 1, property1);
  1949.  
  1950.         new Float:speed = str_to_float(property1);
  1951.         entity_set_float(id, EV_FL_maxspeed, speed == 0 ? 450.0 : speed);
  1952.         g_honey[id] = ent;
  1953.  
  1954.     }
  1955.  
  1956.     new task_id = TASK_HONEY + id;
  1957.     if ( task_exists(task_id) )
  1958.     {
  1959.         remove_task(task_id);
  1960.     }
  1961.     else
  1962.     {
  1963.         static Float:velocity[3];
  1964.         entity_get_vector(id, EV_VEC_velocity, velocity);
  1965.  
  1966.         velocity[0] /= 2.0;
  1967.         velocity[1] /= 2.0;
  1968.  
  1969.         entity_set_vector(id, EV_VEC_velocity, velocity);
  1970.     }
  1971.     set_task(0.1, "TaskNotInHoney", task_id);
  1972.     return PLUGIN_HANDLED;
  1973. }
  1974. ActionBarrier(id, ent, bool:block_terrorists)
  1975. {
  1976.     if ( task_exists(TASK_SOLIDNOT + ent)
  1977.     || task_exists(TASK_SOLID + ent) ) return PLUGIN_HANDLED;
  1978.  
  1979.     new CsTeams:team = block_terrorists ? CS_TEAM_T : CS_TEAM_CT;
  1980.     if ( cs_get_user_team(id) == team ) TaskSolidNot(TASK_SOLIDNOT + ent);
  1981.  
  1982.     return PLUGIN_HANDLED;
  1983. }
  1984.  
  1985. ActionDelayedBhop(ent)
  1986. {
  1987.     if ( task_exists(TASK_SOLIDNOT + ent)
  1988.     || task_exists(TASK_SOLID + ent) ) return PLUGIN_HANDLED;
  1989.  
  1990.     static property1[5];
  1991.     GetProperty(ent, 1, property1);
  1992.  
  1993.     set_task(str_to_float(property1), "TaskSolidNot", TASK_SOLIDNOT + ent);
  1994.  
  1995.     return PLUGIN_HANDLED;
  1996. }
  1997.  
  1998. ActionInvincibility(id, ent)
  1999. {
  2000.     new Float:gametime = get_gametime();
  2001.     if ( !( gametime >= g_invincibility_next_use[id] ) )
  2002.     {
  2003.         if ( !g_has_hud_text[id] )
  2004.         {
  2005.             set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2006.             show_hudmessage(id, "^nInvincibility^nNext Use %.1f",g_invincibility_next_use[id] - gametime);
  2007.         }
  2008.  
  2009.         return PLUGIN_HANDLED;
  2010.     }
  2011.  
  2012.     static property[5];
  2013.  
  2014.     entity_set_float(id, EV_FL_takedamage, DAMAGE_NO);
  2015.  
  2016.     if ( gametime >= g_stealth_time_out[id] )
  2017.     {
  2018.         set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 16);
  2019.     }
  2020.  
  2021.     emit_sound(id, CHAN_STATIC, g_sound_invincibility, 1.0, ATTN_NORM, 0, PITCH_NORM);
  2022.  
  2023.     static Float:time_out;
  2024.     GetProperty(ent, 1, property);
  2025.     time_out = str_to_float(property);
  2026.     set_task(time_out, "TaskRemoveInvincibility", TASK_INVINCIBLE + id, g_blank, 0, g_a, 1);
  2027.  
  2028.     GetProperty(ent, 2, property);
  2029.  
  2030.     g_invincibility_time_out[id] = gametime + time_out;
  2031.     g_invincibility_next_use[id] = gametime + time_out + str_to_float(property);
  2032.  
  2033.     return PLUGIN_HANDLED;
  2034. }
  2035.  
  2036. ActionStealth(id, ent)
  2037. {
  2038.     new Float:gametime = get_gametime();
  2039.     if ( !( gametime >= g_stealth_next_use[id] ) )
  2040.     {
  2041.         if ( !g_has_hud_text[id] )
  2042.         {
  2043.             set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2044.             show_hudmessage(id, "^nStealth^nNext Use %.1f", g_stealth_next_use[id] - gametime);
  2045.         }
  2046.  
  2047.         return PLUGIN_HANDLED;
  2048.     }
  2049.  
  2050.     static property[5];
  2051.  
  2052.     set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 0);
  2053.  
  2054.     emit_sound(id, CHAN_STATIC, g_sound_stealth, 1.0, ATTN_NORM, 0, PITCH_NORM);
  2055.  
  2056.     g_block_status[id] = true;
  2057.  
  2058.     static Float:time_out;
  2059.     GetProperty(ent, 1, property);
  2060.     time_out = str_to_float(property);
  2061.     set_task(time_out, "TaskRemoveStealth", TASK_STEALTH + id, g_blank, 0, g_a, 1);
  2062.     set_task(time_out + 1.0, "TaskRemoveStealth", TASK_STEALTH + id, g_blank, 0, g_a, 1);
  2063.  
  2064.     GetProperty(ent, 2, property);
  2065.  
  2066.     g_stealth_time_out[id] = gametime + time_out;
  2067.     g_stealth_next_use[id] = gametime + time_out + str_to_float(property);
  2068.  
  2069.     return PLUGIN_HANDLED;
  2070. }
  2071.  
  2072. ActionBootsOfSpeed(id, ent)
  2073. {
  2074.     new Float:gametime = get_gametime();
  2075.     if ( !( gametime >= g_boots_of_speed_next_use[id] ) )
  2076.     {
  2077.         if ( !g_has_hud_text[id] )
  2078.         {
  2079.             set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2080.             show_hudmessage(id, "^nBoots Of Speed^nNext Use %.1f", g_boots_of_speed_next_use[id] - gametime);
  2081.         }
  2082.  
  2083.         return PLUGIN_HANDLED;
  2084.     }
  2085.  
  2086.     static property[5];
  2087.  
  2088.     GetProperty(ent, 3, property);
  2089.     entity_set_float(id, EV_FL_maxspeed, str_to_float(property));
  2090.  
  2091.     g_boots_of_speed[id] = ent;
  2092.  
  2093.     emit_sound(id, CHAN_STATIC, g_sound_boots_of_speed, 1.0, ATTN_NORM, 0, PITCH_NORM);
  2094.  
  2095.     static Float:time_out;
  2096.     GetProperty(ent, 1, property);
  2097.     time_out = str_to_float(property);
  2098.     set_task(time_out, "TaskRemoveBootsOfSpeed", TASK_BOOTSOFSPEED + id, g_blank, 0, g_a, 1);
  2099.  
  2100.     GetProperty(ent, 2, property);
  2101.  
  2102.     g_boots_of_speed_time_out[id] = gametime + time_out;
  2103.     g_boots_of_speed_next_use[id] = gametime + time_out + str_to_float(property);
  2104.  
  2105.     return PLUGIN_HANDLED;
  2106. }
  2107.  
  2108. ActionDuck(id, ent)
  2109. {
  2110.     if (is_user_alive(id)) {
  2111.     static property[5];
  2112.     GetProperty(ent, 1, property);
  2113.     entity_set_int(id, EV_INT_bInDuck, 15);
  2114.     }
  2115. }
  2116.  
  2117. ActionMoney(id, ent)
  2118. {
  2119.     if(g_money_used[id])
  2120.     {
  2121.         static property[5];
  2122.         new AddValue, playerMoney;
  2123.         GetProperty(ent, 1, property);
  2124.         playerMoney = cs_get_user_money(id);
  2125.         AddValue = str_to_num(property) + playerMoney;
  2126.         cs_set_user_money(id, AddValue);
  2127.         g_money_used[id] = false;
  2128.         emit_sound(id, CHAN_STATIC, g_sound_money, 1.0, ATTN_NORM, 0, PITCH_NORM);
  2129.         SCM_Print(id, "You have been given %s $!", property);
  2130.     }
  2131.     else{
  2132.         set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2133.         show_hudmessage(id, "Next Use: Next Round");
  2134.     }
  2135.  
  2136.     if (is_user_alive(id) && get_user_team(id) == 2)
  2137.     {
  2138.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2139.     show_hudmessage(id, "This block is for Terrorists Only !");
  2140.     }
  2141. }
  2142.  
  2143. ActionAwp(id, ent)
  2144. {
  2145.     if(user_has_weapon(id, CSW_AWP))
  2146.         return PLUGIN_HANDLED;
  2147.  
  2148.     if (is_user_alive(id) && !AwpUsed[id] && get_user_team(id) == 1)
  2149.     {
  2150.     static property[5];
  2151.     GetProperty(ent, 1, property);
  2152.     give_item(id, "weapon_awp");
  2153.     cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_awp", id), str_to_num(property));
  2154.     AwpUsed[id] = true;
  2155.     new name[42];
  2156.     get_user_name(id, name, 32);
  2157.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2158.     show_hudmessage(0, "%s has picked up an Awp!", name);
  2159.     SCM_Print(0, "^1%s^3 has picked up an^4 Awp!", name);
  2160.     }
  2161.  
  2162.     else
  2163.     {
  2164.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2165.     show_hudmessage(id, "Next Use: Next Round");
  2166.  
  2167.     }
  2168.  
  2169.     if (is_user_alive(id) && get_user_team(id) == 2)
  2170.     {
  2171.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2172.     show_hudmessage(id, "This block is for Terrorists Only !");
  2173.     }
  2174.     return PLUGIN_HANDLED;
  2175. }
  2176.  
  2177. ActionDeagle(id, ent)
  2178. {
  2179.     if(user_has_weapon(id, CSW_DEAGLE))
  2180.         return PLUGIN_HANDLED;
  2181.    
  2182.     if (is_user_alive(id) && !DeagleUsed[id] && get_user_team(id) == 1)
  2183.     {
  2184.     static property[5];
  2185.     GetProperty(ent, 1, property);
  2186.     give_item(id, "weapon_deagle");
  2187.     cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_deagle", id), str_to_num(property));
  2188.     DeagleUsed[id] = true;
  2189.     new name[42];
  2190.     get_user_name(id, name, 32);
  2191.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2192.     show_hudmessage(0, "%s has picked up an Deagle!", name);
  2193.     SCM_Print(0, "^1%s^3 has picked up an^4 Deagle!", name);
  2194.     }
  2195.  
  2196.     else
  2197.     {
  2198.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2199.     show_hudmessage(id, "Next Use: Next Round");
  2200.     }
  2201.  
  2202.     if (is_user_alive(id) && get_user_team(id) == 2)
  2203.     {
  2204.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2205.     show_hudmessage(id, "This block is for Terrorists Only !");
  2206.     }
  2207.     return PLUGIN_HANDLED;
  2208. }
  2209.  
  2210. ActionHe(id, ent)
  2211. {
  2212.     if (HeUsed[id])
  2213.     {
  2214.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2215.     show_hudmessage(id, "Next Use: Next Round");
  2216.     }
  2217.     else if (user_has_weapon( id, CSW_HEGRENADE ))
  2218.     {
  2219.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2220.     show_hudmessage(id, "Use Your HE Grenade before you take another one ..");
  2221.     }
  2222.  
  2223.     else if (get_user_team(id) == 1 && !HeUsed[id] && !user_has_weapon( id, CSW_HEGRENADE ))
  2224.     {
  2225.         static property[5];
  2226.     GetProperty(ent, 1, property);
  2227.     give_item(id, "weapon_hegrenade");
  2228.     HeUsed[id] = true;
  2229.     }
  2230.  
  2231.     if (is_user_alive(id) && get_user_team(id) == 2)
  2232.     {
  2233.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2234.     show_hudmessage(id, "This block is for Terrorists Only !");
  2235.     }
  2236.     return PLUGIN_HANDLED;
  2237. }
  2238. ActionFlash(id, ent)
  2239. {
  2240.     if (FlashUsed[id])
  2241.     {
  2242.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2243.     show_hudmessage(id, "Next Use: Next Round");
  2244.     }
  2245.     else if (user_has_weapon( id, CSW_FLASHBANG ))
  2246.     {
  2247.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2248.     show_hudmessage(id, "Use Your Flashbang before you take another one ..");
  2249.     }
  2250.  
  2251.     if(cs_get_user_bpammo(id, CSW_FLASHBANG) < 2 && !FlashUsed[id] && get_user_team(id) == 1)
  2252.     {
  2253.         static property[5];
  2254.     GetProperty(ent, 1, property);
  2255.     give_item(id, "weapon_flashbang");
  2256.     FlashUsed[id] = true;
  2257.     }
  2258.  
  2259.     if (is_user_alive(id) && get_user_team(id) == 2)
  2260.     {
  2261.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2262.     show_hudmessage(id, "This block is for Terrorists Only !");
  2263.     }
  2264.     return PLUGIN_HANDLED;
  2265. }
  2266.  
  2267. ActionScout(id, ent)
  2268. {
  2269.     if (is_user_alive(id) && !ScoutUsed[id] && get_user_team(id) == 1)
  2270.     {
  2271.     static property[5];
  2272.     GetProperty(ent, 1, property);
  2273.     give_item(id, "weapon_scout");
  2274.     cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_scout", id), str_to_num(property));
  2275.     ScoutUsed[id] = true;
  2276.     new name[42];
  2277.     get_user_name(id, name, 32);
  2278.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2279.     show_hudmessage(0, "%s has picked up a Scout!", name);
  2280.     SCM_Print(0, "^1%s^3 has picked up a^4 Scout!", name);
  2281.     }
  2282.  
  2283.     else
  2284.     {
  2285.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2286.     show_hudmessage(id, "Next Use: Next Round");
  2287.  
  2288.     }
  2289.  
  2290.     if (is_user_alive(id) && get_user_team(id) == 2)
  2291.     {
  2292.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2293.     show_hudmessage(id, "This block is for Terrorists Only !");
  2294.     }
  2295.     return PLUGIN_HANDLED;
  2296. }
  2297.  
  2298. ActionGlock(id, ent)
  2299. {
  2300.     if (is_user_alive(id) && !GlockUsed[id] && get_user_team(id) == 1)
  2301.     {
  2302.     static property[5];
  2303.     GetProperty(ent, 1, property);
  2304.     give_item(id, "weapon_glock18");
  2305.     cs_set_weapon_ammo(find_ent_by_owner(3, "weapon_glock18", id), str_to_num(property));
  2306.     GlockUsed[id] = true;
  2307.     new name[42];
  2308.     get_user_name(id, name, 32);
  2309.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2310.     show_hudmessage(0, "%s has picked up a Glock!", name);
  2311.     SCM_Print(0, "^1%s^3 has picked up a^4 Glock!", name);
  2312.     }
  2313.  
  2314.     else
  2315.     {
  2316.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2317.     show_hudmessage(id, "Next Use: Next Round");
  2318.  
  2319.     }
  2320.  
  2321.     if (is_user_alive(id) && get_user_team(id) == 2)
  2322.     {
  2323.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2324.     show_hudmessage(id, "This block is for Terrorists Only !");
  2325.     }
  2326.     return PLUGIN_HANDLED;
  2327. }
  2328.  
  2329. ActionUSP(id, ent)
  2330. {
  2331.     if (is_user_alive(id) && !USPUsed[id] && get_user_team(id) == 1)
  2332.     {
  2333.     static property[5];
  2334.     GetProperty(ent, 1, property);
  2335.     give_item(id, "weapon_usp");
  2336.     cs_set_weapon_ammo(find_ent_by_owner(3, "weapon_usp", id), str_to_num(property));
  2337.     USPUsed[id] = true;
  2338.     new name[42];
  2339.     get_user_name(id, name, 32);
  2340.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2341.     show_hudmessage(0, "%s has picked up an USP!", name);
  2342.     SCM_Print(0, "^1%s^3 has picked up an^4 USP!", name);
  2343.     }
  2344.  
  2345.     else
  2346.     {
  2347.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2348.     show_hudmessage(id, "Next Use: Next Round");
  2349.  
  2350.     }
  2351.  
  2352.     if (is_user_alive(id) && get_user_team(id) == 2)
  2353.     {
  2354.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2355.     show_hudmessage(id, "This block is for Terrorists Only !");
  2356.     }
  2357.     return PLUGIN_HANDLED;
  2358. }
  2359.  
  2360. ActionM4A1(id, ent)
  2361. {
  2362.     if (is_user_alive(id) && !M4A1Used[id] && get_user_team(id) == 1)
  2363.     {
  2364.     static property[5];
  2365.     GetProperty(ent, 1, property);
  2366.     give_item(id, "weapon_m4a1");
  2367.     cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_m4a1", id), str_to_num(property));
  2368.     M4A1Used[id] = true;
  2369.     new name[42];
  2370.     get_user_name(id, name, 32);
  2371.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2372.     show_hudmessage(0, "%s has picked up a M4A1!", name);
  2373.     SCM_Print(0, "^1%s^3 has picked up a^4 M4A1!", name);
  2374.     }
  2375.  
  2376.     else
  2377.     {
  2378.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2379.     show_hudmessage(id, "Next Use: Next Round");
  2380.  
  2381.     }
  2382.  
  2383.     if (is_user_alive(id) && get_user_team(id) == 2)
  2384.     {
  2385.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2386.     show_hudmessage(id, "This block is for Terrorists Only !");
  2387.     }
  2388.     return PLUGIN_HANDLED;
  2389. }
  2390.  
  2391. ActionM3(id, ent)
  2392. {
  2393.     if (is_user_alive(id) && !M3Used[id] && get_user_team(id) == 1)
  2394.     {
  2395.     static property[5];
  2396.     GetProperty(ent, 1, property);
  2397.     give_item(id, "weapon_m3");
  2398.     cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_m3", id), str_to_num(property));
  2399.     M3Used[id] = true;
  2400.     new name[42];
  2401.     get_user_name(id, name, 32);
  2402.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2403.     show_hudmessage(0, "%s has picked up a M3!", name);
  2404.     SCM_Print(0, "^1%s^3 has picked up a^4 M3!", name);
  2405.     }
  2406.  
  2407.     else
  2408.     {
  2409.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2410.     show_hudmessage(id, "Next Use: Next Round");
  2411.  
  2412.     }
  2413.  
  2414.     if (is_user_alive(id) && get_user_team(id) == 2)
  2415.     {
  2416.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2417.     show_hudmessage(id, "This block is for Terrorists Only !");
  2418.     }
  2419.     return PLUGIN_HANDLED;
  2420. }
  2421.  
  2422. ActionBlind(id)
  2423. {
  2424.     message_begin(MSG_ONE, gmsgScreenFade, {0,0,0}, id);
  2425.     write_short(4096*1);    // Duration
  2426.     write_short(4096*1);    // Hold time
  2427.     write_short(4096);    // Fade type
  2428.     write_byte(0);        // Red
  2429.     write_byte(0);        // Green
  2430.     write_byte(0);        // Blue
  2431.     write_byte(255);    // Alpha
  2432.     message_end();
  2433. }
  2434.  
  2435. ActionP90(id, ent)
  2436. {
  2437.     if (is_user_alive(id) && !P90Used[id] && get_user_team(id) == 1)
  2438.     {
  2439.     static property[5];
  2440.     GetProperty(ent, 1, property);
  2441.     give_item(id, "weapon_p90");
  2442.     cs_set_weapon_ammo(find_ent_by_owner(3, "weapon_p90", id), str_to_num(property));
  2443.     P90Used[id] = true;
  2444.     new name[42];
  2445.     get_user_name(id, name, 32);
  2446.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2447.     show_hudmessage(0, "%s has picked up a P90!", name);
  2448.     SCM_Print(0, "^1%s^3 has picked up a^4 P90!", name);
  2449.     }
  2450.  
  2451.     else
  2452.     {
  2453.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2454.     show_hudmessage(id, "Next Use: Next Round");
  2455.  
  2456.     }
  2457.  
  2458.     if (is_user_alive(id) && get_user_team(id) == 2)
  2459.     {
  2460.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2461.     show_hudmessage(id, "This block is for Terrorists Only !");
  2462.     }
  2463.     return PLUGIN_HANDLED;
  2464. }
  2465.  
  2466. ActionGalil(id, ent)
  2467. {
  2468.     if (is_user_alive(id) && !GalilUsed[id] && get_user_team(id) == 1)
  2469.     {
  2470.     static property[5];
  2471.     GetProperty(ent, 1, property);
  2472.     give_item(id, "weapon_galil");
  2473.     cs_set_weapon_ammo(find_ent_by_owner(3, "weapon_galil", id), str_to_num(property));
  2474.     GalilUsed[id] = true;
  2475.     new name[42];
  2476.     get_user_name(id, name, 32);
  2477.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2478.     show_hudmessage(0, "%s has picked up a Galil!", name);
  2479.     SCM_Print(0, "^1%s^3 has picked up a^4 Galil!", name);
  2480.     }
  2481.  
  2482.     else
  2483.     {
  2484.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2485.     show_hudmessage(id, "Next Use: Next Round");
  2486.  
  2487.     }
  2488.  
  2489.     if (is_user_alive(id) && get_user_team(id) == 2)
  2490.     {
  2491.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2492.     show_hudmessage(id, "This block is for Terrorists Only !");
  2493.     }
  2494.     return PLUGIN_HANDLED;
  2495. }
  2496.  
  2497. ActionFamas(id, ent)
  2498. {
  2499.     if (is_user_alive(id) && !FamasUsed[id] && get_user_team(id) == 1)
  2500.     {
  2501.     static property[5];
  2502.     GetProperty(ent, 1, property);
  2503.     give_item(id, "weapon_famas");
  2504.     cs_set_weapon_ammo(find_ent_by_owner(3, "weapon_famas", id), str_to_num(property));
  2505.     FamasUsed[id] = true;
  2506.     new name[42];
  2507.     get_user_name(id, name, 32);
  2508.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2509.     show_hudmessage(0, "%s has picked up a Famas!", name);
  2510.     SCM_Print(0, "^1%s^3 has picked up a^4 Famas!", name);
  2511.     }
  2512.  
  2513.     else
  2514.     {
  2515.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2516.     show_hudmessage(id, "Next Use: Next Round");
  2517.  
  2518.     }
  2519.  
  2520.     if (is_user_alive(id) && get_user_team(id) == 2)
  2521.     {
  2522.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2523.     show_hudmessage(id, "This block is for Terrorists Only !");
  2524.     }
  2525.     return PLUGIN_HANDLED;
  2526. }
  2527.  
  2528. ActionAK47(id, ent)
  2529. {
  2530.     if (is_user_alive(id) && !AK47Used[id] && get_user_team(id) == 1)
  2531.     {
  2532.     static property[5];
  2533.     GetProperty(ent, 1, property);
  2534.     give_item(id, "weapon_ak47");
  2535.     cs_set_weapon_ammo(find_ent_by_owner(3, "weapon_ak47", id), str_to_num(property));
  2536.     AK47Used[id] = true;
  2537.     new name[42];
  2538.     get_user_name(id, name, 32);
  2539.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2540.     show_hudmessage(0, "%s has picked up a AK47!", name);
  2541.     SCM_Print(0, "^1%s^3 has picked up a^4 AK47!", name);
  2542.     }
  2543.  
  2544.     else
  2545.     {
  2546.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2547.     show_hudmessage(id, "Next Use: Next Round");
  2548.  
  2549.     }
  2550.  
  2551.     if (is_user_alive(id) && get_user_team(id) == 2)
  2552.     {
  2553.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2554.     show_hudmessage(id, "This block is for Terrorists Only !");
  2555.     }
  2556.     return PLUGIN_HANDLED;
  2557. }
  2558.  
  2559. ActionAUG(id, ent)
  2560. {
  2561.     if (is_user_alive(id) && !AUGUsed[id] && get_user_team(id) == 1)
  2562.     {
  2563.     static property[5];
  2564.     GetProperty(ent, 1, property);
  2565.     give_item(id, "weapon_aug");
  2566.     cs_set_weapon_ammo(find_ent_by_owner(3, "weapon_aug", id), str_to_num(property));
  2567.     AUGUsed[id] = true;
  2568.     new name[42];
  2569.     get_user_name(id, name, 32);
  2570.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2571.     show_hudmessage(0, "%s has picked up a AUG!", name);
  2572.     SCM_Print(0, "^1%s^3 has picked up a^4 AUG!", name);
  2573.     }
  2574.  
  2575.     else
  2576.     {
  2577.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2578.     show_hudmessage(id, "Next Use: Next Round");
  2579.  
  2580.     }
  2581.  
  2582.     if (is_user_alive(id) && get_user_team(id) == 2)
  2583.     {
  2584.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2585.     show_hudmessage(id, "This block is for Terrorists Only !");
  2586.     }
  2587.     return PLUGIN_HANDLED;
  2588. }
  2589.  
  2590. ActionSG552(id, ent)
  2591. {
  2592.     if (is_user_alive(id) && !SG552Used[id] && get_user_team(id) == 1)
  2593.     {
  2594.     static property[5];
  2595.     GetProperty(ent, 1, property);
  2596.     give_item(id, "weapon_sg552");
  2597.     cs_set_weapon_ammo(find_ent_by_owner(3, "weapon_sg552", id), str_to_num(property));
  2598.     SG552Used[id] = true;
  2599.     new name[42];
  2600.     get_user_name(id, name, 32);
  2601.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2602.     show_hudmessage(0, "%s has picked up a SG552!", name);
  2603.     SCM_Print(0, "^1%s^3 has picked up a^4 SG552!", name);
  2604.     }
  2605.  
  2606.     else
  2607.     {
  2608.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2609.     show_hudmessage(id, "Next Use: Next Round");
  2610.  
  2611.     }
  2612.  
  2613.     if (is_user_alive(id) && get_user_team(id) == 2)
  2614.     {
  2615.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2616.     show_hudmessage(id, "This block is for Terrorists Only !");
  2617.     }
  2618.     return PLUGIN_HANDLED;
  2619. }
  2620.  
  2621. ActionSG550(id, ent)
  2622. {
  2623.     if (is_user_alive(id) && !SG550Used[id] && get_user_team(id) == 1)
  2624.     {
  2625.     static property[5];
  2626.     GetProperty(ent, 1, property);
  2627.     give_item(id, "weapon_sg550");
  2628.     cs_set_weapon_ammo(find_ent_by_owner(2, "weapon_sg550", id), str_to_num(property));
  2629.     SG550Used[id] = true;
  2630.     new name[42];
  2631.     get_user_name(id, name, 32);
  2632.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2633.     show_hudmessage(0, "%s has picked up a SG550!", name);
  2634.     SCM_Print(0, "^1%s^3 has picked up a^4 SG550!", name);
  2635.     }
  2636.  
  2637.     else
  2638.     {
  2639.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2640.     show_hudmessage(id, "Next Use: Next Round");
  2641.  
  2642.     }
  2643.  
  2644.     if (is_user_alive(id) && get_user_team(id) == 2)
  2645.     {
  2646.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2647.     show_hudmessage(id, "This block is for Terrorists Only !");
  2648.     }
  2649.     return PLUGIN_HANDLED;
  2650. }
  2651.  
  2652. ActionVestHelm(id, ent)
  2653. {
  2654.     if (is_user_alive(id) && !VestHelmUsed[id] && get_user_team(id) == 1)
  2655.     {
  2656.     static property[5];
  2657.     GetProperty(ent, 1, property);
  2658.     give_item(id, "item_vesthelm");
  2659.     VestHelmUsed[id] = true;
  2660.     new name[42];
  2661.     get_user_name(id, name, 32);
  2662.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2663.     show_hudmessage(0, "%s has picked up a Vest+Helm!", name);
  2664.     SCM_Print(0, "^1%s^3 has picked up a^4 Vest+Helm!", name);
  2665.     }
  2666.  
  2667.     else
  2668.     {
  2669.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2670.     show_hudmessage(id, "Next Use: Next Round");
  2671.  
  2672.     }
  2673.  
  2674.     if (is_user_alive(id) && get_user_team(id) == 2)
  2675.     {
  2676.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2677.     show_hudmessage(id, "This block is for Terrorists Only !");
  2678.     }
  2679.     return PLUGIN_HANDLED;
  2680. }
  2681.  
  2682. ActionSmoke(id, ent)
  2683. {
  2684.     if (SmokeUsed[id])
  2685.     {
  2686.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2687.     show_hudmessage(id, "Next Use: Next Round");
  2688.     }
  2689.     else if (user_has_weapon( id, CSW_SMOKEGRENADE ))
  2690.     {
  2691.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2692.     show_hudmessage(id, "Use Your Frostnade before you take another one ..");
  2693.     }
  2694.  
  2695.     else if (get_user_team(id) == 1 && !SmokeUsed[id] && !user_has_weapon( id, CSW_SMOKEGRENADE ))
  2696.     {
  2697.         static property[5];
  2698.     GetProperty(ent, 1, property);
  2699.     give_item(id, "weapon_smokegrenade");
  2700.     SmokeUsed[id] = true;
  2701.     }
  2702.  
  2703.     if (is_user_alive(id) && get_user_team(id) == 2)
  2704.     {
  2705.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2706.     show_hudmessage(id, "This block is for Terrorists Only !");
  2707.     }
  2708.     return PLUGIN_HANDLED;
  2709. }
  2710.  
  2711. ActionXp(id, ent)
  2712. {
  2713.     new Float:gametime = get_gametime();
  2714.     if ( !( gametime >= g_next_xp_time[id] ) )
  2715.     {
  2716.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2717.     show_hudmessage(id, "Xp Block^nNext Use: %.1f", g_next_xp_time[id] - gametime);
  2718.  
  2719.     return PLUGIN_HANDLED;
  2720.     }
  2721.  
  2722.     static property[5];
  2723.     GetProperty(ent, 1, property);
  2724.  
  2725.     if (cs_get_user_team(id) == CS_TEAM_CT)
  2726.     {
  2727.     set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2728.     show_hudmessage(id, "This Block is for Terrorists Only");
  2729.     }
  2730.  
  2731.     if (cs_get_user_team(id) == CS_TEAM_T && !XpUsed[id])
  2732.     {
  2733.     new xp = str_to_num(property);
  2734.     hnsxp_add_user_xp( id, xp );
  2735.     SCM_Print(id, "^3 Youve Gaind^4 %s^3 Xp", property);
  2736.     }
  2737.  
  2738.     GetProperty(ent, 2, property);
  2739.     g_next_xp_time[id] = gametime + str_to_float(property);
  2740.  
  2741.     return PLUGIN_HANDLED;
  2742. }
  2743.  
  2744. ActionCam(id, ent)
  2745. {
  2746.     new Float:gametime = get_gametime();
  2747.     if ( !( gametime >= g_cam_next_use[id] ) )
  2748.     {
  2749.         if ( !g_has_hud_text[id] )
  2750.         {
  2751.             set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2752.             show_hudmessage(id, "^nCamouflage^nNext Use %.1f", g_cam_next_use[id] - gametime);
  2753.         }
  2754.  
  2755.         return PLUGIN_HANDLED;
  2756.     }
  2757.  
  2758.     static property[5];
  2759.    
  2760.     new team;
  2761.     team = get_user_team(id);
  2762.     if (team == 1)
  2763.     {
  2764.         cs_set_user_model(id, "gsg9");
  2765.     }
  2766.     else
  2767.     {
  2768.         cs_set_user_model(id, "leet");
  2769.     }
  2770.  
  2771.     emit_sound(id, CHAN_STATIC, g_sound_cam, 1.0, ATTN_NORM, 0, PITCH_NORM);
  2772.  
  2773.     g_block_status[id] = true;
  2774.  
  2775.     static Float:time_out;
  2776.     GetProperty(ent, 1, property);
  2777.     time_out = str_to_float(property);
  2778.     set_task(time_out, "TaskRemoveCam", TASK_CAM + id, g_blank, 0, g_a, 1);
  2779.  
  2780.     GetProperty(ent, 2, property);
  2781.  
  2782.     g_cam_time_out[id] = gametime + time_out;
  2783.     g_cam_next_use[id] = gametime + time_out + str_to_float(property);
  2784.  
  2785.     return PLUGIN_HANDLED;
  2786. }
  2787.  
  2788. ActionSuper(id, ent)
  2789. {
  2790.     new Float:gametime = get_gametime();
  2791.     if ( !( gametime >= g_super_next_use[id] ) )
  2792.     {
  2793.         if ( !g_has_hud_text[id] )
  2794.         {
  2795.             set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
  2796.             show_hudmessage(id, "^nSuper Man^nNext Use %.1f", g_super_next_use[id] - gametime);
  2797.         }
  2798.  
  2799.         return PLUGIN_HANDLED;
  2800.     }
  2801.  
  2802.     static property[5];
  2803.  
  2804.     GetProperty(ent, 3, property);
  2805.     entity_set_float(id, EV_FL_gravity, str_to_float(property) / 800);
  2806.  
  2807.     g_boots_of_speed[id] = ent;
  2808.  
  2809.     static Float:time_out;
  2810.     GetProperty(ent, 1, property);
  2811.     time_out = str_to_float(property);
  2812.     set_task(time_out, "TaskRemoveSuper", TASK_SUPER + id, g_blank, 0, g_a, 1);
  2813.  
  2814.     GetProperty(ent, 2, property);
  2815.  
  2816.     g_super_time_out[id] = gametime + time_out;
  2817.     g_super_next_use[id] = gametime + time_out + str_to_float(property);
  2818.  
  2819.     return PLUGIN_HANDLED;
  2820. }
  2821.  
  2822. ActionMagic(id, ent)
  2823. {
  2824.     new szProperty[5], Float:vVelocity[3];
  2825.     GetProperty(ent, 1, szProperty);
  2826.  
  2827.     pev(id, pev_velocity, vVelocity);
  2828.     vVelocity[2] = 0.0;
  2829.     set_pev(ent, pev_velocity, vVelocity);
  2830.  
  2831.     static Float:time_out2;
  2832.     static property[20];
  2833.     GetProperty(ent, 1, property);
  2834.     time_out2 = str_to_float(property);
  2835.     set_task(time_out2, "remove_magic");
  2836.  
  2837.     return PLUGIN_HANDLED;
  2838. }
  2839.  
  2840. ActionTeleport(id, ent)
  2841. {
  2842.     //get end entity id
  2843.     new tele = entity_get_int(ent, EV_INT_iuser1);
  2844.    
  2845.     //if teleport end id is valid
  2846.     if (tele)
  2847.         {
  2848.         //get end entity origin
  2849.         new Float:vTele[3];
  2850.         entity_get_vector(tele, EV_VEC_origin, vTele);
  2851.        
  2852.         //if id of entity being teleported is a player and telefrags CVAR is set then kill any nearby players
  2853.         if ((id > 0 && id <= 32) && get_cvar_num("bm_telefrags") > 0)
  2854.             {
  2855.             new player = -1;
  2856.            
  2857.             do
  2858.             {
  2859.                 player = find_ent_in_sphere(player, vTele, 16.0);
  2860.                
  2861.                 //if entity found is a player
  2862.                 if (player > 0 && player <= 32)
  2863.                     {
  2864.                     //if player is alive, and is not the player that went through the teleport
  2865.                     if (is_user_alive(player) && player != id)
  2866.                         {
  2867.                         //kill the player
  2868.                         user_kill(player, 1);
  2869.                     }
  2870.                 }
  2871.             }while(player);
  2872.         }
  2873.        
  2874.         //get origin of the start of the teleport
  2875.         new Float:vOrigin[3];
  2876.         new origin[3];
  2877.         entity_get_vector(ent, EV_VEC_origin, vOrigin);
  2878.         FVecIVec(vOrigin, origin);
  2879.        
  2880.         //show some teleporting effects
  2881.         message_begin(MSG_PVS, SVC_TEMPENTITY, origin);
  2882.         write_byte(TE_IMPLOSION);
  2883.         write_coord(origin[0]);
  2884.         write_coord(origin[1]);
  2885.         write_coord(origin[2]);
  2886.         write_byte(64);        // radius
  2887.         write_byte(100);    // count
  2888.         write_byte(6);        // life
  2889.         message_end();
  2890.        
  2891.         //teleport player
  2892.         entity_set_vector(id, EV_VEC_origin, vTele);
  2893.        
  2894.         //reverse players Z velocity
  2895.         new Float:vVelocity[3];
  2896.         entity_get_vector(id, EV_VEC_velocity, vVelocity);
  2897.         vVelocity[2] = floatabs(vVelocity[2]);
  2898.         entity_set_vector(id, EV_VEC_velocity, vVelocity);
  2899.         emit_sound(id, CHAN_STATIC, g_sound_teleport, 1.0, ATTN_NORM, 0, PITCH_NORM);
  2900.     }
  2901. }
  2902.  
  2903. public TaskSolidNot(ent)
  2904. {
  2905.     ent -= TASK_SOLIDNOT;
  2906.  
  2907.     if ( !is_valid_ent(ent)
  2908.     || entity_get_int(ent, EV_INT_iuser2) ) return PLUGIN_HANDLED;
  2909.  
  2910.     entity_set_int(ent, EV_INT_solid, SOLID_NOT);
  2911.     set_rendering(ent, kRenderFxNone, 255, 255, 255, kRenderTransAdd, 25);
  2912.     set_task(1.0, "TaskSolid", TASK_SOLID + ent);
  2913.  
  2914.     return PLUGIN_HANDLED;
  2915. }
  2916.  
  2917. public TaskSolid(ent)
  2918. {
  2919.     ent -= TASK_SOLID;
  2920.  
  2921.     if ( !IsBlock(ent) ) return PLUGIN_HANDLED;
  2922.  
  2923.     entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
  2924.  
  2925.     if ( entity_get_int(ent, EV_INT_iuser1) > 0 )
  2926.     {
  2927.         GroupBlock(0, ent);
  2928.     }
  2929.     else
  2930.     {
  2931.         static property3[5];
  2932.         GetProperty(ent, 3, property3);
  2933.  
  2934.         new transparency = str_to_num(property3);
  2935.         if ( !transparency
  2936.         || transparency == 255 )
  2937.         {
  2938.             new block_type = entity_get_int(ent, EV_INT_body);
  2939.             SetBlockRendering(ent, g_render[block_type], g_red[block_type], g_green[block_type], g_blue[block_type], g_alpha[block_type]);
  2940.         }
  2941.         else
  2942.         {
  2943.             SetBlockRendering(ent, TRANSALPHA, 255, 255, 255, transparency);
  2944.         }
  2945.     }
  2946.  
  2947.     return PLUGIN_HANDLED;
  2948. }
  2949.  
  2950. public TaskNotOnIce(id)
  2951. {
  2952.     id -= TASK_ICE;
  2953.  
  2954.     g_ice[id] = false;
  2955.  
  2956.     if ( !g_alive[id] ) return PLUGIN_HANDLED;
  2957.  
  2958.     if ( g_boots_of_speed[id] )
  2959.     {
  2960.         static block, property3[5];
  2961.         block = g_boots_of_speed[id];
  2962.         GetProperty(block, 3, property3);
  2963.  
  2964.         entity_set_float(id, EV_FL_maxspeed, str_to_float(property3));
  2965.     }
  2966.     else
  2967.     {
  2968.         ResetMaxspeed(id);
  2969.     }
  2970.  
  2971.     entity_set_float(id, EV_FL_friction, 1.0);
  2972.  
  2973.     return PLUGIN_HANDLED;
  2974. }
  2975.  
  2976. public TaskNotInHoney(id)
  2977. {
  2978.     id -= TASK_HONEY;
  2979.  
  2980.     g_honey[id] = 0;
  2981.  
  2982.     if ( !g_alive[id] ) return PLUGIN_HANDLED;
  2983.  
  2984.     if ( g_boots_of_speed[id] )
  2985.     {
  2986.         static block, property3[5];
  2987.         block = g_boots_of_speed[id];
  2988.         GetProperty(block, 3, property3);
  2989.  
  2990.         entity_set_float(id, EV_FL_maxspeed, str_to_float(property3));
  2991.     }
  2992.     else
  2993.     {
  2994.         ResetMaxspeed(id);
  2995.     }
  2996.  
  2997.     return PLUGIN_HANDLED;
  2998. }
  2999.  
  3000. public TaskRemoveCam(id)
  3001. {
  3002.     id -= TASK_CAM;
  3003.  
  3004.     if ( g_connected[id] )
  3005.     {
  3006.         cs_reset_user_model(id);
  3007.     }
  3008. }
  3009.  
  3010. public TaskRemoveInvincibility(id)
  3011. {
  3012.     id -= TASK_INVINCIBLE;
  3013.  
  3014.     if ( !g_alive[id] ) return PLUGIN_HANDLED;
  3015.  
  3016.     if ( ( g_admin[id] || g_gived_access[id] ) && !g_godmode[id]
  3017.     || ( !g_admin[id] && !g_gived_access[id] ) && !g_all_godmode )
  3018.     {
  3019.         set_user_godmode(id, 0);
  3020.     }
  3021.  
  3022.     if ( get_gametime() >= g_stealth_time_out[id] )
  3023.     {
  3024.         set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 16);
  3025.     }
  3026.  
  3027.     return PLUGIN_HANDLED;
  3028. }
  3029.  
  3030. public TaskRemoveStealth(id)
  3031. {
  3032.     id -= TASK_STEALTH;
  3033.  
  3034.     if ( g_connected[id] )
  3035.     {
  3036.         if ( get_gametime() <= g_stealth_time_out[id] )
  3037.         {
  3038.             set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderTransColor, 16);
  3039.         }
  3040.         else
  3041.         {
  3042.             set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 255);
  3043.         }
  3044.     }
  3045.     g_block_status[id] = false;
  3046. }
  3047.  
  3048. public TaskRemoveBootsOfSpeed(id)
  3049. {
  3050.     id -= TASK_BOOTSOFSPEED;
  3051.  
  3052.     g_boots_of_speed[id] = 0;
  3053.  
  3054.     if ( !g_alive[id] ) return PLUGIN_HANDLED;
  3055.  
  3056.     if ( g_ice[id] )
  3057.     {
  3058.         entity_set_float(id, EV_FL_maxspeed, 400.0);
  3059.     }
  3060.     else if ( g_honey[id] )
  3061.     {
  3062.         static block, property1[5];
  3063.         block = g_honey[id];
  3064.         GetProperty(block, 1, property1);
  3065.  
  3066.         entity_set_float(id, EV_FL_maxspeed, str_to_float(property1));
  3067.     }
  3068.     else
  3069.     {
  3070.         ResetMaxspeed(id);
  3071.     }
  3072.  
  3073.     return PLUGIN_HANDLED;
  3074. }
  3075.  
  3076. public TaskRemoveSuper(id)
  3077. {
  3078.     id -= TASK_SUPER;
  3079.  
  3080.     if ( g_connected[id] )
  3081.     {
  3082.         if ( get_gametime() <= g_super_time_out[id] )
  3083.         {
  3084.             entity_set_float(id, EV_FL_gravity, 800.0 / 800.0);
  3085.         }
  3086.         else
  3087.         {
  3088.             static property[5];
  3089.             new ent;
  3090.             GetProperty(ent, 3, property);
  3091.             entity_set_float(id, EV_FL_gravity, str_to_float(property) / 800);
  3092.         }
  3093.     }
  3094. }
  3095.  
  3096. public TaskSpriteNextFrame(params[])
  3097. {
  3098.     new ent = params[0];
  3099.     if ( !is_valid_ent(ent) )
  3100.     {
  3101.         remove_task(TASK_SPRITE + ent);
  3102.         return PLUGIN_HANDLED;
  3103.     }
  3104.  
  3105.     new frames = params[1];
  3106.     new Float:current_frame = entity_get_float(ent, EV_FL_frame);
  3107.  
  3108.     if ( current_frame < 0.0
  3109.     || current_frame >= frames )
  3110.     {
  3111.         entity_set_float(ent, EV_FL_frame, 1.0);
  3112.     }
  3113.     else
  3114.     {
  3115.         entity_set_float(ent, EV_FL_frame, current_frame + 1.0);
  3116.     }
  3117.  
  3118.     return PLUGIN_HANDLED;
  3119. }
  3120.  
  3121. public remove_magic( id )
  3122. {
  3123.     new iEnt, Float:fOrigin[3];
  3124.     while( (iEnt = find_ent_by_class(iEnt, g_block_classname)) )
  3125.     {
  3126.         new blockType = pev(iEnt, pev_body);
  3127.  
  3128.         if( blockType == MAGIC )
  3129.         {
  3130.             pev(iEnt, pev_v_angle, fOrigin);
  3131.             set_pev(iEnt, pev_velocity, Float:{0.0, 0.0, 0.0});
  3132.             engfunc(EngFunc_SetOrigin, iEnt, fOrigin);
  3133.         }
  3134.     }
  3135. }
  3136.  
  3137. public MsgStatusValue()
  3138. {
  3139.     if ( get_msg_arg_int(1) == 2
  3140.     && g_block_status[get_msg_arg_int(2)] )
  3141.     {
  3142.         set_msg_arg_int(1, get_msg_argtype(1), 1);
  3143.         set_msg_arg_int(2, get_msg_argtype(2), 0);
  3144.     }
  3145. }
  3146.  
  3147. public CmdAttack(id)
  3148. {
  3149.     if ( !IsBlock(g_grabbed[id]) ) return PLUGIN_HANDLED;
  3150.  
  3151.     if ( IsBlockInGroup(id, g_grabbed[id]) && g_group_count[id] > 1 )
  3152.     {
  3153.         static block;
  3154.         for ( new i = 0; i <= g_group_count[id]; ++i )
  3155.         {
  3156.             block = g_grouped_blocks[id][i];
  3157.             if ( !IsBlockInGroup(id, block) ) continue;
  3158.  
  3159.             if ( !IsBlockStuck(block) )
  3160.             {
  3161.                 CopyBlock(id, block);
  3162.             }
  3163.         }
  3164.     }
  3165.     else
  3166.     {
  3167.         if ( IsBlockStuck(g_grabbed[id]) )
  3168.         {
  3169.             SCM_Print(id, "You cannot copy a block that is in a stuck position!");
  3170.             return PLUGIN_HANDLED;
  3171.         }
  3172.  
  3173.         new new_block = CopyBlock(id, g_grabbed[id]);
  3174.         if ( !new_block ) return PLUGIN_HANDLED;
  3175.  
  3176.         entity_set_int(g_grabbed[id], EV_INT_iuser2, 0);
  3177.         entity_set_int(new_block, EV_INT_iuser2, id);
  3178.         g_grabbed[id] = new_block;
  3179.     }
  3180.  
  3181.     return PLUGIN_HANDLED;
  3182. }
  3183.  
  3184. public CmdAttack2(id)
  3185. {
  3186.     if ( !IsBlock(g_grabbed[id]) )
  3187.     {
  3188.         DeleteTeleport(id, g_grabbed[id]);
  3189.         return PLUGIN_HANDLED;
  3190.     }
  3191.  
  3192.     if ( !IsBlockInGroup(id, g_grabbed[id])
  3193.     || g_group_count[id] < 2 )
  3194.     {
  3195.         DeleteBlock(g_grabbed[id]);
  3196.         return PLUGIN_HANDLED;
  3197.     }
  3198.  
  3199.     static block;
  3200.     for ( new i = 0; i <= g_group_count[id]; ++i )
  3201.     {
  3202.         block = g_grouped_blocks[id][i];
  3203.         if ( !is_valid_ent(block)
  3204.         || !IsBlockInGroup(id, block) ) continue;
  3205.  
  3206.         DeleteBlock(block);
  3207.     }
  3208.  
  3209.     return PLUGIN_HANDLED;
  3210. }
  3211.  
  3212. public CmdRotate(id)
  3213. {
  3214.     if ( !IsBlock(g_grabbed[id]) ) return PLUGIN_HANDLED;
  3215.  
  3216.     if ( !IsBlockInGroup(id, g_grabbed[id])
  3217.     || g_group_count[id] < 2 )
  3218.     {
  3219.         RotateBlock(g_grabbed[id]);
  3220.         return PLUGIN_HANDLED;
  3221.     }
  3222.  
  3223.     static block;
  3224.     for ( new i = 0; i <= g_group_count[id]; ++i )
  3225.     {
  3226.         block = g_grouped_blocks[id][i];
  3227.         if ( !is_valid_ent(block)
  3228.         || !IsBlockInGroup(id, block) ) continue;
  3229.  
  3230.         RotateBlock(block);
  3231.     }
  3232.  
  3233.     return PLUGIN_HANDLED;
  3234. }
  3235.  
  3236. public CmdGrab(id)
  3237. {
  3238.     if ( !g_admin[id] && !g_gived_access[id] )
  3239.     {
  3240.         console_print(id, "You have no access to that command");
  3241.         return PLUGIN_HANDLED;
  3242.     }
  3243.  
  3244.     static ent, body;
  3245.     g_grab_length[id] = get_user_aiming(id, ent, body);
  3246.  
  3247.     new bool:is_block = IsBlock(ent);
  3248.  
  3249.     if ( !is_block && !IsTeleport(ent) && !IsLight(ent) ) return PLUGIN_HANDLED;
  3250.  
  3251.     new grabber = entity_get_int(ent, EV_INT_iuser2);
  3252.     if ( grabber && grabber != id ) return PLUGIN_HANDLED;
  3253.  
  3254.     if ( !is_block )
  3255.     {
  3256.         SetGrabbed(id, ent);
  3257.         return PLUGIN_HANDLED;
  3258.     }
  3259.  
  3260.     new player = entity_get_int(ent, EV_INT_iuser1);
  3261.     if ( player && player != id )
  3262.     {
  3263.         new player_name[32];
  3264.         get_user_name(player, player_name, charsmax(player_name));
  3265.  
  3266.         SCM_Print(id, "^1%s3 currently has this block in their group!", player_name);
  3267.         return PLUGIN_HANDLED;
  3268.     }
  3269.  
  3270.     SetGrabbed(id, ent);
  3271.  
  3272.     if ( g_group_count[id] < 2 ) return PLUGIN_HANDLED;
  3273.  
  3274.     static Float:grabbed_origin[3];
  3275.  
  3276.     entity_get_vector(ent, EV_VEC_origin, grabbed_origin);
  3277.  
  3278.     static block, Float:origin[3], Float:offset[3];
  3279.     for ( new i = 0; i <= g_group_count[id]; ++i )
  3280.     {
  3281.         block = g_grouped_blocks[id][i];
  3282.         if ( !is_valid_ent(block) ) continue;
  3283.  
  3284.         entity_get_vector(block, EV_VEC_origin, origin);
  3285.  
  3286.         offset[0] = grabbed_origin[0] - origin[0];
  3287.         offset[1] = grabbed_origin[1] - origin[1];
  3288.         offset[2] = grabbed_origin[2] - origin[2];
  3289.  
  3290.         entity_set_vector(block, EV_VEC_vuser1, offset);
  3291.         entity_set_int(block, EV_INT_iuser2, id);
  3292.     }
  3293.  
  3294.     return PLUGIN_HANDLED;
  3295. }
  3296.  
  3297. SetGrabbed(id, ent)
  3298. {
  3299.     entity_get_string(id, EV_SZ_viewmodel, g_viewmodel[id], charsmax(g_viewmodel));
  3300.     entity_set_string(id, EV_SZ_viewmodel, g_blank);
  3301.  
  3302.     static aiming[3], Float:origin[3];
  3303.  
  3304.     get_user_origin(id, aiming, 3);
  3305.     entity_get_vector(ent, EV_VEC_origin, origin);
  3306.  
  3307.     g_grabbed[id] = ent;
  3308.     g_grab_offset[id][0] = origin[0] - aiming[0];
  3309.     g_grab_offset[id][1] = origin[1] - aiming[1];
  3310.     g_grab_offset[id][2] = origin[2] - aiming[2];
  3311.  
  3312.     entity_set_int(ent, EV_INT_iuser2, id);
  3313. }
  3314.  
  3315. public CmdRelease(id)
  3316. {
  3317.     if ( !g_admin[id] && !g_gived_access[id] )
  3318.     {
  3319.         console_print(id, "You have no access to that command");
  3320.         return PLUGIN_HANDLED;
  3321.     }
  3322.     else if ( !g_grabbed[id] )
  3323.     {
  3324.         return PLUGIN_HANDLED;
  3325.     }
  3326.  
  3327.     if ( IsBlock(g_grabbed[id]) )
  3328.     {
  3329.         if ( IsBlockInGroup(id, g_grabbed[id]) && g_group_count[id] > 1 )
  3330.         {
  3331.             static i, block;
  3332.  
  3333.             new bool:group_is_stuck = true;
  3334.  
  3335.             for ( i = 0; i <= g_group_count[id]; ++i )
  3336.             {
  3337.                 block = g_grouped_blocks[id][i];
  3338.                 if ( IsBlockInGroup(id, block) )
  3339.                 {
  3340.                     entity_set_int(block, EV_INT_iuser2, 0);
  3341.  
  3342.                     if ( group_is_stuck && !IsBlockStuck(block) )
  3343.                     {
  3344.                         group_is_stuck = false;
  3345.                         break;
  3346.                     }
  3347.                 }
  3348.             }
  3349.  
  3350.             if ( group_is_stuck )
  3351.             {
  3352.                 for ( i = 0; i <= g_group_count[id]; ++i )
  3353.                 {
  3354.                     block = g_grouped_blocks[id][i];
  3355.                     if ( IsBlockInGroup(id, block) ) DeleteBlock(block);
  3356.                 }
  3357.  
  3358.                 SCM_Print(id, "Group deleted because all the blocks were stuck!");
  3359.             }
  3360.         }
  3361.         else
  3362.         {
  3363.             if ( is_valid_ent(g_grabbed[id]) )
  3364.             {
  3365.                 if ( IsBlockStuck(g_grabbed[id]) )
  3366.                 {
  3367.                     new bool:deleted = DeleteBlock(g_grabbed[id]);
  3368.                     if ( deleted ) SCM_Print(id, "Block deleted because it was stuck!");
  3369.                 }
  3370.                 else
  3371.                 {
  3372.                     entity_set_int(g_grabbed[id], EV_INT_iuser2, 0);
  3373.                 }
  3374.             }
  3375.         }
  3376.     }
  3377.     else if ( IsTeleport(g_grabbed[id]) )
  3378.     {
  3379.         entity_set_int(g_grabbed[id], EV_INT_iuser2, 0);
  3380.     }
  3381.  
  3382.     entity_get_string(id, EV_SZ_viewmodel, g_viewmodel[id], charsmax(g_viewmodel));
  3383.     entity_set_string(id, EV_SZ_viewmodel, g_blank);
  3384.  
  3385.     g_grabbed[id] = 0;
  3386.  
  3387.     return PLUGIN_HANDLED;
  3388. }
  3389.  
  3390. public CmdMainMenu(id)
  3391. {
  3392.     ShowMainMenu(id);
  3393.     return PLUGIN_HANDLED;
  3394. }
  3395.  
  3396. ShowMainMenu(id)
  3397. {
  3398.     new menu[256], col1[3], col2[3];
  3399.  
  3400.     col1 = g_admin[id] || g_gived_access[id] ? "\r" : "\d";
  3401.     col2 = g_admin[id] || g_gived_access[id] ? "\w" : "\d";
  3402.  
  3403.     format(menu, charsmax(menu),\
  3404.         g_main_menu,\
  3405.         PLUGIN_PREFIX,\
  3406.         PLUGIN_NAME,\
  3407.         PLUGIN_VERSION,\
  3408.         col1,\
  3409.         col2,\
  3410.         g_noclip[id] ? "\yOn" : "\rOff",\
  3411.         col1,\
  3412.         col2,\
  3413.         g_godmode[id] ? "\yOn" : "\rOff"
  3414.         );
  3415.  
  3416.     show_menu(id, g_keys_main_menu, menu, -1, "SCMMainMenu");
  3417. }
  3418.  
  3419. ShowBlockMenu(id)
  3420. {
  3421.     new menu[256], col1[3], col2[3], size[8];
  3422.  
  3423.     col1 = g_admin[id] || g_gived_access[id] ? "\r" : "\d";
  3424.     col2 = g_admin[id] || g_gived_access[id] ? "\w" : "\d";
  3425.  
  3426.     switch ( g_selected_block_size[id] )
  3427.     {
  3428.         case TINY:  size = "Small";
  3429.         case NORMAL:    size = "Normal";
  3430.         case LARGE: size = "Large";
  3431.         case POLE:  size = "Pole";
  3432.     }
  3433.  
  3434.     format(menu, charsmax(menu),\
  3435.         g_block_menu,\
  3436.         PLUGIN_PREFIX,\
  3437.         g_block_names[g_selected_block_type[id]],\
  3438.         col1,\
  3439.         col2,\
  3440.         col1,\
  3441.         col2,\
  3442.         col1,\
  3443.         col2,\
  3444.         col1,\
  3445.         col2,\
  3446.         g_noclip[id] ? "\yOn" : "\rOff",\
  3447.         col1,\
  3448.         col2,\
  3449.         size,\
  3450.         col1,\
  3451.         col2
  3452.         );
  3453.  
  3454.     show_menu(id, g_keys_block_menu, menu, -1, "SCMBlockMenu");
  3455. }
  3456.  
  3457. ShowBlockSelectionMenu(id)
  3458. {
  3459.     new menu[256], title[32], entry[32], num;
  3460.  
  3461.     format(title, charsmax(title), "\r[Ex BM] \yBlock Selection %d^n^n", g_block_selection_page[id]);
  3462.     add(menu, charsmax(menu), title);
  3463.  
  3464.     new start_block = ( g_block_selection_page[id] - 1 ) * 8;
  3465.  
  3466.     for ( new i = start_block; i < start_block + 8; ++i )
  3467.     {
  3468.         if ( i < TOTAL_BLOCKS )
  3469.         {
  3470.             num = ( i - start_block ) + 1;
  3471.  
  3472.             format(entry, charsmax(entry), "\r%d. \w%s^n", num, g_block_names[i]);
  3473.         }
  3474.         else
  3475.         {
  3476.             format(entry, charsmax(entry), "^n");
  3477.         }
  3478.  
  3479.         add(menu, charsmax(menu), entry);
  3480.     }
  3481.  
  3482.     if ( g_block_selection_page[id] < g_block_selection_pages_max )
  3483.     {
  3484.         add(menu, charsmax(menu), "^n\r9. \wMore");
  3485.     }
  3486.     else
  3487.     {
  3488.         add(menu, charsmax(menu), "^n");
  3489.     }
  3490.  
  3491.     add(menu, charsmax(menu), "^n\r0. \wBack");
  3492.  
  3493.     show_menu(id, g_keys_block_selection_menu, menu, -1, "SCMBlockSelectionMenu");
  3494. }
  3495.  
  3496. ShowPropertiesMenu(id, ent)
  3497. {
  3498.     new menu[256], title[32], entry[64], property[5], line1[3], line2[3], line3[3], line4[3], num, block_type;
  3499.  
  3500.     block_type = entity_get_int(ent, EV_INT_body);
  3501.  
  3502.     format(title, charsmax(title), "\r[%s] \ySet Properties^n^n", PLUGIN_PREFIX);
  3503.     add(menu, charsmax(menu), title);
  3504.  
  3505.     if ( g_property1_name[block_type][0] )
  3506.     {
  3507.         GetProperty(ent, 1, property);
  3508.  
  3509.         if ( block_type == BUNNYHOP )
  3510.         {
  3511.             format(entry, charsmax(entry), "\r1. \w%s: %s^n", g_property1_name[block_type], property[0] == '1' ? "\yOn" : "\rOff");
  3512.         }
  3513.         else if ( block_type == SLAP )
  3514.         {
  3515.             format(entry, charsmax(entry), "\r1. \w%s: \y%s^n", g_property1_name[block_type], property[0] == '3' ? "High" : property[0] == '2' ? "Medium" : "Low");
  3516.         }
  3517.         else
  3518.         {
  3519.             format(entry, charsmax(entry), "\r1. \w%s: \y%s^n", g_property1_name[block_type], property);
  3520.         }
  3521.  
  3522.         add(menu, charsmax(menu), entry);
  3523.     }
  3524.     else
  3525.     {
  3526.         format(line1, charsmax(line1), "^n");
  3527.     }
  3528.  
  3529.     if ( g_property2_name[block_type][0] )
  3530.     {
  3531.         if ( g_property1_name[block_type][0] )
  3532.         {
  3533.             num = 2;
  3534.         }
  3535.         else
  3536.         {
  3537.             num = 1;
  3538.         }
  3539.  
  3540.         GetProperty(ent, 2, property);
  3541.  
  3542.         format(entry, charsmax(entry), "\r%d. \w%s: \y%s^n", num, g_property2_name[block_type], property);
  3543.  
  3544.         add(menu, charsmax(menu), entry);
  3545.     }
  3546.     else
  3547.     {
  3548.         format(line2, charsmax(line2), "^n");
  3549.     }
  3550.  
  3551.     if ( g_property3_name[block_type][0] )
  3552.     {
  3553.         if ( g_property1_name[block_type][0] && g_property2_name[block_type][0] )
  3554.         {
  3555.             num = 3;
  3556.         }
  3557.         else if ( g_property1_name[block_type][0]
  3558.         || g_property2_name[block_type][0] )
  3559.         {
  3560.             num = 2;
  3561.         }
  3562.         else
  3563.         {
  3564.             num = 1;
  3565.         }
  3566.  
  3567.         GetProperty(ent, 3, property);
  3568.  
  3569.         if ( block_type == BOOTS_OF_SPEED
  3570.         || property[0] != '0' && !( property[0] == '2' && property[1] == '5' && property[2] == '5' ) )
  3571.         {
  3572.             format(entry, charsmax(entry), "\r%d. \w%s: \y%s^n", num, g_property3_name[block_type], property);
  3573.         }
  3574.         else
  3575.         {
  3576.             format(entry, charsmax(entry), "\r%d. \w%s: \rOff^n", num, g_property3_name[block_type]);
  3577.         }
  3578.  
  3579.         add(menu, charsmax(menu), entry);
  3580.     }
  3581.     else
  3582.     {
  3583.         format(line3, charsmax(line3), "^n");
  3584.     }
  3585.  
  3586.     if ( g_property4_name[block_type][0] )
  3587.     {
  3588.         if ( g_property1_name[block_type][0] && g_property2_name[block_type][0] && g_property3_name[block_type][0] )
  3589.         {
  3590.             num = 4;
  3591.         }
  3592.         else if ( g_property1_name[block_type][0] && g_property2_name[block_type][0]
  3593.         || g_property1_name[block_type][0] && g_property3_name[block_type][0]
  3594.         || g_property2_name[block_type][0] && g_property3_name[block_type][0] )
  3595.         {
  3596.             num = 3;
  3597.         }
  3598.         else if ( g_property1_name[block_type][0]
  3599.         || g_property2_name[block_type][0]
  3600.         || g_property3_name[block_type][0] )
  3601.         {
  3602.             num = 2;
  3603.         }
  3604.         else
  3605.         {
  3606.             num = 1;
  3607.         }
  3608.  
  3609.         GetProperty(ent, 4, property);
  3610.  
  3611.         format(entry, charsmax(entry), "\r%d. \w%s: %s^n", num, g_property4_name[block_type], property[0] == '1' ? "\yYes" : "\rNo");
  3612.         add(menu, charsmax(menu), entry);
  3613.     }
  3614.     else
  3615.     {
  3616.         format(line4, charsmax(line4), "^n");
  3617.     }
  3618.  
  3619.     g_property_info[id][1] = ent;
  3620.  
  3621.     add(menu, charsmax(menu), line1);
  3622.     add(menu, charsmax(menu), line2);
  3623.     add(menu, charsmax(menu), line3);
  3624.     add(menu, charsmax(menu), line4);
  3625.     add(menu, charsmax(menu), "^n^n^n^n^n^n\r0. \wBack");
  3626.  
  3627.     show_menu(id, g_keys_properties_menu, menu, -1, "SCMPropertiesMenu");
  3628. }
  3629.  
  3630. ShowMoveMenu(id)
  3631. {
  3632.     if ( !g_admin[id] && !g_gived_access[id] )
  3633.     {
  3634.         ShowBlockMenu(id);
  3635.         return PLUGIN_HANDLED;
  3636.     }
  3637.  
  3638.     new menu[256];
  3639.  
  3640.     format(menu, charsmax(menu), g_move_menu, PLUGIN_PREFIX, g_grid_size[id]);
  3641.  
  3642.     show_menu(id, g_keys_move_menu, menu, -1, "SCMMoveMenu");
  3643.  
  3644.     return PLUGIN_HANDLED;
  3645. }
  3646.  
  3647. ShowTeleportMenu(id)
  3648. {
  3649.     new menu[256], col1[3], col2[3];
  3650.  
  3651.     col1 = g_admin[id] || g_gived_access[id] ? "\r" : "\d";
  3652.     col2 = g_admin[id] || g_gived_access[id] ? "\w" : "\d";
  3653.  
  3654.     format(menu, charsmax(menu),\
  3655.         g_teleport_menu,\
  3656.         PLUGIN_PREFIX,\
  3657.         col1,\
  3658.         col2,\
  3659.         g_teleport_start[id] ? "\r" : "\d",\
  3660.         g_teleport_start[id] ? "\w" : "\d",\
  3661.         col1,\
  3662.         col2,\
  3663.         col1,\
  3664.         col2,\
  3665.         col1,\
  3666.         col2
  3667.         );
  3668.  
  3669.     show_menu(id, g_keys_teleport_menu, menu, -1, "SCMTeleportMenu");
  3670. }
  3671.  
  3672. ShowLightMenu(id)
  3673. {
  3674.     new menu[256], col1[3], col2[3];
  3675.  
  3676.     col1 = g_admin[id] || g_gived_access[id] ? "\r" : "\d";
  3677.     col2 = g_admin[id] || g_gived_access[id] ? "\w" : "\d";
  3678.  
  3679.     format(menu, charsmax(menu),\
  3680.         g_light_menu,\
  3681.         PLUGIN_PREFIX,\
  3682.         col1,\
  3683.         col2,\
  3684.         col1,\
  3685.         col2,\
  3686.         col1,\
  3687.         col2
  3688.         );
  3689.  
  3690.     show_menu(id, g_keys_light_menu, menu, -1, "SCMLightMenu");
  3691. }
  3692.  
  3693. ShowLightPropertiesMenu(id, ent)
  3694. {
  3695.     new menu[256], radius[5], color_red[5], color_green[5], color_blue[5];
  3696.  
  3697.     GetProperty(ent, 1, radius);
  3698.     GetProperty(ent, 2, color_red);
  3699.     GetProperty(ent, 3, color_green);
  3700.     GetProperty(ent, 4, color_blue);
  3701.  
  3702.     format(menu, charsmax(menu),\
  3703.         g_light_properties_menu,\
  3704.         PLUGIN_PREFIX,\
  3705.         radius,\
  3706.         color_red,\
  3707.         color_green,\
  3708.         color_blue
  3709.         );
  3710.  
  3711.     g_light_property_info[id][1] = ent;
  3712.  
  3713.     show_menu(id, g_keys_light_properties_menu, menu, -1, "SCMLightPropertiesMenu");
  3714. }
  3715.  
  3716. ShowOptionsMenu(id)
  3717. {
  3718.     new menu[256], col1[3], col2[3], col3[3], col4[3];
  3719.  
  3720.     col1 = g_admin[id] || g_gived_access[id] ? "\r" : "\d";
  3721.     col2 = g_admin[id] || g_gived_access[id] ? "\w" : "\d";
  3722.     col3 = g_admin[id] ? "\r" : "\d";
  3723.     col4 = g_admin[id] ? "\w" : "\d";
  3724.  
  3725.     format(menu, charsmax(menu),\
  3726.         g_options_menu,\
  3727.         PLUGIN_PREFIX,\
  3728.         col1,\
  3729.         col2,\
  3730.         g_snapping[id] ? "\yOn" : "\rOff",\
  3731.         col1,\
  3732.         col2,\
  3733.         g_snapping_gap[id],\
  3734.         col1,\
  3735.         col2,\
  3736.         col1,\
  3737.         col2,\
  3738.         col3,\
  3739.         col4,\
  3740.         col3,\
  3741.         col4,\
  3742.         col3,\
  3743.         col4
  3744.         );
  3745.  
  3746.     show_menu(id, g_keys_options_menu, menu, -1, "SCMOptionsMenu");
  3747. }
  3748.  
  3749. ShowChoiceMenu(id, choice, const title[96])
  3750. {
  3751.     new menu[128];
  3752.  
  3753.     g_choice_option[id] = choice;
  3754.  
  3755.     format(menu, charsmax(menu), g_choice_menu, title);
  3756.  
  3757.     show_menu(id, g_keys_choice_menu, menu, -1, "SCMChoiceMenu");
  3758. }
  3759.  
  3760. ShowCommandsMenu(id)
  3761. {
  3762.     new menu[256], col1[3], col2[3], col3[3], col4[3];
  3763.  
  3764.     col1 = g_admin[id] ? "\r" : "\d";
  3765.     col2 = g_admin[id] ? "\w" : "\d";
  3766.     col3 = ( g_admin[id] || g_gived_access[id] ) && g_alive[id] ? "\r" : "\d";
  3767.     col4 = ( g_admin[id] || g_gived_access[id] ) && g_alive[id] ? "\w" : "\d";
  3768.  
  3769.     format(menu, charsmax(menu),\
  3770.         g_commands_menu,\
  3771.         PLUGIN_PREFIX,\
  3772.         col3,\
  3773.         col4,\
  3774.         g_alive[id] && g_has_checkpoint[id] ? "\r" : "\d",\
  3775.         g_alive[id] && g_has_checkpoint[id] ? "\w" : "\d",\
  3776.         ( g_admin[id] || g_gived_access[id] ) && !g_alive[id] ? "\r" : "\d",\
  3777.         ( g_admin[id] || g_gived_access[id] ) && !g_alive[id] ? "\w" : "\d",\
  3778.         col1,\
  3779.         col2,\
  3780.         col1,\
  3781.         col2,\
  3782.         col1,\
  3783.         col2,\
  3784.         g_all_godmode ? "Remove" : "Set",\
  3785.         g_all_godmode ? "from" : "on",\
  3786.         col1,\
  3787.         col2,\
  3788.         PLUGIN_PREFIX
  3789.         );
  3790.  
  3791.     show_menu(id, g_keys_commands_menu, menu, -1, "SCMCommandsMenu");
  3792. }
  3793.  
  3794. public HandleMainMenu(id, key)
  3795. {
  3796.     switch ( key )
  3797.     {
  3798.         case K1: ShowBlockMenu(id);
  3799.         case K2: ShowTeleportMenu(id);
  3800.         case K3: ShowLightMenu(id);
  3801.         case K4:
  3802.         {
  3803.             g_viewing_commands_menu[id] = true;
  3804.             ShowCommandsMenu(id);
  3805.         }
  3806.         case K5: ShowMoveMenu(id);
  3807.         case K6: ToggleNoclip(id);
  3808.         case K7: ToggleGodmode(id);
  3809.         case K9: CmdShowInfo(id);
  3810.         case K0: return;
  3811.     }
  3812.  
  3813.     if ( key == K6 || key == K7 || key == K9 ) ShowMainMenu(id);
  3814. }
  3815.  
  3816. public HandleBlockMenu(id, key)
  3817. {
  3818.     switch ( key )
  3819.     {
  3820.         case K1:
  3821.         {
  3822.             g_block_selection_page[id] = 1;
  3823.             ShowBlockSelectionMenu(id);
  3824.         }
  3825.         case K2: CreateBlockAiming(id, g_selected_block_type[id]);
  3826.         case K3: ConvertBlockAiming(id, g_selected_block_type[id]);
  3827.         case K4: DeleteBlockAiming(id);
  3828.         case K5: RotateBlockAiming(id);
  3829.         case K6: ToggleNoclip(id);
  3830.         case K7: SetPropertiesBlockAiming(id);
  3831.         case K8: ChangeBlockSize(id);
  3832.         case K9: ShowOptionsMenu(id);
  3833.         case K0: ShowMainMenu(id);
  3834.     }
  3835.  
  3836.     if ( key != K1 && key != K6 && key != K7 && key != K9 && key != K0 ) ShowBlockMenu(id);
  3837. }
  3838.  
  3839. public HandleBlockSelectionMenu(id, key)
  3840. {
  3841.     switch ( key )
  3842.     {
  3843.         case K9:
  3844.         {
  3845.             ++g_block_selection_page[id];
  3846.  
  3847.             if ( g_block_selection_page[id] > g_block_selection_pages_max )
  3848.             {
  3849.                 g_block_selection_page[id] = g_block_selection_pages_max;
  3850.             }
  3851.  
  3852.             ShowBlockSelectionMenu(id);
  3853.         }
  3854.         case K0:
  3855.         {
  3856.             --g_block_selection_page[id];
  3857.  
  3858.             if ( g_block_selection_page[id] < 1 )
  3859.             {
  3860.                 ShowBlockMenu(id);
  3861.             }
  3862.             else
  3863.             {
  3864.                 ShowBlockSelectionMenu(id);
  3865.             }
  3866.         }
  3867.         default:
  3868.         {
  3869.             key += ( g_block_selection_page[id] - 1 ) * 8;
  3870.  
  3871.             if ( key < TOTAL_BLOCKS )
  3872.             {
  3873.                 g_selected_block_type[id] = key;
  3874.                 ShowBlockMenu(id);
  3875.             }
  3876.             else
  3877.             {
  3878.                 ShowBlockSelectionMenu(id);
  3879.             }
  3880.         }
  3881.     }
  3882. }
  3883.  
  3884. public HandlePropertiesMenu(id, key)
  3885. {
  3886.     new ent = g_property_info[id][1];
  3887.     if ( !is_valid_ent(ent) )
  3888.     {
  3889.         SCM_Print(id, "That block has been deleted!");
  3890.         g_viewing_properties_menu[id] = false;
  3891.         ShowBlockMenu(id);
  3892.         return PLUGIN_HANDLED;
  3893.     }
  3894.  
  3895.     new block_type = entity_get_int(ent, EV_INT_body);
  3896.  
  3897.     switch ( key )
  3898.     {
  3899.         case K1:
  3900.         {
  3901.             if ( g_property1_name[block_type][0] )
  3902.             {
  3903.                 g_property_info[id][0] = 1;
  3904.             }
  3905.             else if ( g_property2_name[block_type][0] )
  3906.             {
  3907.                 g_property_info[id][0] = 2;
  3908.             }
  3909.             else if ( g_property3_name[block_type][0] )
  3910.             {
  3911.                 g_property_info[id][0] = 3;
  3912.             }
  3913.             else
  3914.             {
  3915.                 g_property_info[id][0] = 4;
  3916.             }
  3917.  
  3918.             if ( g_property_info[id][0] == 1
  3919.             && ( block_type == BUNNYHOP
  3920.             || block_type == SLAP ) )
  3921.             {
  3922.                 ToggleProperty(id, 1);
  3923.             }
  3924.             else if ( g_property_info[id][0] == 4 )
  3925.             {
  3926.                 ToggleProperty(id, 4);
  3927.             }
  3928.             else
  3929.             {
  3930.                 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);
  3931.                 client_cmd(id, "messagemode SCM_SetProperty");
  3932.             }
  3933.         }
  3934.         case K2:
  3935.         {
  3936.             if ( g_property1_name[block_type][0] && g_property2_name[block_type][0]
  3937.             || g_property1_name[block_type][0] && g_property3_name[block_type][0]
  3938.             || g_property1_name[block_type][0] && g_property4_name[block_type][0]
  3939.             || g_property2_name[block_type][0] && g_property3_name[block_type][0]
  3940.             || g_property2_name[block_type][0] && g_property4_name[block_type][0]
  3941.             || g_property3_name[block_type][0] && g_property4_name[block_type][0] )
  3942.             {
  3943.                 if ( g_property1_name[block_type][0] && g_property2_name[block_type][0] )
  3944.                 {
  3945.                     g_property_info[id][0] = 2;
  3946.                 }
  3947.                 else if ( g_property1_name[block_type][0] && g_property3_name[block_type][0]
  3948.                 || g_property2_name[block_type][0] && g_property3_name[block_type][0] )
  3949.                 {
  3950.                     g_property_info[id][0] = 3;
  3951.                 }
  3952.                 else
  3953.                 {
  3954.                     g_property_info[id][0] = 4;
  3955.                 }
  3956.  
  3957.                 if ( g_property_info[id][0] == 4 )
  3958.                 {
  3959.                     ToggleProperty(id, 4);
  3960.                 }
  3961.                 else
  3962.                 {
  3963.                     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);
  3964.                     client_cmd(id, "messagemode SCM_SetProperty");
  3965.                 }
  3966.             }
  3967.         }
  3968.         case K3:
  3969.         {
  3970.             if ( g_property1_name[block_type][0] && g_property2_name[block_type][0] && g_property3_name[block_type][0]
  3971.             || g_property1_name[block_type][0] && g_property2_name[block_type][0] && g_property4_name[block_type][0]
  3972.             || g_property1_name[block_type][0] && g_property3_name[block_type][0] && g_property4_name[block_type][0]
  3973.             || g_property2_name[block_type][0] && g_property3_name[block_type][0] && g_property4_name[block_type][0] )
  3974.             {
  3975.                 if ( g_property1_name[block_type][0] && g_property2_name[block_type][0] && g_property3_name[block_type][0] )
  3976.                 {
  3977.                     g_property_info[id][0] = 3;
  3978.                 }
  3979.                 else
  3980.                 {
  3981.                     g_property_info[id][0] = 4;
  3982.                 }
  3983.  
  3984.                 if ( g_property_info[id][0] == 4 )
  3985.                 {
  3986.                     ToggleProperty(id, 4);
  3987.                 }
  3988.                 else
  3989.                 {
  3990.                     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);
  3991.                     client_cmd(id, "messagemode SCM_SetProperty");
  3992.                 }
  3993.             }
  3994.         }
  3995.         case K4:
  3996.         {
  3997.             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] )
  3998.             {
  3999.                 ToggleProperty(id, 4);
  4000.             }
  4001.         }
  4002.         case K0:
  4003.         {
  4004.             g_viewing_properties_menu[id] = false;
  4005.             ShowBlockMenu(id);
  4006.         }
  4007.     }
  4008.  
  4009.     if ( key != K0 ) ShowPropertiesMenu(id, ent);
  4010.  
  4011.     return PLUGIN_HANDLED;
  4012. }
  4013.  
  4014. public HandleMoveMenu(id, key)
  4015. {
  4016.     switch ( key )
  4017.     {
  4018.         case K1: ToggleGridSize(id);
  4019.         case K0: ShowMainMenu(id);
  4020.         default:
  4021.         {
  4022.             static ent, body;
  4023.             get_user_aiming(id, ent, body);
  4024.  
  4025.             if ( !IsBlock(ent) ) return PLUGIN_HANDLED;
  4026.  
  4027.             static Float:origin[3];
  4028.  
  4029.             if ( IsBlockInGroup(id, ent) && g_group_count[id] > 1 )
  4030.             {
  4031.                 static i, block;
  4032.  
  4033.                 new bool:group_is_stuck = true;
  4034.  
  4035.                 for ( i = 0; i <= g_group_count[id]; ++i )
  4036.                 {
  4037.                     block = g_grouped_blocks[id][i];
  4038.                     if ( IsBlockInGroup(id, block) )
  4039.                     {
  4040.                         entity_get_vector(block, EV_VEC_origin, origin);
  4041.  
  4042.                         switch ( key )
  4043.                         {
  4044.                             case K2: origin[2] += g_grid_size[id];
  4045.                             case K3: origin[2] -= g_grid_size[id];
  4046.                             case K4: origin[0] += g_grid_size[id];
  4047.                             case K5: origin[0] -= g_grid_size[id];
  4048.                             case K6: origin[1] += g_grid_size[id];
  4049.                             case K7: origin[1] -= g_grid_size[id];
  4050.                         }
  4051.  
  4052.                         MoveEntity(id, block, origin, false);
  4053.  
  4054.                         if ( group_is_stuck && !IsBlockStuck(block) )
  4055.                         {
  4056.                             group_is_stuck = false;
  4057.                             break;
  4058.                         }
  4059.                     }
  4060.                 }
  4061.  
  4062.                 if ( group_is_stuck )
  4063.                 {
  4064.                     for ( i = 0; i <= g_group_count[id]; ++i )
  4065.                     {
  4066.                         block = g_grouped_blocks[id][i];
  4067.                         if ( IsBlockInGroup(id, block) )
  4068.                         {
  4069.                             DeleteBlock(block);
  4070.                         }
  4071.                     }
  4072.  
  4073.                     SCM_Print(id, "Group deleted because all the blocks were stuck!");
  4074.                 }
  4075.             }
  4076.             else
  4077.             {
  4078.                 entity_get_vector(ent, EV_VEC_origin, origin);
  4079.  
  4080.                 switch ( key )
  4081.                 {
  4082.                     case K2: origin[2] += g_grid_size[id];
  4083.                     case K3: origin[2] -= g_grid_size[id];
  4084.                     case K4: origin[0] += g_grid_size[id];
  4085.                     case K5: origin[0] -= g_grid_size[id];
  4086.                     case K6: origin[1] += g_grid_size[id];
  4087.                     case K7: origin[1] -= g_grid_size[id];
  4088.                 }
  4089.  
  4090.                 MoveEntity(id, ent, origin, false);
  4091.  
  4092.                 if ( IsBlockStuck(ent) )
  4093.                 {
  4094.                     new bool:deleted = DeleteBlock(ent);
  4095.                     if ( deleted ) SCM_Print(id, "Block deleted because it was stuck!");
  4096.                 }
  4097.             }
  4098.         }
  4099.     }
  4100.  
  4101.     if ( key != K0 ) ShowMoveMenu(id);
  4102.  
  4103.     return PLUGIN_HANDLED;
  4104. }
  4105.  
  4106. public HandleTeleportMenu(id, key)
  4107. {
  4108.     switch ( key )
  4109.     {
  4110.         case K1: CreateTeleportAiming(id, TELEPORT_START);
  4111.         case K2: CreateTeleportAiming(id, TELEPORT_DESTINATION);
  4112.         case K3: DeleteTeleportAiming(id);
  4113.         case K4: SwapTeleportAiming(id);
  4114.         case K5: ShowTeleportPath(id);
  4115.         case K0: ShowMainMenu(id);
  4116.     }
  4117.  
  4118.     if ( key != K9 && key != K0 ) ShowTeleportMenu(id);
  4119. }
  4120.  
  4121. public HandleLightMenu(id, key)
  4122. {
  4123.     switch ( key )
  4124.     {
  4125.         case K1: CreateLightAiming(id);
  4126.         case K2: DeleteLightAiming(id);
  4127.         case K3: SetPropertiesLightAiming(id);
  4128.         case K0: ShowMainMenu(id);
  4129.     }
  4130.  
  4131.     if ( key != K3 && key != K0 ) ShowLightMenu(id);
  4132. }
  4133.  
  4134. public HandleLightPropertiesMenu(id, key)
  4135. {
  4136.     new ent = g_light_property_info[id][1];
  4137.     if ( !is_valid_ent(ent) )
  4138.     {
  4139.         SCM_Print(id, "That light has been deleted!");
  4140.         g_viewing_light_properties_menu[id] = false;
  4141.         ShowLightMenu(id);
  4142.         return PLUGIN_HANDLED;
  4143.     }
  4144.  
  4145.     switch ( key )
  4146.     {
  4147.         case K1: g_light_property_info[id][0] = 1;
  4148.         case K2: g_light_property_info[id][0] = 2;
  4149.         case K3: g_light_property_info[id][0] = 3;
  4150.         case K4: g_light_property_info[id][0] = 4;
  4151.         case K0:
  4152.         {
  4153.             g_viewing_light_properties_menu[id] = false;
  4154.             ShowLightMenu(id);
  4155.         }
  4156.     }
  4157.  
  4158.     if ( key != K0 )
  4159.     {
  4160.         SCM_Print(id, "Type the new property value for the light.");
  4161.         client_cmd(id, "messagemode SCM_SetLightProperty");
  4162.         ShowLightPropertiesMenu(id, ent);
  4163.     }
  4164.  
  4165.     return PLUGIN_HANDLED;
  4166. }
  4167.  
  4168. public HandleOptionsMenu(id, key)
  4169. {
  4170.     switch ( key )
  4171.     {
  4172.         case K1: ToggleSnapping(id);
  4173.         case K2: ToggleSnappingGap(id);
  4174.         case K3: GroupBlockAiming(id);
  4175.         case K4: ClearGroup(id);
  4176.         case K5:
  4177.         {
  4178.             if ( g_admin[id] )  ShowChoiceMenu(id, CHOICE_DELETE, "Are you sure you want to delete all blocks and teleports?");
  4179.             else            ShowOptionsMenu(id);
  4180.         }
  4181.         case K6: SaveBlocks(id);
  4182.         case K7:
  4183.         {
  4184.             if ( g_admin[id] )  ShowChoiceMenu(id, CHOICE_LOAD, "Loading will delete all blocks and teleports, do you want to continue?");
  4185.             else            ShowOptionsMenu(id);
  4186.         }
  4187.         case K0: ShowBlockMenu(id);
  4188.     }
  4189.  
  4190.     if ( key != K5 && key != K7 && key != K0 ) ShowOptionsMenu(id);
  4191. }
  4192.  
  4193. public HandleChoiceMenu(id, key)
  4194. {
  4195.     switch ( key )
  4196.     {
  4197.         case K1:
  4198.         {
  4199.             switch ( g_choice_option[id] )
  4200.             {
  4201.                 case CHOICE_DELETE: DeleteAll(id, true);
  4202.                 case CHOICE_LOAD:   LoadBlocks(id);
  4203.             }
  4204.         }
  4205.         case K2: ShowOptionsMenu(id);
  4206.     }
  4207.  
  4208.     ShowOptionsMenu(id);
  4209. }
  4210.  
  4211. public HandleCommandsMenu(id, key)
  4212. {
  4213.     switch ( key )
  4214.     {
  4215.         case K1: CmdSaveCheckpoint(id);
  4216.         case K2: CmdLoadCheckpoint(id);
  4217.         case K3: CmdReviveYourself(id);
  4218.         case K4: CmdRevivePlayer(id);
  4219.         case K5: CmdReviveEveryone(id);
  4220.         case K6: ToggleAllGodmode(id);
  4221.         case K7: CmdGiveAccess(id);
  4222.         case K0:
  4223.         {
  4224.             g_viewing_commands_menu[id] = false;
  4225.             ShowMainMenu(id);
  4226.         }
  4227.     }
  4228.  
  4229.     if ( key != K0 ) ShowCommandsMenu(id);
  4230. }
  4231.  
  4232. ToggleNoclip(id)
  4233. {
  4234.     if ( g_admin[id] || g_gived_access[id] )
  4235.     {
  4236.         set_user_noclip(id, g_noclip[id] ? 0 : 1);
  4237.         g_noclip[id] = !g_noclip[id];
  4238.         ShowBlockMenu(id);
  4239.     }
  4240. }
  4241.  
  4242. ToggleGodmode(id)
  4243. {
  4244.     if ( g_admin[id] || g_gived_access[id] )
  4245.     {
  4246.         set_user_godmode(id, g_godmode[id] ? 0 : 1);
  4247.         g_godmode[id] = !g_godmode[id];
  4248.     }
  4249. }
  4250.  
  4251. ToggleGridSize(id)
  4252. {
  4253.     if ( g_admin[id] || g_gived_access[id] )
  4254.     g_grid_size[id] *= 1;
  4255.     {
  4256.         g_grid_size[id] += 1.0;
  4257.  
  4258.         if ( g_grid_size[id] > 15.0 )
  4259.         {
  4260.             g_grid_size[id] = 1.0;
  4261.         }
  4262.     }
  4263. }
  4264. ToggleSnapping(id)
  4265. {
  4266.     if ( g_admin[id] || g_gived_access[id] )
  4267.     {
  4268.         g_snapping[id] = !g_snapping[id];
  4269.     }
  4270. }
  4271.  
  4272. ToggleSnappingGap(id)
  4273. {
  4274.     if ( g_admin[id] || g_gived_access[id] )
  4275.     {
  4276.         g_snapping_gap[id] += 4.0;
  4277.  
  4278.         if ( g_snapping_gap[id] > 40.0 )
  4279.         {
  4280.             g_snapping_gap[id] = 0.0;
  4281.         }
  4282.     }
  4283. }
  4284.  
  4285. public CmdSaveCheckpoint(id)
  4286. {
  4287.     if ( !g_admin[id] && !g_gived_access[id] )
  4288.     {
  4289.         console_print(id, "You have no access to that command");
  4290.         return PLUGIN_HANDLED;
  4291.     }
  4292.     else if ( !g_alive[id] )
  4293.     {
  4294.         SCM_Print(id, "You have to be alive to save a checkpoint!");
  4295.         return PLUGIN_HANDLED;
  4296.     }
  4297.     else if ( g_noclip[id] )
  4298.     {
  4299.         SCM_Print(id, "You can't save a checkpoint while using noclip!");
  4300.         return PLUGIN_HANDLED;
  4301.     }
  4302.  
  4303.     static Float:velocity[3];
  4304.     get_user_velocity(id, velocity);
  4305.  
  4306.     new button =    entity_get_int(id, EV_INT_button);
  4307.     new flags = entity_get_int(id, EV_INT_flags);
  4308.  
  4309.     if ( !( ( velocity[2] >= 0.0 || ( flags & FL_INWATER ) ) && !( button & IN_JUMP ) && velocity[2] <= 0.0 ) )
  4310.     {
  4311.         SCM_Print(id, "You can't save a checkpoint while moving up or down!");
  4312.         return PLUGIN_HANDLED;
  4313.     }
  4314.  
  4315.     if ( flags & FL_DUCKING )   g_checkpoint_duck[id] = true;
  4316.     else                g_checkpoint_duck[id] = false;
  4317.  
  4318.     entity_get_vector(id, EV_VEC_origin, g_checkpoint_position[id]);
  4319.  
  4320.     SCM_Print(id, "Checkpoint saved!");
  4321.  
  4322.     if ( !g_has_checkpoint[id] )        g_has_checkpoint[id] = true;
  4323.  
  4324.     if ( g_viewing_commands_menu[id] )  ShowCommandsMenu(id);
  4325.  
  4326.     return PLUGIN_HANDLED;
  4327. }
  4328.  
  4329. public CmdLoadCheckpoint(id)
  4330. {
  4331.     if ( !g_admin[id] && !g_gived_access[id] )
  4332.     {
  4333.         console_print(id, "You have no access to that command");
  4334.         return PLUGIN_HANDLED;
  4335.     }
  4336.     else if ( !g_alive[id] )
  4337.     {
  4338.         SCM_Print(id, "You have to be alive to load a checkpoint!");
  4339.         return PLUGIN_HANDLED;
  4340.     }
  4341.     else if ( !g_has_checkpoint[id] )
  4342.     {
  4343.         SCM_Print(id, "You don't have a checkpoint!");
  4344.         return PLUGIN_HANDLED;
  4345.     }
  4346.  
  4347.     static Float:origin[3];
  4348.     for ( new i = 1; i <= g_max_players; i++ )
  4349.     {
  4350.         if ( i == id
  4351.         || !g_alive[i] ) continue;
  4352.  
  4353.         entity_get_vector(id, EV_VEC_origin, origin);
  4354.  
  4355.         if ( get_distance_f(g_checkpoint_position[id], origin) <= 35.0 )
  4356.         {
  4357.             if ( cs_get_user_team(i) == cs_get_user_team(id) ) continue;
  4358.  
  4359.             SCM_Print(id, "Somebody is too close to your checkpoint!");
  4360.             return PLUGIN_HANDLED;
  4361.         }
  4362.     }
  4363.  
  4364.     entity_set_vector(id, EV_VEC_origin, g_checkpoint_position[id]);
  4365.     entity_set_vector(id, EV_VEC_velocity, Float:{ 0.0, 0.0, 0.0 });
  4366.  
  4367.     if ( g_checkpoint_duck[id] )
  4368.     {
  4369.         entity_set_int(id, EV_INT_flags, entity_get_int(id, EV_INT_flags) | FL_DUCKING);
  4370.     }
  4371.  
  4372.     return PLUGIN_HANDLED;
  4373. }
  4374.  
  4375. public CmdReviveYourself(id)
  4376. {
  4377.     if ( !g_admin[id] && !g_gived_access[id] )
  4378.     {
  4379.         console_print(id, "You have no access to that command");
  4380.         return PLUGIN_HANDLED;
  4381.     }
  4382.     else if ( g_alive[id] )
  4383.     {
  4384.         SCM_Print(id, "You are already alive!");
  4385.         return PLUGIN_HANDLED;
  4386.     }
  4387.  
  4388.     ExecuteHam(Ham_CS_RoundRespawn, id);
  4389.     SCM_Print(id, "You have revived yourself!");
  4390.  
  4391.     static name[32];
  4392.     get_user_name(id, name, charsmax(name));
  4393.  
  4394.     for ( new i = 1; i <= g_max_players; i++ )
  4395.     {
  4396.         if ( !g_connected[i]
  4397.         || i == id ) continue;
  4398.  
  4399.         SCM_Print(i, "^1%s^3 revived himself!", name);
  4400.     }
  4401.  
  4402.     return PLUGIN_HANDLED;
  4403. }
  4404.  
  4405. CmdRevivePlayer(id)
  4406. {
  4407.     if ( !g_admin[id] && !g_gived_access[id] )
  4408.     {
  4409.         console_print(id, "You have no access to that command");
  4410.         return PLUGIN_HANDLED;
  4411.     }
  4412.  
  4413.     client_cmd(id, "messagemode SCM_Revive");
  4414.     SCM_Print(id, "Type the name of the client that you want to revive.");
  4415.  
  4416.     return PLUGIN_HANDLED;
  4417. }
  4418.  
  4419. public RevivePlayer(id)
  4420. {
  4421.     if ( !g_admin[id] && !g_gived_access[id] )
  4422.     {
  4423.         console_print(id, "You have no access to that command");
  4424.         return PLUGIN_HANDLED;
  4425.     }
  4426.  
  4427.     static arg[32], target;
  4428.     read_argv(1, arg, charsmax(arg));
  4429.  
  4430.     target = cmd_target(id, arg, CMDTARGET_NO_BOTS);
  4431.     if ( !target ) return PLUGIN_HANDLED;
  4432.     else if ( id == target )
  4433.     {
  4434.         CmdReviveYourself(id);
  4435.         return PLUGIN_HANDLED;
  4436.     }
  4437.  
  4438.     static target_name[32];
  4439.     get_user_name(target, target_name, charsmax(target_name));
  4440.  
  4441.     if ( g_admin[target]
  4442.     || g_gived_access[target] )
  4443.     {
  4444.         SCM_Print(id, "^1%s^3 is admin, he can revive himself!", target_name);
  4445.         return PLUGIN_HANDLED;
  4446.     }
  4447.     else if ( g_alive[target] )
  4448.     {
  4449.         SCM_Print(id, "^1%s^3 is already alive!", target_name);
  4450.         return PLUGIN_HANDLED;
  4451.     }
  4452.  
  4453.     ExecuteHam(Ham_CS_RoundRespawn, target);
  4454.  
  4455.     static admin_name[32];
  4456.     get_user_name(id, admin_name, charsmax(admin_name));
  4457.  
  4458.     SCM_Print(id, "You revived^1 %s^3!", target_name);
  4459.  
  4460.     for ( new i = 1; i <= g_max_players; i++ )
  4461.     {
  4462.         if ( !g_connected[i]
  4463.         || i == id
  4464.         || i == target ) continue;
  4465.  
  4466.         SCM_Print(i, "^1%s^3 revived^1 %s^3!", admin_name, target_name);
  4467.     }
  4468.  
  4469.     SCM_Print(target, "You have been revived by^1 %s^3!", admin_name);
  4470.  
  4471.     return PLUGIN_HANDLED;
  4472. }
  4473.  
  4474. CmdReviveEveryone(id)
  4475. {
  4476.     if ( !g_admin[id] )
  4477.     {
  4478.         console_print(id, "You have no access to that command");
  4479.         return PLUGIN_HANDLED;
  4480.     }
  4481.  
  4482.     for ( new i = 1; i <= g_max_players; i++ )
  4483.     {
  4484.         if ( !g_connected[i]
  4485.         || g_admin[i]
  4486.         || g_gived_access[i]
  4487.         || g_alive[i] ) continue;
  4488.  
  4489.         ExecuteHam(Ham_CS_RoundRespawn, i);
  4490.     }
  4491.  
  4492.     static admin_name[32];
  4493.     get_user_name(id, admin_name, charsmax(admin_name));
  4494.  
  4495.     SCM_Print(0, "^1%s^3 revived everyone!", admin_name);
  4496.  
  4497.     return PLUGIN_HANDLED;
  4498. }
  4499.  
  4500. ToggleAllGodmode(id)
  4501. {
  4502.     if ( !g_admin[id] )
  4503.     {
  4504.         console_print(id, "You have no access to that command");
  4505.         return PLUGIN_HANDLED;
  4506.     }
  4507.  
  4508.     for ( new i = 1; i <= g_max_players; i++ )
  4509.     {
  4510.         if ( !g_connected[i] ) continue;
  4511.  
  4512.         if ( g_alive[i]
  4513.         && !g_admin[i]
  4514.         && !g_gived_access[i] )
  4515.         {
  4516.             entity_set_float(i, EV_FL_takedamage, g_all_godmode ? DAMAGE_AIM : DAMAGE_NO);
  4517.         }
  4518.  
  4519.         if ( g_viewing_commands_menu[i] ) ShowCommandsMenu(i);
  4520.     }
  4521.  
  4522.     g_all_godmode = !g_all_godmode;
  4523.  
  4524.     static admin_name[32];
  4525.     get_user_name(id, admin_name, charsmax(admin_name));
  4526.  
  4527.     if ( g_all_godmode )    SCM_Print(0, "^1%s^3 set godmode on everyone!", admin_name);
  4528.     else            SCM_Print(0, "^1%s^3 removed godmode from everyone!", admin_name);
  4529.  
  4530.     return PLUGIN_HANDLED;
  4531. }
  4532.  
  4533. CmdGiveAccess(id)
  4534. {
  4535.     if ( !g_admin[id] )
  4536.     {
  4537.         console_print(id, "You have no access to that command");
  4538.         return PLUGIN_HANDLED;
  4539.     }
  4540.  
  4541.     client_cmd(id, "messagemode SCM_GiveAccess");
  4542.     SCM_Print(id, "Type the name of the client that you want to give access to %s.", PLUGIN_PREFIX);
  4543.  
  4544.     return PLUGIN_HANDLED;
  4545. }
  4546.  
  4547. public GiveAccess(id)
  4548. {
  4549.     if ( !g_admin[id] )
  4550.     {
  4551.         console_print(id, "You have no access to that command");
  4552.         return PLUGIN_HANDLED;
  4553.     }
  4554.  
  4555.     static arg[32], target;
  4556.     read_argv(1, arg, charsmax(arg));
  4557.  
  4558.     target = cmd_target(id, arg, CMDTARGET_NO_BOTS);
  4559.     if ( !target ) return PLUGIN_HANDLED;
  4560.  
  4561.     static target_name[32];
  4562.     get_user_name(target, target_name, charsmax(target_name));
  4563.  
  4564.     if ( g_admin[target] || g_gived_access[target] )
  4565.     {
  4566.         SCM_Print(id, "^1%s^3 already have access to %s!", target_name, PLUGIN_PREFIX);
  4567.         return PLUGIN_HANDLED;
  4568.     }
  4569.  
  4570.     g_gived_access[target] = true;
  4571.  
  4572.     SCM_Print(id, "You gived^1 %s^3 access to %s!", target_name, PLUGIN_PREFIX);
  4573.  
  4574.     static admin_name[32];
  4575.     get_user_name(id, admin_name, charsmax(admin_name));
  4576.  
  4577.     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);
  4578.  
  4579.     for ( new i = 1; i <= g_max_players; i++ )
  4580.     {
  4581.         if ( i == id
  4582.         || i == target
  4583.         || !g_connected[i] ) continue;
  4584.  
  4585.         SCM_Print(i, "^1%s^3 gived^1 %s^3 access to %s!", admin_name, target_name, PLUGIN_PREFIX);
  4586.     }
  4587.  
  4588.     return PLUGIN_HANDLED;
  4589. }
  4590.  
  4591. public CmdShowInfo(id)
  4592. {
  4593.  static text[1120], len, textures[32], title[64];
  4594.  
  4595.  get_pcvar_string(g_cvar_textures, textures, charsmax(textures));
  4596.  
  4597.  len += format(text[len], charsmax(text) - len, "<html>");
  4598.  
  4599.  len += format(text[len], charsmax(text) - len, "<style type = ^"text/css^">");
  4600.  
  4601.  len += format(text[len], charsmax(text) - len, "body");
  4602.  len += format(text[len], charsmax(text) - len, "{");
  4603.  len += format(text[len], charsmax(text) - len,  "background-color:#000000;");
  4604.  len += format(text[len], charsmax(text) - len, "font-family:Comic Sans MS;");
  4605.  len += format(text[len], charsmax(text) - len, "font-weight:bold;");
  4606.  len += format(text[len], charsmax(text) - len, "}");
  4607.  
  4608.  len += format(text[len], charsmax(text) - len, "h1");
  4609.  len += format(text[len], charsmax(text) - len, "{");
  4610.  len += format(text[len], charsmax(text) - len, "color:#00FF00;");
  4611.  len += format(text[len], charsmax(text) - len, "font-size:large;");
  4612.  len += format(text[len], charsmax(text) - len, "}");
  4613.  
  4614.  len += format(text[len], charsmax(text) - len, "h2");
  4615.  len += format(text[len], charsmax(text) - len, "{");
  4616.  len += format(text[len], charsmax(text) - len, "color:#00FF00;");
  4617.  len += format(text[len], charsmax(text) - len, "font-size:medium;");
  4618.  len += format(text[len], charsmax(text) - len, "}");
  4619.  
  4620.  len += format(text[len], charsmax(text) - len, "h3");
  4621.  len += format(text[len], charsmax(text) - len, "{");
  4622.  len += format(text[len], charsmax(text) - len, "color:#0096FF;");
  4623.  len += format(text[len], charsmax(text) - len, "font-size:medium;");
  4624.  len += format(text[len], charsmax(text) - len, "}");
  4625.  
  4626.  len += format(text[len], charsmax(text) - len, "h4");
  4627.  len += format(text[len], charsmax(text) - len, "{");
  4628.  len += format(text[len], charsmax(text) - len, "color:#FFFFFF;");
  4629.  len += format(text[len], charsmax(text) - len, "font-size:medium;");
  4630.  len += format(text[len], charsmax(text) - len, "}");
  4631.  
  4632.  len += format(text[len], charsmax(text) - len, "h5");
  4633.  len += format(text[len], charsmax(text) - len, "{");
  4634.  len += format(text[len], charsmax(text) - len, "color:#FFFFFF;");
  4635.  len += format(text[len], charsmax(text) - len, "font-size:x-small;");
  4636.  len += format(text[len], charsmax(text) - len, "}");
  4637.  
  4638.  len += format(text[len], charsmax(text) - len, "</style>");
  4639.  
  4640.  len += format(text[len], charsmax(text) - len, "<body>");
  4641.  len += format(text[len], charsmax(text) - len, "<div align = ^"center^">");
  4642.  
  4643.  len += format(text[len], charsmax(text) - len, "<h1>");
  4644.  len += format(text[len], charsmax(text) - len, "%s v%s", PLUGIN_NAME, PLUGIN_VERSION);
  4645.  len += format(text[len], charsmax(text) - len, "</h1>");
  4646.  
  4647.  len += format(text[len], charsmax(text) - len, "<h4>");
  4648.  len += format(text[len], charsmax(text) - len, "by %s", PLUGIN_AUTHOR);
  4649.  len += format(text[len], charsmax(text) - len, "</h4>");
  4650.  
  4651.  len += format(text[len], charsmax(text) - len, "<h2>");
  4652.  len += format(text[len], charsmax(text) - len, "Grabbing Blocks:");
  4653.  len += format(text[len], charsmax(text) - len, "</h3>");
  4654.  
  4655.  len += format(text[len], charsmax(text) - len, "<h5>");
  4656.  len += format(text[len], charsmax(text) - len, "Bind a key to +bmgrab to move the blocks around.<br />");
  4657.  len += format(text[len], charsmax(text) - len, "Eg: <I>Bind F +bmgrab.</I>");
  4658.  len += format(text[len], charsmax(text) - len, "</h5>");
  4659.  
  4660.  len += format(text[len], charsmax(text) - len, "<h2>");
  4661.  len += format(text[len], charsmax(text) - len, "Commands while grabbing a block:");
  4662.  len += format(text[len], charsmax(text) - len, "</h2>");
  4663.  
  4664.  len += format(text[len], charsmax(text) - len, "<h5>");
  4665.  len += format(text[len], charsmax(text) - len, "<I>+Attack</I>: Copies the block.<br />");
  4666.  len += format(text[len], charsmax(text) - len, "<I>+Attack2</I>: Deletes the block.<br />");
  4667.  len += format(text[len], charsmax(text) - len, "<I>+Reload</I>: Rotates the block.<br />");
  4668.  len += format(text[len], charsmax(text) - len, "<I>+Jump</I>: Moves the block closer to you.<br />");
  4669.  len += format(text[len], charsmax(text) - len, "<I>+Duck</I>: Moves the block further away from you.");
  4670.  len += format(text[len], charsmax(text) - len, "</h5>");
  4671.  
  4672.  len += format(text[len], charsmax(text) - len, "<h3>");
  4673.  len += format(text[len], charsmax(text) - len, "Press <I>+Use</I> to see what block you are aiming at.<br />");
  4674.  len += format(text[len], charsmax(text) - len, "Type /bm to bring up the %s Main Menu.", PLUGIN_NAME);
  4675.  len += format(text[len], charsmax(text) - len, "</h3>");
  4676.  
  4677.  len += format(text[len], charsmax(text) - len, "</div>");
  4678.  len += format(text[len], charsmax(text) - len, "</body>");
  4679.  
  4680.  len += format(text[len], charsmax(text) - len, "</html>");
  4681.  
  4682.  format(title, charsmax(title) - 1, "Blockmaker Help");
  4683.  show_motd(id, text, title);
  4684.  
  4685.  return PLUGIN_HANDLED;
  4686. }
  4687.  
  4688.  
  4689. MoveGrabbedEntity(id, Float:move_to[3] = { 0.0, 0.0, 0.0 })
  4690. {
  4691.     static aiming[3];
  4692.     static look[3];
  4693.     static Float:float_aiming[3];
  4694.     static Float:float_look[3];
  4695.     static Float:direction[3];
  4696.     static Float:length;
  4697.  
  4698.     get_user_origin(id, aiming, 1);
  4699.     get_user_origin(id, look, 3);
  4700.     IVecFVec(aiming, float_aiming);
  4701.     IVecFVec(look, float_look);
  4702.  
  4703.     direction[0] = float_look[0] - float_aiming[0];
  4704.     direction[1] = float_look[1] - float_aiming[1];
  4705.     direction[2] = float_look[2] - float_aiming[2];
  4706.     length = get_distance_f(float_look, float_aiming);
  4707.  
  4708.     if ( length == 0.0 ) length = 1.0;
  4709.  
  4710.     move_to[0] = ( float_aiming[0] + direction[0] * g_grab_length[id] / length ) + g_grab_offset[id][0];
  4711.     move_to[1] = ( float_aiming[1] + direction[1] * g_grab_length[id] / length ) + g_grab_offset[id][1];
  4712.     move_to[2] = ( float_aiming[2] + direction[2] * g_grab_length[id] / length ) + g_grab_offset[id][2];
  4713.     move_to[2] = float(floatround(move_to[2], floatround_floor));
  4714.  
  4715.     MoveEntity(id, g_grabbed[id], move_to, true);
  4716. }
  4717.  
  4718. MoveEntity(id, ent, Float:move_to[3], bool:do_snapping)
  4719. {
  4720.     if ( do_snapping ) DoSnapping(id, ent, move_to);
  4721.  
  4722.     entity_set_origin(ent, move_to);
  4723. }
  4724.  
  4725. CreateBlockAiming(const id, const block_type)
  4726. {
  4727.     if ( !g_admin[id] && !g_gived_access[id] )
  4728.     {
  4729.         console_print(id, "You have no access to that command");
  4730.         return PLUGIN_HANDLED;
  4731.     }
  4732.    
  4733.     static origin[3];
  4734.     static Float:float_origin[3];
  4735.    
  4736.     new szCreator[32];
  4737.    
  4738.     get_user_name(id, szCreator, 31);
  4739.     replace_all(szCreator, 31, " ", "_");
  4740.    
  4741.     get_user_origin(id, origin, 3);
  4742.     IVecFVec(origin, float_origin);
  4743.     float_origin[2] += 4.0;
  4744.    
  4745.     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);
  4746.    
  4747.     return PLUGIN_HANDLED;
  4748. }
  4749.  
  4750. CreateBlock(const id, const block_type, Float:origin[3], const axis, const size, const property1[], const property2[], const property3[], const property4[], szCreator[] = "Unknown")
  4751. {
  4752.     new ent = create_entity("info_target");
  4753.     if ( !is_valid_ent(ent) ) return 0;
  4754.  
  4755.     entity_set_string(ent, EV_SZ_classname, g_block_classname);
  4756.     entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
  4757.     entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE);
  4758.  
  4759.     new block_model[256];
  4760.     new Float:size_min[3];
  4761.     new Float:size_max[3];
  4762.     new Float:angles[3];
  4763.     new Float:scale;
  4764.  
  4765.     switch ( axis )
  4766.     {
  4767.         case X:
  4768.         {
  4769.             if( size == POLE )
  4770.             {
  4771.                 size_min[0] = -32.0;
  4772.                 size_min[1] = -4.0;
  4773.                 size_min[2] = -4.0;
  4774.  
  4775.                 size_max[0] = 32.0;
  4776.                 size_max[1] = 4.0;
  4777.                 size_max[2] = 4.0;
  4778.             }
  4779.             else
  4780.             {
  4781.                 size_min[0] = -4.0;
  4782.                 size_min[1] = -32.0;
  4783.                 size_min[2] = -32.0;
  4784.  
  4785.                 size_max[0] = 4.0;
  4786.                 size_max[1] = 32.0;
  4787.                 size_max[2] = 32.0;
  4788.             }
  4789.  
  4790.             angles[0] = 90.0;
  4791.         }
  4792.         case Y:
  4793.         {
  4794.             if( size == POLE )
  4795.             {
  4796.                 size_min[0] = -4.0;
  4797.                 size_min[1] = -32.0;
  4798.                 size_min[2] = -4.0;
  4799.  
  4800.                 size_max[0] = 4.0;
  4801.                 size_max[1] = 32.0;
  4802.                 size_max[2] = 4.0;
  4803.             }
  4804.             else
  4805.             {
  4806.                 size_min[0] = -32.0;
  4807.                 size_min[1] = -4.0;
  4808.                 size_min[2] = -32.0;
  4809.  
  4810.                 size_max[0] = 32.0;
  4811.                 size_max[1] = 4.0;
  4812.                 size_max[2] = 32.0;
  4813.             }
  4814.  
  4815.             angles[0] = 90.0;
  4816.             angles[2] = 90.0;
  4817.         }
  4818.         case Z:
  4819.         {
  4820.             if( size == POLE )
  4821.             {
  4822.                 size_min[0] = -4.0;
  4823.                 size_min[1] = -4.0;
  4824.                 size_min[2] = -32.0;
  4825.  
  4826.                 size_max[0] = 4.0;
  4827.                 size_max[1] = 4.0;
  4828.                 size_max[2] = 32.0;
  4829.             }
  4830.             else
  4831.             {
  4832.                 size_min[0] = -32.0;
  4833.                 size_min[1] = -32.0;
  4834.                 size_min[2] = -4.0;
  4835.  
  4836.                 size_max[0] = 32.0;
  4837.                 size_max[1] = 32.0;
  4838.                 size_max[2] = 4.0;
  4839.             }
  4840.  
  4841.             angles[0] = 0.0;
  4842.             angles[1] = 0.0;
  4843.             angles[2] = 0.0;
  4844.         }
  4845.     }
  4846.  
  4847.     switch ( size )
  4848.     {
  4849.         case TINY:
  4850.         {
  4851.             SetBlockModelName(block_model, g_block_models[block_type], "Tiny");
  4852.             scale = 0.25;
  4853.         }
  4854.         case NORMAL:
  4855.         {
  4856.             block_model = g_block_models[block_type];
  4857.             scale = 1.0;
  4858.         }
  4859.         case LARGE:
  4860.         {
  4861.             SetBlockModelName(block_model, g_block_models[block_type], "Large");
  4862.             scale = 2.0;
  4863.         }
  4864.         case POLE:
  4865.         {
  4866.             SetBlockModelName(block_model, g_block_models[block_type], "Pole");
  4867.             scale = 1.0;
  4868.         }
  4869.     }
  4870.  
  4871.     for ( new i = 0; i < 3; ++i )
  4872.     {
  4873.         if ( size_min[i] != 4.0 && size_min[i] != -4.0 )
  4874.         {
  4875.             size_min[i] *= scale;
  4876.         }
  4877.  
  4878.         if ( size_max[i] != 4.0 && size_max[i] != -4.0 )
  4879.         {
  4880.             size_max[i] *= scale;
  4881.         }
  4882.     }
  4883.  
  4884.     entity_set_model(ent, block_model);
  4885.  
  4886.     SetBlockRendering(ent, g_render[block_type], g_red[block_type], g_green[block_type], g_blue[block_type], g_alpha[block_type]);
  4887.  
  4888.     entity_set_vector(ent, EV_VEC_angles, angles);
  4889.     entity_set_size(ent, size_min, size_max);
  4890.     entity_set_int(ent, EV_INT_body, block_type);
  4891.  
  4892.     if ( 1 <= id <= g_max_players )
  4893.     {
  4894.         DoSnapping(id, ent, origin);
  4895.     }
  4896.  
  4897.     if( block_type == MAGIC )
  4898.     {
  4899.         set_pev(ent, pev_movetype, MOVETYPE_FLY);
  4900.         set_pev(ent, pev_v_angle, origin);
  4901.     }
  4902.    
  4903.     set_pev(ent, pev_targetname, szCreator, 31);
  4904.    
  4905.     entity_set_origin(ent, origin);
  4906.    
  4907.     SetProperty(ent, 1, property1);
  4908.     SetProperty(ent, 2, property2);
  4909.     SetProperty(ent, 3, property3);
  4910.     SetProperty(ent, 4, property4);
  4911.  
  4912.     return ent;
  4913. }
  4914.  
  4915. ConvertBlockAiming(id, const convert_to)
  4916. {
  4917.     if ( !g_admin[id] && !g_gived_access[id] )
  4918.     {
  4919.         console_print(id, "You have no access to that command");
  4920.         return PLUGIN_HANDLED;
  4921.     }
  4922.  
  4923.     static ent, body;
  4924.     get_user_aiming(id, ent, body);
  4925.  
  4926.     if ( !IsBlock(ent) ) return PLUGIN_HANDLED;
  4927.  
  4928.     new grabber = entity_get_int(ent, EV_INT_iuser2);
  4929.     if ( grabber && grabber != id ) return PLUGIN_HANDLED;
  4930.  
  4931.     new player = entity_get_int(ent, EV_INT_iuser1);
  4932.     if ( player && player != id )
  4933.     {
  4934.         new player_name[32];
  4935.         get_user_name(player, player_name, charsmax(player_name));
  4936.  
  4937.         SCM_Print(id, "^1%s^3 currently has this block in their group!", player_name);
  4938.         return PLUGIN_HANDLED;
  4939.     }
  4940.  
  4941.     static new_block;
  4942.     if ( IsBlockInGroup(id, ent) && g_group_count[id] > 1 )
  4943.     {
  4944.         static i, block, block_count;
  4945.  
  4946.         block_count = 0;
  4947.         for ( i = 0; i <= g_group_count[id]; ++i )
  4948.         {
  4949.             block = g_grouped_blocks[id][i];
  4950.             if ( !IsBlockInGroup(id, block) ) continue;
  4951.  
  4952.             new_block = ConvertBlock(id, block, convert_to, true);
  4953.             if ( new_block != 0 )
  4954.             {
  4955.                 g_grouped_blocks[id][i] = new_block;
  4956.  
  4957.                 GroupBlock(id, new_block);
  4958.             }
  4959.             else
  4960.             {
  4961.                 ++block_count;
  4962.             }
  4963.         }
  4964.  
  4965.         if ( block_count > 1 )
  4966.         {
  4967.             SCM_Print(id, "Couldn't convert^1 %d^3 blocks!", block_count);
  4968.         }
  4969.     }
  4970.     else
  4971.     {
  4972.         new_block = ConvertBlock(id, ent, convert_to, false);
  4973.         if ( IsBlockStuck(new_block) )
  4974.         {
  4975.             new bool:deleted = DeleteBlock(new_block);
  4976.             if ( deleted ) SCM_Print(id, "Block deleted because it was stuck!");
  4977.         }
  4978.     }
  4979.  
  4980.     return PLUGIN_HANDLED;
  4981. }
  4982.  
  4983. ConvertBlock(id, ent, const convert_to, const bool:preserve_size, szCreator[] = "Unknown")
  4984. {
  4985.     new axis;
  4986.     new block_type;
  4987.     new property1[5], property2[5], property3[5], property4[5];
  4988.     new Float:origin[3];
  4989.     new Float:size_max[3];
  4990.    
  4991.     get_user_name(id, szCreator, 31);
  4992.     replace_all(szCreator, 31, " ", "_");
  4993.    
  4994.     block_type = entity_get_int(ent, EV_INT_body);
  4995.  
  4996.     entity_get_vector(ent, EV_VEC_origin, origin);
  4997.     entity_get_vector(ent, EV_VEC_maxs, size_max);
  4998.  
  4999.     for ( new i = 0; i < 3; ++i )
  5000.     {
  5001.         if ( size_max[i] == 4.0 )
  5002.         {
  5003.             axis = i;
  5004.             break;
  5005.         }
  5006.     }
  5007.  
  5008.     GetProperty(ent, 1, property1);
  5009.     GetProperty(ent, 2, property2);
  5010.     GetProperty(ent, 3, property3);
  5011.     GetProperty(ent, 4, property4);
  5012.  
  5013.     if ( block_type != convert_to )
  5014.     {
  5015.         copy(property1, charsmax(property1), g_property1_default_value[convert_to]);
  5016.         copy(property2, charsmax(property1), g_property2_default_value[convert_to]);
  5017.         copy(property3, charsmax(property1), g_property3_default_value[convert_to]);
  5018.         copy(property4, charsmax(property1), g_property4_default_value[convert_to]);
  5019.     }
  5020.  
  5021.     DeleteBlock(ent);
  5022.  
  5023.     if ( preserve_size )
  5024.     {
  5025.         static size, Float:max_size;
  5026.  
  5027.         max_size = size_max[0] + size_max[1] + size_max[2];
  5028.  
  5029.         if ( max_size > 128.0 )     size = LARGE;
  5030.         else if ( max_size > 64.0 ) size = NORMAL;
  5031.         else if ( max_size > 36.0 ) size = POLE;
  5032.         else                size = TINY;
  5033.  
  5034.         return CreateBlock(id, convert_to, origin, axis, size, property1, property2, property3, property4, szCreator);
  5035.     }
  5036.     else
  5037.     {
  5038.         return CreateBlock(id, convert_to, origin, axis, g_selected_block_size[id], property1, property2, property3, property4, szCreator);
  5039.     }
  5040.  
  5041.     return ent;
  5042. }
  5043.  
  5044. DeleteBlockAiming(id)
  5045. {
  5046.     if ( !g_admin[id] && !g_gived_access[id] )
  5047.     {
  5048.         console_print(id, "You have no access to that command");
  5049.         return PLUGIN_HANDLED;
  5050.     }
  5051.  
  5052.     static ent, body;
  5053.     get_user_aiming(id, ent, body);
  5054.  
  5055.     if ( !IsBlock(ent) ) return PLUGIN_HANDLED;
  5056.  
  5057.     new grabber = entity_get_int(ent, EV_INT_iuser2);
  5058.     if ( grabber && grabber != id ) return PLUGIN_HANDLED;
  5059.  
  5060.     new player = entity_get_int(ent, EV_INT_iuser1);
  5061.     if ( player && player != id )
  5062.     {
  5063.         new player_name[32];
  5064.         get_user_name(player, player_name, charsmax(player_name));
  5065.  
  5066.         SCM_Print(id, "^1%s^3 currently has this block in their group!", player_name);
  5067.         return PLUGIN_HANDLED;
  5068.     }
  5069.  
  5070.     if ( IsBlockInGroup(id, ent) && g_group_count[id] > 1 )
  5071.     {
  5072.         static i, block;
  5073.         for ( i = 0; i <= g_group_count[id]; ++i )
  5074.         {
  5075.             block = g_grouped_blocks[id][i];
  5076.             if ( !is_valid_ent(block) ) continue;
  5077.  
  5078.             DeleteBlock(block);
  5079.         }
  5080.  
  5081.         return PLUGIN_HANDLED;
  5082.     }
  5083.  
  5084.     DeleteBlock(ent);
  5085.  
  5086.     return PLUGIN_HANDLED;
  5087. }
  5088.  
  5089. bool:DeleteBlock(ent)
  5090. {
  5091.     if ( !IsBlock(ent) ) return false;
  5092.  
  5093.     remove_entity(ent);
  5094.     return true;
  5095. }
  5096.  
  5097. RotateBlockAiming(id)
  5098. {
  5099.     if ( !g_admin[id] && !g_gived_access[id] )
  5100.     {
  5101.         console_print(id, "You have no access to that command");
  5102.         return PLUGIN_HANDLED;
  5103.     }
  5104.  
  5105.     static ent, body;
  5106.     get_user_aiming(id, ent, body);
  5107.  
  5108.     if ( !IsBlock(ent) ) return PLUGIN_HANDLED;
  5109.  
  5110.     new grabber = entity_get_int(ent, EV_INT_iuser2);
  5111.     if ( grabber && grabber != id ) return PLUGIN_HANDLED;
  5112.  
  5113.     new player = entity_get_int(ent, EV_INT_iuser1);
  5114.     if ( player && player != id )
  5115.     {
  5116.         static player_name[32];
  5117.         get_user_name(player, player_name, charsmax(player_name));
  5118.  
  5119.         SCM_Print(id, "^1%s^3 currently has this block in their group!", player_name);
  5120.         return PLUGIN_HANDLED;
  5121.     }
  5122.  
  5123.     if ( IsBlockInGroup(id, ent) && g_group_count[id] > 1 )
  5124.     {
  5125.         static block;
  5126.         for ( new i = 0; i <= g_group_count[id]; ++i )
  5127.         {
  5128.             block = g_grouped_blocks[id][i];
  5129.             if ( IsBlockInGroup(id, block) ) RotateBlock(block);
  5130.         }
  5131.     }
  5132.     else
  5133.     {
  5134.         RotateBlock(ent);
  5135.     }
  5136.  
  5137.     return PLUGIN_HANDLED;
  5138. }
  5139.  
  5140. RotateBlock(ent)
  5141. {
  5142.     if ( !is_valid_ent(ent) ) return false;
  5143.  
  5144.     static Float:angles[3];
  5145.     static Float:size_min[3];
  5146.     static Float:size_max[3];
  5147.     static Float:temp;
  5148.  
  5149.     entity_get_vector(ent, EV_VEC_angles, angles);
  5150.     entity_get_vector(ent, EV_VEC_mins, size_min);
  5151.     entity_get_vector(ent, EV_VEC_maxs, size_max);
  5152.  
  5153.     if ( angles[0] == 0.0 && angles[2] == 0.0 )
  5154.     {
  5155.         angles[0] = 90.0;
  5156.     }
  5157.     else if ( angles[0] == 90.0 && angles[2] == 0.0 )
  5158.     {
  5159.         angles[0] = 90.0;
  5160.         angles[2] = 90.0;
  5161.     }
  5162.     else
  5163.     {
  5164.         angles[0] = 0.0;
  5165.         angles[1] = 0.0;
  5166.         angles[2] = 0.0;
  5167.     }
  5168.  
  5169.     temp = size_min[0];
  5170.     size_min[0] = size_min[2];
  5171.     size_min[2] = size_min[1];
  5172.     size_min[1] = temp;
  5173.  
  5174.     temp = size_max[0];
  5175.     size_max[0] = size_max[2];
  5176.     size_max[2] = size_max[1];
  5177.     size_max[1] = temp;
  5178.  
  5179.     entity_set_vector(ent, EV_VEC_angles, angles);
  5180.     entity_set_size(ent, size_min, size_max);
  5181.  
  5182.     return true;
  5183. }
  5184.  
  5185. ChangeBlockSize(id)
  5186. {
  5187.     switch ( g_selected_block_size[id] )
  5188.     {
  5189.         case TINY:  g_selected_block_size[id] = NORMAL;
  5190.         case NORMAL:    g_selected_block_size[id] = LARGE;
  5191.         case LARGE: g_selected_block_size[id] = POLE;
  5192.         case POLE:  g_selected_block_size[id] = TINY;
  5193.     }
  5194. }
  5195.  
  5196. SetPropertiesBlockAiming(id)
  5197. {
  5198.     if ( !g_admin[id] && !g_gived_access[id] )
  5199.     {
  5200.         console_print(id, "You have no access to that command");
  5201.         ShowBlockMenu(id);
  5202.         return PLUGIN_HANDLED;
  5203.     }
  5204.  
  5205.     static ent, body;
  5206.     get_user_aiming(id, ent, body);
  5207.  
  5208.     if ( !IsBlock(ent) )
  5209.     {
  5210.         ShowBlockMenu(id);
  5211.         return PLUGIN_HANDLED;
  5212.     }
  5213.  
  5214.     new block_type = entity_get_int(ent, EV_INT_body);
  5215.  
  5216.     if ( !g_property1_name[block_type][0]
  5217.     && !g_property2_name[block_type][0]
  5218.     && !g_property3_name[block_type][0]
  5219.     && !g_property4_name[block_type][0] )
  5220.     {
  5221.         ShowBlockMenu(id);
  5222.         return PLUGIN_HANDLED;
  5223.     }
  5224.  
  5225.     g_viewing_properties_menu[id] = true;
  5226.     ShowPropertiesMenu(id, ent);
  5227.  
  5228.     return PLUGIN_HANDLED;
  5229. }
  5230.  
  5231. public SetPropertyBlock(id)
  5232. {
  5233.     static arg[5];
  5234.     read_argv(1, arg, charsmax(arg));
  5235.  
  5236.     if ( !strlen(arg) )
  5237.     {
  5238.         SCM_Print(id, "You can't set a property blank! Please type a new value.");
  5239.         client_cmd(id, "messagemode SCM_SetProperty");
  5240.         return PLUGIN_HANDLED;
  5241.     }
  5242.     else if ( !IsStrFloat(arg) )
  5243.     {
  5244.         SCM_Print(id, "You can't use letters in a property! Please type a new value.");
  5245.         client_cmd(id, "messagemode SCM_SetProperty");
  5246.         return PLUGIN_HANDLED;
  5247.     }
  5248.  
  5249.     new ent = g_property_info[id][1];
  5250.     if ( !is_valid_ent(ent) )
  5251.     {
  5252.         SCM_Print(id, "That block has been deleted!");
  5253.         g_viewing_properties_menu[id] = false;
  5254.         ShowBlockMenu(id);
  5255.         return PLUGIN_HANDLED;
  5256.     }
  5257.     static block_type;
  5258.  
  5259.     static property;
  5260.     static Float:property_value;
  5261.  
  5262.     block_type = entity_get_int(ent, EV_INT_body);
  5263.     property = g_property_info[id][0];
  5264.     property_value = str_to_float(arg);
  5265.  
  5266.     if ( property == 3
  5267.     && block_type != BOOTS_OF_SPEED
  5268.     && block_type != SUPER )
  5269.     {
  5270.         if ( !( 1 <= property_value <= 200
  5271.         || property_value == 255
  5272.         || property_value == 0 ) )
  5273.         {
  5274.             SCM_Print(id, "The property has to be between^1 1^3 and^1 200^3,^1 255^3 or^1 0^3!");
  5275.             return PLUGIN_HANDLED;
  5276.         }
  5277.     }
  5278.     else
  5279.     {
  5280.         switch ( block_type )
  5281.         {
  5282.             case DAMAGE, HEALER:
  5283.             {
  5284.                 if ( property == 1
  5285.                 && !( 1 <= property_value <= 100 ) )
  5286.                 {
  5287.                     SCM_Print(id, "The property has to be between^1 1^3 and^1 100^3!");
  5288.                     return PLUGIN_HANDLED;
  5289.                 }
  5290.                 else if ( !( 0.1 <= property_value <= 240 ) )
  5291.                 {
  5292.                     SCM_Print(id, "The property has to be between^1 0.1^3 and^1 240^3!");
  5293.                     return PLUGIN_HANDLED;
  5294.                 }
  5295.             }
  5296.             case TRAMPOLINE:
  5297.             {
  5298.                 if ( !( 200 <= property_value <= 2000 ) )
  5299.                 {
  5300.                     SCM_Print(id, "The property has to be between^1 200^3 and^1 2000^3!");
  5301.                     return PLUGIN_HANDLED;
  5302.                 }
  5303.             }
  5304.             case SPEED_BOOST:
  5305.             {
  5306.                 if ( property == 1
  5307.                 && !( 200 <= property_value <= 2000 ) )
  5308.                 {
  5309.                     SCM_Print(id, "The property has to be between^1 200^3 and^1 2000^3!");
  5310.                     return PLUGIN_HANDLED;
  5311.                 }
  5312.                 else if ( !( 0 <= property_value <= 2000 ) )
  5313.                 {
  5314.                     SCM_Print(id, "The property has to be between^1 0^3 and^1 2000^3!");
  5315.                     return PLUGIN_HANDLED;
  5316.                 }
  5317.             }
  5318.             case SUPER:
  5319.             {
  5320.                 if ( property == 3
  5321.                 && !( 50 <= property_value <= 750 ) )
  5322.                 {
  5323.                     SCM_Print(id, "The property has to be between^1 50^3 and^1 750^3!");
  5324.                     return PLUGIN_HANDLED;
  5325.                 }
  5326.             }
  5327.             case LOW_GRAVITY:
  5328.             {
  5329.                 if ( !( 50 <= property_value <= 750 ) )
  5330.                 {
  5331.                     SCM_Print(id, "The property has to be between^1 50^3 and^1 750^3!");
  5332.                     return PLUGIN_HANDLED;
  5333.                 }
  5334.             }
  5335.             case HONEY:
  5336.             {
  5337.                 if ( !( 1 <= property_value <= 200
  5338.                 || property_value == 0 ) )
  5339.                 {
  5340.                     SCM_Print(id, "The property has to be between^1 1^3 and^1 200^3, or^1 0^3!");
  5341.                     return PLUGIN_HANDLED;
  5342.                 }
  5343.             }
  5344.             case DELAYED_BUNNYHOP:
  5345.             {
  5346.                 if ( !( 0.5 <= property_value <= 5 ) )
  5347.                 {
  5348.                     SCM_Print(id, "The property has to be between^1 0.5^3 and^1 5^3!");
  5349.                     return PLUGIN_HANDLED;
  5350.                 }
  5351.             }
  5352.             case  SCOUT, GLOCK, USP, M4A1, M3, P90, GALIL, FAMAS, AK47, AUG, SG552, SG550:
  5353.             {
  5354.                 if ( property == 1
  5355.                 && !( 1 <= property_value <= 5 ) )
  5356.                 {
  5357.                     SCM_Print(id, "The property has to be between^1 1^3 and^1 5^3!");
  5358.                     return PLUGIN_HANDLED;
  5359.                 }
  5360.                 else if ( property == 2
  5361.                 && !( 1 <= property_value <= 5 ) )
  5362.                 {
  5363.                     SCM_Print(id, "The property has to be between^1 1^3 and^1 5^3!");
  5364.                     return PLUGIN_HANDLED;
  5365.                 }
  5366.                 else if ( property == 3
  5367.                 && !( 1 <= property_value <= 5 ) )
  5368.                 {
  5369.                     SCM_Print(id, "The property has to be between^1 1^3 and^1 5^3!");
  5370.                     return PLUGIN_HANDLED;
  5371.                 }
  5372.                 else if ( property == 4
  5373.                 && !( 1 <= property_value <= 5 ) )
  5374.                 {
  5375.                     SCM_Print(id, "The property has to be between^1 1^3 and^1 5^3!");
  5376.                     return PLUGIN_HANDLED;
  5377.                 }
  5378.                 else if ( property == 5
  5379.                 && !( 1 <= property_value <= 5 ) )
  5380.                 {
  5381.                     SCM_Print(id, "The property has to be between^1 1^3 and^1 5^3!");
  5382.                     return PLUGIN_HANDLED;
  5383.                 }
  5384.                 else if ( property == 6
  5385.                 && !( 1 <= property_value <= 5 ) )
  5386.                 {
  5387.                     SCM_Print(id, "The property has to be between^1 1^3 and^1 5^3!");
  5388.                     return PLUGIN_HANDLED;
  5389.                 }
  5390.                 else if ( property == 7
  5391.                 && !( 1 <= property_value <= 5 ) )
  5392.                 {
  5393.                     SCM_Print(id, "The property has to be between^1 1^3 and^1 5^3!");
  5394.                     return PLUGIN_HANDLED;
  5395.                 }
  5396.                 else if ( property == 8
  5397.                 && !( 1 <= property_value <= 5 ) )
  5398.                 {
  5399.                     SCM_Print(id, "The property has to be between^1 1^3 and^1 5^3!");
  5400.                     return PLUGIN_HANDLED;
  5401.                 }
  5402.                 else if ( property == 9
  5403.                 && !( 1 <= property_value <= 5 ) )
  5404.                 {
  5405.                     SCM_Print(id, "The property has to be between^1 1^3 and^1 5^3!");
  5406.                     return PLUGIN_HANDLED;
  5407.                 }
  5408.                 else if ( property == 10
  5409.                 && !( 1 <= property_value <= 5 ) )
  5410.                 {
  5411.                     SCM_Print(id, "The property has to be between^1 1^3 and^1 5^3!");
  5412.                     return PLUGIN_HANDLED;
  5413.                 }
  5414.                 else if ( property == 11
  5415.                 && !( 1 <= property_value <= 5 ) )
  5416.                 {
  5417.                     SCM_Print(id, "The property has to be between^1 1^3 and^1 5^3!");
  5418.                     return PLUGIN_HANDLED;
  5419.                 }
  5420.                 else if ( property == 12
  5421.                 && !( 1 <= property_value <= 5 ) )
  5422.                 {
  5423.                     SCM_Print(id, "The property has to be between^1 1^3 and^1 5^3!");
  5424.                     return PLUGIN_HANDLED;
  5425.                 }
  5426.             }
  5427.             case INVINCIBILITY, STEALTH, BOOTS_OF_SPEED:
  5428.             {
  5429.                 if ( property == 1
  5430.                 && !( 0.5 <= property_value <= 240 ) )
  5431.                 {
  5432.                     SCM_Print(id, "The property has to be between^1 0.5^3 and^1 240^3!");
  5433.                     return PLUGIN_HANDLED;
  5434.                 }
  5435.                 else if ( property == 2
  5436.                 && !( 0 <= property_value <= 240 ) )
  5437.                 {
  5438.                     SCM_Print(id, "The property has to be between^1 0^3 and^1 240^3!");
  5439.                     return PLUGIN_HANDLED;
  5440.                 }
  5441.                 else if ( property == 3
  5442.                 && block_type == BOOTS_OF_SPEED
  5443.                 && !( 260 <= property_value <= 400 ) )
  5444.                 {
  5445.                     SCM_Print(id, "The property has to be between^1 260^3 and^1 400^3!");
  5446.                     return PLUGIN_HANDLED;
  5447.                 }
  5448.             }
  5449.             case XP:
  5450.             {
  5451.                 if ( !is_user_admin(id) )
  5452.                 {
  5453.                     if ( property == 1
  5454.                     && !( 5 <= property_value <= 10 ) )
  5455.                     {
  5456.                         SCM_Print(id, "The property has to be between^1 5^3 and^1 10^3!^4 (need admin to more xp!)");
  5457.                         return PLUGIN_HANDLED;
  5458.                     }
  5459.                     else if ( property == 2
  5460.                     && !( 120 <= property_value <= 1000 ) )
  5461.                     {
  5462.                         SCM_Print(id, "The property has to be between^1 120^3 and^1 1000^3!^4 (need admin to more time!)");
  5463.                         return PLUGIN_HANDLED;
  5464.                     }
  5465.                 }
  5466.             }
  5467.         }
  5468.     }
  5469.  
  5470.     SetProperty(ent, property, arg);
  5471.  
  5472.     for ( new i = 1; i <= g_max_players; i++ )
  5473.     {
  5474.         if ( !g_connected[i]
  5475.         || !g_viewing_properties_menu[i] ) continue;
  5476.  
  5477.         ent = g_property_info[i][1];
  5478.         ShowPropertiesMenu(i, ent);
  5479.     }
  5480.  
  5481.     return PLUGIN_HANDLED;
  5482. }
  5483.  
  5484. ToggleProperty(id, property)
  5485. {
  5486.     new ent = g_property_info[id][1];
  5487.     if ( !is_valid_ent(ent) )
  5488.     {
  5489.         SCM_Print(id, "That block has been deleted!");
  5490.         g_viewing_properties_menu[id] = false;
  5491.         ShowBlockMenu(id);
  5492.         return PLUGIN_HANDLED;
  5493.     }
  5494.  
  5495.     static property_value[5];
  5496.     GetProperty(ent, property, property_value);
  5497.  
  5498.     new block_type = entity_get_int(ent, EV_INT_body);
  5499.  
  5500.     if ( (block_type == SLAP ) && property == 1 )
  5501.     {
  5502.         if ( property_value[0] == '1' )     copy(property_value, charsmax(property_value), "2");
  5503.         else if ( property_value[0] == '2' )    copy(property_value, charsmax(property_value), "3");
  5504.         else                    copy(property_value, charsmax(property_value), "1");
  5505.     }
  5506.     else
  5507.     {
  5508.         if ( property_value[0] == '0' )     copy(property_value, charsmax(property_value), "1");
  5509.         else                    copy(property_value, charsmax(property_value), "0");
  5510.     }
  5511.  
  5512.     SetProperty(ent, property, property_value);
  5513.  
  5514.     for ( new i = 1; i <= g_max_players; i++ )
  5515.     {
  5516.         if ( g_connected[i] && g_viewing_properties_menu[i] )
  5517.         {
  5518.             ent = g_property_info[i][1];
  5519.             ShowPropertiesMenu(i, ent);
  5520.         }
  5521.     }
  5522.  
  5523.     return PLUGIN_HANDLED;
  5524. }
  5525.  
  5526. GetProperty(ent, property, property_value[])
  5527. {
  5528.     switch ( property )
  5529.     {
  5530.         case 1: pev(ent, pev_message, property_value, 5);
  5531.         case 2: pev(ent, pev_netname, property_value, 5);
  5532.         case 3: pev(ent, pev_viewmodel2, property_value, 5);
  5533.         case 4: pev(ent, pev_weaponmodel2, property_value, 5);
  5534.     }
  5535.  
  5536.     return (strlen(property_value) ? 1 : 0);
  5537. }
  5538.  
  5539. SetProperty(ent, property, const property_value[])
  5540. {
  5541.     switch ( property )
  5542.     {
  5543.         case 1: set_pev(ent, pev_message, property_value, 5);
  5544.         case 2: set_pev(ent, pev_netname, property_value, 5);
  5545.         case 3:
  5546.         {
  5547.             set_pev(ent, pev_viewmodel2, property_value, 5);
  5548.  
  5549.             new block_type = entity_get_int(ent, EV_INT_body);
  5550.             if ( g_property3_name[block_type][0] && block_type != BOOTS_OF_SPEED && block_type != SUPER && block_type != XP )
  5551.             {
  5552.                 new transparency = str_to_num(property_value);
  5553.                 if ( !transparency
  5554.                 || transparency == 255 )
  5555.                 {
  5556.                     SetBlockRendering(ent, g_render[block_type], g_red[block_type], g_green[block_type], g_blue[block_type], g_alpha[block_type]);
  5557.                 }
  5558.                 else
  5559.                 {
  5560.                     SetBlockRendering(ent, TRANSALPHA, 255, 255, 255, transparency);
  5561.                 }
  5562.             }
  5563.         }
  5564.         case 4: set_pev(ent, pev_weaponmodel2, property_value, 5);
  5565.     }
  5566.  
  5567.     return 1;
  5568. }
  5569.  
  5570. CopyBlock(id, ent)
  5571. {
  5572.     if ( !is_valid_ent(ent) ) return 0;
  5573.  
  5574.     new size;
  5575.     new axis;
  5576.     new property1[5], property2[5], property3[5], property4[5];
  5577.     new Float:origin[3];
  5578.     new Float:angles[3];
  5579.     new Float:size_min[3];
  5580.     new Float:size_max[3];
  5581.     new Float:max_size;
  5582.    
  5583.     new szCreator[32];
  5584.     get_user_name(id, szCreator, 31);
  5585.     replace_all(szCreator, 31, " ", "_");
  5586.    
  5587.     entity_get_vector(ent, EV_VEC_origin, origin);
  5588.     entity_get_vector(ent, EV_VEC_angles, angles);
  5589.     entity_get_vector(ent, EV_VEC_mins, size_min);
  5590.     entity_get_vector(ent, EV_VEC_maxs, size_max);
  5591.  
  5592.     max_size = size_max[0] + size_max[1] + size_max[2];
  5593.  
  5594.     if ( max_size > 128.0 )     size = LARGE;
  5595.     else if ( max_size > 64.0 ) size = NORMAL;
  5596.     else if ( max_size > 36.0 ) size = POLE;
  5597.     else                size = TINY;
  5598.  
  5599.     for ( new i = 0; i < 3; ++i )
  5600.     {
  5601.         if ( size_max[i] == 4.0 )
  5602.         {
  5603.             axis = i;
  5604.             break;
  5605.         }
  5606.     }
  5607.  
  5608.     GetProperty(ent, 1, property1);
  5609.     GetProperty(ent, 2, property2);
  5610.     GetProperty(ent, 3, property3);
  5611.     GetProperty(ent, 4, property4);
  5612.  
  5613.     return CreateBlock(0, entity_get_int(ent, EV_INT_body), origin, axis, size, property1, property2, property3, property4, szCreator);
  5614. }
  5615.  
  5616. GroupBlockAiming(id)
  5617. {
  5618.     if ( !g_admin[id] && !g_gived_access[id] )
  5619.     {
  5620.         console_print(id, "You have no access to that command");
  5621.         return PLUGIN_HANDLED;
  5622.     }
  5623.  
  5624.     static ent, body;
  5625.     get_user_aiming(id, ent, body);
  5626.  
  5627.     if ( !IsBlock(ent) ) return PLUGIN_HANDLED;
  5628.  
  5629.     new player = entity_get_int(ent, EV_INT_iuser1);
  5630.     if ( !player )
  5631.     {
  5632.         ++g_group_count[id];
  5633.         g_grouped_blocks[id][g_group_count[id]] = ent;
  5634.         GroupBlock(id, ent);
  5635.  
  5636.     }
  5637.     else if ( player == id )
  5638.     {
  5639.         UnGroupBlock(ent);
  5640.     }
  5641.     else
  5642.     {
  5643.         static player, name[32];
  5644.  
  5645.         player = entity_get_int(ent, EV_INT_iuser1);
  5646.         get_user_name(player, name, charsmax(name));
  5647.  
  5648.         SCM_Print(id, "Block is already in a group by:^1 %s", name);
  5649.     }
  5650.  
  5651.     return PLUGIN_HANDLED;
  5652. }
  5653.  
  5654. GroupBlock(id, ent)
  5655. {
  5656.     if ( !is_valid_ent(ent) ) return PLUGIN_HANDLED;
  5657.  
  5658.     if ( 1 <= id <= g_max_players )
  5659.     {
  5660.         entity_set_int(ent, EV_INT_iuser1, id);
  5661.     }
  5662.  
  5663.     set_rendering(ent, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 16);
  5664.  
  5665.     return PLUGIN_HANDLED;
  5666. }
  5667.  
  5668. UnGroupBlock(ent)
  5669. {
  5670.     if ( !IsBlock(ent) ) return PLUGIN_HANDLED;
  5671.  
  5672.     entity_set_int(ent, EV_INT_iuser1, 0);
  5673.  
  5674.     new block_type = entity_get_int(ent, EV_INT_body);
  5675.     SetBlockRendering(ent, g_render[block_type], g_red[block_type], g_green[block_type], g_blue[block_type], g_alpha[block_type]);
  5676.  
  5677.     return PLUGIN_HANDLED;
  5678. }
  5679.  
  5680. ClearGroup(id)
  5681. {
  5682.     if ( !g_admin[id] && !g_gived_access[id] )
  5683.     {
  5684.         console_print(id, "You have no access to that command");
  5685.         return PLUGIN_HANDLED;
  5686.     }
  5687.  
  5688.     static block;
  5689.     static block_count;
  5690.     static blocks_deleted;
  5691.  
  5692.     block_count = 0;
  5693.     blocks_deleted = 0;
  5694.     for ( new i = 0; i <= g_group_count[id]; ++i )
  5695.     {
  5696.         block = g_grouped_blocks[id][i];
  5697.         if ( IsBlockInGroup(id, block) )
  5698.         {
  5699.             if ( IsBlockStuck(block) )
  5700.             {
  5701.                 DeleteBlock(block);
  5702.                 ++blocks_deleted;
  5703.             }
  5704.             else
  5705.             {
  5706.                 UnGroupBlock(block);
  5707.                 ++block_count;
  5708.             }
  5709.         }
  5710.     }
  5711.  
  5712.     g_group_count[id] = 0;
  5713.  
  5714.     if ( g_connected[id] )
  5715.     {
  5716.         if ( blocks_deleted > 0 )
  5717.         {
  5718.             SCM_Print(id, "Removed^1 %d^3 blocks from group. Deleted^1 %d^3 stuck blocks!", block_count, blocks_deleted);
  5719.         }
  5720.         else
  5721.         {
  5722.             SCM_Print(id, "Removed^1 %d^3 blocks from group!", block_count);
  5723.         }
  5724.     }
  5725.  
  5726.     return PLUGIN_HANDLED;
  5727. }
  5728.  
  5729. SetBlockRendering(ent, type, red, green, blue, alpha)
  5730. {
  5731.     if ( !IsBlock(ent) ) return PLUGIN_HANDLED;
  5732.  
  5733.     switch ( type )
  5734.     {
  5735.         case GLOWSHELL:     set_rendering(ent, kRenderFxGlowShell, red, green, blue, kRenderNormal, alpha);
  5736.         case TRANSCOLOR:    set_rendering(ent, kRenderFxGlowShell, red, green, blue, kRenderTransColor, alpha);
  5737.         case TRANSALPHA:    set_rendering(ent, kRenderFxNone, red, green, blue, kRenderTransColor, alpha);
  5738.         case TRANSWHITE:    set_rendering(ent, kRenderFxNone, red, green, blue, kRenderTransAdd, alpha);
  5739.         default:        set_rendering(ent, kRenderFxNone, red, green, blue, kRenderNormal, alpha);
  5740.     }
  5741.  
  5742.     return PLUGIN_HANDLED;
  5743. }
  5744.  
  5745. bool:IsBlock(ent)
  5746. {
  5747.     if ( !is_valid_ent(ent) ) return false;
  5748.  
  5749.     static classname[32];
  5750.     entity_get_string(ent, EV_SZ_classname, classname, charsmax(classname));
  5751.  
  5752.     if ( equal(classname, g_block_classname) )
  5753.     {
  5754.         return true;
  5755.     }
  5756.  
  5757.     return false;
  5758. }
  5759.  
  5760. bool:IsBlockInGroup(id, ent)
  5761. {
  5762.     if ( !is_valid_ent(ent) ) return false;
  5763.  
  5764.     new player = entity_get_int(ent, EV_INT_iuser1);
  5765.     if ( player == id ) return true;
  5766.  
  5767.     return false;
  5768. }
  5769.  
  5770. bool:IsBlockStuck(ent)
  5771. {
  5772.     if ( !is_valid_ent(ent) ) return false;
  5773.  
  5774.     new content;
  5775.     new Float:origin[3];
  5776.     new Float:point[3];
  5777.     new Float:size_min[3];
  5778.     new Float:size_max[3];
  5779.  
  5780.     entity_get_vector(ent, EV_VEC_mins, size_min);
  5781.     entity_get_vector(ent, EV_VEC_maxs, size_max);
  5782.  
  5783.     entity_get_vector(ent, EV_VEC_origin, origin);
  5784.  
  5785.     size_min[0] += 1.0;
  5786.     size_min[1] += 1.0;
  5787.     size_min[2] += 1.0;
  5788.  
  5789.     size_max[0] -= 1.0;
  5790.     size_max[1] -= 1.0;
  5791.     size_max[2] -= 1.0;
  5792.  
  5793.     for ( new i = 0; i < 14; ++i )
  5794.     {
  5795.         point = origin;
  5796.  
  5797.         switch ( i )
  5798.         {
  5799.             case 0:
  5800.             {
  5801.                     point[0] += size_max[0];
  5802.                     point[1] += size_max[1];
  5803.                     point[2] += size_max[2];
  5804.             }
  5805.             case 1:
  5806.             {
  5807.                     point[0] += size_min[0];
  5808.                     point[1] += size_max[1];
  5809.                     point[2] += size_max[2];
  5810.             }
  5811.             case 2:
  5812.             {
  5813.                     point[0] += size_max[0];
  5814.                     point[1] += size_min[1];
  5815.                     point[2] += size_max[2];
  5816.             }
  5817.             case 3:
  5818.             {
  5819.                     point[0] += size_min[0];
  5820.                     point[1] += size_min[1];
  5821.                     point[2] += size_max[2];
  5822.             }
  5823.             case 4:
  5824.             {
  5825.                     point[0] += size_max[0];
  5826.                     point[1] += size_max[1];
  5827.                     point[2] += size_min[2];
  5828.             }
  5829.             case 5:
  5830.             {
  5831.                     point[0] += size_min[0];
  5832.                     point[1] += size_max[1];
  5833.                     point[2] += size_min[2];
  5834.             }
  5835.             case 6:
  5836.             {
  5837.                     point[0] += size_max[0];
  5838.                     point[1] += size_min[1];
  5839.                     point[2] += size_min[2];
  5840.             }
  5841.             case 7:
  5842.             {
  5843.                     point[0] += size_min[0];
  5844.                     point[1] += size_min[1];
  5845.                     point[2] += size_min[2];
  5846.             }
  5847.             case 8:     point[0] += size_max[0];
  5848.             case 9:     point[0] += size_min[0];
  5849.             case 10:    point[1] += size_max[1];
  5850.             case 11:    point[1] += size_min[1];
  5851.             case 12:    point[2] += size_max[2];
  5852.             case 13:    point[2] += size_min[2];
  5853.         }
  5854.  
  5855.         content = point_contents(point);
  5856.         if ( content == CONTENTS_EMPTY
  5857.         || !content ) return false;
  5858.     }
  5859.  
  5860.     return true;
  5861. }
  5862.  
  5863. CreateTeleportAiming(id, teleport_type)
  5864. {
  5865.     if ( !g_admin[id] && !g_gived_access[id] )
  5866.     {
  5867.         console_print(id, "You have no access to that command");
  5868.         return PLUGIN_HANDLED;
  5869.     }
  5870.  
  5871.     static origin[3];
  5872.     static Float:float_origin[3];
  5873.  
  5874.     get_user_origin(id, origin, 3);
  5875.     IVecFVec(origin, float_origin);
  5876.     float_origin[2] += 36.0;
  5877.  
  5878.     CreateTeleport(id, teleport_type, float_origin);
  5879.  
  5880.     return PLUGIN_HANDLED;
  5881. }
  5882.  
  5883. CreateTeleport(id, teleport_type, Float:origin[3])
  5884. {
  5885.     new ent = create_entity("info_target");
  5886.     if ( !is_valid_ent(ent) ) return PLUGIN_HANDLED;
  5887.  
  5888.     switch ( teleport_type )
  5889.     {
  5890.         case TELEPORT_START:
  5891.         {
  5892.             if ( g_teleport_start[id] ) remove_entity(g_teleport_start[id]);
  5893.  
  5894.             entity_set_string(ent, EV_SZ_classname, g_start_classname);
  5895.             entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
  5896.             entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE);
  5897.             entity_set_model(ent, g_sprite_teleport_start);
  5898.             entity_set_size(ent, Float:{ -16.0, -16.0, -16.0 }, Float:{ 16.0, 16.0, 16.0 });
  5899.             entity_set_origin(ent, origin);
  5900.  
  5901.             entity_set_int(ent, EV_INT_rendermode, 5);
  5902.             entity_set_float(ent, EV_FL_renderamt, 255.0);
  5903.  
  5904.             static params[2];
  5905.             params[0] = ent;
  5906.             params[1] = 6;
  5907.  
  5908.             set_task(0.1, "TaskSpriteNextFrame", TASK_SPRITE + ent, params, 2, g_b);
  5909.  
  5910.             g_teleport_start[id] = ent;
  5911.         }
  5912.         case TELEPORT_DESTINATION:
  5913.         {
  5914.             if ( !g_teleport_start[id] )
  5915.             {
  5916.                 remove_entity(ent);
  5917.                 return PLUGIN_HANDLED;
  5918.             }
  5919.  
  5920.             entity_set_string(ent, EV_SZ_classname, g_destination_classname);
  5921.             entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
  5922.             entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE);
  5923.             entity_set_model(ent, g_sprite_teleport_destination);
  5924.             entity_set_size(ent, Float:{ -16.0, -16.0, -16.0 }, Float:{ 16.0, 16.0, 16.0 });
  5925.             entity_set_origin(ent, origin);
  5926.  
  5927.             entity_set_int(ent, EV_INT_rendermode, 5);
  5928.             entity_set_float(ent, EV_FL_renderamt, 255.0);
  5929.  
  5930.             entity_set_int(ent, EV_INT_iuser1, g_teleport_start[id]);
  5931.             entity_set_int(g_teleport_start[id], EV_INT_iuser1, ent);
  5932.  
  5933.             static params[2];
  5934.             params[0] = ent;
  5935.             params[1] = 4;
  5936.  
  5937.             set_task(0.1, "TaskSpriteNextFrame", TASK_SPRITE + ent, params, 2, g_b);
  5938.  
  5939.             g_teleport_start[id] = 0;
  5940.         }
  5941.     }
  5942.  
  5943.     return PLUGIN_HANDLED;
  5944. }
  5945.  
  5946. DeleteTeleportAiming(id)
  5947. {
  5948.     if ( !g_admin[id] && !g_gived_access[id] )
  5949.     {
  5950.         console_print(id, "You have no access to that command");
  5951.         return PLUGIN_HANDLED;
  5952.     }
  5953.  
  5954.     static ent, body;
  5955.     get_user_aiming(id, ent, body, 9999);
  5956.  
  5957.     new bool:deleted = DeleteTeleport(id, ent);
  5958.     if ( deleted ) SCM_Print(id, "Teleport deleted!");
  5959.  
  5960.     return PLUGIN_HANDLED;
  5961. }
  5962.  
  5963. bool:DeleteTeleport(id, ent)
  5964. {
  5965.     for ( new i = 0; i < 2; ++i )
  5966.     {
  5967.         if ( !IsTeleport(ent) ) return false;
  5968.  
  5969.         new tele = entity_get_int(ent, EV_INT_iuser1);
  5970.  
  5971.         if ( g_teleport_start[id] == ent
  5972.         || g_teleport_start[id] == tele )
  5973.         {
  5974.             g_teleport_start[id] = 0;
  5975.         }
  5976.  
  5977.         if ( task_exists(TASK_SPRITE + ent) )
  5978.         {
  5979.             remove_task(TASK_SPRITE + ent);
  5980.         }
  5981.  
  5982.         if ( task_exists(TASK_SPRITE + tele) )
  5983.         {
  5984.             remove_task(TASK_SPRITE + tele);
  5985.         }
  5986.  
  5987.         if ( tele ) remove_entity(tele);
  5988.  
  5989.         remove_entity(ent);
  5990.         return true;
  5991.     }
  5992.  
  5993.     return false;
  5994. }
  5995.  
  5996. SwapTeleportAiming(id)
  5997. {
  5998.     if ( !g_admin[id] && !g_gived_access[id] )
  5999.     {
  6000.         console_print(id, "You have no access to that command");
  6001.         return PLUGIN_HANDLED;
  6002.     }
  6003.  
  6004.     static ent, body;
  6005.     get_user_aiming(id, ent, body, 9999);
  6006.  
  6007.     if ( !IsTeleport(ent) ) return PLUGIN_HANDLED;
  6008.  
  6009.     SwapTeleport(id, ent);
  6010.  
  6011.     return PLUGIN_HANDLED;
  6012. }
  6013.  
  6014. SwapTeleport(id, ent)
  6015. {
  6016.     static Float:origin_ent[3];
  6017.     static Float:origin_tele[3];
  6018.  
  6019.     new tele = entity_get_int(ent, EV_INT_iuser1);
  6020.     if ( !is_valid_ent(tele) )
  6021.     {
  6022.         SCM_Print(id, "Can't swap teleport positions!");
  6023.         return PLUGIN_HANDLED;
  6024.     }
  6025.  
  6026.     entity_get_vector(ent, EV_VEC_origin, origin_ent);
  6027.     entity_get_vector(tele, EV_VEC_origin, origin_tele);
  6028.  
  6029.     static classname[32];
  6030.     entity_get_string(ent, EV_SZ_classname, classname, charsmax(classname));
  6031.  
  6032.     DeleteTeleport(id, ent);
  6033.  
  6034.     if ( equal(classname, g_start_classname) )
  6035.     {
  6036.         CreateTeleport(id, TELEPORT_START, origin_tele);
  6037.         CreateTeleport(id, TELEPORT_DESTINATION, origin_ent);
  6038.     }
  6039.     else if ( equal(classname, g_destination_classname) )
  6040.     {
  6041.         CreateTeleport(id, TELEPORT_START, origin_ent);
  6042.         CreateTeleport(id, TELEPORT_DESTINATION, origin_tele);
  6043.     }
  6044.  
  6045.     SCM_Print(id, "Teleports swapped!");
  6046.  
  6047.     return PLUGIN_HANDLED;
  6048. }
  6049.  
  6050. ShowTeleportPath(id)
  6051. {
  6052.     static ent, body;
  6053.     get_user_aiming(id, ent, body);
  6054.  
  6055.     if ( !IsTeleport(ent) ) return PLUGIN_HANDLED;
  6056.  
  6057.     new tele = entity_get_int(ent, EV_INT_iuser1);
  6058.     if ( !tele ) return PLUGIN_HANDLED;
  6059.  
  6060.     static Float:origin1[3], Float:origin2[3], Float:dist;
  6061.  
  6062.     entity_get_vector(ent, EV_VEC_origin, origin1);
  6063.     entity_get_vector(tele, EV_VEC_origin, origin2);
  6064.  
  6065.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  6066.     write_byte(TE_BEAMPOINTS);
  6067.     write_coord(floatround(origin1[0], floatround_floor));
  6068.     write_coord(floatround(origin1[1], floatround_floor));
  6069.     write_coord(floatround(origin1[2], floatround_floor));
  6070.     write_coord(floatround(origin2[0], floatround_floor));
  6071.     write_coord(floatround(origin2[1], floatround_floor));
  6072.     write_coord(floatround(origin2[2], floatround_floor));
  6073.     write_short(g_sprite_beam);
  6074.     write_byte(0);
  6075.     write_byte(1);
  6076.     write_byte(50);
  6077.     write_byte(5);
  6078.     write_byte(0);
  6079.     write_byte(255);
  6080.     write_byte(255);
  6081.     write_byte(255);
  6082.     write_byte(255);
  6083.     write_byte(0);
  6084.     message_end();
  6085.  
  6086.     dist = get_distance_f(origin1, origin2);
  6087.  
  6088.     SCM_Print(id, "A line has been drawn to show the teleport path. Distance:^1 %f units", dist);
  6089.  
  6090.     return PLUGIN_HANDLED;
  6091. }
  6092.  
  6093. bool:IsTeleport(ent)
  6094. {
  6095.     if ( !is_valid_ent(ent) ) return false;
  6096.  
  6097.     static classname[32];
  6098.     entity_get_string(ent, EV_SZ_classname, classname, charsmax(classname));
  6099.  
  6100.     if ( equal(classname, g_start_classname)
  6101.     || equal(classname, g_destination_classname) )
  6102.     {
  6103.         return true;
  6104.     }
  6105.  
  6106.     return false;
  6107. }
  6108.  
  6109. CreateLightAiming(const id)
  6110. {
  6111.     if ( !g_admin[id] && !g_gived_access[id] )
  6112.     {
  6113.         console_print(id, "You have no access to that command");
  6114.         return PLUGIN_HANDLED;
  6115.     }
  6116.  
  6117.     static origin[3];
  6118.     static Float:float_origin[3];
  6119.    
  6120.     new szCreator[32];
  6121.    
  6122.     get_user_name(id, szCreator, 31);
  6123.     replace_all(szCreator, 31, " ", "_");
  6124.    
  6125.     get_user_origin(id, origin, 3);
  6126.     IVecFVec(origin, float_origin);
  6127.     float_origin[2] += 4.0;
  6128.  
  6129.     CreateLight(float_origin, "25", "255", "255", "255", szCreator);
  6130.  
  6131.     return PLUGIN_HANDLED;
  6132. }
  6133.  
  6134. CreateLight(Float:origin[3], const radius[], const color_red[], const color_green[], const color_blue[], szCreator[] = "Unknown")
  6135. {
  6136.     new ent = create_entity("info_target");
  6137.     if ( !is_valid_ent(ent) ) return 0;
  6138.  
  6139.     entity_set_origin(ent, origin);
  6140.     entity_set_model(ent, g_sprite_light);
  6141.     entity_set_float(ent, EV_FL_scale, 0.25);
  6142.     entity_set_string(ent, EV_SZ_classname, g_light_classname);
  6143.     entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
  6144.     entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE);
  6145.  
  6146.     entity_set_size(ent, Float:{ -3.0, -3.0, -6.0 }, Float:{ 3.0, 3.0, 6.0 });
  6147.  
  6148.     static Float:color[3];
  6149.     color[0] = str_to_float(color_red);
  6150.     color[1] = str_to_float(color_green);
  6151.     color[2] = str_to_float(color_blue);
  6152.  
  6153.     entity_set_vector(ent, EV_VEC_rendercolor, color);
  6154.  
  6155.     SetProperty(ent, 1, radius);
  6156.     SetProperty(ent, 2, color_red);
  6157.     SetProperty(ent, 3, color_green);
  6158.     SetProperty(ent, 4, color_blue);
  6159.  
  6160.     entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.01);
  6161.    
  6162.     set_pev(ent, pev_targetname,szCreator, 31);
  6163.  
  6164.     return ent;
  6165. }
  6166.  
  6167. DeleteLightAiming(id)
  6168. {
  6169.     if ( !g_admin[id] && !g_gived_access[id] )
  6170.     {
  6171.         console_print(id, "You have no access to that command");
  6172.         return PLUGIN_HANDLED;
  6173.     }
  6174.  
  6175.     static ent, body;
  6176.     get_user_aiming(id, ent, body);
  6177.  
  6178.     if ( !IsLight(ent) ) return PLUGIN_HANDLED;
  6179.  
  6180.     new grabber = entity_get_int(ent, EV_INT_iuser2);
  6181.     if ( grabber && grabber != id ) return PLUGIN_HANDLED;
  6182.  
  6183.     DeleteLight(ent);
  6184.  
  6185.     return PLUGIN_HANDLED;
  6186. }
  6187.  
  6188. bool:DeleteLight(ent)
  6189. {
  6190.     if ( !IsLight(ent) ) return false;
  6191.  
  6192.     remove_entity(ent);
  6193.  
  6194.     return true;
  6195. }
  6196.  
  6197. SetPropertiesLightAiming(id)
  6198. {
  6199.     if ( !g_admin[id] && !g_gived_access[id] )
  6200.     {
  6201.         console_print(id, "You have no access to that command");
  6202.         ShowLightMenu(id);
  6203.         return PLUGIN_HANDLED;
  6204.     }
  6205.  
  6206.     static ent, body;
  6207.     get_user_aiming(id, ent, body);
  6208.  
  6209.     if ( !IsLight(ent) )
  6210.     {
  6211.         ShowLightMenu(id);
  6212.         return PLUGIN_HANDLED;
  6213.     }
  6214.  
  6215.     g_viewing_light_properties_menu[id] = true;
  6216.     ShowLightPropertiesMenu(id, ent);
  6217.  
  6218.     return PLUGIN_HANDLED;
  6219. }
  6220.  
  6221. public SetPropertyLight(id)
  6222. {
  6223.     static arg[33];
  6224.     read_argv(1, arg, charsmax(arg));
  6225.  
  6226.     if ( !strlen(arg) )
  6227.     {
  6228.         SCM_Print(id, "You can't set a property blank! Please type a new value.");
  6229.         client_cmd(id, "messagemode SCM_SetLightProperty");
  6230.         return PLUGIN_HANDLED;
  6231.     }
  6232.     else if ( !is_str_num(arg) )
  6233.     {
  6234.         SCM_Print(id, "You can't use letters in a property! Please type a new value.");
  6235.         client_cmd(id, "messagemode SCM_SetLightProperty");
  6236.         return PLUGIN_HANDLED;
  6237.     }
  6238.  
  6239.     new ent = g_light_property_info[id][1];
  6240.     if ( !is_valid_ent(ent) )
  6241.     {
  6242.         SCM_Print(id, "That light has been deleted!");
  6243.         g_viewing_light_properties_menu[id] = false;
  6244.         ShowLightMenu(id);
  6245.         return PLUGIN_HANDLED;
  6246.     }
  6247.  
  6248.     static property;
  6249.     static property_value;
  6250.  
  6251.     property = g_light_property_info[id][0];
  6252.     property_value = str_to_num(arg);
  6253.  
  6254.     if ( property == 1 )
  6255.     {
  6256.         if ( !( 1 <= property_value <= 100 ) )
  6257.         {
  6258.             SCM_Print(id, "The property has to be between^1 1^3 and^1 100^3!");
  6259.             return PLUGIN_HANDLED;
  6260.         }
  6261.     }
  6262.     else if ( !( 0 <= property_value <= 255 ) )
  6263.     {
  6264.         SCM_Print(id, "The property has to be between^1 0^3 and^1 255^3!");
  6265.         return PLUGIN_HANDLED;
  6266.     }
  6267.  
  6268.     SetProperty(ent, property, arg);
  6269.  
  6270.     if ( property != 1 )
  6271.     {
  6272.         static color_red[5], color_green[5], color_blue[5];
  6273.  
  6274.         GetProperty(ent, 2, color_red);
  6275.         GetProperty(ent, 3, color_green);
  6276.         GetProperty(ent, 4, color_blue);
  6277.  
  6278.         static Float:color[3];
  6279.         color[0] = str_to_float(color_red);
  6280.         color[1] = str_to_float(color_green);
  6281.         color[2] = str_to_float(color_blue);
  6282.  
  6283.         entity_set_vector(ent, EV_VEC_rendercolor, color);
  6284.     }
  6285.  
  6286.     for ( new i = 1; i <= g_max_players; i++ )
  6287.     {
  6288.         if ( !g_connected[i]
  6289.         || !g_viewing_light_properties_menu[i] ) continue;
  6290.  
  6291.         ent = g_light_property_info[i][1];
  6292.         ShowLightPropertiesMenu(i, ent);
  6293.     }
  6294.  
  6295.     return PLUGIN_HANDLED;
  6296. }
  6297.  
  6298. public LightThink(ent)
  6299. {
  6300.     static radius[5], color_red[5], color_green[5], color_blue[5];
  6301.  
  6302.     GetProperty(ent, 1, radius);
  6303.     GetProperty(ent, 2, color_red);
  6304.     GetProperty(ent, 3, color_green);
  6305.     GetProperty(ent, 4, color_blue);
  6306.  
  6307.     static Float:float_origin[3];
  6308.     entity_get_vector(ent, EV_VEC_origin, float_origin);
  6309.  
  6310.     static origin[3];
  6311.     FVecIVec(float_origin, origin);
  6312.  
  6313.     message_begin(MSG_PVS, SVC_TEMPENTITY, origin, 0);
  6314.     write_byte(TE_DLIGHT);
  6315.     write_coord(origin[0]);
  6316.     write_coord(origin[1]);
  6317.     write_coord(origin[2]);
  6318.     write_byte(str_to_num(radius));
  6319.     write_byte(str_to_num(color_red));
  6320.     write_byte(str_to_num(color_green));
  6321.     write_byte(str_to_num(color_blue));
  6322.     write_byte(1);
  6323.     write_byte(1);
  6324.     message_end();
  6325.  
  6326.     entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.01);
  6327. }
  6328.  
  6329. bool:IsLight(ent)
  6330. {
  6331.     if ( !is_valid_ent(ent) ) return false;
  6332.  
  6333.     static classname[32];
  6334.     entity_get_string(ent, EV_SZ_classname, classname, charsmax(classname));
  6335.  
  6336.     if ( equal(classname, g_light_classname) )
  6337.     {
  6338.         return true;
  6339.     }
  6340.  
  6341.     return false;
  6342. }
  6343.  
  6344. DoSnapping(id, ent, Float:move_to[3])
  6345. {
  6346.     if ( !g_snapping[id] ) return PLUGIN_HANDLED;
  6347.  
  6348.     new traceline;
  6349.     new closest_trace;
  6350.     new block_face;
  6351.     new Float:snap_size;
  6352.     new Float:v_return[3];
  6353.     new Float:dist;
  6354.     new Float:old_dist;
  6355.     new Float:trace_start[3];
  6356.     new Float:trace_end[3];
  6357.     new Float:size_min[3];
  6358.     new Float:size_max[3];
  6359.  
  6360.     entity_get_vector(ent, EV_VEC_mins, size_min);
  6361.     entity_get_vector(ent, EV_VEC_maxs, size_max);
  6362.  
  6363.     snap_size = g_snapping_gap[id] + 10.0;
  6364.     old_dist = 9999.9;
  6365.     closest_trace = 0;
  6366.     for ( new i = 0; i < 6; ++i )
  6367.     {
  6368.         trace_start = move_to;
  6369.  
  6370.         switch ( i )
  6371.         {
  6372.             case 0: trace_start[0] += size_min[0];
  6373.             case 1: trace_start[0] += size_max[0];
  6374.             case 2: trace_start[1] += size_min[1];
  6375.             case 3: trace_start[1] += size_max[1];
  6376.             case 4: trace_start[2] += size_min[2];
  6377.             case 5: trace_start[2] += size_max[2];
  6378.         }
  6379.  
  6380.         trace_end = trace_start;
  6381.  
  6382.         switch ( i )
  6383.         {
  6384.             case 0: trace_end[0] -= snap_size;
  6385.             case 1: trace_end[0] += snap_size;
  6386.             case 2: trace_end[1] -= snap_size;
  6387.             case 3: trace_end[1] += snap_size;
  6388.             case 4: trace_end[2] -= snap_size;
  6389.             case 5: trace_end[2] += snap_size;
  6390.         }
  6391.  
  6392.         traceline = trace_line(ent, trace_start, trace_end, v_return);
  6393.         if ( IsBlock(traceline)
  6394.         && ( !IsBlockInGroup(id, traceline) || !IsBlockInGroup(id, ent) ) )
  6395.         {
  6396.             dist = get_distance_f(trace_start, v_return);
  6397.             if ( dist < old_dist )
  6398.             {
  6399.                 closest_trace = traceline;
  6400.                 old_dist = dist;
  6401.  
  6402.                 block_face = i;
  6403.             }
  6404.         }
  6405.     }
  6406.  
  6407.     if ( !is_valid_ent(closest_trace) ) return PLUGIN_HANDLED;
  6408.  
  6409.     static Float:trace_origin[3];
  6410.     static Float:trace_size_min[3];
  6411.     static Float:trace_size_max[3];
  6412.  
  6413.     entity_get_vector(closest_trace, EV_VEC_origin, trace_origin);
  6414.     entity_get_vector(closest_trace, EV_VEC_mins, trace_size_min);
  6415.     entity_get_vector(closest_trace, EV_VEC_maxs, trace_size_max);
  6416.  
  6417.     move_to = trace_origin;
  6418.  
  6419.     if ( block_face == 0 ) move_to[0] += ( trace_size_max[0] + size_max[0] ) + g_snapping_gap[id];
  6420.     if ( block_face == 1 ) move_to[0] += ( trace_size_min[0] + size_min[0] ) - g_snapping_gap[id];
  6421.     if ( block_face == 2 ) move_to[1] += ( trace_size_max[1] + size_max[1] ) + g_snapping_gap[id];
  6422.     if ( block_face == 3 ) move_to[1] += ( trace_size_min[1] + size_min[1] ) - g_snapping_gap[id];
  6423.     if ( block_face == 4 ) move_to[2] += ( trace_size_max[2] + size_max[2] ) + g_snapping_gap[id];
  6424.     if ( block_face == 5 ) move_to[2] += ( trace_size_min[2] + size_min[2] ) - g_snapping_gap[id];
  6425.  
  6426.     return PLUGIN_HANDLED;
  6427. }
  6428.  
  6429. DeleteAll(id, bool:notify)
  6430. {
  6431.     if ( !g_admin[id] )
  6432.     {
  6433.         console_print(id, "You have no access to that command");
  6434.         return PLUGIN_HANDLED;
  6435.     }
  6436.  
  6437.     static ent, block_count, tele_count, light_count, bool:deleted;
  6438.  
  6439.     ent = -1;
  6440.     block_count = 0;
  6441.     while ( ( ent = find_ent_by_class(ent, g_block_classname) ) )
  6442.     {
  6443.         deleted = DeleteBlock(ent);
  6444.         if ( deleted )
  6445.         {
  6446.             ++block_count;
  6447.         }
  6448.     }
  6449.  
  6450.     ent = -1;
  6451.     tele_count = 0;
  6452.     while ( ( ent = find_ent_by_class(ent, g_start_classname) ) )
  6453.     {
  6454.         deleted = DeleteTeleport(id, ent);
  6455.         if ( deleted )
  6456.         {
  6457.             ++tele_count;
  6458.         }
  6459.     }
  6460.  
  6461.     ent = -1;
  6462.     light_count = 0;
  6463.     while ( ( ent = find_ent_by_class(ent, g_light_classname) ) )
  6464.     {
  6465.         deleted = DeleteLight(ent);
  6466.         if ( deleted )
  6467.         {
  6468.             ++light_count;
  6469.         }
  6470.     }
  6471.  
  6472.     if ( ( block_count
  6473.         || tele_count
  6474.         || light_count )
  6475.     && notify )
  6476.     {
  6477.         static name[32];
  6478.         get_user_name(id, name, charsmax(name));
  6479.  
  6480.         for ( new i = 1; i <= g_max_players; ++i )
  6481.         {
  6482.             g_grabbed[i] = 0;
  6483.             g_teleport_start[i] = 0;
  6484.  
  6485.             if ( !g_connected[i]
  6486.             || !g_admin[i] && !g_gived_access[i] ) continue;
  6487.  
  6488.             SCM_Print(i, "^1%s^3 deleted^1 %d blocks^3,^1 %d teleports^3 and^1 %d lights^3 from the map!", name, block_count, tele_count, light_count);
  6489.         }
  6490.     }
  6491.  
  6492.     return PLUGIN_HANDLED;
  6493. }
  6494.  
  6495. SaveBlocks(id)
  6496. {
  6497.     if ( !g_admin[id] )
  6498.     {
  6499.         console_print(id, "You have no access to that command");
  6500.         return PLUGIN_HANDLED;
  6501.     }
  6502.  
  6503.     new ent;
  6504.     new file;
  6505.     new data[128];
  6506.     new block_count;
  6507.     new tele_count;
  6508.     new light_count;
  6509.     new block_type;
  6510.     new size;
  6511.     new property1[5], property2[5], property3[5], property4[5];
  6512.     new tele;
  6513.     new Float:origin[3];
  6514.     new Float:angles[3];
  6515.     new Float:tele_start[3];
  6516.     new Float:tele_end[3];
  6517.     new Float:max_size;
  6518.     new Float:size_max[3];
  6519.    
  6520.     new szCreator[32];
  6521.    
  6522.     file = fopen(g_file, "wt");
  6523.  
  6524.     block_count = 0;
  6525.     tele_count = 0;
  6526.  
  6527.     ent = -1;
  6528.     while ( ( ent = find_ent_by_class(ent, g_block_classname) ) )
  6529.     {
  6530.         block_type = entity_get_int(ent, EV_INT_body);
  6531.         if( block_type == MAGIC )
  6532.         {
  6533.             pev(ent, pev_v_angle, origin);
  6534.         }
  6535.         else
  6536.         {
  6537.             entity_get_vector(ent, EV_VEC_origin, origin);
  6538.         }
  6539.         entity_get_vector(ent, EV_VEC_angles, angles);
  6540.         entity_get_vector(ent, EV_VEC_maxs, size_max);
  6541.        
  6542.         entity_get_string(ent, EV_SZ_targetname, szCreator, 31);
  6543.        
  6544.         GetProperty(ent, 1, property1);
  6545.         GetProperty(ent, 2, property2);
  6546.         GetProperty(ent, 3, property3);
  6547.         GetProperty(ent, 4, property4);
  6548.        
  6549.         if ( !property1[0] ) copy(property1, charsmax(property1), "/");
  6550.         if ( !property2[0] ) copy(property2, charsmax(property2), "/");
  6551.         if ( !property3[0] ) copy(property3, charsmax(property3), "/");
  6552.         if ( !property4[0] ) copy(property4, charsmax(property4), "/");
  6553.        
  6554.         max_size = size_max[0] + size_max[1] + size_max[2];
  6555.        
  6556.         if ( max_size > 128.0 )     size = LARGE;
  6557.         else if ( max_size > 64.0 ) size = NORMAL;
  6558.         else if ( max_size > 36.0 ) size = POLE;
  6559.         else                size = TINY;
  6560.        
  6561.         formatex(data, charsmax(data), "%c %f %f %f %f %f %f %d %s %s %s %s %s^n",\
  6562.         g_block_save_ids[block_type],\
  6563.         origin[0],\
  6564.         origin[1],\
  6565.         origin[2],\
  6566.         angles[0],\
  6567.         angles[1],\
  6568.         angles[2],\
  6569.         size,\
  6570.         property1,\
  6571.         property2,\
  6572.         property3,\
  6573.         property4,\
  6574.         szCreator
  6575.         );
  6576.         fputs(file, data);
  6577.        
  6578.         ++block_count;
  6579.     }
  6580.  
  6581.     ent = -1;
  6582.     while ( ( ent = find_ent_by_class(ent, g_destination_classname) ) )
  6583.     {
  6584.         tele = entity_get_int(ent, EV_INT_iuser1);
  6585.         if ( tele )
  6586.         {
  6587.             entity_get_vector(tele, EV_VEC_origin, tele_start);
  6588.             entity_get_vector(ent, EV_VEC_origin, tele_end);
  6589.  
  6590.             formatex(data, charsmax(data), "* %f %f %f %f %f %f^n",\
  6591.                 tele_start[0],\
  6592.                 tele_start[1],\
  6593.                 tele_start[2],\
  6594.                 tele_end[0],\
  6595.                 tele_end[1],\
  6596.                 tele_end[2]
  6597.                 );
  6598.             fputs(file, data);
  6599.  
  6600.             ++tele_count;
  6601.         }
  6602.     }
  6603.  
  6604.     ent = -1;
  6605.     while ( ( ent = find_ent_by_class(ent, g_light_classname) ) )
  6606.     {
  6607.         entity_get_vector(ent, EV_VEC_origin, origin);
  6608.        
  6609.         entity_get_string(ent, EV_SZ_targetname, szCreator, 31);
  6610.        
  6611.         GetProperty(ent, 1, property1);
  6612.         GetProperty(ent, 2, property2);
  6613.         GetProperty(ent, 3, property3);
  6614.         GetProperty(ent, 4, property4);
  6615.        
  6616.         formatex(data, charsmax(data), "! %f %f %f / / / / %s %s %s %s %s^n",\
  6617.         origin[0],\
  6618.         origin[1],\
  6619.         origin[2],\
  6620.         property1,\
  6621.         property2,\
  6622.         property3,\
  6623.         property4,\
  6624.         szCreator
  6625.         );
  6626.         fputs(file, data);
  6627.        
  6628.         ++light_count;
  6629.     }
  6630.  
  6631.     static name[32];
  6632.     get_user_name(id, name, charsmax(name));
  6633.  
  6634.     for ( new i = 1; i <= g_max_players; ++i )
  6635.     {
  6636.         if ( g_connected[i]
  6637.         && ( g_admin[i] || g_gived_access[i] ) )
  6638.         {
  6639.             SCM_Print(i, "^1%s^3 saved^1 %d block%s^3,^1 %d teleport%s^3 and^1 %d light%s^3! Total entites in map:^1 %d", name, block_count, block_count == 1 ? g_blank : "s", tele_count, tele_count == 1 ? g_blank : "s", light_count, light_count == 1 ? g_blank : "s", entity_count());
  6640.         }
  6641.     }
  6642.  
  6643.     fclose(file);
  6644.     return PLUGIN_HANDLED;
  6645. }
  6646.  
  6647. LoadBlocks(id)
  6648. {
  6649.     if ( id != 0 && !g_admin[id] )
  6650.     {
  6651.         console_print(id, "You have no access to that command");
  6652.         return PLUGIN_HANDLED;
  6653.     }
  6654.     else if ( !file_exists(g_file)
  6655.     && 1 <= id <= g_max_players )
  6656.     {
  6657.         SCM_Print(id, "Couldn't find file:^1 %s", g_file);
  6658.         return PLUGIN_HANDLED;
  6659.     }
  6660.  
  6661.     if ( 1 <= id <= g_max_players )
  6662.     {
  6663.         DeleteAll(id, false);
  6664.     }
  6665.  
  6666.     new file;
  6667.     new data[128];
  6668.     new block_count;
  6669.     new tele_count;
  6670.     new light_count;
  6671.     new type[2];
  6672.     new block_size[17];
  6673.     new origin_x[17];
  6674.     new origin_y[17];
  6675.     new origin_z[17];
  6676.     new angel_x[17];
  6677.     new angel_y[17];
  6678.     new angel_z[17];
  6679.     new block_type;
  6680.     new axis;
  6681.     new size;
  6682.     new property1[5], property2[5], property3[5], property4[5];
  6683.     new Float:origin[3];
  6684.     new Float:angles[3];
  6685.  
  6686.     new szCreator[32];
  6687.    
  6688.     file = fopen(g_file, "rt");
  6689.  
  6690.     block_count = 0;
  6691.     tele_count = 0;
  6692.  
  6693.     while ( !feof(file) )
  6694.     {
  6695.         type = g_blank;
  6696.        
  6697.         fgets(file, data, charsmax(data));
  6698.         parse(data,\
  6699.         type, charsmax(type),\
  6700.         origin_x, charsmax(origin_x),\
  6701.         origin_y, charsmax(origin_y),\
  6702.         origin_z, charsmax(origin_z),\
  6703.         angel_x, charsmax(angel_x),\
  6704.         angel_y, charsmax(angel_y),\
  6705.         angel_z, charsmax(angel_z),\
  6706.         block_size, charsmax(block_size),\
  6707.         property1, charsmax(property1),\
  6708.         property2, charsmax(property2),\
  6709.         property3, charsmax(property3),\
  6710.         property4, charsmax(property4),\
  6711.         szCreator, charsmax(szCreator)
  6712.         );
  6713.  
  6714.         origin[0] = str_to_float(origin_x);
  6715.         origin[1] = str_to_float(origin_y);
  6716.         origin[2] = str_to_float(origin_z);
  6717.         angles[0] = str_to_float(angel_x);
  6718.         angles[1] = str_to_float(angel_y);
  6719.         angles[2] = str_to_float(angel_z);
  6720.         size =      str_to_num(block_size);
  6721.  
  6722.         if ( strlen(type) > 0 )
  6723.         {
  6724.             if ( type[0] != '*' )
  6725.             {
  6726.                 if ( angles[0] == 90.0 && angles[1] == 0.0 && angles[2] == 0.0 )
  6727.                 {
  6728.                     axis = X;
  6729.                 }
  6730.                 else if ( angles[0] == 90.0 && angles[1] == 0.0 && angles[2] == 90.0 )
  6731.                 {
  6732.                     axis = Y;
  6733.                 }
  6734.                 else
  6735.                 {
  6736.                     axis = Z;
  6737.                 }
  6738.             }
  6739.  
  6740.             switch ( type[0] )
  6741.             {
  6742.                 case 'A': block_type = PLATFORM;
  6743.                 case 'B': block_type = BUNNYHOP;
  6744.                 case 'C': block_type = DAMAGE;
  6745.                 case 'D': block_type = HEALER;
  6746.                 case 'E': block_type = NO_FALL_DAMAGE;
  6747.                 case 'F': block_type = ICE;
  6748.                 case 'G': block_type = TRAMPOLINE;
  6749.                 case 'H': block_type = SPEED_BOOST;
  6750.                 case 'I': block_type = DEATH;
  6751.                 case 'J': block_type = LOW_GRAVITY;
  6752.                 case 'K': block_type = SLAP;
  6753.                 case 'L': block_type = HONEY;
  6754.                 case 'M': block_type = CT_BARRIER;
  6755.                 case 'N': block_type = T_BARRIER;
  6756.                 case 'O': block_type = GLASS;
  6757.                 case 'P': block_type = DELAYED_BUNNYHOP;
  6758.                 case 'Q': block_type = INVINCIBILITY;
  6759.                 case 'R': block_type = STEALTH;
  6760.                 case 'S': block_type = BOOTS_OF_SPEED;
  6761.                 case 'T': block_type = DUCK;
  6762.                 case 'U': block_type = MONEY;
  6763.                 case 'V': block_type = AWP;
  6764.                 case 'W': block_type = DEAGLE;
  6765.                 case 'X': block_type = HE;
  6766.                 case 'Y': block_type = FLASH;
  6767.                 case 'Z': block_type = SMOKE;
  6768.                 case '1': block_type = XP;
  6769.                 case '2': block_type = SCOUT;
  6770.                 case '3': block_type = GLOCK;
  6771.                 case '4': block_type = USP;
  6772.                 case '5': block_type = M4A1;
  6773.                 case '6': block_type = M3;
  6774.                 case '7': block_type = BLIND;
  6775.                 case '8': block_type = P90;
  6776.                 case '9': block_type = GALIL;
  6777.                 case '@': block_type = FAMAS;
  6778.                 case '#': block_type = AK47;
  6779.                 case '$': block_type = AUG;
  6780.                 case '%': block_type = SG552;
  6781.                 case '(': block_type = VESTHELM;
  6782.                 case '&': block_type = ICEBHOP;
  6783.                 case '|': block_type = CAM;
  6784.                 case '>': block_type = SUPER;
  6785.                 case '<': block_type = MAGIC;
  6786.                 case '*':
  6787.                 {
  6788.                     CreateTeleport(0, TELEPORT_START, origin);
  6789.                     CreateTeleport(0, TELEPORT_DESTINATION, angles);
  6790.  
  6791.                     ++tele_count;
  6792.                 }
  6793.                 case '!':
  6794.                 {
  6795.                     CreateLight(origin, property1, property2, property3, property4, szCreator);
  6796.  
  6797.                     ++light_count;
  6798.                 }
  6799.             }
  6800.  
  6801.             if ( type[0] != '*' && type[0] != '!' )
  6802.             {
  6803.                 CreateBlock(0, block_type, origin, axis, size, property1, property2, property3, property4, szCreator);
  6804.                
  6805.                 ++block_count;
  6806.             }
  6807.         }
  6808.     }
  6809.  
  6810.     fclose(file);
  6811.  
  6812.     if ( 1 <= id <= g_max_players )
  6813.     {
  6814.         static name[32];
  6815.         get_user_name(id, name, charsmax(name));
  6816.  
  6817.         for ( new i = 1; i <= g_max_players; ++i )
  6818.         {
  6819.             if ( !g_connected[i]
  6820.             || !g_admin[i] && !g_gived_access[i] ) continue;
  6821.  
  6822.             SCM_Print(i, "^1%s^3 loaded^1 %d block%s^3,^1 %d teleport%s^3 and^1 %d light%s^3! Total entites in map:^1 %d", name, block_count, block_count == 1 ? g_blank : "s", tele_count, tele_count == 1 ? g_blank : "s", light_count, light_count == 1 ? g_blank : "s", entity_count());
  6823.         }
  6824.     }
  6825.  
  6826.     return PLUGIN_HANDLED;
  6827. }
  6828.  
  6829. bool:IsStrFloat(string[])
  6830. {
  6831.     new len = strlen(string);
  6832.     for ( new i = 0; i < len; i++ )
  6833.     {
  6834.         switch ( string[i] )
  6835.         {
  6836.             case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', '-':    continue;
  6837.             default:                            return false;
  6838.         }
  6839.     }
  6840.  
  6841.     return true;
  6842. }
  6843.  
  6844. ResetPlayer(id)
  6845. {
  6846.     g_no_fall_damage[id] =      false;
  6847.     g_ice[id] =         false;
  6848.     g_low_gravity[id] =     false;
  6849.     g_no_slow_down[id] =        false;
  6850.     g_block_status[id] =        false;
  6851.     g_has_hud_text[id] =        false;
  6852.  
  6853.     g_slap_times[id] =      0;
  6854.     g_honey[id] =           0;
  6855.     g_boots_of_speed[id] =      0;
  6856.  
  6857.     g_next_damage_time[id] =    0.0;
  6858.     g_next_heal_time[id] =      0.0;
  6859.     g_invincibility_time_out[id] =  0.0;
  6860.     g_invincibility_next_use[id] =  0.0;
  6861.     g_stealth_time_out[id] =    0.0;
  6862.     g_stealth_next_use[id] =    0.0;
  6863.     g_cam_time_out[id] =        0.0;
  6864.     g_cam_next_use[id] =        0.0;
  6865.     g_boots_of_speed_time_out[id] = 0.0;
  6866.     g_boots_of_speed_next_use[id] = 0.0;
  6867.     g_super_time_out[id] =      0.0;
  6868.     g_super_next_use[id] =      0.0;
  6869.     g_next_xp_time[id] =        0.0;
  6870.  
  6871.     new task_id = TASK_INVINCIBLE + id;
  6872.     if ( task_exists(task_id) )
  6873.     {
  6874.         TaskRemoveInvincibility(task_id);
  6875.         remove_task(task_id);
  6876.     }
  6877.  
  6878.     task_id = TASK_STEALTH + id;
  6879.     if ( task_exists(task_id) )
  6880.     {
  6881.         TaskRemoveStealth(task_id);
  6882.         remove_task(task_id);
  6883.     }
  6884.  
  6885.     task_id = TASK_BOOTSOFSPEED + id;
  6886.     if ( task_exists(task_id) )
  6887.     {
  6888.         TaskRemoveBootsOfSpeed(task_id);
  6889.         remove_task(task_id);
  6890.     }
  6891.    
  6892.     task_id = TASK_CAM + id;
  6893.     if ( task_exists(task_id) )
  6894.     {
  6895.         TaskRemoveCam(task_id);
  6896.         remove_task(task_id);
  6897.     }
  6898.    
  6899.     task_id = TASK_SUPER + id;
  6900.     if ( task_exists(task_id) )
  6901.     {
  6902.         TaskRemoveSuper(task_id);
  6903.         remove_task(task_id);
  6904.     }
  6905.    
  6906.     if ( g_connected[id] )
  6907.     {
  6908.         set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 255);
  6909.     }
  6910.  
  6911.     g_reseted[id] =         true;
  6912.  
  6913.     g_money_used[id] = true;
  6914. }
  6915.  
  6916. ResetMaxspeed(id)
  6917. {
  6918.     static Float:max_speed;
  6919.     switch ( get_user_weapon(id) )
  6920.     {
  6921.         case CSW_SG550, CSW_AWP, CSW_G3SG1:     max_speed = 210.0;
  6922.         case CSW_M249:                  max_speed = 220.0;
  6923.         case CSW_AK47:                  max_speed = 221.0;
  6924.         case CSW_M3, CSW_M4A1:              max_speed = 230.0;
  6925.         case CSW_SG552:                 max_speed = 235.0;
  6926.         case CSW_XM1014, CSW_AUG, CSW_GALIL, CSW_FAMAS: max_speed = 240.0;
  6927.         case CSW_P90:                   max_speed = 245.0;
  6928.         case CSW_SCOUT:                 max_speed = 260.0;
  6929.         default:                    max_speed = 250.0;
  6930.     }
  6931.  
  6932.     entity_set_float(id, EV_FL_maxspeed, max_speed);
  6933. }
  6934.  
  6935. make_SayText(receiver, sender, sMessage[])
  6936. {
  6937.     if( !sender )
  6938.     {
  6939.         return 0;
  6940.     }
  6941.    
  6942.     message_begin(receiver ? MSG_ONE : MSG_ALL, g_msgSayText, {0, 0, 0}, receiver);
  6943.     write_byte(sender);
  6944.     write_string(sMessage);
  6945.     message_end();
  6946.    
  6947.     return 1;
  6948. }
  6949.  
  6950. SCM_Print(plr, const sFmt[], any:...)
  6951. {
  6952.     new i = plr ? plr : get_player();
  6953.     if( !i )
  6954.     {
  6955.         return 0;
  6956.     }
  6957.    
  6958.     new sMessage[256];
  6959.     new len = formatex(sMessage, 255, "^4[ ^1%s^4 ]^3 ", PLUGIN_PREFIX);
  6960.     vformat(sMessage[len], 255-len, sFmt, 3);
  6961.     sMessage[192] = '^0';
  6962.    
  6963.     make_SayText(plr, i, sMessage);
  6964.    
  6965.     return 1;
  6966. }
  6967.  
  6968. get_player()
  6969. {
  6970.     for( new plr = 1; plr <= g_MaxPlayers; plr++ )
  6971.     {
  6972.         if( g_connected[plr] )
  6973.         {
  6974.             return plr;
  6975.         }
  6976.     }
  6977.    
  6978.     return 0;
  6979. }
  6980.  
  6981. public TASK_Advertise()
  6982. {
  6983.     SCM_Print(0, "^1 This^3 BlockMaker v%s^1 was create for ^3Extreme^1 by^4 %s", PLUGIN_VERSION, PLUGIN_AUTHOR);
  6984. }
  6985.  
  6986. public SlayUser(id)
  6987.     return PLUGIN_HANDLED;
Add Comment
Please, Sign In to add comment