Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 154.01 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <sdkhooks>
  4. #include <smlib>
  5.  
  6. // #define CHAT_TAG "[BlockBuilder] "
  7. //#define MESS "[BlockBuilder] %s"
  8.  
  9. new currentEnt[MAXPLAYERS+1];
  10. new byUnits[MAXPLAYERS+1];
  11. new Unit_Rotation[MAXPLAYERS+1] = false
  12.  
  13. enum BlockConfig
  14. {
  15. String:BlockName[64],
  16. String:ModelPath[256],
  17. String:SoundPath[256],
  18. Float:EffectTime,
  19. Float:CooldownTime
  20. }
  21.  
  22. #define HEGrenadeOffset 14 // (14 * 4)
  23. #define FlashbangOffset 15 // (15 * 4)
  24. #define SmokegrenadeOffset 16 // (16 * 4)
  25. #define IncenderyGrenadesOffset 17 // (17 * 4) Also Molotovs
  26. #define DecoyGrenadeOffset 18 // (18 * 4)
  27.  
  28. new const String:INVI_SOUND_PATH[] = "*blockbuilder/invincibility.mp3"
  29. new const String:STEALTH_SOUND_PATH[] = "*blockbuilder/stealth.mp3"
  30. new const String:NUKE_SOUND_PATH[] = "*blockbuilder/nuke.mp3"
  31. new const String:BOS_SOUND_PATH[] = "*blockbuilder/bootsofspeed.mp3"
  32. new const String:CAM_SOUND_PATH[] = "*blockbuilder/camouflage.mp3"
  33. new const String:TELE_SOUND_PATH[] = "*blockbuilder/teleport.mp3"
  34.  
  35. //new DuckHop[MAXPLAYERS+1] = false;
  36. //new DuckHop_Perform[MAXPLAYERS+1] = false;
  37. //new Float:DuckHop_Velocity[MAXPLAYERS+1][3]
  38.  
  39. new g_iDragEnt[MAXPLAYERS+1];
  40. new g_iBlockSelection[MAXPLAYERS+1]={0, ...};
  41. new g_iBlocks[2048] = {-1, ...};
  42. new g_iTeleporters[2048] = {-1, ...};
  43. // new g_iClientBlocks[MAXPLAYERS+1] = {-1, ...};
  44. new g_iGravity[MAXPLAYERS+1]={0,...};
  45. new g_iAmmo;
  46. new g_iPrimaryAmmoType;
  47. new g_iCurrentTele[MAXPLAYERS+1]={-1,...};
  48. new g_iBeamSprite = 0;
  49. new CurrentModifier[MAXPLAYERS+1] = 0
  50. new Float:TrampolineForce[2048] = 0.0
  51. new Float:SpeedBoostForce_1[2048] = 0.0
  52. new Float:SpeedBoostForce_2[2048] = 0.0
  53. //new Float:velocity_duck = 0.0
  54. new Block_Transparency[2048] = 0
  55. new blocksize = 0
  56.  
  57. new bool:g_bNoFallDmg[MAXPLAYERS+1]={false,...};
  58. new bool:g_bInvCanUse[MAXPLAYERS+1]={true,...};
  59. new bool:g_bInv[MAXPLAYERS+1]={false,...};
  60. new bool:g_bStealthCanUse[MAXPLAYERS+1]={true,...};
  61. new bool:g_bBootsCanUse[MAXPLAYERS+1]={true,...};
  62. new bool:g_bLocked[MAXPLAYERS+1]={false,...};
  63. new bool:g_bTriggered[2048] = {false, ...};
  64. new bool:g_bCamCanUse[MAXPLAYERS+1]={true,...};
  65. new bool:g_bDeagleCanUse[MAXPLAYERS+1]={true,...};
  66. new bool:g_bAwpCanUse[MAXPLAYERS+1]={true,...};
  67. new bool:g_bHEgrenadeCanUse[MAXPLAYERS+1]={true,...};
  68. new bool:g_bFlashbangCanUse[MAXPLAYERS+1]={true,...};
  69. new bool:g_bSmokegrenadeCanUse[MAXPLAYERS+1]={true,...};
  70. new bool:g_bSnapping[MAXPLAYERS+1]={false,...};
  71. new bool:g_bGroups[MAXPLAYERS+1][2048];
  72. new bool:g_bRandomCantUse[MAXPLAYERS+1]
  73.  
  74. new Handle:Block_Timers[64]
  75. new Block_Touching[MAXPLAYERS+1] = 0;
  76.  
  77.  
  78. new Float:g_fSnappingGap[MAXPLAYERS+1]={0.0,...};
  79. new Float:g_fClientAngles[MAXPLAYERS+1][3];
  80. new Float:g_fAngles[2048][3];
  81.  
  82. // Skriv antal blocks!
  83. new g_eBlocks[116][BlockConfig];
  84.  
  85. new Handle:g_hClientMenu[MAXPLAYERS+1];
  86. new Handle:g_hBlocksKV = INVALID_HANDLE;
  87. new Handle:g_hTeleSound = INVALID_HANDLE;
  88.  
  89. new Handle:Cvar_Prefix;
  90. new Handle:Cvar_Height;
  91. new Handle:Cvar_RandomTime;
  92. new Float:TrueForce
  93. new Float:randomblock_time = 0.0;
  94. new String:CHAT_TAG[64];
  95.  
  96. new RoundIndex = 0; // Quite lazy way yet effective one
  97.  
  98. public Plugin:myinfo =
  99. {
  100. name = "Blockmaker",
  101. author = "x3ro + k0nan",
  102. description = "Spawn Blocks",
  103. version = "1.046",
  104. url = "https://forums.alliedmods.net/showthread.php?t=270733"
  105. }
  106.  
  107.  
  108. //public Action:Command_velocity_duck(client, args)
  109. //{
  110. // decl String:argc[18]
  111. // GetCmdArg(1, argc, sizeof(argc))
  112.  
  113. // velocity_duck = StringToFloat(argc)
  114. //}
  115.  
  116. public OnPluginStart()
  117.  
  118. {
  119.  
  120. // new pieces[4];
  121. // new longip = GetConVarInt(FindConVar("hostip"));
  122. //
  123. // pieces[0] = (longip >> 24) & 0x000000FF;
  124. // pieces[1] = (longip >> 16) & 0x000000FF;
  125. // pieces[2] = (longip >> 8) & 0x000000FF;
  126. // pieces[3] = longip & 0x000000FF;
  127. //
  128. // decl String:NetIP[32]
  129. // Format(NetIP, sizeof(NetIP), "%d.%d.%d.%d", pieces[0], pieces[1], pieces[2], pieces[3]);
  130. // if(StrEqual(NetIP, "255.255.255.255"))
  131. // {
  132. randomblock_time = 60.0;
  133. g_hTeleSound = CreateConVar("sm_blockbuilder_telesound", "blockbuilder/teleport.mp3");
  134. Cvar_Height = CreateConVar("sm_blockbuilder_block_height", "0.0", "Height of block (Can be -10.0 aswell as 15.0")
  135. HookConVarChange(Cvar_Height, OnHeightConVarChange)
  136.  
  137. Format(CHAT_TAG, sizeof(CHAT_TAG), "[blockbuilder]")
  138. Cvar_Prefix = CreateConVar("sm_blockbuilder_prefix", "[blockbuilder]", "A Prefix used by messages within Blockbuilder...")
  139. HookConVarChange(Cvar_Prefix, OnPrefixChanged)
  140.  
  141. Cvar_RandomTime = CreateConVar("sm_blockbuilder_random_cooldown", "60", "A cooldown for using random block for player. Example: After you use once random block you need to wait 60 sec.")
  142. HookConVarChange(Cvar_RandomTime, OnRandomChanged)
  143.  
  144. //
  145. // ADMIN FLAG "O" FOR USING BLOCKMAKER
  146. // ADMIN FLAG "P" FOR SAVING AND LOADING
  147. //
  148.  
  149. // RegConsoleCmd("sm_bb", Command_BlockBuilder);
  150. RegAdminCmd("sm_bb", Command_BlockBuilder, ADMFLAG_CUSTOM1);
  151. // RegConsoleCmd("sm_bsave", Command_SaveBlocks);
  152. RegAdminCmd("sm_bsave", Command_SaveBlocks, ADMFLAG_CUSTOM2);
  153. RegAdminCmd("sm_unitmover", Command_UnitMove, ADMFLAG_CUSTOM1);
  154. RegAdminCmd("sm_blocksnap", Command_BlockSnap, ADMFLAG_CUSTOM1);
  155. RegAdminCmd("sm_snapgrid", Command_SnapGrid, ADMFLAG_CUSTOM1);
  156. RegAdminCmd("+grab", Command_GrabBlock, ADMFLAG_CUSTOM1);
  157. RegAdminCmd("-grab", Command_ReleaseBlock, ADMFLAG_CUSTOM1);
  158. RegAdminCmd("tgrab", Command_ToggleGrab, ADMFLAG_CUSTOM1);
  159. // RegAdminCmd("velocity_duck", Command_velocity_duck, ADMFLAG_CUSTOM1);
  160.  
  161. HookEvent("round_start", RoundStart);
  162. HookEvent("round_end", RoundEnd);
  163.  
  164. AutoExecConfig();
  165.  
  166. g_iAmmo = FindSendPropOffs("CCSPlayer", "m_iAmmo");
  167. g_iPrimaryAmmoType = FindSendPropOffs("CBaseCombatWeapon", "m_iPrimaryAmmoType");
  168.  
  169. new String:file[256];
  170. BuildPath(Path_SM, file, sizeof(file), "configs/blockbuilder.blocks.txt");
  171.  
  172. new Handle:kv = CreateKeyValues("Blocks");
  173. FileToKeyValues(kv, file);
  174.  
  175. if (!KvGotoFirstSubKey(kv))
  176. {
  177. PrintToServer("No first subkey");
  178. return;
  179. }
  180.  
  181. new i = 0;
  182.  
  183. do
  184. {
  185. KvGetSectionName(kv, g_eBlocks[i][BlockName], 64);
  186. KvGetString(kv, "model", g_eBlocks[i][ModelPath], 256);
  187. KvGetString(kv, "sound", g_eBlocks[i][SoundPath], 256);
  188. g_eBlocks[i][EffectTime] = KvGetFloat(kv, "effect");
  189. g_eBlocks[i][CooldownTime] = KvGetFloat(kv, "cooldown");
  190. ++i;
  191. } while (KvGotoNextKey(kv));
  192.  
  193. CloseHandle(kv);
  194.  
  195. g_hBlocksKV = CreateKeyValues("Blocks");
  196. }
  197.  
  198. public Action:Command_GrabBlock(client, args)
  199. {
  200. if(g_iDragEnt[client] == 0)
  201. {
  202. new ent = GetClientAimTarget(client, false);
  203. if(IsValidBlock(ent))
  204. {
  205. g_iDragEnt[client] = ent;
  206. if(g_bGroups[client][g_iDragEnt[client]])
  207. {
  208. for(new i=0;i<2048;++i)
  209. {
  210. if(IsValidBlock(i) && g_bGroups[client][i])
  211. {
  212. SetEntityMoveType(i, MOVETYPE_VPHYSICS);
  213. AcceptEntityInput(i, "enablemotion");
  214. }
  215. }
  216. }
  217. else
  218. {
  219. SetEntityMoveType(g_iDragEnt[client], MOVETYPE_VPHYSICS);
  220.  
  221. AcceptEntityInput(g_iDragEnt[client], "enablemotion");
  222. }
  223. //PrintToChat(client, MESS, "Block has been grabbed.");
  224. }
  225. else
  226. {
  227. // CreateBlock(client);
  228. }
  229. }
  230. // Fixar "Unknown Command"
  231. return Plugin_Handled;
  232. }
  233.  
  234. public Action:Command_ReleaseBlock(client, args)
  235. {
  236. if(g_iDragEnt[client] != 0)
  237. {
  238. new Float:fVelocity[3] = {0.0, 0.0, 0.0};
  239. TeleportEntity(g_iDragEnt[client], NULL_VECTOR, g_fAngles[g_iDragEnt[client]], fVelocity);
  240. if(g_bGroups[client][g_iDragEnt[client]])
  241. {
  242. for(new i=0;i<2048;++i)
  243. {
  244. if(IsValidBlock(i) && g_bGroups[client][i])
  245. {
  246. SetEntityMoveType(i, MOVETYPE_NONE);
  247. AcceptEntityInput(i, "disablemotion");
  248. }
  249. }
  250. }
  251. else
  252. {
  253. SetEntityMoveType(g_iDragEnt[client], MOVETYPE_NONE);
  254. AcceptEntityInput(g_iDragEnt[client], "disablemotion");
  255. }
  256. g_iDragEnt[client] = 0;
  257. //PrintToChat(client, MESS, "Block has been released.");
  258. }
  259. // Fixar "Unknown Command"
  260. return Plugin_Handled;
  261. }
  262.  
  263. public Action:Command_ToggleGrab(client, args)
  264. {
  265. if(g_iDragEnt[client] != 0)
  266. {
  267. new Float:fVelocity[3] = {0.0, 0.0, 0.0};
  268. TeleportEntity(g_iDragEnt[client], NULL_VECTOR, g_fAngles[g_iDragEnt[client]], fVelocity);
  269. if(g_bGroups[client][g_iDragEnt[client]])
  270. {
  271. for(new i=0;i<2048;++i)
  272. {
  273. if(IsValidBlock(i) && g_bGroups[client][i])
  274. {
  275. SetEntityMoveType(i, MOVETYPE_NONE);
  276. AcceptEntityInput(i, "disablemotion");
  277. }
  278. }
  279. }
  280. else
  281. {
  282. SetEntityMoveType(g_iDragEnt[client], MOVETYPE_NONE);
  283. AcceptEntityInput(g_iDragEnt[client], "disablemotion");
  284. }
  285. g_iDragEnt[client] = 0;
  286. //PrintToChat(client, MESS, "Block has been released.");
  287. }
  288. else
  289. {
  290. new ent = GetClientAimTarget(client, false);
  291. if(IsValidBlock(ent))
  292. {
  293. g_iDragEnt[client] = ent;
  294. if(g_bGroups[client][g_iDragEnt[client]])
  295. {
  296. for(new i=0;i<2048;++i)
  297. {
  298. if(IsValidBlock(i) && g_bGroups[client][i])
  299. {
  300. SetEntityMoveType(i, MOVETYPE_VPHYSICS);
  301. AcceptEntityInput(i, "enablemotion");
  302. }
  303. }
  304. }
  305. else
  306. {
  307. SetEntityMoveType(g_iDragEnt[client], MOVETYPE_VPHYSICS);
  308. AcceptEntityInput(g_iDragEnt[client], "enablemotion");
  309. }
  310. //PrintToChat(client, MESS, "Block has been grabbed.");
  311. }
  312. else
  313. {
  314. // CreateBlock(client);
  315. }
  316. }
  317. }
  318.  
  319. public OnRandomChanged(Handle:cvar, const String:oldVal[], const String:newVal[])
  320. {
  321. randomblock_time = StringToFloat(newVal)
  322. }
  323.  
  324. public OnPrefixChanged(Handle:cvar, const String:oldVal[], const String:newVal[])
  325. {
  326. Format(CHAT_TAG, sizeof(CHAT_TAG), "%s", newVal)
  327. }
  328.  
  329. public Action:Command_BlockSnap(client, args)
  330. {
  331. if(g_bSnapping[client])
  332. {
  333. g_bSnapping[client] = false
  334. PrintToChat(client, "\x03%s\x04 Block Snapping Off.", CHAT_TAG);
  335. }
  336. else
  337. {
  338. PrintToChat(client, "\x03%s\x04 Block Snapping On.", CHAT_TAG);
  339. g_bSnapping[client] = true;
  340. }
  341. }
  342.  
  343. public Action:Command_SnapGrid(client, args)
  344. {
  345. decl String:argc[18]
  346. GetCmdArg(1, argc, sizeof(argc))
  347.  
  348. g_fSnappingGap[client] = StringToFloat(argc)
  349. }
  350.  
  351. public Action:Command_UnitMove(client, args)
  352. {
  353. decl Float:vecAngles[3], Float:vecOrigin[3];
  354. GetClientEyePosition(client, vecOrigin);
  355. GetClientEyeAngles(client, vecAngles);
  356.  
  357. new entity = GetClientAimTarget(client, false);
  358. if(IsValidBlock(entity) || g_iTeleporters[entity])
  359. {
  360. currentEnt[client] = entity
  361. DrawUnitMovePanel(client);
  362. return Plugin_Handled;
  363. }
  364. PrintToChat(client, "\x03%s\x04 You have to aim at the object to change it's position.", CHAT_TAG);
  365. DisplayMenu(CreateMainMenu(client), client, 0);
  366.  
  367. return Plugin_Handled;
  368. }
  369.  
  370. DrawUnitMovePanel(client)
  371. {
  372. new Handle:panel = CreatePanel();
  373. SetPanelTitle(panel, "Advanced Block Placement");
  374. decl String:concatedMoveBy[128];
  375. Format(concatedMoveBy, sizeof(concatedMoveBy), "%s%f", "Move by: ", float(byUnits[client]) / 10);
  376. DrawPanelItem(panel, concatedMoveBy);
  377. DrawPanelItem(panel, "X+");
  378. DrawPanelItem(panel, "X-");
  379. DrawPanelItem(panel, "Y+");
  380. DrawPanelItem(panel, "Y-");
  381. DrawPanelItem(panel, "Z+");
  382. DrawPanelItem(panel, "Z-");
  383. if(!Unit_Rotation[client])
  384. {
  385. DrawPanelItem(panel, "Mode: Position");
  386. }
  387. else
  388. {
  389. DrawPanelItem(panel, "Mode: Rotation");
  390. }
  391. DrawPanelItem(panel, "Exit");
  392. SendPanelToClient(panel, client, DrawUnitMovePanelHandler, 360);
  393.  
  394. CloseHandle(panel);
  395. }
  396. /*
  397. DETOUR_DECL_STATIC5(KillEater, void*, void *, item, CBaseEntity *, attacker, CBaseEntity *, victim, struct kill_eater_event_t, data, int, unk5)
  398. {
  399. if (victim == 0)
  400. return DETOUR_STATIC_CALL(KillEater)(item, attacker, victim, data, unk5);
  401. */
  402.  
  403. public DrawUnitMovePanelHandler(Handle:menu, MenuAction:action, client, key)
  404. {
  405. if (action == MenuAction_Select)
  406. {
  407. new Float:currentEntLocation[3];
  408. if(!Unit_Rotation[client])
  409. {
  410. GetEntPropVector(currentEnt[client], Prop_Send, "m_vecOrigin", currentEntLocation);
  411. }
  412. else
  413. {
  414. GetEntPropVector(currentEnt[client], Prop_Data, "m_angRotation", currentEntLocation);
  415. }
  416.  
  417. new Float:byUnitsFloat = float(byUnits[client]) / 10;
  418. new Dont = false
  419. switch(key)
  420. {
  421. case 1:
  422. {
  423. switch(byUnits[client])
  424. {
  425. case 1:
  426. {
  427. byUnits[client] = 5;
  428. }
  429. case 5:
  430. {
  431. byUnits[client] = 10;
  432. }
  433. case 10:
  434. {
  435. byUnits[client] = 80;
  436. }
  437. case 120:
  438. {
  439. byUnits[client] = 320;
  440. }
  441. case 330:
  442. {
  443. byUnits[client] = 640;
  444. }
  445. case 660:
  446. {
  447. byUnits[client] = 1;
  448. }
  449. default:
  450. {
  451. byUnits[client] = 1;
  452. }
  453. }
  454. }
  455. case 2:
  456. {
  457. currentEntLocation[0] += byUnitsFloat;
  458. }
  459. case 3:
  460. {
  461. currentEntLocation[0] -= byUnitsFloat;
  462. }
  463. case 4:
  464. {
  465. currentEntLocation[1] += byUnitsFloat;
  466. }
  467. case 5:
  468. {
  469. currentEntLocation[1] -= byUnitsFloat;
  470. }
  471. case 6:
  472. {
  473. currentEntLocation[2] += byUnitsFloat;
  474. }
  475. case 7:
  476. {
  477. currentEntLocation[2] -= byUnitsFloat;
  478. }
  479. case 8:
  480. {
  481. if(!Unit_Rotation[client])
  482. {
  483. Unit_Rotation[client] = true;
  484. }
  485. else
  486. {
  487. Unit_Rotation[client] = false;
  488. }
  489. }
  490. case 9:
  491. {
  492. CreateMainMenu(client);
  493. Dont = true
  494. }
  495. }
  496. if(!Dont)
  497. DrawUnitMovePanel(client);
  498. if(!(key == 8))
  499. {
  500. if(!Unit_Rotation[client])
  501. {
  502. TeleportEntity(currentEnt[client], currentEntLocation, NULL_VECTOR, NULL_VECTOR);
  503. }
  504. else
  505. {
  506. TeleportEntity(currentEnt[client], NULL_VECTOR, currentEntLocation, NULL_VECTOR);
  507. }
  508. }
  509. }
  510. }
  511.  
  512. public OnHeightConVarChange(Handle:cvar, const String:oldVal[], const String:newVal[])
  513. {
  514. TrueForce = StringToFloat(newVal)
  515. }
  516.  
  517. // REMOVE BREAKABLES
  518. public OnEntityCreated(entity, const String:classname[]) {
  519. if(StrEqual(classname, "func_breakable") || StrEqual(classname, "func_breakable_surf")) {
  520. SDKHook(entity, SDKHook_Spawn, Hook_OnEntitySpawn);
  521. }
  522. }
  523. public Action:Hook_OnEntitySpawn(entity) {
  524. AcceptEntityInput(entity, "Kill");
  525. return Plugin_Handled;
  526. }
  527. // END OF REMOVE BREAKABLES
  528.  
  529. public OnConfigsExecuted()
  530. {
  531. new String:sound[512];
  532. GetConVarString(g_hTeleSound, sound, sizeof(sound));
  533. if(!StrEqual(sound, ""))
  534. {
  535. PrecacheSound(sound);
  536. }
  537. }
  538.  
  539. public Action:RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
  540. {
  541. // STEALTH FIX ??
  542. for(int client = 1; client <= MaxClients; client++)
  543. {
  544. if(!IsClientInGame(client))
  545. continue;
  546. SetEntityRenderMode(client , RENDER_NORMAL);
  547. SDKUnhook(client, SDKHook_SetTransmit, Stealth_SetTransmit)
  548. }
  549.  
  550. for(new i=0;i<2048;++i)
  551. {
  552. g_iBlocks[i]=-1;
  553. g_bTriggered[i]=false;
  554. g_iTeleporters[i]=-1;
  555. }
  556. for(new i=1;i<=MaxClients;++i)
  557. {
  558. g_bHEgrenadeCanUse[i]=true;
  559. g_bFlashbangCanUse[i]=true;
  560. g_bSmokegrenadeCanUse[i]=true;
  561. g_iCurrentTele[i]=-1;
  562. g_bInv[i]=false;
  563. g_bInvCanUse[i]=true;
  564. g_bStealthCanUse[i]=true;
  565. g_bBootsCanUse[i]=true;
  566. g_bLocked[i]=false;
  567. g_bNoFallDmg[i]=false;
  568. g_bCamCanUse[i]=true;
  569. g_bAwpCanUse[i]=true;
  570. g_bDeagleCanUse[i]=true;
  571. g_bRandomCantUse[i]=false;
  572. }
  573. RoundIndex++
  574. LoadBlocks();
  575. return Plugin_Continue;
  576. }
  577.  
  578. public Action:RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
  579. {
  580. return Plugin_Continue;
  581. }
  582.  
  583. public OnClientPutInServer(client)
  584. {
  585. g_bInv[client]=false;
  586. g_bInvCanUse[client]=true;
  587. g_bStealthCanUse[client]=true;
  588. g_bBootsCanUse[client]=true;
  589. g_bLocked[client]=false;
  590. g_bNoFallDmg[client]=false;
  591. g_bCamCanUse[client]=true;
  592. g_bAwpCanUse[client]=true;
  593. g_bDeagleCanUse[client]=true;
  594. g_bHEgrenadeCanUse[client]=true;
  595. g_bFlashbangCanUse[client]=true;
  596. // g_iClientBlocks[client]=-1;
  597. g_iCurrentTele[client]=-1;
  598. g_bSnapping[client] = false;
  599. g_bRandomCantUse[client] = false;
  600. g_fSnappingGap[client] = 0.0
  601. for(new i=0;i<2048;++i)
  602. g_bGroups[client][i]=false;
  603. SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
  604. }
  605.  
  606. public OnMapStart()
  607. {
  608. RoundIndex = 0;
  609. SetConVarBool(FindConVar("sv_turbophysics"), true);
  610.  
  611. for(new i=0;i<sizeof(g_eBlocks);++i)
  612. {
  613. if(strcmp(g_eBlocks[i][SoundPath], "")!=0)
  614. PrecacheSound(g_eBlocks[i][SoundPath], true);
  615. }
  616.  
  617. PrecacheModel("models/platforms/b-tele.mdl", true);
  618. PrecacheModel("models/platforms/r-tele.mdl", true);
  619. PrecacheModel("models/player/ctm_gign.mdl");
  620. PrecacheModel("models/player/tm_phoenix.mdl");
  621.  
  622. FakePrecacheSound(INVI_SOUND_PATH);
  623. FakePrecacheSound(STEALTH_SOUND_PATH);
  624. FakePrecacheSound(NUKE_SOUND_PATH);
  625. FakePrecacheSound(BOS_SOUND_PATH);
  626. FakePrecacheSound(CAM_SOUND_PATH);
  627. FakePrecacheSound(TELE_SOUND_PATH);
  628.  
  629. DownloadsTable()
  630.  
  631. g_iBeamSprite = PrecacheModel("materials/sprites/orangelight1.vmt");
  632.  
  633. for(new i=0;i<2048;++i)
  634. {
  635. for(new a=1;a<=MaxClients;++a)
  636. {
  637. g_bGroups[a][i]=false;
  638. }
  639. g_iBlocks[i]=-1;
  640. g_iTeleporters[i]=-1;
  641. g_bTriggered[i]=false;
  642. }
  643.  
  644. if(g_hBlocksKV != INVALID_HANDLE)
  645. {
  646. CloseHandle(g_hBlocksKV);
  647. g_hBlocksKV = INVALID_HANDLE;
  648. }
  649.  
  650. new String:file[256];
  651. new String:map[64];
  652. //new String:id[64];
  653. //GetCurrentWorkshopMap(map, 65, id, 65)
  654. GetCurrentMap(map, sizeof(map));
  655. BuildPath(Path_SM, file, sizeof(file), "data/block.%s.txt", map);
  656. if(FileExists(file))
  657. {
  658. g_hBlocksKV = CreateKeyValues("Blocks");
  659. FileToKeyValues(g_hBlocksKV, file);
  660. }
  661. }
  662.  
  663. DownloadsTable()
  664. {
  665. PrecacheModel("models/blockbuilder/awp.mdl")
  666. PrecacheModel("models/esagame_normal/bunnyhop.mdl")
  667. PrecacheModel("models/blockbuilder/camouflage.mdl")
  668. PrecacheModel("models/esagame_normal/ct_barrier.mdl")
  669. PrecacheModel("models/esagame_normal/damage.mdl")
  670. PrecacheModel("models/blockbuilder/deagle.mdl")
  671. PrecacheModel("models/esagame_normal/death.mdl")
  672. PrecacheModel("models/esagame_normal/delayedbunnyhop.mdl")
  673. PrecacheModel("models/blockbuilder/fire.mdl")
  674. PrecacheModel("models/blockbuilder/flash.mdl")
  675. PrecacheModel("models/blockbuilder/frost.mdl")
  676. PrecacheModel("models/blockbuilder/glass.mdl")
  677. PrecacheModel("models/blockbuilder/gravity.mdl")
  678. PrecacheModel("models/blockbuilder/he.mdl")
  679. PrecacheModel("models/esagame_normal/heal.mdl")
  680. PrecacheModel("models/esagame_normal/honey.mdl")
  681. PrecacheModel("models/esagame_normal/ice.mdl")
  682. PrecacheModel("models/esagame_normal/invincibility.mdl")
  683. PrecacheModel("models/esagame_normal/nfd.mdl")
  684. PrecacheModel("models/blockbuilder/noslowdown.mdl")
  685. PrecacheModel("models/blockbuilder/nuke.mdl")
  686. PrecacheModel("models/esagame_normal/platform.mdl")
  687. PrecacheModel("models/blockbuilder/random.mdl")
  688. PrecacheModel("models/blockbuilder/slap.mdl")
  689. PrecacheModel("models/esagame_normal/boots.mdl")
  690. PrecacheModel("models/esagame_normal/speedboost.mdl")
  691. PrecacheModel("models/esagame_normal/stealth.mdl")
  692. PrecacheModel("models/esagame_normal/tt_barrier.mdl")
  693. PrecacheModel("models/esagame_normal/trampoline.mdl")
  694.  
  695. AddFileToDownloadsTable("models/platforms/b-tele.mdl");
  696. AddFileToDownloadsTable("models/platforms/b-tele.dx80.vtx")
  697. AddFileToDownloadsTable("models/platforms/b-tele.dx90.vtx")
  698. AddFileToDownloadsTable("models/platforms/b-tele.sw.vtx")
  699. AddFileToDownloadsTable("models/platforms/b-tele.phy")
  700. AddFileToDownloadsTable("models/platforms/b-tele.vvd")
  701. AddFileToDownloadsTable("models/platforms/r-tele.mdl");
  702. AddFileToDownloadsTable("models/platforms/r-tele.dx80.vtx")
  703. AddFileToDownloadsTable("models/platforms/r-tele.dx90.vtx")
  704. AddFileToDownloadsTable("models/platforms/r-tele.sw.vtx")
  705. AddFileToDownloadsTable("models/platforms/r-tele.phy")
  706. AddFileToDownloadsTable("models/platforms/r-tele.vvd")
  707.  
  708. AddFileToDownloadsTable("models/blockbuilder/awp.mdl")
  709. AddFileToDownloadsTable("models/esagame_normal/bunnyhop.mdl")
  710. AddFileToDownloadsTable("models/blockbuilder/camouflage.mdl")
  711. AddFileToDownloadsTable("models/esagame_normal/ct_barrier.mdl")
  712. AddFileToDownloadsTable("models/esagame_normal/damage.mdl")
  713. AddFileToDownloadsTable("models/blockbuilder/deagle.mdl")
  714. AddFileToDownloadsTable("models/esagame_normal/death.mdl")
  715. AddFileToDownloadsTable("models/esagame_normal/delayedbunnyhop.mdl")
  716. AddFileToDownloadsTable("models/blockbuilder/fire.mdl")
  717. AddFileToDownloadsTable("models/blockbuilder/flash.mdl")
  718. AddFileToDownloadsTable("models/blockbuilder/frost.mdl")
  719. AddFileToDownloadsTable("models/blockbuilder/glass.mdl")
  720. AddFileToDownloadsTable("models/blockbuilder/gravity.mdl")
  721. AddFileToDownloadsTable("models/blockbuilder/he.mdl")
  722. AddFileToDownloadsTable("models/esagame_normal/heal.mdl")
  723. AddFileToDownloadsTable("models/esagame_normal/honey.mdl")
  724. AddFileToDownloadsTable("models/esagame_normal/ice.mdl")
  725. AddFileToDownloadsTable("models/esagame_normal/invincibility.mdl")
  726. AddFileToDownloadsTable("models/esagame_normal/nfd.mdl")
  727. AddFileToDownloadsTable("models/blockbuilder/noslowdown.mdl")
  728. AddFileToDownloadsTable("models/blockbuilder/nuke.mdl")
  729. AddFileToDownloadsTable("models/esagame_normal/platform.mdl")
  730. AddFileToDownloadsTable("models/blockbuilder/random.mdl")
  731. AddFileToDownloadsTable("models/blockbuilder/slap.mdl")
  732. AddFileToDownloadsTable("models/esagame_normal/boots.mdl")
  733. AddFileToDownloadsTable("models/esagame_normal/speedboost.mdl")
  734. AddFileToDownloadsTable("models/esagame_normal/stealth.mdl")
  735. AddFileToDownloadsTable("models/esagame_normal/tt_barrier.mdl")
  736. AddFileToDownloadsTable("models/esagame_normal/trampoline.mdl")
  737.  
  738. AddFileToDownloadsTable("models/blockbuilder/awp.dx80.vtx")
  739. AddFileToDownloadsTable("models/blockbuilder/bhop.dx80.vtx")
  740. AddFileToDownloadsTable("models/blockbuilder/camouflage.dx80.vtx")
  741. AddFileToDownloadsTable("models/blockbuilder/ctbarrier.dx80.vtx")
  742. AddFileToDownloadsTable("models/blockbuilder/damage.dx80.vtx")
  743. AddFileToDownloadsTable("models/blockbuilder/deagle.dx80.vtx")
  744. AddFileToDownloadsTable("models/blockbuilder/death.dx80.vtx")
  745. AddFileToDownloadsTable("models/blockbuilder/delay.dx80.vtx")
  746. AddFileToDownloadsTable("models/blockbuilder/fire.dx80.vtx")
  747. AddFileToDownloadsTable("models/blockbuilder/flash.dx80.vtx")
  748. AddFileToDownloadsTable("models/blockbuilder/frost.dx80.vtx")
  749. AddFileToDownloadsTable("models/blockbuilder/glass.dx80.vtx")
  750. AddFileToDownloadsTable("models/blockbuilder/gravity.dx80.vtx")
  751. AddFileToDownloadsTable("models/blockbuilder/he.dx80.vtx")
  752. AddFileToDownloadsTable("models/blockbuilder/health.dx80.vtx")
  753. AddFileToDownloadsTable("models/blockbuilder/honey.dx80.vtx")
  754. AddFileToDownloadsTable("models/blockbuilder/ice.dx80.vtx")
  755. AddFileToDownloadsTable("models/blockbuilder/invincibility.dx80.vtx")
  756. AddFileToDownloadsTable("models/blockbuilder/nofalldmg.dx80.vtx")
  757. AddFileToDownloadsTable("models/blockbuilder/noslowdown.dx80.vtx")
  758. AddFileToDownloadsTable("models/blockbuilder/nuke.dx80.vtx")
  759. AddFileToDownloadsTable("models/blockbuilder/platform.dx80.vtx")
  760. AddFileToDownloadsTable("models/blockbuilder/random.dx80.vtx")
  761. AddFileToDownloadsTable("models/blockbuilder/slap.dx80.vtx")
  762. AddFileToDownloadsTable("models/blockbuilder/speed.dx80.vtx")
  763. AddFileToDownloadsTable("models/blockbuilder/speedboost.dx80.vtx")
  764. AddFileToDownloadsTable("models/blockbuilder/stealth.dx80.vtx")
  765. AddFileToDownloadsTable("models/blockbuilder/tbarrier.dx80.vtx")
  766. AddFileToDownloadsTable("models/blockbuilder/tramp.dx80.vtx")
  767.  
  768. AddFileToDownloadsTable("models/blockbuilder/awp.dx90.vtx")
  769. AddFileToDownloadsTable("models/blockbuilder/bhop.dx90.vtx")
  770. AddFileToDownloadsTable("models/blockbuilder/camouflage.dx90.vtx")
  771. AddFileToDownloadsTable("models/blockbuilder/ctbarrier.dx90.vtx")
  772. AddFileToDownloadsTable("models/blockbuilder/damage.dx90.vtx")
  773. AddFileToDownloadsTable("models/blockbuilder/deagle.dx90.vtx")
  774. AddFileToDownloadsTable("models/blockbuilder/death.dx90.vtx")
  775. AddFileToDownloadsTable("models/blockbuilder/delay.dx90.vtx")
  776. AddFileToDownloadsTable("models/blockbuilder/fire.dx90.vtx")
  777. AddFileToDownloadsTable("models/blockbuilder/flash.dx90.vtx")
  778. AddFileToDownloadsTable("models/blockbuilder/frost.dx90.vtx")
  779. AddFileToDownloadsTable("models/blockbuilder/glass.dx90.vtx")
  780. AddFileToDownloadsTable("models/blockbuilder/gravity.dx90.vtx")
  781. AddFileToDownloadsTable("models/blockbuilder/he.dx90.vtx")
  782. AddFileToDownloadsTable("models/blockbuilder/health.dx90.vtx")
  783. AddFileToDownloadsTable("models/blockbuilder/honey.dx90.vtx")
  784. AddFileToDownloadsTable("models/blockbuilder/ice.dx90.vtx")
  785. AddFileToDownloadsTable("models/blockbuilder/invincibility.dx90.vtx")
  786. AddFileToDownloadsTable("models/blockbuilder/nofalldmg.dx90.vtx")
  787. AddFileToDownloadsTable("models/blockbuilder/noslowdown.dx90.vtx")
  788. AddFileToDownloadsTable("models/blockbuilder/nuke.dx90.vtx")
  789. AddFileToDownloadsTable("models/blockbuilder/platform.dx90.vtx")
  790. AddFileToDownloadsTable("models/blockbuilder/random.dx90.vtx")
  791. AddFileToDownloadsTable("models/blockbuilder/slap.dx90.vtx")
  792. AddFileToDownloadsTable("models/blockbuilder/speed.dx90.vtx")
  793. AddFileToDownloadsTable("models/blockbuilder/speedboost.dx90.vtx")
  794. AddFileToDownloadsTable("models/blockbuilder/stealth.dx90.vtx")
  795. AddFileToDownloadsTable("models/blockbuilder/tbarrier.dx90.vtx")
  796. AddFileToDownloadsTable("models/blockbuilder/tramp.dx90.vtx")
  797.  
  798. AddFileToDownloadsTable("models/blockbuilder/awp.phy")
  799. AddFileToDownloadsTable("models/blockbuilder/bhop.phy")
  800. AddFileToDownloadsTable("models/blockbuilder/camouflage.phy")
  801. AddFileToDownloadsTable("models/blockbuilder/ctbarrier.phy")
  802. AddFileToDownloadsTable("models/blockbuilder/damage.phy")
  803. AddFileToDownloadsTable("models/blockbuilder/deagle.phy")
  804. AddFileToDownloadsTable("models/blockbuilder/death.phy")
  805. AddFileToDownloadsTable("models/blockbuilder/delay.phy")
  806. AddFileToDownloadsTable("models/blockbuilder/fire.phy")
  807. AddFileToDownloadsTable("models/blockbuilder/flash.phy")
  808. AddFileToDownloadsTable("models/blockbuilder/frost.phy")
  809. AddFileToDownloadsTable("models/blockbuilder/glass.phy")
  810. AddFileToDownloadsTable("models/blockbuilder/gravity.phy")
  811. AddFileToDownloadsTable("models/blockbuilder/he.phy")
  812. AddFileToDownloadsTable("models/blockbuilder/health.phy")
  813. AddFileToDownloadsTable("models/blockbuilder/honey.phy")
  814. AddFileToDownloadsTable("models/blockbuilder/ice.phy")
  815. AddFileToDownloadsTable("models/blockbuilder/invincibility.phy")
  816. AddFileToDownloadsTable("models/blockbuilder/nofalldmg.phy")
  817. AddFileToDownloadsTable("models/blockbuilder/noslowdown.phy")
  818. AddFileToDownloadsTable("models/blockbuilder/nuke.phy")
  819. AddFileToDownloadsTable("models/blockbuilder/platform.phy")
  820. AddFileToDownloadsTable("models/blockbuilder/random.phy")
  821. AddFileToDownloadsTable("models/blockbuilder/slap.phy")
  822. AddFileToDownloadsTable("models/blockbuilder/speed.phy")
  823. AddFileToDownloadsTable("models/blockbuilder/speedboost.phy")
  824. AddFileToDownloadsTable("models/blockbuilder/stealth.phy")
  825. AddFileToDownloadsTable("models/blockbuilder/tbarrier.phy")
  826. AddFileToDownloadsTable("models/blockbuilder/tramp.phy")
  827.  
  828. AddFileToDownloadsTable("models/blockbuilder/awp.sw.vtx")
  829. AddFileToDownloadsTable("models/blockbuilder/bhop.sw.vtx")
  830. AddFileToDownloadsTable("models/blockbuilder/camouflage.sw.vtx")
  831. AddFileToDownloadsTable("models/blockbuilder/ctbarrier.sw.vtx")
  832. AddFileToDownloadsTable("models/blockbuilder/damage.sw.vtx")
  833. AddFileToDownloadsTable("models/blockbuilder/deagle.sw.vtx")
  834. AddFileToDownloadsTable("models/blockbuilder/death.sw.vtx")
  835. AddFileToDownloadsTable("models/blockbuilder/delay.sw.vtx")
  836. AddFileToDownloadsTable("models/blockbuilder/fire.sw.vtx")
  837. AddFileToDownloadsTable("models/blockbuilder/flash.sw.vtx")
  838. AddFileToDownloadsTable("models/blockbuilder/frost.sw.vtx")
  839. AddFileToDownloadsTable("models/blockbuilder/glass.sw.vtx")
  840. AddFileToDownloadsTable("models/blockbuilder/gravity.sw.vtx")
  841. AddFileToDownloadsTable("models/blockbuilder/he.sw.vtx")
  842. AddFileToDownloadsTable("models/blockbuilder/health.sw.vtx")
  843. AddFileToDownloadsTable("models/blockbuilder/honey.sw.vtx")
  844. AddFileToDownloadsTable("models/blockbuilder/ice.sw.vtx")
  845. AddFileToDownloadsTable("models/blockbuilder/invincibility.sw.vtx")
  846. AddFileToDownloadsTable("models/blockbuilder/nofalldmg.sw.vtx")
  847. AddFileToDownloadsTable("models/blockbuilder/noslowdown.sw.vtx")
  848. AddFileToDownloadsTable("models/blockbuilder/nuke.sw.vtx")
  849. AddFileToDownloadsTable("models/blockbuilder/platform.sw.vtx")
  850. AddFileToDownloadsTable("models/blockbuilder/random.sw.vtx")
  851. AddFileToDownloadsTable("models/blockbuilder/slap.sw.vtx")
  852. AddFileToDownloadsTable("models/blockbuilder/speed.sw.vtx")
  853. AddFileToDownloadsTable("models/blockbuilder/speedboost.sw.vtx")
  854. AddFileToDownloadsTable("models/blockbuilder/stealth.sw.vtx")
  855. AddFileToDownloadsTable("models/blockbuilder/tbarrier.sw.vtx")
  856. AddFileToDownloadsTable("models/blockbuilder/tramp.sw.vtx")
  857.  
  858. AddFileToDownloadsTable("models/blockbuilder/awp.vvd")
  859. AddFileToDownloadsTable("models/blockbuilder/bhop.vvd")
  860. AddFileToDownloadsTable("models/blockbuilder/camouflage.vvd")
  861. AddFileToDownloadsTable("models/blockbuilder/ctbarrier.vvd")
  862. AddFileToDownloadsTable("models/blockbuilder/damage.vvd")
  863. AddFileToDownloadsTable("models/blockbuilder/deagle.vvd")
  864. AddFileToDownloadsTable("models/blockbuilder/death.vvd")
  865. AddFileToDownloadsTable("models/blockbuilder/delay.vvd")
  866. AddFileToDownloadsTable("models/blockbuilder/fire.vvd")
  867. AddFileToDownloadsTable("models/blockbuilder/flash.vvd")
  868. AddFileToDownloadsTable("models/blockbuilder/frost.vvd")
  869. AddFileToDownloadsTable("models/blockbuilder/glass.vvd")
  870. AddFileToDownloadsTable("models/blockbuilder/gravity.vvd")
  871. AddFileToDownloadsTable("models/blockbuilder/he.vvd")
  872. AddFileToDownloadsTable("models/blockbuilder/health.vvd")
  873. AddFileToDownloadsTable("models/blockbuilder/honey.vvd")
  874. AddFileToDownloadsTable("models/blockbuilder/ice.vvd")
  875. AddFileToDownloadsTable("models/blockbuilder/invincibility.vvd")
  876. AddFileToDownloadsTable("models/blockbuilder/nofalldmg.vvd")
  877. AddFileToDownloadsTable("models/blockbuilder/noslowdown.vvd")
  878. AddFileToDownloadsTable("models/blockbuilder/nuke.vvd")
  879. AddFileToDownloadsTable("models/blockbuilder/platform.vvd")
  880. AddFileToDownloadsTable("models/blockbuilder/random.vvd")
  881. AddFileToDownloadsTable("models/blockbuilder/slap.vvd")
  882. AddFileToDownloadsTable("models/blockbuilder/speed.vvd")
  883. AddFileToDownloadsTable("models/blockbuilder/speedboost.vvd")
  884. AddFileToDownloadsTable("models/blockbuilder/stealth.vvd")
  885. AddFileToDownloadsTable("models/blockbuilder/tbarrier.vvd")
  886. AddFileToDownloadsTable("models/blockbuilder/tramp.vvd")
  887.  
  888.  
  889. AddFileToDownloadsTable("materials/models/platforms/glow2.vtf")
  890. AddFileToDownloadsTable("materials/models/platforms/glow2.vmt")
  891. AddFileToDownloadsTable("materials/models/blockbuilder/awp.vtf")
  892. AddFileToDownloadsTable("materials/models/blockbuilder/awp.vmt")
  893. AddFileToDownloadsTable("materials/models/blockbuilder/awp_side.vmt")
  894. AddFileToDownloadsTable("materials/models/blockbuilder/awp_side.vtf")
  895. AddFileToDownloadsTable("materials/models/blockbuilder/bhop.vmt")
  896. AddFileToDownloadsTable("materials/models/blockbuilder/bhop.vtf")
  897. AddFileToDownloadsTable("materials/models/blockbuilder/bhop_side.vmt")
  898. AddFileToDownloadsTable("materials/models/blockbuilder/bhop_side.vtf")
  899. AddFileToDownloadsTable("materials/models/platforms/blue_glow1.vmt")
  900. AddFileToDownloadsTable("materials/models/platforms/blue_glow1.vtf")
  901. AddFileToDownloadsTable("materials/models/blockbuilder/camouflage.vmt")
  902. AddFileToDownloadsTable("materials/models/blockbuilder/camouflage.vtf")
  903. AddFileToDownloadsTable("materials/models/blockbuilder/camouflage_side.vtf")
  904. AddFileToDownloadsTable("materials/models/blockbuilder/camouflage_side.vmt")
  905. AddFileToDownloadsTable("materials/models/blockbuilder/ctbarrier.vmt")
  906. AddFileToDownloadsTable("materials/models/blockbuilder/ctbarrier.vtf")
  907. AddFileToDownloadsTable("materials/models/blockbuilder/ctbarrier_side.vmt")
  908. AddFileToDownloadsTable("materials/models/blockbuilder/ctbarrier_side.vtf")
  909. AddFileToDownloadsTable("materials/models/blockbuilder/damage.vmt")
  910. AddFileToDownloadsTable("materials/models/blockbuilder/damage.vtf")
  911. AddFileToDownloadsTable("materials/models/blockbuilder/damage_side.vtf")
  912. AddFileToDownloadsTable("materials/models/blockbuilder/damage_side.vmt")
  913. AddFileToDownloadsTable("materials/models/blockbuilder/deagle.vtf")
  914. AddFileToDownloadsTable("materials/models/blockbuilder/deagle.vmt")
  915. AddFileToDownloadsTable("materials/models/blockbuilder/deagle_side.vmt")
  916. AddFileToDownloadsTable("materials/models/blockbuilder/deagle_side.vtf")
  917. AddFileToDownloadsTable("materials/models/blockbuilder/death.vmt")
  918. AddFileToDownloadsTable("materials/models/blockbuilder/death.vtf")
  919. AddFileToDownloadsTable("materials/models/blockbuilder/death_n.vtf")
  920. AddFileToDownloadsTable("materials/models/blockbuilder/delay.vmt")
  921. AddFileToDownloadsTable("materials/models/blockbuilder/delay.vtf")
  922. AddFileToDownloadsTable("materials/models/blockbuilder/delay_side.vmt")
  923. AddFileToDownloadsTable("materials/models/blockbuilder/delay_side.vtf")
  924. AddFileToDownloadsTable("materials/models/blockbuilder/fire.vmt")
  925. AddFileToDownloadsTable("materials/models/blockbuilder/fire.vtf")
  926. AddFileToDownloadsTable("materials/models/blockbuilder/fire_side.vmt")
  927. AddFileToDownloadsTable("materials/models/blockbuilder/fire_side.vtf")
  928. AddFileToDownloadsTable("materials/models/blockbuilder/flash.vmt")
  929. AddFileToDownloadsTable("materials/models/blockbuilder/flash.vtf")
  930. AddFileToDownloadsTable("materials/models/blockbuilder/frost.vmt")
  931. AddFileToDownloadsTable("materials/models/blockbuilder/frost.vtf")
  932. AddFileToDownloadsTable("materials/models/blockbuilder/frost_side.vtf")
  933. AddFileToDownloadsTable("materials/models/blockbuilder/frost_side.vmt")
  934. AddFileToDownloadsTable("materials/models/blockbuilder/glass.vmt")
  935. AddFileToDownloadsTable("materials/models/blockbuilder/glass.vtf")
  936. AddFileToDownloadsTable("materials/models/blockbuilder/gravity.vmt")
  937. AddFileToDownloadsTable("materials/models/blockbuilder/gravity.vtf")
  938. AddFileToDownloadsTable("materials/models/blockbuilder/gravity_side.vmt")
  939. AddFileToDownloadsTable("materials/models/blockbuilder/gravity_side.vtf")
  940. AddFileToDownloadsTable("materials/models/blockbuilder/he.vmt")
  941. AddFileToDownloadsTable("materials/models/blockbuilder/he.vtf")
  942. AddFileToDownloadsTable("materials/models/blockbuilder/he_side.vtf")
  943. AddFileToDownloadsTable("materials/models/blockbuilder/he_side.vmt")
  944. AddFileToDownloadsTable("materials/models/blockbuilder/health.vmt")
  945. AddFileToDownloadsTable("materials/models/blockbuilder/health.vtf")
  946. AddFileToDownloadsTable("materials/models/blockbuilder/health_n.vtf")
  947. AddFileToDownloadsTable("materials/models/blockbuilder/honey.vmt")
  948. AddFileToDownloadsTable("materials/models/blockbuilder/honey.vtf")
  949. AddFileToDownloadsTable("materials/models/blockbuilder/honey_side.vtf")
  950. AddFileToDownloadsTable("materials/models/blockbuilder/honey_side.vmt")
  951. AddFileToDownloadsTable("materials/models/blockbuilder/ice_n.vtf")
  952. AddFileToDownloadsTable("materials/models/blockbuilder/invincibility.vmt")
  953. AddFileToDownloadsTable("materials/models/blockbuilder/invincibility.vtf")
  954. AddFileToDownloadsTable("materials/models/blockbuilder/invincibility_side.vtf")
  955. AddFileToDownloadsTable("materials/models/blockbuilder/invincibility_side.vmt")
  956. AddFileToDownloadsTable("materials/models/blockbuilder/nofalldmg.vmt")
  957. AddFileToDownloadsTable("materials/models/blockbuilder/nofalldmg.vtf")
  958. AddFileToDownloadsTable("materials/models/blockbuilder/nofalldmg_side.vtf")
  959. AddFileToDownloadsTable("materials/models/blockbuilder/nofalldmg_side.vmt")
  960. AddFileToDownloadsTable("materials/models/blockbuilder/noslowdown.vmt")
  961. AddFileToDownloadsTable("materials/models/blockbuilder/noslowdown.vtf")
  962. AddFileToDownloadsTable("materials/models/blockbuilder/noslowdown_side.vmt")
  963. AddFileToDownloadsTable("materials/models/blockbuilder/noslowdown_side.vtf")
  964. AddFileToDownloadsTable("materials/models/blockbuilder/nuke.vmt")
  965. AddFileToDownloadsTable("materials/models/blockbuilder/nuke.vtf")
  966. AddFileToDownloadsTable("materials/models/blockbuilder/platform.vtf")
  967. AddFileToDownloadsTable("materials/models/blockbuilder/platform.vmt")
  968. AddFileToDownloadsTable("materials/models/blockbuilder/platform_side.vmt")
  969. AddFileToDownloadsTable("materials/models/blockbuilder/platform_side.vtf")
  970. AddFileToDownloadsTable("materials/models/blockbuilder/random.vmt")
  971. AddFileToDownloadsTable("materials/models/blockbuilder/random.vtf")
  972. AddFileToDownloadsTable("materials/models/blockbuilder/random_side.vtf")
  973. AddFileToDownloadsTable("materials/models/blockbuilder/random_side.vmt")
  974. AddFileToDownloadsTable("materials/models/platforms/red_glow1.vtf")
  975. AddFileToDownloadsTable("materials/models/platforms/red_glow1.vmt")
  976. AddFileToDownloadsTable("materials/models/blockbuilder/slap.vtf")
  977. AddFileToDownloadsTable("materials/models/blockbuilder/slap.vmt")
  978. AddFileToDownloadsTable("materials/models/blockbuilder/speed.vmt")
  979. AddFileToDownloadsTable("materials/models/blockbuilder/speed.vtf")
  980. AddFileToDownloadsTable("materials/models/blockbuilder/speed_n.vtf")
  981. AddFileToDownloadsTable("materials/models/blockbuilder/speedboost.vmt")
  982. AddFileToDownloadsTable("materials/models/blockbuilder/speedboost.vtf")
  983. AddFileToDownloadsTable("materials/models/platforms/sphere.vmt")
  984. AddFileToDownloadsTable("materials/models/platforms/sphere.vtf")
  985. AddFileToDownloadsTable("materials/models/blockbuilder/stealth.vtf")
  986. AddFileToDownloadsTable("materials/models/blockbuilder/stealth.vmt")
  987. AddFileToDownloadsTable("materials/models/blockbuilder/stealth_side.vmt")
  988. AddFileToDownloadsTable("materials/models/blockbuilder/stealth_side.vtf")
  989. AddFileToDownloadsTable("materials/models/platforms/tape.vmt")
  990. AddFileToDownloadsTable("materials/models/platforms/tape.vtf")
  991. AddFileToDownloadsTable("materials/models/blockbuilder/tbarrier.vmt")
  992. AddFileToDownloadsTable("materials/models/blockbuilder/tbarrier.vtf")
  993. AddFileToDownloadsTable("materials/models/blockbuilder/tbarrier_side.vmt")
  994. AddFileToDownloadsTable("materials/models/blockbuilder/tbarrier_side.vtf")
  995. AddFileToDownloadsTable("materials/models/blockbuilder/tramp.vmt")
  996. AddFileToDownloadsTable("materials/models/blockbuilder/tramp.vtf")
  997. AddFileToDownloadsTable("materials/models/blockbuilder/tramp_n.vtf")
  998. AddFileToDownloadsTable("materials/models/blockbuilder/ice_top.vmt")
  999. AddFileToDownloadsTable("materials/models/blockbuilder/ice_top.vtf")
  1000.  
  1001.  
  1002. // LARGE BLOCKS
  1003.  
  1004. AddFileToDownloadsTable("models/blockbuilder/large_awp.vvd")
  1005. AddFileToDownloadsTable("models/blockbuilder/large_bhop.vvd")
  1006. AddFileToDownloadsTable("models/blockbuilder/large_camouflage.vvd")
  1007. AddFileToDownloadsTable("models/blockbuilder/large_ctbarrier.vvd")
  1008. AddFileToDownloadsTable("models/blockbuilder/large_damage.vvd")
  1009. AddFileToDownloadsTable("models/blockbuilder/large_deagle.vvd")
  1010. AddFileToDownloadsTable("models/blockbuilder/large_death.vvd")
  1011. AddFileToDownloadsTable("models/blockbuilder/large_delay.vvd")
  1012. AddFileToDownloadsTable("models/blockbuilder/large_fire.vvd")
  1013. AddFileToDownloadsTable("models/blockbuilder/large_flash.vvd")
  1014. AddFileToDownloadsTable("models/blockbuilder/large_frost.vvd")
  1015. AddFileToDownloadsTable("models/blockbuilder/large_glass.vvd")
  1016. AddFileToDownloadsTable("models/blockbuilder/large_gravity.vvd")
  1017. AddFileToDownloadsTable("models/blockbuilder/large_he.vvd")
  1018. AddFileToDownloadsTable("models/blockbuilder/large_health.vvd")
  1019. AddFileToDownloadsTable("models/blockbuilder/large_honey.vvd")
  1020. AddFileToDownloadsTable("models/blockbuilder/large_ice.vvd")
  1021. AddFileToDownloadsTable("models/blockbuilder/large_invincibility.vvd")
  1022. AddFileToDownloadsTable("models/blockbuilder/large_nofalldmg.vvd")
  1023. AddFileToDownloadsTable("models/blockbuilder/large_noslowdown.vvd")
  1024. AddFileToDownloadsTable("models/blockbuilder/large_nuke.vvd")
  1025. AddFileToDownloadsTable("models/blockbuilder/large_platform.vvd")
  1026. AddFileToDownloadsTable("models/blockbuilder/large_random.vvd")
  1027. AddFileToDownloadsTable("models/blockbuilder/large_slap.vvd")
  1028. AddFileToDownloadsTable("models/blockbuilder/large_speed.vvd")
  1029. AddFileToDownloadsTable("models/blockbuilder/large_speedboost.vvd")
  1030. AddFileToDownloadsTable("models/blockbuilder/large_stealth.vvd")
  1031. AddFileToDownloadsTable("models/blockbuilder/large_tbarrier.vvd")
  1032. AddFileToDownloadsTable("models/blockbuilder/large_tramp.vvd")
  1033.  
  1034. AddFileToDownloadsTable("models/blockbuilder/large_awp.dx90.vtx")
  1035. AddFileToDownloadsTable("models/blockbuilder/large_bhop.dx90.vtx")
  1036. AddFileToDownloadsTable("models/blockbuilder/large_camouflage.dx90.vtx")
  1037. AddFileToDownloadsTable("models/blockbuilder/large_ctbarrier.dx90.vtx")
  1038. AddFileToDownloadsTable("models/blockbuilder/large_damage.dx90.vtx")
  1039. AddFileToDownloadsTable("models/blockbuilder/large_deagle.dx90.vtx")
  1040. AddFileToDownloadsTable("models/blockbuilder/large_death.dx90.vtx")
  1041. AddFileToDownloadsTable("models/blockbuilder/large_delay.dx90.vtx")
  1042. AddFileToDownloadsTable("models/blockbuilder/large_fire.dx90.vtx")
  1043. AddFileToDownloadsTable("models/blockbuilder/large_flash.dx90.vtx")
  1044. AddFileToDownloadsTable("models/blockbuilder/large_frost.dx90.vtx")
  1045. AddFileToDownloadsTable("models/blockbuilder/large_glass.dx90.vtx")
  1046. AddFileToDownloadsTable("models/blockbuilder/large_gravity.dx90.vtx")
  1047. AddFileToDownloadsTable("models/blockbuilder/large_he.dx90.vtx")
  1048. AddFileToDownloadsTable("models/blockbuilder/large_health.dx90.vtx")
  1049. AddFileToDownloadsTable("models/blockbuilder/large_honey.dx90.vtx")
  1050. AddFileToDownloadsTable("models/blockbuilder/large_ice.dx90.vtx")
  1051. AddFileToDownloadsTable("models/blockbuilder/large_invincibility.dx90.vtx")
  1052. AddFileToDownloadsTable("models/blockbuilder/large_nofalldmg.dx90.vtx")
  1053. AddFileToDownloadsTable("models/blockbuilder/large_noslowdown.dx90.vtx")
  1054. AddFileToDownloadsTable("models/blockbuilder/large_nuke.dx90.vtx")
  1055. AddFileToDownloadsTable("models/blockbuilder/large_platform.dx90.vtx")
  1056. AddFileToDownloadsTable("models/blockbuilder/large_random.dx90.vtx")
  1057. AddFileToDownloadsTable("models/blockbuilder/large_slap.dx90.vtx")
  1058. AddFileToDownloadsTable("models/blockbuilder/large_speed.dx90.vtx")
  1059. AddFileToDownloadsTable("models/blockbuilder/large_speedboost.dx90.vtx")
  1060. AddFileToDownloadsTable("models/blockbuilder/large_stealth.dx90.vtx")
  1061. AddFileToDownloadsTable("models/blockbuilder/large_tbarrier.dx90.vtx")
  1062. AddFileToDownloadsTable("models/blockbuilder/large_tramp.dx90.vtx")
  1063.  
  1064. AddFileToDownloadsTable("models/blockbuilder/large_awp.phy")
  1065. AddFileToDownloadsTable("models/blockbuilder/large_bhop.phy")
  1066. AddFileToDownloadsTable("models/blockbuilder/large_camouflage.phy")
  1067. AddFileToDownloadsTable("models/blockbuilder/large_ctbarrier.phy")
  1068. AddFileToDownloadsTable("models/blockbuilder/large_damage.phy")
  1069. AddFileToDownloadsTable("models/blockbuilder/large_deagle.phy")
  1070. AddFileToDownloadsTable("models/blockbuilder/large_death.phy")
  1071. AddFileToDownloadsTable("models/blockbuilder/large_delay.phy")
  1072. AddFileToDownloadsTable("models/blockbuilder/large_fire.phy")
  1073. AddFileToDownloadsTable("models/blockbuilder/large_flash.phy")
  1074. AddFileToDownloadsTable("models/blockbuilder/large_frost.phy")
  1075. AddFileToDownloadsTable("models/blockbuilder/large_glass.phy")
  1076. AddFileToDownloadsTable("models/blockbuilder/large_gravity.phy")
  1077. AddFileToDownloadsTable("models/blockbuilder/large_he.phy")
  1078. AddFileToDownloadsTable("models/blockbuilder/large_health.phy")
  1079. AddFileToDownloadsTable("models/blockbuilder/large_honey.phy")
  1080. AddFileToDownloadsTable("models/blockbuilder/large_ice.phy")
  1081. AddFileToDownloadsTable("models/blockbuilder/large_invincibility.phy")
  1082. AddFileToDownloadsTable("models/blockbuilder/large_nofalldmg.phy")
  1083. AddFileToDownloadsTable("models/blockbuilder/large_noslowdown.phy")
  1084. AddFileToDownloadsTable("models/blockbuilder/large_nuke.phy")
  1085. AddFileToDownloadsTable("models/blockbuilder/large_platform.phy")
  1086. AddFileToDownloadsTable("models/blockbuilder/large_random.phy")
  1087. AddFileToDownloadsTable("models/blockbuilder/large_slap.phy")
  1088. AddFileToDownloadsTable("models/blockbuilder/large_speed.phy")
  1089. AddFileToDownloadsTable("models/blockbuilder/large_speedboost.phy")
  1090. AddFileToDownloadsTable("models/blockbuilder/large_stealth.phy")
  1091. AddFileToDownloadsTable("models/blockbuilder/large_tbarrier.phy")
  1092. AddFileToDownloadsTable("models/blockbuilder/large_tramp.phy")
  1093.  
  1094. AddFileToDownloadsTable("models/blockbuilder/large_awp.mdl")
  1095. AddFileToDownloadsTable("models/esagame_large/bunnyhop.mdl")
  1096. AddFileToDownloadsTable("models/blockbuilder/large_camouflage.mdl")
  1097. AddFileToDownloadsTable("models/esagame_large/ct_barrier")
  1098. AddFileToDownloadsTable("models/esagame_large/damage.mdl")
  1099. AddFileToDownloadsTable("models/blockbuilder/large_deagle.mdl")
  1100. AddFileToDownloadsTable("models/blockbuilder/large_death.mdl")
  1101. AddFileToDownloadsTable("models/blockbuilder/large_delay.mdl")
  1102. AddFileToDownloadsTable("models/blockbuilder/large_fire.mdl")
  1103. AddFileToDownloadsTable("models/blockbuilder/large_flash.mdl")
  1104. AddFileToDownloadsTable("models/blockbuilder/large_frost.mdl")
  1105. AddFileToDownloadsTable("models/blockbuilder/large_glass.mdl")
  1106. AddFileToDownloadsTable("models/blockbuilder/large_gravity.mdl")
  1107. AddFileToDownloadsTable("models/blockbuilder/large_he.mdl")
  1108. AddFileToDownloadsTable("models/esa_large/heal.mdl")
  1109. AddFileToDownloadsTable("models/esa_large/honey.mdl")
  1110. AddFileToDownloadsTable("models/esa_large/ice.mdl")
  1111. AddFileToDownloadsTable("models/esa_large/invincibility.mdl")
  1112. AddFileToDownloadsTable("models/esa_large/nfd.mdl")
  1113. AddFileToDownloadsTable("models/blockbuilder/large_noslowdown.mdl")
  1114. AddFileToDownloadsTable("models/blockbuilder/large_nuke.mdl")
  1115. AddFileToDownloadsTable("models/esa_large/platform.mdl")
  1116. AddFileToDownloadsTable("models/blockbuilder/large_random.mdl")
  1117. AddFileToDownloadsTable("models/blockbuilder/large_slap.mdl")
  1118. AddFileToDownloadsTable("models/esa_large/boots.mdl")
  1119. AddFileToDownloadsTable("models/esa_large/speedboost.mdl")
  1120. AddFileToDownloadsTable("models/esa_large/stealth.mdl")
  1121. AddFileToDownloadsTable("models/esa_large/tt_barrier.mdl")
  1122. AddFileToDownloadsTable("models/esa_large/trampoline.mdl")
  1123.  
  1124. PrecacheModel("models/blockbuilder/large_awp.mdl")
  1125. PrecacheModel("models/esa_large/bunnyhop.mdl")
  1126. PrecacheModel("models/blockbuilder/large_camouflage.mdl")
  1127. PrecacheModel("models/esa_large/ct_barrier.mdl")
  1128. PrecacheModel("models/esa_large/damage.mdl")
  1129. PrecacheModel("models/blockbuilder/large_deagle.mdl")
  1130. PrecacheModel("models/esa_large/death.mdl")
  1131. PrecacheModel("models/esa_large/delayedbunnyhop.mdl")
  1132. PrecacheModel("models/blockbuilder/large_fire.mdl")
  1133. PrecacheModel("models/blockbuilder/large_flash.mdl")
  1134. PrecacheModel("models/blockbuilder/large_frost.mdl")
  1135. PrecacheModel("models/blockbuilder/large_glass.mdl")
  1136. PrecacheModel("models/blockbuilder/large_gravity.mdl")
  1137. PrecacheModel("models/blockbuilder/large_he.mdl")
  1138. PrecacheModel("models/esa_large/heal.mdl")
  1139. PrecacheModel("models/esa_large/honey.mdl")
  1140. PrecacheModel("models/esa_large/ice.mdl")
  1141. PrecacheModel("models/esa_large/invincibility.mdl")
  1142. PrecacheModel("models/esa_large/nfd.mdl")
  1143. PrecacheModel("models/blockbuilder/large_noslowdown.mdl")
  1144. PrecacheModel("models/blockbuilder/large_nuke.mdl")
  1145. PrecacheModel("models/esa_large/platform.mdl")
  1146. PrecacheModel("models/blockbuilder/large_random.mdl")
  1147. PrecacheModel("models/blockbuilder/large_slap.mdl")
  1148. PrecacheModel("models/esa_large/boots.mdl")
  1149. PrecacheModel("models/esa_large/speedboost.mdl")
  1150. PrecacheModel("models/blockbuilder/large_stealth.mdl")
  1151. PrecacheModel("models/esa_large/tt_barrier.mdl")
  1152. PrecacheModel("models/esa_large/trampoline.mdl")
  1153.  
  1154. // small BLOCKS
  1155.  
  1156. AddFileToDownloadsTable("models/blockbuilder/small_awp.vvd")
  1157. AddFileToDownloadsTable("models/blockbuilder/small_bhop.vvd")
  1158. AddFileToDownloadsTable("models/blockbuilder/small_camouflage.vvd")
  1159. AddFileToDownloadsTable("models/blockbuilder/small_ctbarrier.vvd")
  1160. AddFileToDownloadsTable("models/blockbuilder/small_damage.vvd")
  1161. AddFileToDownloadsTable("models/blockbuilder/small_deagle.vvd")
  1162. AddFileToDownloadsTable("models/blockbuilder/small_death.vvd")
  1163. AddFileToDownloadsTable("models/blockbuilder/small_delay.vvd")
  1164. AddFileToDownloadsTable("models/blockbuilder/small_fire.vvd")
  1165. AddFileToDownloadsTable("models/blockbuilder/small_flash.vvd")
  1166. AddFileToDownloadsTable("models/blockbuilder/small_frost.vvd")
  1167. AddFileToDownloadsTable("models/blockbuilder/small_glass.vvd")
  1168. AddFileToDownloadsTable("models/blockbuilder/small_gravity.vvd")
  1169. AddFileToDownloadsTable("models/blockbuilder/small_he.vvd")
  1170. AddFileToDownloadsTable("models/blockbuilder/small_health.vvd")
  1171. AddFileToDownloadsTable("models/blockbuilder/small_honey.vvd")
  1172. AddFileToDownloadsTable("models/blockbuilder/small_ice.vvd")
  1173. AddFileToDownloadsTable("models/blockbuilder/small_invincibility.vvd")
  1174. AddFileToDownloadsTable("models/blockbuilder/small_nofalldmg.vvd")
  1175. AddFileToDownloadsTable("models/blockbuilder/small_noslowdown.vvd")
  1176. AddFileToDownloadsTable("models/blockbuilder/small_nuke.vvd")
  1177. AddFileToDownloadsTable("models/blockbuilder/small_platform.vvd")
  1178. AddFileToDownloadsTable("models/blockbuilder/small_random.vvd")
  1179. AddFileToDownloadsTable("models/blockbuilder/small_slap.vvd")
  1180. AddFileToDownloadsTable("models/blockbuilder/small_speed.vvd")
  1181. AddFileToDownloadsTable("models/blockbuilder/small_speedboost.vvd")
  1182. AddFileToDownloadsTable("models/blockbuilder/small_stealth.vvd")
  1183. AddFileToDownloadsTable("models/blockbuilder/small_tbarrier.vvd")
  1184. AddFileToDownloadsTable("models/blockbuilder/small_tramp.vvd")
  1185.  
  1186. AddFileToDownloadsTable("models/blockbuilder/small_awp.dx90.vtx")
  1187. AddFileToDownloadsTable("models/blockbuilder/small_bhop.dx90.vtx")
  1188. AddFileToDownloadsTable("models/blockbuilder/small_camouflage.dx90.vtx")
  1189. AddFileToDownloadsTable("models/blockbuilder/small_ctbarrier.dx90.vtx")
  1190. AddFileToDownloadsTable("models/blockbuilder/small_damage.dx90.vtx")
  1191. AddFileToDownloadsTable("models/blockbuilder/small_deagle.dx90.vtx")
  1192. AddFileToDownloadsTable("models/blockbuilder/small_death.dx90.vtx")
  1193. AddFileToDownloadsTable("models/blockbuilder/small_delay.dx90.vtx")
  1194. AddFileToDownloadsTable("models/blockbuilder/small_fire.dx90.vtx")
  1195. AddFileToDownloadsTable("models/blockbuilder/small_flash.dx90.vtx")
  1196. AddFileToDownloadsTable("models/blockbuilder/small_frost.dx90.vtx")
  1197. AddFileToDownloadsTable("models/blockbuilder/small_glass.dx90.vtx")
  1198. AddFileToDownloadsTable("models/blockbuilder/small_gravity.dx90.vtx")
  1199. AddFileToDownloadsTable("models/blockbuilder/small_he.dx90.vtx")
  1200. AddFileToDownloadsTable("models/blockbuilder/small_health.dx90.vtx")
  1201. AddFileToDownloadsTable("models/blockbuilder/small_honey.dx90.vtx")
  1202. AddFileToDownloadsTable("models/blockbuilder/small_ice.dx90.vtx")
  1203. AddFileToDownloadsTable("models/blockbuilder/small_invincibility.dx90.vtx")
  1204. AddFileToDownloadsTable("models/blockbuilder/small_nofalldmg.dx90.vtx")
  1205. AddFileToDownloadsTable("models/blockbuilder/small_noslowdown.dx90.vtx")
  1206. AddFileToDownloadsTable("models/blockbuilder/small_nuke.dx90.vtx")
  1207. AddFileToDownloadsTable("models/blockbuilder/small_platform.dx90.vtx")
  1208. AddFileToDownloadsTable("models/blockbuilder/small_random.dx90.vtx")
  1209. AddFileToDownloadsTable("models/blockbuilder/small_slap.dx90.vtx")
  1210. AddFileToDownloadsTable("models/blockbuilder/small_speed.dx90.vtx")
  1211. AddFileToDownloadsTable("models/blockbuilder/small_speedboost.dx90.vtx")
  1212. AddFileToDownloadsTable("models/blockbuilder/small_stealth.dx90.vtx")
  1213. AddFileToDownloadsTable("models/blockbuilder/small_tbarrier.dx90.vtx")
  1214. AddFileToDownloadsTable("models/blockbuilder/small_tramp.dx90.vtx")
  1215.  
  1216. AddFileToDownloadsTable("models/blockbuilder/small_awp.phy")
  1217. AddFileToDownloadsTable("models/blockbuilder/small_bhop.phy")
  1218. AddFileToDownloadsTable("models/blockbuilder/small_camouflage.phy")
  1219. AddFileToDownloadsTable("models/blockbuilder/small_ctbarrier.phy")
  1220. AddFileToDownloadsTable("models/blockbuilder/small_damage.phy")
  1221. AddFileToDownloadsTable("models/blockbuilder/small_deagle.phy")
  1222. AddFileToDownloadsTable("models/blockbuilder/small_death.phy")
  1223. AddFileToDownloadsTable("models/blockbuilder/small_delay.phy")
  1224. AddFileToDownloadsTable("models/blockbuilder/small_fire.phy")
  1225. AddFileToDownloadsTable("models/blockbuilder/small_flash.phy")
  1226. AddFileToDownloadsTable("models/blockbuilder/small_frost.phy")
  1227. AddFileToDownloadsTable("models/blockbuilder/small_glass.phy")
  1228. AddFileToDownloadsTable("models/blockbuilder/small_gravity.phy")
  1229. AddFileToDownloadsTable("models/blockbuilder/small_he.phy")
  1230. AddFileToDownloadsTable("models/blockbuilder/small_health.phy")
  1231. AddFileToDownloadsTable("models/blockbuilder/small_honey.phy")
  1232. AddFileToDownloadsTable("models/blockbuilder/small_ice.phy")
  1233. AddFileToDownloadsTable("models/blockbuilder/small_invincibility.phy")
  1234. AddFileToDownloadsTable("models/blockbuilder/small_nofalldmg.phy")
  1235. AddFileToDownloadsTable("models/blockbuilder/small_noslowdown.phy")
  1236. AddFileToDownloadsTable("models/blockbuilder/small_nuke.phy")
  1237. AddFileToDownloadsTable("models/blockbuilder/small_platform.phy")
  1238. AddFileToDownloadsTable("models/blockbuilder/small_random.phy")
  1239. AddFileToDownloadsTable("models/blockbuilder/small_slap.phy")
  1240. AddFileToDownloadsTable("models/blockbuilder/small_speed.phy")
  1241. AddFileToDownloadsTable("models/blockbuilder/small_speedboost.phy")
  1242. AddFileToDownloadsTable("models/blockbuilder/small_stealth.phy")
  1243. AddFileToDownloadsTable("models/blockbuilder/small_tbarrier.phy")
  1244. AddFileToDownloadsTable("models/blockbuilder/small_tramp.phy")
  1245.  
  1246. AddFileToDownloadsTable("models/blockbuilder/small_awp.mdl")
  1247. AddFileToDownloadsTable("models/esa_small/bunnyhop.mdl")
  1248. AddFileToDownloadsTable("models/blockbuilder/small_camouflage.mdl")
  1249. AddFileToDownloadsTable("models/esa_small/ct_barrier.mdl")
  1250. AddFileToDownloadsTable("models/esa_small/damage.mdl")
  1251. AddFileToDownloadsTable("models/blockbuilder/small_deagle.mdl")
  1252. AddFileToDownloadsTable("models/esa_small/death.mdl")
  1253. AddFileToDownloadsTable("models/esa_small/delayedbunnyhop.mdl")
  1254. AddFileToDownloadsTable("models/blockbuilder/small_fire.mdl")
  1255. AddFileToDownloadsTable("models/blockbuilder/small_flash.mdl")
  1256. AddFileToDownloadsTable("models/blockbuilder/small_frost.mdl")
  1257. AddFileToDownloadsTable("models/blockbuilder/small_glass.mdl")
  1258. AddFileToDownloadsTable("models/blockbuilder/small_gravity.mdl")
  1259. AddFileToDownloadsTable("models/blockbuilder/small_he.mdl")
  1260. AddFileToDownloadsTable("models/esa_small/heal.mdl")
  1261. AddFileToDownloadsTable("models/esa_small/honey.mdl")
  1262. AddFileToDownloadsTable("models/esa_small/ice.mdl")
  1263. AddFileToDownloadsTable("models/esa_small/invincibility.mdl")
  1264. AddFileToDownloadsTable("models/esa_small/nfd.mdl")
  1265. AddFileToDownloadsTable("models/blockbuilder/small_noslowdown.mdl")
  1266. AddFileToDownloadsTable("models/blockbuilder/small_nuke.mdl")
  1267. AddFileToDownloadsTable("models/esa_small/platform.mdl")
  1268. AddFileToDownloadsTable("models/blockbuilder/small_random.mdl")
  1269. AddFileToDownloadsTable("models/blockbuilder/small_slap.mdl")
  1270. AddFileToDownloadsTable("models/esa_small/boots.mdl")
  1271. AddFileToDownloadsTable("models/esa_small/speedboost.mdl")
  1272. AddFileToDownloadsTable("models/esa_small/stealth.mdl")
  1273. AddFileToDownloadsTable("models/esa_small/tt_barrier.mdl")
  1274. AddFileToDownloadsTable("models/esa_small/trampoline.mdl")
  1275.  
  1276. PrecacheModel("models/blockbuilder/small_awp.mdl")
  1277. PrecacheModel("models/esa_small/bunnyhop.mdl")
  1278. PrecacheModel("models/blockbuilder/small_camouflage.mdl")
  1279. PrecacheModel("models/esa_small/ct_barrier.mdl")
  1280. PrecacheModel("models/esa_small/damage.mdl")
  1281. PrecacheModel("models/blockbuilder/small_deagle.mdl")
  1282. PrecacheModel("models/esa_small/death.mdl")
  1283. PrecacheModel("models/esa_small/delayedbunnyhop.mdl")
  1284. PrecacheModel("models/blockbuilder/small_fire.mdl")
  1285. PrecacheModel("models/blockbuilder/small_flash.mdl")
  1286. PrecacheModel("models/blockbuilder/small_frost.mdl")
  1287. PrecacheModel("models/blockbuilder/small_glass.mdl")
  1288. PrecacheModel("models/blockbuilder/small_gravity.mdl")
  1289. PrecacheModel("models/blockbuilder/small_he.mdl")
  1290. PrecacheModel("models/esa_small/heal.mdl")
  1291. PrecacheModel("models/esa_small/honey.mdl")
  1292. PrecacheModel("models/esa_small/ice.mdl")
  1293. PrecacheModel("models/esa_small/invincibility.mdl")
  1294. PrecacheModel("models/esa_small/nfd.mdl")
  1295. PrecacheModel("models/blockbuilder/small_noslowdown.mdl")
  1296. PrecacheModel("models/blockbuilder/small_nuke.mdl")
  1297. PrecacheModel("models/esa_small/platform.mdl")
  1298. PrecacheModel("models/blockbuilder/small_random.mdl")
  1299. PrecacheModel("models/blockbuilder/small_slap.mdl")
  1300. PrecacheModel("models/esa_small/boots.mdl")
  1301. PrecacheModel("models/esa_small/speedboost.mdl")
  1302. PrecacheModel("models/esa_small/stealth.mdl")
  1303. PrecacheModel("models/esa_small/tt_barrier.mdl")
  1304. PrecacheModel("models/esa_small/trampoline.mdl")
  1305.  
  1306. // pole BLOCKS
  1307.  
  1308. AddFileToDownloadsTable("models/blockbuilder/pole_awp.vvd")
  1309. AddFileToDownloadsTable("models/blockbuilder/pole_bhop.vvd")
  1310. AddFileToDownloadsTable("models/blockbuilder/pole_camouflage.vvd")
  1311. AddFileToDownloadsTable("models/blockbuilder/pole_ctbarrier.vvd")
  1312. AddFileToDownloadsTable("models/blockbuilder/pole_damage.vvd")
  1313. AddFileToDownloadsTable("models/blockbuilder/pole_deagle.vvd")
  1314. AddFileToDownloadsTable("models/blockbuilder/pole_death.vvd")
  1315. AddFileToDownloadsTable("models/blockbuilder/pole_delay.vvd")
  1316. AddFileToDownloadsTable("models/blockbuilder/pole_fire.vvd")
  1317. AddFileToDownloadsTable("models/blockbuilder/pole_flash.vvd")
  1318. AddFileToDownloadsTable("models/blockbuilder/pole_frost.vvd")
  1319. AddFileToDownloadsTable("models/blockbuilder/pole_glass.vvd")
  1320. AddFileToDownloadsTable("models/blockbuilder/pole_gravity.vvd")
  1321. AddFileToDownloadsTable("models/blockbuilder/pole_he.vvd")
  1322. AddFileToDownloadsTable("models/blockbuilder/pole_health.vvd")
  1323. AddFileToDownloadsTable("models/blockbuilder/pole_honey.vvd")
  1324. AddFileToDownloadsTable("models/blockbuilder/pole_ice.vvd")
  1325. AddFileToDownloadsTable("models/blockbuilder/pole_invincibility.vvd")
  1326. AddFileToDownloadsTable("models/blockbuilder/pole_nofalldmg.vvd")
  1327. AddFileToDownloadsTable("models/blockbuilder/pole_noslowdown.vvd")
  1328. AddFileToDownloadsTable("models/blockbuilder/pole_nuke.vvd")
  1329. AddFileToDownloadsTable("models/blockbuilder/pole_platform.vvd")
  1330. AddFileToDownloadsTable("models/blockbuilder/pole_random.vvd")
  1331. AddFileToDownloadsTable("models/blockbuilder/pole_slap.vvd")
  1332. AddFileToDownloadsTable("models/blockbuilder/pole_speed.vvd")
  1333. AddFileToDownloadsTable("models/blockbuilder/pole_speedboost.vvd")
  1334. AddFileToDownloadsTable("models/blockbuilder/pole_stealth.vvd")
  1335. AddFileToDownloadsTable("models/blockbuilder/pole_tbarrier.vvd")
  1336. AddFileToDownloadsTable("models/blockbuilder/pole_tramp.vvd")
  1337.  
  1338. AddFileToDownloadsTable("models/blockbuilder/pole_awp.dx90.vtx")
  1339. AddFileToDownloadsTable("models/blockbuilder/pole_bhop.dx90.vtx")
  1340. AddFileToDownloadsTable("models/blockbuilder/pole_camouflage.dx90.vtx")
  1341. AddFileToDownloadsTable("models/blockbuilder/pole_ctbarrier.dx90.vtx")
  1342. AddFileToDownloadsTable("models/blockbuilder/pole_damage.dx90.vtx")
  1343. AddFileToDownloadsTable("models/blockbuilder/pole_deagle.dx90.vtx")
  1344. AddFileToDownloadsTable("models/blockbuilder/pole_death.dx90.vtx")
  1345. AddFileToDownloadsTable("models/blockbuilder/pole_delay.dx90.vtx")
  1346. AddFileToDownloadsTable("models/blockbuilder/pole_fire.dx90.vtx")
  1347. AddFileToDownloadsTable("models/blockbuilder/pole_flash.dx90.vtx")
  1348. AddFileToDownloadsTable("models/blockbuilder/pole_frost.dx90.vtx")
  1349. AddFileToDownloadsTable("models/blockbuilder/pole_glass.dx90.vtx")
  1350. AddFileToDownloadsTable("models/blockbuilder/pole_gravity.dx90.vtx")
  1351. AddFileToDownloadsTable("models/blockbuilder/pole_he.dx90.vtx")
  1352. AddFileToDownloadsTable("models/blockbuilder/pole_health.dx90.vtx")
  1353. AddFileToDownloadsTable("models/blockbuilder/pole_honey.dx90.vtx")
  1354. AddFileToDownloadsTable("models/blockbuilder/pole_ice.dx90.vtx")
  1355. AddFileToDownloadsTable("models/blockbuilder/pole_invincibility.dx90.vtx")
  1356. AddFileToDownloadsTable("models/blockbuilder/pole_nofalldmg.dx90.vtx")
  1357. AddFileToDownloadsTable("models/blockbuilder/pole_noslowdown.dx90.vtx")
  1358. AddFileToDownloadsTable("models/blockbuilder/pole_nuke.dx90.vtx")
  1359. AddFileToDownloadsTable("models/blockbuilder/pole_platform.dx90.vtx")
  1360. AddFileToDownloadsTable("models/blockbuilder/pole_random.dx90.vtx")
  1361. AddFileToDownloadsTable("models/blockbuilder/pole_slap.dx90.vtx")
  1362. AddFileToDownloadsTable("models/blockbuilder/pole_speed.dx90.vtx")
  1363. AddFileToDownloadsTable("models/blockbuilder/pole_speedboost.dx90.vtx")
  1364. AddFileToDownloadsTable("models/blockbuilder/pole_stealth.dx90.vtx")
  1365. AddFileToDownloadsTable("models/blockbuilder/pole_tbarrier.dx90.vtx")
  1366. AddFileToDownloadsTable("models/blockbuilder/pole_tramp.dx90.vtx")
  1367.  
  1368. AddFileToDownloadsTable("models/blockbuilder/pole_awp.phy")
  1369. AddFileToDownloadsTable("models/blockbuilder/pole_bhop.phy")
  1370. AddFileToDownloadsTable("models/blockbuilder/pole_camouflage.phy")
  1371. AddFileToDownloadsTable("models/blockbuilder/pole_ctbarrier.phy")
  1372. AddFileToDownloadsTable("models/blockbuilder/pole_damage.phy")
  1373. AddFileToDownloadsTable("models/blockbuilder/pole_deagle.phy")
  1374. AddFileToDownloadsTable("models/blockbuilder/pole_death.phy")
  1375. AddFileToDownloadsTable("models/blockbuilder/pole_delay.phy")
  1376. AddFileToDownloadsTable("models/blockbuilder/pole_fire.phy")
  1377. AddFileToDownloadsTable("models/blockbuilder/pole_flash.phy")
  1378. AddFileToDownloadsTable("models/blockbuilder/pole_frost.phy")
  1379. AddFileToDownloadsTable("models/blockbuilder/pole_glass.phy")
  1380. AddFileToDownloadsTable("models/blockbuilder/pole_gravity.phy")
  1381. AddFileToDownloadsTable("models/blockbuilder/pole_he.phy")
  1382. AddFileToDownloadsTable("models/blockbuilder/pole_health.phy")
  1383. AddFileToDownloadsTable("models/blockbuilder/pole_honey.phy")
  1384. AddFileToDownloadsTable("models/blockbuilder/pole_ice.phy")
  1385. AddFileToDownloadsTable("models/blockbuilder/pole_invincibility.phy")
  1386. AddFileToDownloadsTable("models/blockbuilder/pole_nofalldmg.phy")
  1387. AddFileToDownloadsTable("models/blockbuilder/pole_noslowdown.phy")
  1388. AddFileToDownloadsTable("models/blockbuilder/pole_nuke.phy")
  1389. AddFileToDownloadsTable("models/blockbuilder/pole_platform.phy")
  1390. AddFileToDownloadsTable("models/blockbuilder/pole_random.phy")
  1391. AddFileToDownloadsTable("models/blockbuilder/pole_slap.phy")
  1392. AddFileToDownloadsTable("models/blockbuilder/pole_speed.phy")
  1393. AddFileToDownloadsTable("models/blockbuilder/pole_speedboost.phy")
  1394. AddFileToDownloadsTable("models/blockbuilder/pole_stealth.phy")
  1395. AddFileToDownloadsTable("models/blockbuilder/pole_tbarrier.phy")
  1396. AddFileToDownloadsTable("models/blockbuilder/pole_tramp.phy")
  1397.  
  1398. AddFileToDownloadsTable("models/blockbuilder/pole_awp.mdl")
  1399. AddFileToDownloadsTable("models/blockbuilder/pole_bhop.mdl")
  1400. AddFileToDownloadsTable("models/blockbuilder/pole_camouflage.mdl")
  1401. AddFileToDownloadsTable("models/blockbuilder/pole_ctbarrier.mdl")
  1402. AddFileToDownloadsTable("models/blockbuilder/pole_damage.mdl")
  1403. AddFileToDownloadsTable("models/blockbuilder/pole_deagle.mdl")
  1404. AddFileToDownloadsTable("models/blockbuilder/pole_death.mdl")
  1405. AddFileToDownloadsTable("models/blockbuilder/pole_delay.mdl")
  1406. AddFileToDownloadsTable("models/blockbuilder/pole_fire.mdl")
  1407. AddFileToDownloadsTable("models/blockbuilder/pole_flash.mdl")
  1408. AddFileToDownloadsTable("models/blockbuilder/pole_frost.mdl")
  1409. AddFileToDownloadsTable("models/blockbuilder/pole_glass.mdl")
  1410. AddFileToDownloadsTable("models/blockbuilder/pole_gravity.mdl")
  1411. AddFileToDownloadsTable("models/blockbuilder/pole_he.mdl")
  1412. AddFileToDownloadsTable("models/blockbuilder/pole_health.mdl")
  1413. AddFileToDownloadsTable("models/blockbuilder/pole_honey.mdl")
  1414. AddFileToDownloadsTable("models/blockbuilder/pole_ice.mdl")
  1415. AddFileToDownloadsTable("models/blockbuilder/pole_invincibility.mdl")
  1416. AddFileToDownloadsTable("models/blockbuilder/pole_nofalldmg.mdl")
  1417. AddFileToDownloadsTable("models/blockbuilder/pole_noslowdown.mdl")
  1418. AddFileToDownloadsTable("models/blockbuilder/pole_nuke.mdl")
  1419. AddFileToDownloadsTable("models/blockbuilder/pole_platform.mdl")
  1420. AddFileToDownloadsTable("models/blockbuilder/pole_random.mdl")
  1421. AddFileToDownloadsTable("models/blockbuilder/pole_slap.mdl")
  1422. AddFileToDownloadsTable("models/blockbuilder/pole_speed.mdl")
  1423. AddFileToDownloadsTable("models/blockbuilder/pole_speedboost.mdl")
  1424. AddFileToDownloadsTable("models/blockbuilder/pole_stealth.mdl")
  1425. AddFileToDownloadsTable("models/blockbuilder/pole_tbarrier.mdl")
  1426. AddFileToDownloadsTable("models/blockbuilder/pole_tramp.mdl")
  1427.  
  1428. PrecacheModel("models/blockbuilder/pole_awp.mdl")
  1429. PrecacheModel("models/blockbuilder/pole_bhop.mdl")
  1430. PrecacheModel("models/blockbuilder/pole_camouflage.mdl")
  1431. PrecacheModel("models/blockbuilder/pole_ctbarrier.mdl")
  1432. PrecacheModel("models/blockbuilder/pole_damage.mdl")
  1433. PrecacheModel("models/blockbuilder/pole_deagle.mdl")
  1434. PrecacheModel("models/blockbuilder/pole_death.mdl")
  1435. PrecacheModel("models/blockbuilder/pole_delay.mdl")
  1436. PrecacheModel("models/blockbuilder/pole_fire.mdl")
  1437. PrecacheModel("models/blockbuilder/pole_flash.mdl")
  1438. PrecacheModel("models/blockbuilder/pole_frost.mdl")
  1439. PrecacheModel("models/blockbuilder/pole_glass.mdl")
  1440. PrecacheModel("models/blockbuilder/pole_gravity.mdl")
  1441. PrecacheModel("models/blockbuilder/pole_he.mdl")
  1442. PrecacheModel("models/blockbuilder/pole_health.mdl")
  1443. PrecacheModel("models/blockbuilder/pole_honey.mdl")
  1444. PrecacheModel("models/blockbuilder/pole_ice.mdl")
  1445. PrecacheModel("models/blockbuilder/pole_invincibility.mdl")
  1446. PrecacheModel("models/blockbuilder/pole_nofalldmg.mdl")
  1447. PrecacheModel("models/blockbuilder/pole_noslowdown.mdl")
  1448. PrecacheModel("models/blockbuilder/pole_nuke.mdl")
  1449. PrecacheModel("models/blockbuilder/pole_platform.mdl")
  1450. PrecacheModel("models/blockbuilder/pole_random.mdl")
  1451. PrecacheModel("models/blockbuilder/pole_slap.mdl")
  1452. PrecacheModel("models/blockbuilder/pole_speed.mdl")
  1453. PrecacheModel("models/blockbuilder/pole_speedboost.mdl")
  1454. PrecacheModel("models/blockbuilder/pole_stealth.mdl")
  1455. PrecacheModel("models/blockbuilder/pole_tbarrier.mdl")
  1456. PrecacheModel("models/blockbuilder/pole_tramp.mdl")
  1457. }
  1458.  
  1459. public Action:Command_SaveBlocks(client, args)
  1460. {
  1461.  
  1462. if(client)
  1463. {
  1464. // if(!(GetUserFlagBits(client) & ADMFLAG_CUSTOM1 || GetUserFlagBits(client) & ADMFLAG_ROOT))
  1465. // {
  1466. // PrintToChat(client, "\x03%s\x04 You don't have permission to access this.", CHAT_TAG);
  1467. // return Plugin_Handled;
  1468. // }
  1469. }
  1470. else {
  1471. new iPlayers = 0;
  1472. for(new i = 1; i <= MaxClients; i++)
  1473. {
  1474. if(IsValidClient(i))
  1475. {
  1476. iPlayers++;
  1477. }
  1478. }
  1479. if(!iPlayers)
  1480. {
  1481. PrintToServer("You can only save when at least one client is in-game");
  1482. return Plugin_Handled;
  1483. }
  1484. }
  1485.  
  1486.  
  1487. if(g_hBlocksKV != INVALID_HANDLE)
  1488. CloseHandle(g_hBlocksKV);
  1489. g_hBlocksKV = CreateKeyValues("Blocks");
  1490. KvGotoFirstSubKey(g_hBlocksKV);
  1491. new index = 1, blocks=0,teleporters=0;
  1492. new String:tmp[11];
  1493. new Float:fPos[3], Float:fAng[3];
  1494. for(new i=0;i<2048;++i)
  1495. {
  1496. if(!IsValidBlock(i) || g_iTeleporters[i]==1)
  1497. continue;
  1498.  
  1499. GetEntPropVector(i, Prop_Data, "m_vecOrigin", fPos);
  1500.  
  1501.  
  1502. IntToString(index, tmp, sizeof(tmp));
  1503. KvJumpToKey(g_hBlocksKV, tmp, true);
  1504. if(g_iTeleporters[i]>1 && IsValidBlock(g_iTeleporters[i]))
  1505. {
  1506. GetEntPropVector(g_iTeleporters[i], Prop_Data, "m_vecOrigin", fAng);
  1507. KvSetNum(g_hBlocksKV, "teleporter", 1);
  1508. KvSetVector(g_hBlocksKV, "entrance", fPos);
  1509. KvSetVector(g_hBlocksKV, "exit", fAng);
  1510. teleporters++;
  1511. }
  1512. else
  1513. {
  1514. GetEntPropVector(i, Prop_Data, "m_angRotation", fAng);
  1515. KvSetNum(g_hBlocksKV, "blocktype", g_iBlocks[i]);
  1516. KvSetVector(g_hBlocksKV, "position", fPos);
  1517. KvSetVector(g_hBlocksKV, "angles", fAng);
  1518. if(g_iBlocks[i] == 5 || g_iBlocks[i] == 35 || g_iBlocks[i] == 64 || g_iBlocks[i] == 93)
  1519. {
  1520. KvSetFloat(g_hBlocksKV, "attrib1", TrampolineForce[i])
  1521. }
  1522. else if(g_iBlocks[i] == 6 || g_iBlocks[i] == 36 || g_iBlocks[i] == 65 || g_iBlocks[i] == 94)
  1523. {
  1524. KvSetFloat(g_hBlocksKV, "attrib1", SpeedBoostForce_1[i])
  1525. KvSetFloat(g_hBlocksKV, "attrib2", SpeedBoostForce_2[i])
  1526. }
  1527. else if(g_iBlocks[i] == 28 || g_iBlocks[i] == 57 || g_iBlocks[i] == 86 || g_iBlocks[i] == 115 || g_iBlocks[i] == 18 || g_iBlocks[i] == 47 || g_iBlocks[i] == 76 || g_iBlocks[i] == 105 || g_iBlocks[i] == 1 || g_iBlocks[i] == 31 || g_iBlocks[i] == 60 || g_iBlocks[i] == 89)
  1528. {
  1529. KvSetFloat(g_hBlocksKV, "attrib1", SpeedBoostForce_1[i])
  1530. }
  1531. if(Block_Transparency[i] > 0)
  1532. KvSetNum(g_hBlocksKV, "transparency", Block_Transparency[i])
  1533. blocks++;
  1534. }
  1535. KvGoBack(g_hBlocksKV);
  1536. index++;
  1537. }
  1538. KvRewind(g_hBlocksKV);
  1539. new String:file[256];
  1540. new String:map[64];
  1541. //new String:id[64];
  1542.  
  1543. //GetCurrentWorkshopMap(map, 65, id, 65)
  1544. GetCurrentMap(map, sizeof(map));
  1545. BuildPath(Path_SM, file, sizeof(file), "data/block.%s.txt", map);
  1546. KeyValuesToFile(g_hBlocksKV, file);
  1547.  
  1548. PrintToChatAll("\x03%s\x04 %d blocks and %d pair of teleporters were saved.", CHAT_TAG, blocks, teleporters);
  1549. PrintToServer("%d blocks and %d teleports saved", blocks, teleporters);
  1550.  
  1551. return Plugin_Handled;
  1552. }
  1553.  
  1554. SaveBlocks(bool:msg=false)
  1555. {
  1556. if(g_hBlocksKV != INVALID_HANDLE)
  1557. CloseHandle(g_hBlocksKV);
  1558. g_hBlocksKV = CreateKeyValues("Blocks");
  1559. KvGotoFirstSubKey(g_hBlocksKV);
  1560. new index = 1, blocks=0,teleporters=0;
  1561. new String:tmp[11];
  1562. new Float:fPos[3], Float:fAng[3];
  1563. for(new i=MaxClients+1;i<=2048;++i)
  1564. {
  1565. if(!IsValidBlock(i) || g_iTeleporters[i]==1)
  1566. continue;
  1567.  
  1568. GetEntPropVector(i, Prop_Data, "m_vecOrigin", fPos);
  1569.  
  1570.  
  1571. IntToString(index, tmp, sizeof(tmp));
  1572. KvJumpToKey(g_hBlocksKV, tmp, true);
  1573. if(g_iTeleporters[i]>1 && IsValidBlock(g_iTeleporters[i]))
  1574. {
  1575. GetEntPropVector(g_iTeleporters[i], Prop_Data, "m_vecOrigin", fAng);
  1576. KvSetNum(g_hBlocksKV, "teleporter", 1);
  1577. KvSetVector(g_hBlocksKV, "entrance", fPos);
  1578. KvSetVector(g_hBlocksKV, "exit", fAng);
  1579. teleporters++;
  1580. }
  1581. else
  1582. {
  1583. GetEntPropVector(i, Prop_Data, "m_angRotation", fAng);
  1584. KvSetNum(g_hBlocksKV, "blocktype", g_iBlocks[i]);
  1585. KvSetVector(g_hBlocksKV, "position", fPos);
  1586. KvSetVector(g_hBlocksKV, "angles", fAng);
  1587. if(g_iBlocks[i] == 5 || g_iBlocks[i] == 35 || g_iBlocks[i] == 64 || g_iBlocks[i] == 93)
  1588. {
  1589. KvSetFloat(g_hBlocksKV, "attrib1", TrampolineForce[i])
  1590. }
  1591. else if(g_iBlocks[i] == 6 || g_iBlocks[i] == 36 || g_iBlocks[i] == 65 || g_iBlocks[i] == 94)
  1592. {
  1593. KvSetFloat(g_hBlocksKV, "attrib1", SpeedBoostForce_1[i])
  1594. KvSetFloat(g_hBlocksKV, "attrib2", SpeedBoostForce_2[i])
  1595. }
  1596. else if(g_iBlocks[i] == 28 || g_iBlocks[i] == 57 || g_iBlocks[i] == 86 || g_iBlocks[i] == 115 || g_iBlocks[i] == 18 || g_iBlocks[i] == 47 || g_iBlocks[i] == 76 || g_iBlocks[i] == 105 || g_iBlocks[i] == 1 || g_iBlocks[i] == 31 || g_iBlocks[i] == 60 || g_iBlocks[i] == 89)
  1597. {
  1598. KvSetFloat(g_hBlocksKV, "attrib1", SpeedBoostForce_1[i])
  1599. }
  1600. if(Block_Transparency[i] > 0)
  1601. KvSetNum(g_hBlocksKV, "transparency", Block_Transparency[i])
  1602. blocks++;
  1603. }
  1604. KvGoBack(g_hBlocksKV);
  1605. index++;
  1606. }
  1607. KvRewind(g_hBlocksKV);
  1608. new String:file[256];
  1609. new String:map[64];
  1610. //new String:id[64];
  1611.  
  1612. //GetCurrentWorkshopMap(map, 65, id, 65)
  1613. GetCurrentMap(map, sizeof(map));
  1614. BuildPath(Path_SM, file, sizeof(file), "data/block.%s.txt", map);
  1615. KeyValuesToFile(g_hBlocksKV, file);
  1616.  
  1617. if(msg)
  1618. PrintToChatAll("\x03%s\x04 %d blocks and %d pair of teleporters were saved.", CHAT_TAG, blocks, teleporters);
  1619. PrintToServer("%d blocks and %d teleports saved", blocks, teleporters);
  1620. }
  1621.  
  1622. LoadBlocks(bool:msg=false)
  1623. {
  1624. if(g_hBlocksKV == INVALID_HANDLE)
  1625. return;
  1626.  
  1627. new teleporters=0, blocks=0;
  1628. new Float:fPos[3], Float:fAng[3];
  1629. KvRewind(g_hBlocksKV);
  1630. KvGotoFirstSubKey(g_hBlocksKV);
  1631. do
  1632. {
  1633. if(KvGetNum(g_hBlocksKV, "teleporter") == 1)
  1634. {
  1635. KvGetVector(g_hBlocksKV, "entrance", fPos);
  1636. KvGetVector(g_hBlocksKV, "exit", fAng);
  1637. g_iTeleporters[CreateTeleportEntrance(0, fPos)] = CreateTeleportExit(0, fAng);
  1638. teleporters++;
  1639. }
  1640. else
  1641. {
  1642. KvGetVector(g_hBlocksKV, "position", fPos);
  1643. KvGetVector(g_hBlocksKV, "angles", fAng);
  1644. new transparency = KvGetNum(g_hBlocksKV, "transparency", 0)
  1645. new blocktype = KvGetNum(g_hBlocksKV, "blocktype")
  1646. if(blocktype == 5 || blocktype == 35 || blocktype == 64 || blocktype == 93)
  1647. {
  1648. CreateBlock(0, blocktype, fPos, fAng, KvGetFloat(g_hBlocksKV, "attrib1"), 0.0, transparency)
  1649. }
  1650. else if(blocktype == 6 || blocktype == 36 || blocktype == 65 || blocktype == 94)
  1651. {
  1652. CreateBlock(0, blocktype, fPos, fAng, KvGetFloat(g_hBlocksKV, "attrib1"), KvGetFloat(g_hBlocksKV, "attrib2"), transparency)
  1653. }
  1654. else if(blocktype == 28 || blocktype == 57 || blocktype == 86 || blocktype == 115 || blocktype == 18 || blocktype == 47 || blocktype == 76 || blocktype == 105 || blocktype == 1 || blocktype == 31 || blocktype == 60 || blocktype == 89)
  1655. {
  1656. CreateBlock(0, blocktype, fPos, fAng, KvGetFloat(g_hBlocksKV, "attrib1"), 0.0, transparency)
  1657. }
  1658. else
  1659. {
  1660. CreateBlock(0, blocktype, fPos, fAng, 0.0, 0.0, transparency);
  1661. }
  1662. blocks++;
  1663. }
  1664. } while (KvGotoNextKey(g_hBlocksKV));
  1665.  
  1666. if(msg)
  1667. PrintToChatAll("\x03%s\x04 %d blocks and %d pair of teleporters were loaded.", CHAT_TAG, blocks, teleporters);
  1668. }
  1669.  
  1670. //public Action:ResetPerform(Handle:timer, any:client)
  1671. //{
  1672. // if(!DuckHop[client])
  1673. // DuckHop_Perform[client] = false
  1674. //}
  1675.  
  1676. public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
  1677. {
  1678. /*
  1679. if(IsPlayerAlive(client))
  1680. {
  1681. if (buttons & IN_DUCK)
  1682. {
  1683. if (!(GetEntityFlags(client) & FL_ONGROUND))
  1684. {
  1685. if (!(GetEntityMoveType(client) & MOVETYPE_LADDER))
  1686. {
  1687. // if(GetEntProp(client, Prop_Data, "m_nWaterLevel") <= 1)
  1688. // {
  1689. DuckHop[client] = true;
  1690. // }
  1691. }
  1692. }
  1693. else
  1694. {
  1695. decl Float:velocity[3]
  1696. GetEntPropVector(client, Prop_Data, "m_vecVelocity", velocity);
  1697. if(DuckHop[client])
  1698. {
  1699. DuckHop[client] = false
  1700.  
  1701. DuckHop_Perform[client] = true
  1702. DuckHop_Velocity[client][0] = velocity[0] * 5.5
  1703. DuckHop_Velocity[client][1] = velocity[1] * 5.5 // velocity_duck
  1704. }
  1705. if(DuckHop_Perform[client])
  1706. {
  1707. if(buttons & IN_JUMP)
  1708. {
  1709. DuckHop_Velocity[client][2] = velocity[2]
  1710. TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, DuckHop_Velocity[client])
  1711.  
  1712. }
  1713. else
  1714. {
  1715. CreateTimer(0.80, ResetPerform, client)
  1716. }
  1717. }
  1718. }
  1719. }
  1720. }*/
  1721.  
  1722. new Float:fPos[3];
  1723. new Float:fPos2[3];
  1724. GetClientAbsOrigin(client, fPos);
  1725. fPos[2]+=50.0;
  1726.  
  1727. //new block_ent = GetClientAimTarget(client, false);
  1728.  
  1729. for(new a=MaxClients+1;a<2048;++a)
  1730. {
  1731. if(GetClientTeam(client)<2)
  1732. continue;
  1733.  
  1734. if(g_iBlocks[a]==10)
  1735. {
  1736. GetEntPropVector(a, Prop_Data, "m_vecOrigin", fPos2);
  1737. if(fPos[0] - 20.0 < fPos2[0] < fPos[0] + 20.0 && fPos[1] - 20.0 < fPos2[1] < fPos[1] + 20.0 && fPos[2] - 60.0 < fPos2[2] < fPos[2] + 60.0)
  1738. {
  1739. new iTeam=GetClientTeam(client);
  1740. if(iTeam==2)
  1741. PrintToChatAll("\x03%s\x04 %N has nuked the Counter-Terrorist team.", CHAT_TAG, client);
  1742. else if(iTeam==3)
  1743. PrintToChatAll("\x03%s\x04 %N has nuked the Terrorist team.", CHAT_TAG, client);
  1744.  
  1745. g_iBlocks[a]=0;
  1746.  
  1747. EmitSoundToAll(NUKE_SOUND_PATH)
  1748.  
  1749. for(new i=1;i<=MaxClients;++i)
  1750. {
  1751. if(IsClientInGame(i))
  1752. {
  1753. if(IsPlayerAlive(i))
  1754. {
  1755. if((iTeam == 2 && GetClientTeam(i)==3) || (iTeam == 3 && GetClientTeam(i)==2))
  1756. {
  1757. if(!g_bInv[i])
  1758. ForcePlayerSuicide(i);
  1759. }
  1760. }
  1761. }
  1762. }
  1763. break;
  1764. }
  1765. }
  1766. else if(g_iBlocks[a]==14 || g_iBlocks[a]==43 || g_iBlocks[a]==72 || g_iBlocks[a]==101) // CT Barrier
  1767. {
  1768. if(GetClientTeam(client)==3)
  1769. {
  1770. if(!g_bLocked[client])
  1771. {
  1772. GetEntPropVector(a, Prop_Data, "m_vecOrigin", fPos2);
  1773. if(fPos[0] - 60.0 < fPos2[0] < fPos[0] + 60.0 && fPos[1] - 60.0 < fPos2[1] < fPos[1] + 60.0 && fPos[2] - 120.0 < fPos2[2] < fPos[2] + 120.0)
  1774. {
  1775. new Float:fVelocity[3];
  1776. GetEntPropVector(client, Prop_Data, "m_vecVelocity", fVelocity);
  1777. ScaleVector(fVelocity, -2.0);
  1778. fVelocity[2] = 0.0;
  1779. g_bLocked[client]=true;
  1780. CreateTimer(0.1, ResetLock, client);
  1781.  
  1782. TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fVelocity);
  1783. }
  1784. }
  1785. }
  1786. }
  1787. else if(g_iBlocks[a]==15 || g_iBlocks[a]==44 || g_iBlocks[a]==73 || g_iBlocks[a]==102) // T Barrier
  1788. {
  1789.  
  1790. if(GetClientTeam(client)==2)
  1791. {
  1792. if(!g_bLocked[client])
  1793. {
  1794. GetEntPropVector(a, Prop_Data, "m_vecOrigin", fPos2);
  1795. if(fPos[0] - 60.0 < fPos2[0] < fPos[0] + 60.0 && fPos[1] - 60.0 < fPos2[1] < fPos[1] + 60.0 && fPos[2] - 120.0 < fPos2[2] < fPos[2] + 120.0)
  1796. {
  1797. new Float:fVelocity[3];
  1798. GetEntPropVector(client, Prop_Data, "m_vecVelocity", fVelocity);
  1799. ScaleVector(fVelocity, -2.0);
  1800. fVelocity[2] = 0.0;
  1801. g_bLocked[client]=true;
  1802. CreateTimer(0.1, ResetLock, client);
  1803.  
  1804. TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fVelocity);
  1805. }
  1806. }
  1807. }
  1808. }
  1809. else if(g_iBlocks[a]==19 || g_iBlocks[a]==5 || g_iBlocks[a]==6 || g_iBlocks[a]==35 || g_iBlocks[a]==64 || g_iBlocks[a]==93 || g_iBlocks[a]==36 || g_iBlocks[a]==65 || g_iBlocks[a]==94 || g_iBlocks[a]==48 || g_iBlocks[a]==77 || g_iBlocks[a]==105) // NOFALLDAMAGE for the NOFALLDMG Block TRAMPOLINE AND SPEEDBOOST
  1810. {
  1811. GetEntPropVector(a, Prop_Data, "m_vecOrigin", fPos2);
  1812. if(GetVectorDistance(fPos, fPos2)<=100.0)
  1813. {
  1814. if(!g_bNoFallDmg[client])
  1815. CreateTimer(0.2, ResetNoFall, client);
  1816. g_bNoFallDmg[client]=true;
  1817. }
  1818. } else if(g_iTeleporters[a]>1 && 2<=GetClientTeam(client)<=3)
  1819. {
  1820. GetEntPropVector(a, Prop_Data, "m_vecOrigin", fPos2);
  1821. if(IsValidBlock(g_iTeleporters[a]))
  1822. {
  1823. if(fPos[0] - 32.0 < fPos2[0] < fPos[0] + 32.0 && fPos[1] - 32.0 < fPos2[1] < fPos[1] + 32.0 && fPos[2] - 64.0 < fPos2[2] < fPos[2] + 64.0)
  1824. {
  1825. new String:sound[512];
  1826. GetConVarString(g_hTeleSound, sound, sizeof(sound));
  1827. GetEntPropVector(g_iTeleporters[a], Prop_Data, "m_vecOrigin", fPos2);
  1828. TeleportEntity(client, fPos2, NULL_VECTOR, NULL_VECTOR);
  1829. EmitSoundToClient(client, TELE_SOUND_PATH);
  1830. }
  1831. }
  1832. }
  1833. }
  1834. if(g_iDragEnt[client] != 0)
  1835. {
  1836. if(IsValidEdict(g_iDragEnt[client]))
  1837. {
  1838. // new ent = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
  1839. // if(ent != -1)
  1840. // {
  1841. // SetEntPropFloat(ent, Prop_Send, "m_flNextPrimaryAttack", 10000.0);
  1842. // SetEntPropFloat(ent, Prop_Send, "m_flNextSecondaryAttack", 10000.0);
  1843. // }
  1844.  
  1845. new Float:vecDir[3], Float:vecPos[3], Float:vecVel[3];
  1846. new Float:viewang[3];
  1847.  
  1848. GetClientEyeAngles(client, viewang);
  1849. GetAngleVectors(viewang, vecDir, NULL_VECTOR, NULL_VECTOR);
  1850. GetClientEyePosition(client, vecPos);
  1851.  
  1852. vecPos[0]+=vecDir[0]*200;
  1853. vecPos[1]+=vecDir[1]*200;
  1854. vecPos[2]+=vecDir[2]*200;
  1855.  
  1856. GetEntPropVector(g_iDragEnt[client], Prop_Send, "m_vecOrigin", vecDir);
  1857.  
  1858. new Float:fPos3[3];
  1859.  
  1860. new bool:bSnap = false;
  1861. new bool:bGroup = g_bGroups[client][g_iDragEnt[client]];
  1862.  
  1863. if(g_bSnapping[client] && (FloatAbs(g_fClientAngles[client][1]) - FloatAbs(angles[1])) < 2.0 && !bGroup)
  1864. {
  1865. for(new i=MaxClients+1;i<2048;++i)
  1866. {
  1867. if(IsValidBlock(i) && i != g_iDragEnt[client])
  1868. {
  1869. GetEntPropVector(i, Prop_Send, "m_vecOrigin", fPos3);
  1870. if(GetVectorDistance(vecDir, fPos3) <= 60.0+g_fSnappingGap[client])
  1871. {
  1872. bSnap = true;
  1873. new Float:d1, Float:d2, Float:d3, Float:d4, Float:d5, Float:d6;
  1874. if(g_fAngles[i][1] == 0.0 && g_fAngles[i][2]==0.0)
  1875. {
  1876. fPos3[0]+=64.0;
  1877. d1=GetVectorDistance(vecDir, fPos3);
  1878. fPos3[0]-=128.0;
  1879. d2=GetVectorDistance(vecDir, fPos3);
  1880. fPos3[0]+=64.0;
  1881. fPos3[1]+=64.0;
  1882. d3=GetVectorDistance(vecDir, fPos3);
  1883. fPos3[1]-=128.0;
  1884. d4=GetVectorDistance(vecDir, fPos3);
  1885. fPos3[1]+=64.0;
  1886. fPos3[2]+=8.0;
  1887. d5=GetVectorDistance(vecDir, fPos3);
  1888. fPos3[2]-=16.0;
  1889. d6=GetVectorDistance(vecDir, fPos3);
  1890. fPos3[2]+=8.0;
  1891.  
  1892. vecDir = fPos3;
  1893. if(d1 < d2 && d1 < d3 && d1 < d4 && d1 < d5 && d1 < d6)
  1894. vecDir[0]+=64.0+g_fSnappingGap[client];
  1895. else if(d2 < d1 && d2 < d3 && d2 < d4 && d2 < d5 && d2 < d6)
  1896. vecDir[0]-=64.0+g_fSnappingGap[client];
  1897. else if(d3 < d1 && d3 < d2 && d3 < d4 && d3 < d5 && d3 < d6)
  1898. vecDir[1]+=64.0+g_fSnappingGap[client];
  1899. else if(d4 < d1 && d4 < d2 && d4 < d3 && d4 < d5 && d4 < d6)
  1900. vecDir[1]-=64.0+g_fSnappingGap[client];
  1901. else if(d5 < d1 && d5 < d2 && d5 < d3 && d5 < d4 && d5 < d6)
  1902. vecDir[2]+=8.0+g_fSnappingGap[client];
  1903. else if(d6 < d1 && d6 < d2 && d6 < d3 && d6 < d4 && d6 < d5)
  1904. vecDir[2]-=8.0+g_fSnappingGap[client];
  1905. } else if(g_fAngles[i][1]==0.0 && g_fAngles[i][2] == 90.0)
  1906. {
  1907. fPos3[0]+=64.0;
  1908. d1=GetVectorDistance(vecDir, fPos3);
  1909. fPos3[0]-=128.0;
  1910. d2=GetVectorDistance(vecDir, fPos3);
  1911. fPos3[0]+=64.0;
  1912. fPos3[1]+=8.0;
  1913. d3=GetVectorDistance(vecDir, fPos3);
  1914. fPos3[1]-=16.0;
  1915. d4=GetVectorDistance(vecDir, fPos3);
  1916. fPos3[1]+=8.0;
  1917. fPos3[2]+=64.0;
  1918. d5=GetVectorDistance(vecDir, fPos3);
  1919. fPos3[2]-=128.0;
  1920. d6=GetVectorDistance(vecDir, fPos3);
  1921. fPos3[2]+=64.0;
  1922.  
  1923. vecDir = fPos3;
  1924. if(d1 < d2 && d1 < d3 && d1 < d4 && d1 < d5 && d1 < d6)
  1925. vecDir[0]+=64.0+g_fSnappingGap[client];
  1926. else if(d2 < d1 && d2 < d3 && d2 < d4 && d2 < d5 && d2 < d6)
  1927. vecDir[0]-=64.0+g_fSnappingGap[client];
  1928. else if(d3 < d1 && d3 < d2 && d3 < d4 && d3 < d5 && d3 < d6)
  1929. vecDir[1]+=8.0+g_fSnappingGap[client];
  1930. else if(d4 < d1 && d4 < d2 && d4 < d3 && d4 < d5 && d4 < d6)
  1931. vecDir[1]-=8.0+g_fSnappingGap[client];
  1932. else if(d5 < d1 && d5 < d2 && d5 < d3 && d5 < d4 && d5 < d6)
  1933. vecDir[2]+=64.0+g_fSnappingGap[client];
  1934. else if(d6 < d1 && d6 < d2 && d6 < d3 && d6 < d4 && d6 < d5)
  1935. vecDir[2]-=64.0+g_fSnappingGap[client];
  1936. }
  1937. else
  1938. {
  1939. fPos3[0]+=8.0;
  1940. d1=GetVectorDistance(vecDir, fPos3);
  1941. fPos3[0]-=16.0;
  1942. d2=GetVectorDistance(vecDir, fPos3);
  1943. fPos3[0]+=8.0;
  1944. fPos3[1]+=64.0;
  1945. d3=GetVectorDistance(vecDir, fPos3);
  1946. fPos3[1]-=128.0;
  1947. d4=GetVectorDistance(vecDir, fPos3);
  1948. fPos3[1]+=64.0;
  1949. fPos3[2]+=64.0;
  1950. d5=GetVectorDistance(vecDir, fPos3);
  1951. fPos3[2]-=128.0;
  1952. d6=GetVectorDistance(vecDir, fPos3);
  1953. fPos3[2]+=64.0;
  1954.  
  1955. vecDir = fPos3;
  1956. if(d1 < d2 && d1 < d3 && d1 < d4 && d1 < d5 && d1 < d6)
  1957. vecDir[0]+=8.0+g_fSnappingGap[client];
  1958. else if(d2 < d1 && d2 < d3 && d2 < d4 && d2 < d5 && d2 < d6)
  1959. vecDir[0]-=8.0+g_fSnappingGap[client];
  1960. else if(d3 < d1 && d3 < d2 && d3 < d4 && d3 < d5 && d3 < d6)
  1961. vecDir[1]+=64.0+g_fSnappingGap[client];
  1962. else if(d4 < d1 && d4 < d2 && d4 < d3 && d4 < d5 && d4 < d6)
  1963. vecDir[1]-=64.0+g_fSnappingGap[client];
  1964. else if(d5 < d1 && d5 < d2 && d5 < d3 && d5 < d4 && d5 < d6)
  1965. vecDir[2]+=64.0+g_fSnappingGap[client];
  1966. else if(d6 < d1 && d6 < d2 && d6 < d3 && d6 < d4 && d6 < d5)
  1967. vecDir[2]-=64.0+g_fSnappingGap[client];
  1968. }
  1969.  
  1970. g_fAngles[g_iDragEnt[client]] = g_fAngles[i];
  1971. break;
  1972. }
  1973. }
  1974. }
  1975. }
  1976.  
  1977. if(!bSnap)
  1978. {
  1979. SubtractVectors(vecPos, vecDir, vecVel);
  1980. ScaleVector(vecVel, 10.0);
  1981. TeleportEntity(g_iDragEnt[client], NULL_VECTOR, g_fAngles[g_iDragEnt[client]], vecVel);
  1982. if(bGroup)
  1983. {
  1984. new Float:playerPos[3];
  1985. GetClientEyePosition(client, playerPos);
  1986. new Float:vecOrig[3];
  1987. vecOrig = vecPos;
  1988.  
  1989. for(new i=MaxClients+1;i<2048;++i)
  1990. {
  1991. if(IsValidBlock(i) && i != g_iDragEnt[client] && g_bGroups[client][i])
  1992. {
  1993. vecPos = vecOrig;
  1994. SubtractVectors(vecPos, vecDir, vecVel);
  1995. ScaleVector(vecVel, 10.0);
  1996.  
  1997. TeleportEntity(i, NULL_VECTOR, g_fAngles[i], vecVel);
  1998. }
  1999. }
  2000. }
  2001. }
  2002. else
  2003. {
  2004. SetEntityMoveType(g_iDragEnt[client], MOVETYPE_NONE);
  2005. AcceptEntityInput(g_iDragEnt[client], "disablemotion");
  2006. new Float:nvel[3] = {0.0, 0.0, 0.0};
  2007. TeleportEntity(g_iDragEnt[client], vecDir, g_fAngles[g_iDragEnt[client]], nvel);
  2008.  
  2009. g_iDragEnt[client] = 0
  2010.  
  2011. DisplayMenu(CreateMainMenu(client), client, 0);
  2012. }
  2013. }
  2014. else
  2015. {
  2016. g_iDragEnt[client] = 0;
  2017. }
  2018. }
  2019.  
  2020. g_fClientAngles[client]=angles;
  2021.  
  2022. return Plugin_Continue;
  2023. }
  2024.  
  2025. public Action:ResetLock(Handle:timer, any:client)
  2026. {
  2027. if(!IsClientInGame(client))
  2028. return Plugin_Stop;
  2029. g_bLocked[client]=false;
  2030. new Float:fVelocity[3];
  2031. GetEntPropVector(client, Prop_Data, "m_vecVelocity", fVelocity);
  2032. ScaleVector(fVelocity, -0.5);
  2033. return Plugin_Stop;
  2034. }
  2035.  
  2036. public bool:TraceRayDontHitSelf(entity, mask, any:data)
  2037. {
  2038. if(entity == data)
  2039. return false;
  2040. return true;
  2041. }
  2042.  
  2043. public Action:Command_BlockBuilder(client, args)
  2044. {
  2045. // if(!(GetUserFlagBits(client) & ADMFLAG_CUSTOM1 || GetUserFlagBits(client) & ADMFLAG_ROOT))
  2046. // {
  2047. // PrintToChat(client, "\x03%s\x04 You don't have permission to access this.", CHAT_TAG);
  2048. // return Plugin_Handled;
  2049. // }
  2050.  
  2051. new Handle:menu = CreateMainMenu(client);
  2052.  
  2053. DisplayMenu(menu, client, 30);
  2054. return Plugin_Handled;
  2055. }
  2056.  
  2057. public Handler_BlockBuilder(Handle:menu, MenuAction:action, client, param2)
  2058. {
  2059. if (action == MenuAction_Select)
  2060. {
  2061. new bool:bDisplayMenu = true;
  2062. if(param2==0)
  2063. {
  2064. bDisplayMenu = false;
  2065. DisplayMenu(CreateBlocksMenu(), client, 0);
  2066. } else if(param2==1)
  2067. {
  2068. if(g_iDragEnt[client] == 0)
  2069. {
  2070. new ent = GetClientAimTarget(client, false);
  2071. if(IsValidBlock(ent))
  2072. {
  2073. g_iDragEnt[client] = ent;
  2074. if(g_bGroups[client][g_iDragEnt[client]])
  2075. {
  2076. for(new i=0;i<2048;++i)
  2077. {
  2078. if(IsValidBlock(i) && g_bGroups[client][i])
  2079. {
  2080. SetEntityMoveType(i, MOVETYPE_VPHYSICS);
  2081. AcceptEntityInput(i, "enablemotion");
  2082. }
  2083. }
  2084. }
  2085. else
  2086. {
  2087. SetEntityMoveType(g_iDragEnt[client], MOVETYPE_VPHYSICS);
  2088. AcceptEntityInput(g_iDragEnt[client], "enablemotion");
  2089. }
  2090. //PrintToChat(client, MESS, "Block has been grabbed.");
  2091. }
  2092. else
  2093. {
  2094. // Skapar blocket
  2095. CreateBlock(client);
  2096. }
  2097. }
  2098. else
  2099. {
  2100. new Float:fVelocity[3] = {0.0, 0.0, 0.0};
  2101. TeleportEntity(g_iDragEnt[client], NULL_VECTOR, g_fAngles[g_iDragEnt[client]], fVelocity);
  2102. if(g_bGroups[client][g_iDragEnt[client]])
  2103. {
  2104. for(new i=0;i<2048;++i)
  2105. {
  2106. if(IsValidBlock(i) && g_bGroups[client][i])
  2107. {
  2108. SetEntityMoveType(i, MOVETYPE_NONE);
  2109. AcceptEntityInput(i, "disablemotion");
  2110. }
  2111. }
  2112. }
  2113. else
  2114. {
  2115. SetEntityMoveType(g_iDragEnt[client], MOVETYPE_NONE);
  2116. AcceptEntityInput(g_iDragEnt[client], "disablemotion");
  2117. }
  2118. g_iDragEnt[client] = 0;
  2119. //PrintToChat(client, MESS, "Block has been released.");
  2120. }
  2121. } else if(param2==2)
  2122. {
  2123. new ent = GetClientAimTarget(client, false);
  2124. if(IsValidBlock(ent))
  2125. {
  2126. decl Float:vAng[3];
  2127. GetEntPropVector(ent, Prop_Data, "m_angRotation", vAng);
  2128.  
  2129. if (vAng[1])
  2130. {
  2131. vAng[1] = 0.0;
  2132. vAng[2] = 0.0;
  2133. }
  2134. else if (vAng[2])
  2135. vAng[1] = 90.0;
  2136. else
  2137. vAng[2] = 90.0;
  2138.  
  2139. g_fAngles[ent] = vAng;
  2140.  
  2141. TeleportEntity(ent, NULL_VECTOR, vAng, NULL_VECTOR);
  2142. }
  2143. else
  2144. {
  2145. PrintToChat(client, "\x03%s\x04 You must aim at a block.", CHAT_TAG);
  2146. }
  2147. } else if(param2==3)
  2148. {
  2149. new ent = GetClientAimTarget(client, false);
  2150. if(IsValidBlock(ent) && g_iTeleporters[ent]==-1)
  2151. {
  2152. if(g_iBlockSelection[client]==g_iBlocks[ent])
  2153. {
  2154. PrintToChat(client, "%s The block type is the same, there's no need to change.", CHAT_TAG);
  2155. }
  2156. else
  2157. {
  2158. g_iBlocks[ent]=g_iBlockSelection[client];
  2159. SetEntityModel(ent, g_eBlocks[g_iBlockSelection[client]][ModelPath]);
  2160. //PrintToChat(client, "%sSuccessfully converted the block to \x03%s\x04.", CHAT_TAG, g_eBlocks[g_iBlockSelection[client]][BlockName]);
  2161. }
  2162. }
  2163. else
  2164. {
  2165. PrintToChat(client, "\x03%s\x04 You must aim at a block.", CHAT_TAG);
  2166. }
  2167. } else if(param2==4)
  2168. {
  2169. new ent = GetClientAimTarget(client, false);
  2170. if(IsValidBlock(ent))
  2171. {
  2172. AcceptEntityInput(ent, "Kill");
  2173. g_iBlocks[ent]=-1;
  2174. if(g_iTeleporters[ent]>=1)
  2175. {
  2176. if(g_iTeleporters[ent]>1 && IsValidBlock(g_iTeleporters[ent]))
  2177. {
  2178. AcceptEntityInput(g_iTeleporters[ent], "Kill");
  2179. g_iTeleporters[g_iTeleporters[ent]] = -1;
  2180. } else if(g_iTeleporters[ent]==1)
  2181. {
  2182. for(new i=MaxClients+1;i<2048;++i)
  2183. {
  2184. if(g_iTeleporters[i]==ent)
  2185. {
  2186. if(IsValidBlock(i))
  2187. AcceptEntityInput(i, "Kill");
  2188. g_iTeleporters[i] = -1;
  2189. break;
  2190. }
  2191. }
  2192. }
  2193.  
  2194. g_iTeleporters[ent]=-1;
  2195. }
  2196. //PrintToChat(client, MESS, "Block has been deleted.");
  2197. }
  2198. else
  2199. {
  2200. PrintToChat(client, "\x03%s\x04 You must aim at a block.", CHAT_TAG);
  2201. }
  2202. } else if(param2==5)
  2203. {
  2204. if(GetEntityMoveType(client) != MOVETYPE_NOCLIP)
  2205. {
  2206. SetEntityMoveType(client, MOVETYPE_NOCLIP);
  2207. }
  2208. else
  2209. {
  2210. SetEntityMoveType(client, MOVETYPE_ISOMETRIC);
  2211. }
  2212. } else if(param2==6)
  2213. {
  2214. if(GetEntProp(client, Prop_Data, "m_takedamage", 1) == 2)
  2215. {
  2216. SetEntProp(client, Prop_Data, "m_takedamage", 0, 1);
  2217. }
  2218. else
  2219. {
  2220. SetEntProp(client, Prop_Data, "m_takedamage", 2, 1);
  2221. }
  2222. DisplayMenu(CreateMainMenu(client), client, 0);
  2223. } else if(param2==7)
  2224. {
  2225. bDisplayMenu=false;
  2226. DisplayMenu(CreateTeleportMenu(client), client, 0);
  2227. } else if(param2==10)
  2228. {
  2229. bDisplayMenu=false;
  2230. DisplayMenu(CreateOptionsMenu(client), client, 0);
  2231. }
  2232. else if(param2==9)
  2233. {
  2234. new ent = GetClientAimTarget(client, false);
  2235. if(IsValidBlock(ent))
  2236. {
  2237. if(g_iBlocks[ent] == 5 || g_iBlocks[ent] == 93 || g_iBlocks[ent] == 64 || g_iBlocks[ent] == 35) // TRAMPOLINE
  2238. {
  2239. bDisplayMenu=false;
  2240. CurrentModifier[client] = ent
  2241. AdjustTrampolineForce(client)
  2242.  
  2243. }
  2244. else if(g_iBlocks[ent] == 6 || g_iBlocks[ent] == 94 || g_iBlocks[ent] == 65 || g_iBlocks[ent] == 36)
  2245. {
  2246. bDisplayMenu=false;
  2247. CurrentModifier[client] = ent
  2248. ShowMenu3E(client)
  2249. }
  2250. else if(g_iBlocks[ent] == 18 || g_iBlocks[ent] == 105 || g_iBlocks[ent] == 76 || g_iBlocks[ent] == 47)
  2251. {
  2252. bDisplayMenu=false;
  2253. CurrentModifier[client] = ent
  2254. ShowMenuDelayed_NoSlowdown(client)
  2255. }
  2256. else if(g_iBlocks[ent] == 28 || g_iBlocks[ent] == 115 || g_iBlocks[ent] == 86 || g_iBlocks[ent] == 57)
  2257. {
  2258. bDisplayMenu=false;
  2259. CurrentModifier[client] = ent
  2260. ShowMenuDelayed(client)
  2261. }
  2262. else
  2263. {
  2264. bDisplayMenu=false;
  2265. DisplayMenu(CreateMainMenu(client), client, 0);
  2266. PrintToChat(client, "\x03%s\x04 There are no properties available for this block.", CHAT_TAG);
  2267. }
  2268. }
  2269. else
  2270. {
  2271. bDisplayMenu=false;
  2272. DisplayMenu(CreateMainMenu(client), client, 0);
  2273. PrintToChat(client, "\x03%s\x04 You have to aim at the block to change it's properties.", CHAT_TAG);
  2274. }
  2275. }
  2276. else if(param2==8)
  2277. {
  2278. new ent = GetClientAimTarget(client, false);
  2279. if(IsValidBlock(ent))
  2280. {
  2281. bDisplayMenu=false;
  2282. CurrentModifier[client] = ent
  2283. Command_BlockAlpha(client)
  2284. }
  2285. }
  2286.  
  2287. // Ställer in block size
  2288. // else if(param2==2)
  2289. // {
  2290. //
  2291. // if(blocksize==1)
  2292. // {
  2293. // blocksize=2;
  2294. // }
  2295. // else if(blocksize==2)
  2296. // {
  2297. // blocksize=0;
  2298. // }
  2299. // else
  2300. // {
  2301. // blocksize=1;
  2302. // }
  2303. //
  2304. // }
  2305.  
  2306. if(bDisplayMenu)
  2307. DisplayMenu(CreateMainMenu(client), client, 0);
  2308. }
  2309. }
  2310.  
  2311. public Command_BlockAlpha(client)
  2312. {
  2313. new Handle:menu = CreateMenu(BB_ALPHA, MenuAction_Select | MenuAction_End);
  2314. SetMenuTitle(menu, "Block Transparency");
  2315. AddMenuItem(menu, "20", "20");
  2316. AddMenuItem(menu, "40", "40");
  2317. AddMenuItem(menu, "60", "60");
  2318. AddMenuItem(menu, "80", "80");
  2319. AddMenuItem(menu, "100", "100");
  2320. AddMenuItem(menu, "120", "120");
  2321. AddMenuItem(menu, "140", "140");
  2322. AddMenuItem(menu, "160", "160");
  2323. AddMenuItem(menu, "180", "180");
  2324. AddMenuItem(menu, "200", "200");
  2325. AddMenuItem(menu, "220", "240");
  2326. AddMenuItem(menu, "250", "250");
  2327. AddMenuItem(menu, "255", "255 (DEFAULT)");
  2328.  
  2329. DisplayMenu(menu, client, MENU_TIME_FOREVER);
  2330. }
  2331.  
  2332.  
  2333. public BB_ALPHA(Handle:menu, MenuAction:action, client, param2)
  2334. {
  2335. switch (action)
  2336. {
  2337. case MenuAction_Select:
  2338. {
  2339. decl String:item[16];
  2340. GetMenuItem(menu, param2, item, sizeof(item));
  2341. SetEntityRenderMode(CurrentModifier[client], RENDER_TRANSCOLOR)
  2342. SetEntityRenderColor(CurrentModifier[client], 255, 255, 255, StringToInt(item))
  2343. DisplayMenu(CreateMainMenu(client), client, 0);
  2344. PrintToChat(client, "\x03%s\x04 Block's Transparency has been adjusted.", CHAT_TAG);
  2345. Block_Transparency[CurrentModifier[client]] = StringToInt(item);
  2346. }
  2347. case MenuAction_End:
  2348. {
  2349. CloseHandle(menu);
  2350. }
  2351. }
  2352. }
  2353.  
  2354. public AdjustTrampolineForce(client)
  2355. {
  2356. new Handle:menu = CreateMenu(TFCH2, MenuAction_Select | MenuAction_End);
  2357. SetMenuTitle(menu, "Adjust Trampoline Force:");
  2358. AddMenuItem(menu, "1000", "1000");
  2359. AddMenuItem(menu, "900", "900");
  2360. AddMenuItem(menu, "800", "800");
  2361. AddMenuItem(menu, "700", "700");
  2362. AddMenuItem(menu, "600", "600");
  2363. AddMenuItem(menu, "500", "500 (DEFAULT)");
  2364. AddMenuItem(menu, "400", "400");
  2365. AddMenuItem(menu, "300", "300");
  2366.  
  2367. DisplayMenu(menu, client, MENU_TIME_FOREVER);
  2368. }
  2369.  
  2370. public TFCH2(Handle:menu, MenuAction:action, client, param2)
  2371. {
  2372. switch (action)
  2373. {
  2374. case MenuAction_Select:
  2375. {
  2376. decl String:item[16];
  2377. GetMenuItem(menu, param2, item, sizeof(item));
  2378. TrampolineForce[CurrentModifier[client]] = StringToFloat(item)
  2379. DisplayMenu(CreateMainMenu(client), client, 0);
  2380. PrintToChat(client, "\x03%s\x04 Trampoline has been adjusted.", CHAT_TAG);
  2381. }
  2382. case MenuAction_End:
  2383. {
  2384. CloseHandle(menu);
  2385. }
  2386. }
  2387. }
  2388.  
  2389. public Handle:CreateTeleportMenu(client)
  2390. {
  2391. new Handle:menu = CreateMenu(Handler_Teleport);
  2392. SetMenuTitle(menu, "Teleport Menu");
  2393. if(g_iCurrentTele[client]==-1)
  2394. AddMenuItem(menu, "0", "Teleport Start");
  2395. else
  2396. AddMenuItem(menu, "0", "Cancel teleport");
  2397. AddMenuItem(menu, "1", "Teleport End");
  2398. AddMenuItem(menu, "2", "Swap Teleport Start/End");
  2399. AddMenuItem(menu, "3", "Delete Teleport");
  2400. AddMenuItem(menu, "4", "Show Teleport Path");
  2401. SetMenuExitBackButton(menu, true);
  2402. return menu;
  2403. }
  2404.  
  2405. public Handle:CreateBlocksMenu()
  2406. {
  2407. new Handle:menu = CreateMenu(Handler_Blocks);
  2408. decl String:szItem[4];
  2409. SetMenuTitle(menu, "Block Menu");
  2410. for (new i; i < sizeof(g_eBlocks); i++)
  2411. {
  2412. IntToString(i, szItem, sizeof(szItem));
  2413. AddMenuItem(menu, szItem, g_eBlocks[i][BlockName]);
  2414. }
  2415. SetMenuExitBackButton(menu, true);
  2416. return menu;
  2417. }
  2418.  
  2419. public Handle:CreateMainMenu(client)
  2420. {
  2421. new Handle:menu = CreateMenu(Handler_BlockBuilder);
  2422.  
  2423. SetMenuTitle(menu, "blockbuilder Blockmaker");
  2424.  
  2425. new String:sInfo[256];
  2426. Format(sInfo, sizeof(sInfo), "Block: %s", g_eBlocks[g_iBlockSelection[client]][BlockName]);
  2427. AddMenuItem(menu, "0", sInfo);
  2428. if(g_iDragEnt[client]==0)
  2429. AddMenuItem(menu, "1", "Place Block");
  2430. else
  2431. AddMenuItem(menu, "1", "Release Block");
  2432.  
  2433.  
  2434. // if(blocksize==1)
  2435. // AddMenuItem(menu, "2", "Size: Small");
  2436. // else if(blocksize==2)
  2437. // AddMenuItem(menu, "2", "Size: Large");
  2438. // else
  2439. // AddMenuItem(menu, "2", "Size: Normal");
  2440.  
  2441.  
  2442. AddMenuItem(menu, "3", "Rotate Block");
  2443. AddMenuItem(menu, "4", "Replace Block");
  2444. AddMenuItem(menu, "5", "Delete Block");
  2445.  
  2446. if(GetEntityMoveType(client) != MOVETYPE_NOCLIP)
  2447. AddMenuItem(menu, "6", "No Clip: Off");
  2448. else
  2449. AddMenuItem(menu, "6", "No Clip: On");
  2450.  
  2451. if(GetEntProp(client, Prop_Data, "m_takedamage", 1) == 2)
  2452. AddMenuItem(menu, "7", "Godmode: Off");
  2453. else
  2454. AddMenuItem(menu, "7", "Godmode: On");
  2455.  
  2456. AddMenuItem(menu, "8", "Teleport Builder");
  2457. AddMenuItem(menu, "9", "Block Transparency");
  2458. AddMenuItem(menu, "10", "Block Properties");
  2459. AddMenuItem(menu, "11", "More Options");
  2460. SetMenuExitButton(menu, true);
  2461. g_hClientMenu[client] = menu;
  2462. return menu;
  2463. }
  2464.  
  2465. public Handle:CreateOptionsMenu(client)
  2466. {
  2467. new Handle:menu = CreateMenu(Handler_Options);
  2468. SetMenuTitle(menu, "Options Menu");
  2469.  
  2470. if(g_bSnapping[client])
  2471. AddMenuItem(menu, "0", "Snapping: On");
  2472. else
  2473. AddMenuItem(menu, "0", "Snapping: Off");
  2474.  
  2475.  
  2476. new String:sText[256];
  2477. Format(sText, sizeof(sText), "Snapping gap: %.1f\n \n", g_fSnappingGap[client]);
  2478. AddMenuItem(menu, "1", sText);
  2479.  
  2480. AddMenuItem(menu, "2", "Add to group");
  2481. AddMenuItem(menu, "3", "Clear group\n \n");
  2482.  
  2483. new bRoot = (GetUserFlagBits(client) & ADMFLAG_ROOT || GetUserFlagBits(client) & ReadFlagString("p") ?true:false);
  2484.  
  2485. // AddMenuItem(menu, "4", "Load from file");
  2486. AddMenuItem(menu, "4", "Load from file", (bRoot?ITEMDRAW_DEFAULT:ITEMDRAW_DISABLED));
  2487. // AddMenuItem(menu, "5", "Save to file\n \n");
  2488. AddMenuItem(menu, "5", "Save to file\n \n", (bRoot?ITEMDRAW_DEFAULT:ITEMDRAW_DISABLED));
  2489.  
  2490. // AddMenuItem(menu, "6", "Delete all blocks");
  2491. AddMenuItem(menu, "6", "Delete all blocks", (bRoot?ITEMDRAW_DEFAULT:ITEMDRAW_DISABLED));
  2492. // AddMenuItem(menu, "7", "Delete all teleporters");
  2493. AddMenuItem(menu, "7", "Delete all teleporters", (bRoot?ITEMDRAW_DEFAULT:ITEMDRAW_DISABLED));
  2494.  
  2495. SetMenuExitBackButton(menu, true);
  2496. return menu;
  2497. }
  2498.  
  2499. CreateTeleportEntrance(client, Float:fPos[3]={0.0, 0.0, 0.0})
  2500. {
  2501. new Float:vecDir[3], Float:vecPos[3], Float:viewang[3];
  2502. if(client > 0)
  2503. {
  2504. GetClientEyeAngles(client, viewang);
  2505. GetAngleVectors(viewang, vecDir, NULL_VECTOR, NULL_VECTOR);
  2506. GetClientEyePosition(client, vecPos);
  2507. vecPos[0]+=vecDir[0]*100;
  2508. vecPos[1]+=vecDir[1]*100;
  2509. vecPos[2]+=vecDir[2]*100;
  2510. }
  2511. else
  2512. {
  2513. vecPos = fPos;
  2514. }
  2515.  
  2516. new ent = CreateEntityByName("prop_physics_override");
  2517. DispatchKeyValue(ent, "model", "models/platforms/b-tele.mdl");
  2518. TeleportEntity(ent, vecPos, NULL_VECTOR, NULL_VECTOR);
  2519. DispatchSpawn(ent);
  2520.  
  2521. SetEntityMoveType(ent, MOVETYPE_NONE);
  2522. AcceptEntityInput(ent, "disablemotion");
  2523. SetEntProp(ent, Prop_Data, "m_CollisionGroup", 2);
  2524.  
  2525. g_iTeleporters[ent]=1;
  2526. g_iCurrentTele[client]=ent;
  2527.  
  2528. SDKHook(ent, SDKHook_StartTouch, OnStartTouch);
  2529.  
  2530. return ent;
  2531. }
  2532.  
  2533. CreateTeleportExit(client, Float:fPos[3]={0.0, 0.0, 0.0})
  2534. {
  2535. new Float:vecDir[3], Float:vecPos[3], Float:viewang[3];
  2536. if(client > 0)
  2537. {
  2538. GetClientEyeAngles(client, viewang);
  2539. GetAngleVectors(viewang, vecDir, NULL_VECTOR, NULL_VECTOR);
  2540. GetClientEyePosition(client, vecPos);
  2541. vecPos[0]+=vecDir[0]*100;
  2542. vecPos[1]+=vecDir[1]*100;
  2543. vecPos[2]+=vecDir[2]*100;
  2544. }
  2545. else
  2546. {
  2547. vecPos = fPos;
  2548. }
  2549.  
  2550. new ent = CreateEntityByName("prop_physics_override");
  2551. DispatchKeyValue(ent, "model", "models/platforms/r-tele.mdl");
  2552. TeleportEntity(ent, vecPos, NULL_VECTOR, NULL_VECTOR);
  2553. DispatchSpawn(ent);
  2554.  
  2555. SetEntityMoveType(ent, MOVETYPE_NONE);
  2556. AcceptEntityInput(ent, "disablemotion");
  2557. SetEntProp(ent, Prop_Data, "m_CollisionGroup", 2);
  2558.  
  2559. g_iTeleporters[ent]=1;
  2560.  
  2561. return ent;
  2562. }
  2563.  
  2564. CreateBlock(client, blocktype=0, Float:fPos[3]={0.0, 0.0, 0.0}, Float:fAng[3]={0.0, 0.0, 0.0}, Float:attrib1=0.0, Float:attrib2=0.0, transparency=0)
  2565. {
  2566. new Float:vecDir[3], Float:vecPos[3], Float:viewang[3];
  2567. if(client > 0)
  2568. {
  2569. GetClientEyeAngles(client, viewang);
  2570. GetAngleVectors(viewang, vecDir, NULL_VECTOR, NULL_VECTOR);
  2571. GetClientEyePosition(client, vecPos);
  2572. vecPos[0]+=vecDir[0]*100;
  2573. vecPos[1]+=vecDir[1]*100;
  2574. vecPos[2]+=vecDir[2]*100;
  2575. }
  2576. else
  2577. {
  2578. vecPos = fPos;
  2579. }
  2580.  
  2581.  
  2582. new block_entity = CreateEntityByName("prop_physics_override");
  2583.  
  2584. // // SMALL BLOCKS (the suffix _small should be added)
  2585. // if (blocksize == 1)
  2586. // {
  2587. //
  2588. // }
  2589. // // LARGE BLOCKS (the suffix _large should be added)
  2590. // else if (blocksize == 2)
  2591. // {
  2592. //
  2593. // if(g_iBlockSelection[blocktype] == 0)
  2594. // {
  2595. // g_iBlockSelection[blocktype]=30;
  2596. // g_iBlockSelection[ModelPath]="models/blockbuilder/large_platform.mdl";
  2597. // }
  2598. // else if(g_iBlockSelection[blocktype] == 1)
  2599. // {
  2600. // g_iBlockSelection[blocktype]=31;
  2601. // g_iBlockSelection[ModelPath]="models/blockbuilder/large_bhop.mdl";
  2602. // }
  2603. // else
  2604. // {
  2605. //
  2606. // }
  2607. //
  2608. // DispatchKeyValue(block_entity, "model", g_eBlocks[(g_iBlockSelection[blocktype])][ModelPath]);
  2609. //
  2610. // }
  2611. // // NORMAL BLOCKS (no suffix is needed here)
  2612. // else
  2613. // {
  2614. // DispatchKeyValue(block_entity, "model", g_eBlocks[(client > 0 ? g_iBlockSelection[client]:blocktype)][ModelPath]);
  2615. // }
  2616.  
  2617. DispatchKeyValue(block_entity, "model", g_eBlocks[(client > 0 ? g_iBlockSelection[client]:blocktype)][ModelPath]);
  2618. TeleportEntity(block_entity, vecPos, fAng, NULL_VECTOR);
  2619. DispatchSpawn(block_entity);
  2620.  
  2621. SetEntityMoveType(block_entity, MOVETYPE_NONE);
  2622.  
  2623.  
  2624.  
  2625. if(transparency > 0)
  2626. {
  2627. SetEntityRenderMode(block_entity, RENDER_TRANSCOLOR)
  2628. SetEntityRenderColor(block_entity, 255, 255, 255, transparency)
  2629. Block_Transparency[block_entity] = transparency;
  2630. }
  2631. else
  2632. {
  2633. Block_Transparency[block_entity] = -1;
  2634. }
  2635. AcceptEntityInput(block_entity, "disablemotion");
  2636. if(14 <= (client>0?g_iBlockSelection[client]:blocktype) <= 15)
  2637. {
  2638. SetEntProp(block_entity, Prop_Data, "m_CollisionGroup", 2);
  2639. }
  2640. g_iBlocks[block_entity]=(client>0?g_iBlockSelection[client]:blocktype);
  2641. if(g_iBlocks[block_entity] == 5 || g_iBlocks[block_entity] == 35 || g_iBlocks[block_entity] == 64 || g_iBlocks[block_entity] == 93)
  2642. {
  2643. if(attrib1 == 0)
  2644. {
  2645. TrampolineForce[block_entity] = 500.0
  2646. }
  2647. else
  2648. {
  2649. TrampolineForce[block_entity] = attrib1
  2650. }
  2651. CurrentModifier[client] = block_entity
  2652.  
  2653. if(client > 0)
  2654. {
  2655. CreateTimer(0.10, ShowMenu, client)
  2656. }
  2657. else
  2658. {
  2659. SDKHook(block_entity, SDKHook_StartTouch, OnStartTouch);
  2660. SDKHook(block_entity, SDKHook_Touch, OnTouch);
  2661. SDKHook(block_entity, SDKHook_EndTouch, OnEndTouch);
  2662. }
  2663. }
  2664. else if(g_iBlocks[block_entity] == 6 || g_iBlocks[block_entity] == 36 || g_iBlocks[block_entity] == 65 || g_iBlocks[block_entity] == 94)
  2665. {
  2666. if(attrib1 == 0)
  2667. {
  2668. SpeedBoostForce_1[block_entity] = 800.0
  2669. }
  2670. else
  2671. {
  2672. SpeedBoostForce_1[block_entity] = attrib1
  2673. }
  2674. if(attrib2 == 0)
  2675. {
  2676. SpeedBoostForce_2[block_entity] = 260.0
  2677. }
  2678. else
  2679. {
  2680. SpeedBoostForce_2[block_entity] = attrib2
  2681. }
  2682. CurrentModifier[client] = block_entity
  2683. if(client > 0)
  2684. {
  2685. CreateTimer(0.10, ShowMenu3, client)
  2686. }
  2687. else
  2688. {
  2689. SDKHook(block_entity, SDKHook_StartTouch, OnStartTouch);
  2690. SDKHook(block_entity, SDKHook_Touch, OnTouch);
  2691. SDKHook(block_entity, SDKHook_EndTouch, OnEndTouch);
  2692. }
  2693. }
  2694. // else if(g_iBlocks[block_entity] == 8)
  2695. // {
  2696. // SetEntityRenderColor(block_entity, 255, 255, 255 ,75);
  2697. // SetEntityRenderMode(block_entity, RENDER_GLOW)
  2698. // }
  2699. // else if(g_iBlocks[block_entity] == 14) // CT Barrier
  2700. // {
  2701. // SDKHook(block_entity, SDKHook_ShouldCollide, ShouldCollide_CT)
  2702. // PrintToChatAll("CT Barreir touched now")
  2703. // }
  2704. // else if(g_iBlocks[block_entity] == 15) // T Barrier
  2705. // {
  2706. // SDKHook(block_entity, SDKHook_ShouldCollide, ShouldCollide_T)
  2707. // PrintToChatAll("TT Barier touched now")
  2708. // }
  2709. else if(g_iBlocks[block_entity] == 28 || g_iBlocks[block_entity] == 57 || g_iBlocks[block_entity] == 86 || g_iBlocks[block_entity] == 115)
  2710. {
  2711. CurrentModifier[client] = block_entity
  2712. if(attrib1 == 0)
  2713. {
  2714. SpeedBoostForce_1[block_entity] = 1.5
  2715. }
  2716. else
  2717. {
  2718. SpeedBoostForce_1[block_entity] = attrib1
  2719. }
  2720. if(client > 0)
  2721. {
  2722. CreateTimer(0.10, ShowMenuDelayed2, client)
  2723. }
  2724. else
  2725. {
  2726. SDKHook(block_entity, SDKHook_StartTouch, OnStartTouch);
  2727. SDKHook(block_entity, SDKHook_Touch, OnTouch);
  2728. SDKHook(block_entity, SDKHook_EndTouch, OnEndTouch);
  2729. }
  2730.  
  2731. }
  2732. else if(g_iBlocks[block_entity] == 18 || g_iBlocks[block_entity] == 47 || g_iBlocks[block_entity] == 76 || g_iBlocks[block_entity] == 105)
  2733. {
  2734. CurrentModifier[client] = block_entity
  2735. if(attrib1 == 0)
  2736. {
  2737. SpeedBoostForce_1[block_entity] = 1.5
  2738. }
  2739. else
  2740. {
  2741. SpeedBoostForce_1[block_entity] = attrib1
  2742. }
  2743. if(client > 0)
  2744. {
  2745. CreateTimer(0.10, ShowMenuDelayed_NoSlowdown2, client);
  2746. }
  2747. else
  2748. {
  2749. SDKHook(block_entity, SDKHook_StartTouch, OnStartTouch);
  2750. SDKHook(block_entity, SDKHook_Touch, OnTouch);
  2751. SDKHook(block_entity, SDKHook_EndTouch, OnEndTouch);
  2752. }
  2753.  
  2754. }
  2755. else
  2756. {
  2757. SDKHook(block_entity, SDKHook_StartTouch, OnStartTouch);
  2758. SDKHook(block_entity, SDKHook_Touch, OnTouch);
  2759. SDKHook(block_entity, SDKHook_EndTouch, OnEndTouch);
  2760. }
  2761.  
  2762. g_fAngles[block_entity]=fAng;
  2763.  
  2764. //PrintToChat(client, "%sSuccessfully spawned block \x03%s\x04.", CHAT_TAG, g_eBlocks[g_iBlockSelection[client]][BlockName]);
  2765. return block_entity;
  2766. }
  2767. /*
  2768. public bool:ShouldCollide_T(entity, collisiongroup, contentsmask, bool:originalResult)
  2769. {
  2770. if ((contentsmask & CONTENTS_TEAM2 == CONTENTS_TEAM2))
  2771. {
  2772. return false;
  2773. }
  2774. return true;
  2775. }
  2776.  
  2777. public bool:ShouldCollide_CT(entity, collisiongroup, contentsmask, bool:originalResult)
  2778. {
  2779. if ((contentsmask & CONTENTS_TEAM1 == CONTENTS_TEAM1))
  2780. {
  2781. return false;
  2782. }
  2783. return true;
  2784. }*/
  2785.  
  2786. public Action:ShowMenu(Handle:timer, any:client)
  2787. {
  2788. new Handle:menu = CreateMenu(TFCH, MenuAction_Select | MenuAction_End);
  2789. SetMenuTitle(menu, "Choose Trampoline Force:");
  2790. AddMenuItem(menu, "1000", "1000");
  2791. AddMenuItem(menu, "900", "900");
  2792. AddMenuItem(menu, "800", "800");
  2793. AddMenuItem(menu, "700", "700");
  2794. AddMenuItem(menu, "600", "600");
  2795. AddMenuItem(menu, "500", "500 (DEFAULT)");
  2796. AddMenuItem(menu, "400", "400");
  2797. AddMenuItem(menu, "300", "300");
  2798.  
  2799. DisplayMenu(menu, client, MENU_TIME_FOREVER);
  2800. }
  2801.  
  2802. public TFCH(Handle:menu, MenuAction:action, client, param2)
  2803. {
  2804. switch (action)
  2805. {
  2806. case MenuAction_Select:
  2807. {
  2808. decl String:item[16];
  2809. GetMenuItem(menu, param2, item, sizeof(item));
  2810. TrampolineForce[CurrentModifier[client]] = StringToFloat(item)
  2811.  
  2812. SDKHook(CurrentModifier[client], SDKHook_StartTouch, OnStartTouch);
  2813. SDKHook(CurrentModifier[client], SDKHook_Touch, OnTouch);
  2814. SDKHook(CurrentModifier[client], SDKHook_EndTouch, OnEndTouch);
  2815. DisplayMenu(CreateMainMenu(client), client, 0);
  2816. }
  2817. case MenuAction_End:
  2818. {
  2819. CloseHandle(menu);
  2820. }
  2821. }
  2822. }
  2823.  
  2824. public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
  2825. {
  2826. if(g_bInv[victim] || (g_bNoFallDmg[victim] && damagetype & DMG_FALL))
  2827. return Plugin_Handled;
  2828. return Plugin_Continue;
  2829. }
  2830.  
  2831. public OnStartTouch(ent1, ent2)
  2832. {
  2833. new client = -1;
  2834. new block = -1;
  2835. if(1 <= ent1 <= MaxClients){
  2836. client = ent1;
  2837. }
  2838. else if(1 <= ent2 <= MaxClients){
  2839. client = ent2;
  2840. }
  2841.  
  2842. if(IsValidBlock(ent1)){
  2843. block = ent1;
  2844. }
  2845. else if(IsValidBlock(ent2)){
  2846. block = ent2;
  2847. }
  2848.  
  2849. if(client == -1 || block == -1){
  2850. return;
  2851. }
  2852.  
  2853. if(g_iTeleporters[block]!=-1){
  2854. return;
  2855. }
  2856. if(GetClientTeam(client)<2){
  2857. return;
  2858. }
  2859.  
  2860.  
  2861. if(g_iBlocks[block]==5 || g_iBlocks[block]==35 || g_iBlocks[block]==64 || g_iBlocks[block]==93) // TRAMP ?
  2862. {
  2863. new Handle:packet = CreateDataPack()
  2864. WritePackCell(packet, client)
  2865. WritePackCell(packet, block)
  2866. CreateTimer(0.0, JumpPlayer, packet)
  2867. g_bNoFallDmg[client]=true;
  2868. }
  2869. else if(g_iBlocks[block]==6 || g_iBlocks[block]==36 || g_iBlocks[block]==65 || g_iBlocks[block]==94)
  2870. {
  2871. new Handle:packet = CreateDataPack()
  2872. WritePackCell(packet, client)
  2873. WritePackCell(packet, block)
  2874. CreateTimer(0.0, BoostPlayer, packet);
  2875. }
  2876.  
  2877. decl Float:block_loc[3]
  2878. GetEntPropVector(block, Prop_Send, "m_vecOrigin", block_loc);
  2879. decl Float:player_loc[3]
  2880. GetClientAbsOrigin(client, player_loc)
  2881. player_loc[2] += TrueForce;
  2882.  
  2883.  
  2884. // NEW DEATHBLOCK
  2885. if(g_iBlocks[block]==9 || g_iBlocks[block]==29 || g_iBlocks[block]==58 || g_iBlocks[block]==87)
  2886. {
  2887. if(IsClientInGame(client) && IsPlayerAlive(client))
  2888. {
  2889. if(!g_bInv[client]) {
  2890. if(GetEntityFlags(client) && GetEntPropEnt(client, Prop_Send, "m_hGroundEntity") == block) {
  2891. SDKHooks_TakeDamage(client, 0, 0, 10000.0);
  2892. }
  2893. }
  2894. }
  2895. }
  2896.  
  2897. // NEW DAMAGE
  2898. else if(g_iBlocks[block]==2 || g_iBlocks[block]==32 || g_iBlocks[block]==61 || g_iBlocks[block]==90)
  2899. {
  2900. if(GetEntityFlags(client) && !g_bInv[client] && GetEntPropEnt(client, Prop_Send, "m_hGroundEntity") == block) {
  2901. if(IsValidHandle(Block_Timers[client])) {
  2902. KillTimer(Block_Timers[client]);
  2903. }
  2904. Block_Timers[client] = CreateTimer(g_eBlocks[2][CooldownTime], DamagePlayer, client);
  2905. }
  2906. }
  2907.  
  2908. // NEW HEAL
  2909. else if(g_iBlocks[block]==3 || g_iBlocks[block]==33 || g_iBlocks[block]==62 || g_iBlocks[block]==91)
  2910. {
  2911. if(GetEntityFlags(client) && GetEntPropEnt(client, Prop_Send, "m_hGroundEntity") == block) {
  2912. if(IsValidHandle(Block_Timers[client])) {
  2913. KillTimer(Block_Timers[client]);
  2914. }
  2915. Block_Timers[client] = CreateTimer(g_eBlocks[3][EffectTime], HealPlayer, client);
  2916. }
  2917. }
  2918.  
  2919.  
  2920. if(FL_ONGROUND && GetEntPropEnt(client, Prop_Send, "m_hGroundEntity") == block)
  2921. {
  2922. // new bool:bRandom = false;
  2923. if(g_iBlocks[block]==24 || g_iBlocks[block]==53 || g_iBlocks[block]==82 || g_iBlocks[block]==111)
  2924. {
  2925. if(!g_bRandomCantUse[client])
  2926. {
  2927. g_bRandomCantUse[client] = true;
  2928. new Handle:datapack = CreateDataPack()
  2929. WritePackCell(datapack, client)
  2930. WritePackCell(datapack, RoundIndex)
  2931. if(randomblock_time >= 1.0)
  2932. {
  2933. CreateTimer(randomblock_time, ResetCooldownRandom, datapack)
  2934. }
  2935. else
  2936. {
  2937. CreateTimer(1.0, ResetCooldownRandom, datapack)
  2938. }
  2939. new random = RoundFloat(GetRandomFloat(1.00, 8.00))
  2940. if(random == 1) // Invincibility, Stealth, Camouflage, Boots Of Speed, a slap, or death!
  2941. {
  2942. new Handle:packet_f = CreateDataPack()
  2943. WritePackCell(packet_f, RoundIndex)
  2944. WritePackCell(packet_f, client)
  2945. CreateTimer(g_eBlocks[7][EffectTime], ResetInv, packet_f);
  2946. CreateTimer(g_eBlocks[7][CooldownTime], ResetInvCooldown, packet_f);
  2947. g_bInv[client]=true;
  2948. g_bInvCanUse[client]=false;
  2949.  
  2950. // CreateLight(client)
  2951.  
  2952. new Handle:packet = CreateDataPack()
  2953. WritePackCell(packet, RoundIndex)
  2954. WritePackCell(packet, client)
  2955. WritePackCell(packet, RoundFloat(g_eBlocks[7][EffectTime]))
  2956. WritePackString(packet, "Invincibility")
  2957.  
  2958. EmitSoundToClient(client, INVI_SOUND_PATH, block)
  2959. CreateTimer(1.0, TimeLeft, packet)
  2960. PrintToChat(client, "\x03%s\x04 You've rolled an Invincibility from Random Block!", CHAT_TAG);
  2961. }
  2962. else if(random == 2)
  2963. {
  2964. new Handle:packet_f = CreateDataPack()
  2965. WritePackCell(packet_f, RoundIndex)
  2966. WritePackCell(packet_f, client)
  2967.  
  2968. CreateTimer(g_eBlocks[8][EffectTime], ResetStealth, packet_f);
  2969. CreateTimer(g_eBlocks[8][CooldownTime], ResetStealthCooldown, packet_f);
  2970. SetEntityRenderMode(client, RENDER_NONE);
  2971. SDKHook(client, SDKHook_SetTransmit, Stealth_SetTransmit)
  2972. g_bStealthCanUse[client]=false;
  2973.  
  2974. new Handle:packet = CreateDataPack()
  2975. WritePackCell(packet, RoundIndex)
  2976. WritePackCell(packet, client)
  2977. WritePackCell(packet, RoundFloat(g_eBlocks[8][EffectTime]))
  2978. WritePackString(packet, "Stealth")
  2979. EmitSoundToClient(client, STEALTH_SOUND_PATH, block)
  2980. CreateTimer(1.0, TimeLeft, packet)
  2981. PrintToChat(client, "\x03%s\x04 You've rolled a Stealth from Random Block!", CHAT_TAG);
  2982. }
  2983. else if(random == 3)
  2984. {
  2985. if(GetClientTeam(client)==2)
  2986. SetEntityModel(client, "models/player/ctm_gign.mdl");
  2987. else if(GetClientTeam(client)==3)
  2988. SetEntityModel(client, "models/player/tm_phoenix.mdl");
  2989. g_bCamCanUse[client]=false;
  2990. new Handle:packet_f = CreateDataPack()
  2991. WritePackCell(packet_f, RoundIndex)
  2992. WritePackCell(packet_f, client)
  2993. CreateTimer(g_eBlocks[21][EffectTime], ResetCamouflage, packet_f);
  2994. CreateTimer(g_eBlocks[21][CooldownTime], ResetCamCanUse, packet_f);
  2995.  
  2996. new Handle:packet = CreateDataPack()
  2997. WritePackCell(packet, RoundIndex)
  2998. WritePackCell(packet, client)
  2999. WritePackCell(packet, RoundFloat(g_eBlocks[21][EffectTime]))
  3000. WritePackString(packet, "Camouflage")
  3001. EmitSoundToClient(client, CAM_SOUND_PATH, block)
  3002. CreateTimer(1.0, TimeLeft, packet)
  3003. PrintToChat(client, "\x03%s\x04 You've rolled a Camouflage from Random Block!", CHAT_TAG);
  3004. }
  3005. else if(random == 4)
  3006. {
  3007. new Handle:packet_f = CreateDataPack()
  3008. WritePackCell(packet_f, RoundIndex)
  3009. WritePackCell(packet_f, client)
  3010. CreateTimer(g_eBlocks[16][EffectTime], ResetBoots, packet_f);
  3011. CreateTimer(g_eBlocks[16][CooldownTime], ResetBootsCooldown, packet_f);
  3012. SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.45);
  3013. g_bBootsCanUse[client]=false;
  3014.  
  3015. new Handle:packet = CreateDataPack()
  3016. WritePackCell(packet, RoundIndex)
  3017. WritePackCell(packet, client)
  3018. WritePackCell(packet, RoundFloat(g_eBlocks[16][EffectTime]))
  3019. WritePackString(packet, "Speed Boost")
  3020.  
  3021. EmitSoundToClient(client, BOS_SOUND_PATH, block)
  3022.  
  3023. CreateTimer(1.0, TimeLeft, packet)
  3024. PrintToChat(client, "\x03%s\x04 You've rolled a Speed Boost from Random Block!", CHAT_TAG);
  3025. }
  3026. else if(random == 5)
  3027. {
  3028. if(!g_bInv[client])
  3029. {
  3030. SDKHooks_TakeDamage(client, 0, 0, 10000.0);
  3031. PrintToChat(client, "\x03%s\x04 You've rolled a Death from Random Block!", CHAT_TAG);
  3032. }
  3033. else
  3034. {
  3035. PrintToChat(client, "\x03%s\x04 Huh? It looks like you've avoided death from Random Block!", CHAT_TAG);
  3036. }
  3037. }
  3038. else if(random == 6)
  3039. {
  3040. new ent = -1;
  3041. ent = Client_GiveWeaponAndAmmo(client, "weapon_deagle", true, 0, 1, 1, 1);
  3042. SetEntProp(ent, Prop_Data, "m_iClip1", 1);
  3043. SetEntProp(ent, Prop_Data, "m_iClip2", 1);
  3044. SetEntData(client, g_iAmmo+(GetEntData(ent, g_iPrimaryAmmoType)<<2), 0, 4, true);
  3045. PrintToChatAll("\x03%s\x04 %N just got a Deagle", CHAT_TAG, client);
  3046. }
  3047. else if(random == 7)
  3048. {
  3049. new ent = -1;
  3050. ent = Client_GiveWeaponAndAmmo(client, "weapon_awp", true, 0, 1, 1, 1);
  3051. SetEntProp(ent, Prop_Data, "m_iClip1", 1);
  3052. SetEntProp(ent, Prop_Data, "m_iClip2", 1);
  3053. SetEntData(client, g_iAmmo+(GetEntData(ent, g_iPrimaryAmmoType)<<2), 0, 4, true);
  3054. PrintToChatAll("\x03%s\x04 %N just got a AWP", CHAT_TAG, client);
  3055. }
  3056. else if(random == 8)
  3057. {
  3058. new grenade_random = RoundFloat(GetRandomFloat(1.00, 3.00))
  3059. if(grenade_random == 1)
  3060. {
  3061. GivePlayerItem(client, "weapon_hegrenade");
  3062. }
  3063. else if(grenade_random == 2)
  3064. {
  3065. GivePlayerItem(client, "weapon_flashbang");
  3066. }
  3067. else if(grenade_random == 3)
  3068. {
  3069. // GivePlayerItem(client, "weapon_smokegrenade");
  3070. GivePlayerItem(client, "weapon_decoy");
  3071. }
  3072. PrintToChat(client, "\x03%s\x04 You've rolled a Grenade from Random Block!", CHAT_TAG);
  3073. }
  3074. }
  3075. }
  3076. // else if(g_iBlocks[block]==2 || g_iBlocks[block]==32 || g_iBlocks[block]==61 || g_iBlocks[block]==90)
  3077. // {
  3078. // if(IsValidHandle(Block_Timers[client]))
  3079. // KillTimer(Block_Timers[client])
  3080. // CreateTimer(g_eBlocks[2][CooldownTime], DamagePlayer, client);
  3081. // }
  3082. // else if(g_iBlocks[block]==3 || g_iBlocks[block]==33 || g_iBlocks[block]==62 || g_iBlocks[block]==91)
  3083. // {
  3084. // if(IsValidHandle(Block_Timers[client]))
  3085. // KillTimer(Block_Timers[client])
  3086. // Block_Timers[client] = CreateTimer(g_eBlocks[3][EffectTime], HealPlayer, client);
  3087. // }
  3088. else if(g_iBlocks[block]==4 || g_iBlocks[block]==34 || g_iBlocks[block]==63 || g_iBlocks[block]==92)
  3089. {
  3090. }
  3091. else if(g_iBlocks[block]==7 || g_iBlocks[block]==37 || g_iBlocks[block]==66 || g_iBlocks[block]==95)
  3092. {
  3093. if(g_bInvCanUse[client])
  3094. {
  3095. new Handle:packet_f = CreateDataPack()
  3096. WritePackCell(packet_f, RoundIndex)
  3097. WritePackCell(packet_f, client)
  3098. CreateTimer(g_eBlocks[7][EffectTime], ResetInv, packet_f);
  3099. CreateTimer(g_eBlocks[7][CooldownTime], ResetInvCooldown, packet_f);
  3100. g_bInv[client]=true;
  3101. g_bInvCanUse[client]=false;
  3102.  
  3103. // CreateLight(client)
  3104.  
  3105. new Handle:packet = CreateDataPack()
  3106. WritePackCell(packet, RoundIndex)
  3107. WritePackCell(packet, client)
  3108. WritePackCell(packet, RoundFloat(g_eBlocks[7][EffectTime]))
  3109. WritePackString(packet, "Invincibility")
  3110.  
  3111. EmitSoundToClient(client, INVI_SOUND_PATH, block)
  3112. CreateTimer(1.0, TimeLeft, packet)
  3113. }
  3114. }
  3115. else if(g_iBlocks[block]==8 || g_iBlocks[block]==38 || g_iBlocks[block]==67 || g_iBlocks[block]==96)
  3116. {
  3117. if(g_bStealthCanUse[client])
  3118. {
  3119. new Handle:packet_f = CreateDataPack()
  3120. WritePackCell(packet_f, RoundIndex)
  3121. WritePackCell(packet_f, client)
  3122.  
  3123. CreateTimer(g_eBlocks[8][EffectTime], ResetStealth, packet_f);
  3124. CreateTimer(g_eBlocks[8][CooldownTime], ResetStealthCooldown, packet_f);
  3125. SetEntityRenderMode(client, RENDER_NONE);
  3126. SDKHook(client, SDKHook_SetTransmit, Stealth_SetTransmit)
  3127. g_bStealthCanUse[client]=false;
  3128.  
  3129. new Handle:packet = CreateDataPack()
  3130. WritePackCell(packet, RoundIndex)
  3131. WritePackCell(packet, client)
  3132. WritePackCell(packet, RoundFloat(g_eBlocks[8][EffectTime]))
  3133. WritePackString(packet, "Stealth")
  3134. EmitSoundToClient(client, STEALTH_SOUND_PATH, block)
  3135. CreateTimer(1.0, TimeLeft, packet)
  3136. }
  3137. }
  3138. else if(g_iBlocks[block]==11 || g_iBlocks[block]==40 || g_iBlocks[block]==69 || g_iBlocks[block]==98)
  3139. {
  3140. SetEntityGravity(client, 0.4);
  3141. CreateTimer(3.0, ResetGrav, client)
  3142. g_iGravity[client]=1;
  3143. }
  3144. else if(g_iBlocks[block]==12 || g_iBlocks[block]==41 || g_iBlocks[block]==70 || g_iBlocks[block]==99)
  3145. {
  3146. if(IsValidHandle(Block_Timers[client]))
  3147. KillTimer(Block_Timers[client])
  3148. CreateTimer(g_eBlocks[2][CooldownTime], DamagePlayer_Fire, client);
  3149. IgniteEntity(client, 10000.0);
  3150. }
  3151. else if(g_iBlocks[block]==13 || g_iBlocks[block]==42 || g_iBlocks[block]==71 || g_iBlocks[block]==100)
  3152. {
  3153. CreateTimer(0.0, SlapPlayerBlock, client);
  3154. }
  3155. // else if(g_iBlocks[block]==14 || g_iBlocks[block]==43 || g_iBlocks[block]==72 || g_iBlocks[block]==101)
  3156. // {
  3157. // if(GetClientTeam(client) == 2)
  3158. // {
  3159. // SetEntProp(block_entity, Prop_Data, "m_CollisionGroup", 2);
  3160. // }
  3161. // }
  3162. // else if(g_iBlocks[block]==15 || g_iBlocks[block]==44 || g_iBlocks[block]==73 || g_iBlocks[block]==102)
  3163. // {
  3164. // if(GetClientTeam(client) == 3)
  3165. // {
  3166. // SetEntProp(block_entity, Prop_Data, "m_CollisionGroup", 2);
  3167. // }
  3168. // }
  3169. else if(g_iBlocks[block]==16 || g_iBlocks[block]==45 || g_iBlocks[block]==74 || g_iBlocks[block]==103)
  3170. {
  3171. if(g_bBootsCanUse[client])
  3172. {
  3173. new Handle:packet_f = CreateDataPack()
  3174. WritePackCell(packet_f, RoundIndex)
  3175. WritePackCell(packet_f, client)
  3176. CreateTimer(g_eBlocks[16][EffectTime], ResetBoots, packet_f);
  3177. CreateTimer(g_eBlocks[16][CooldownTime], ResetBootsCooldown, packet_f);
  3178. // SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 2.33);
  3179.  
  3180. // Ny boots of speed hastighet
  3181. SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.45);
  3182. g_bBootsCanUse[client]=false;
  3183.  
  3184. new Handle:packet = CreateDataPack()
  3185. WritePackCell(packet, RoundIndex)
  3186. WritePackCell(packet, client)
  3187. WritePackCell(packet, RoundFloat(g_eBlocks[16][EffectTime]))
  3188. WritePackString(packet, "Speed Boost")
  3189.  
  3190. EmitSoundToClient(client, BOS_SOUND_PATH, block)
  3191.  
  3192. CreateTimer(1.0, TimeLeft, packet)
  3193. }
  3194. }
  3195. else if(g_iBlocks[block]==19 || g_iBlocks[block]==48 || g_iBlocks[block]==77 || g_iBlocks[block]==106)
  3196. {
  3197. g_bNoFallDmg[client]=true;
  3198. }
  3199. else if(g_iBlocks[block]==20 || g_iBlocks[block]==49 || g_iBlocks[block]==78 || g_iBlocks[block]==107)
  3200. {
  3201.  
  3202. }
  3203. else if(g_iBlocks[block]==21 || g_iBlocks[block]==50 || g_iBlocks[block]==79 || g_iBlocks[block]==108)
  3204. {
  3205. if(g_bCamCanUse[client])
  3206. {
  3207. if(GetClientTeam(client)==2)
  3208. SetEntityModel(client, "models/player/ctm_gign.mdl");
  3209. else if(GetClientTeam(client)==3)
  3210. SetEntityModel(client, "models/player/tm_phoenix.mdl");
  3211. g_bCamCanUse[client]=false;
  3212. new Handle:packet_f = CreateDataPack()
  3213. WritePackCell(packet_f, RoundIndex)
  3214. WritePackCell(packet_f, client)
  3215. CreateTimer(g_eBlocks[21][EffectTime], ResetCamouflage, packet_f);
  3216. CreateTimer(g_eBlocks[21][CooldownTime], ResetCamCanUse, packet_f);
  3217.  
  3218. new Handle:packet = CreateDataPack()
  3219. WritePackCell(packet, RoundIndex)
  3220. WritePackCell(packet, client)
  3221. WritePackCell(packet, RoundFloat(g_eBlocks[21][EffectTime]))
  3222. WritePackString(packet, "Camouflage")
  3223. EmitSoundToClient(client, CAM_SOUND_PATH, block)
  3224. CreateTimer(1.0, TimeLeft, packet)
  3225. }
  3226. }
  3227. else if(g_iBlocks[block]==22 || g_iBlocks[block]==51 || g_iBlocks[block]==80 || g_iBlocks[block]==109)
  3228. {
  3229. if(g_bDeagleCanUse[client])
  3230. {
  3231. if(GetClientTeam(client)==2)
  3232. {
  3233. new ent = -1;
  3234. ent = Client_GiveWeaponAndAmmo(client, "weapon_deagle", true, 0, 1, 1, 1);
  3235. SetEntProp(ent, Prop_Data, "m_iClip1", 1);
  3236. SetEntProp(ent, Prop_Data, "m_iClip2", 1);
  3237. SetEntData(client, g_iAmmo+(GetEntData(ent, g_iPrimaryAmmoType)<<2), 0, 4, true);
  3238. PrintToChatAll("\x03%s\x04 %N has got a DEAGLE", CHAT_TAG, client);
  3239. g_bDeagleCanUse[client] = false;
  3240. }
  3241. }
  3242. }
  3243. else if(g_iBlocks[block]==23 || g_iBlocks[block]==52 || g_iBlocks[block]==81 || g_iBlocks[block]==110)
  3244. {
  3245. if(g_bAwpCanUse[client])
  3246. {
  3247. if(GetClientTeam(client)==2)
  3248. {
  3249. new ent = -1;
  3250. ent = Client_GiveWeaponAndAmmo(client, "weapon_awp", true, 0, 1, 1, 1);
  3251. SetEntProp(ent, Prop_Data, "m_iClip1", 1);
  3252. SetEntProp(ent, Prop_Data, "m_iClip2", 1);
  3253. SetEntData(client, g_iAmmo+(GetEntData(ent, g_iPrimaryAmmoType)<<2), 0, 4, true);
  3254. PrintToChatAll("\x03%s\x04 %N has got an AWP", CHAT_TAG, client);
  3255. g_bAwpCanUse[client] = false;
  3256. }
  3257. }
  3258. }
  3259.  
  3260.  
  3261.  
  3262. // if(bRandom)
  3263. // g_iBlocks[block]=24;
  3264. }
  3265. if(g_iBlocks[block]==1 || g_iBlocks[block]==31 || g_iBlocks[block]==89 || g_iBlocks[block]==60)
  3266. {
  3267. g_bTriggered[block]=true;
  3268. CreateTimer(g_eBlocks[1][EffectTime], StartNoBlock, block);
  3269. }
  3270.  
  3271. else if(g_iBlocks[block]==18 || g_iBlocks[block]==47 || g_iBlocks[block]==76 || g_iBlocks[block]==105)
  3272. {
  3273. g_bTriggered[block]=true;
  3274. CreateTimer(g_eBlocks[18][EffectTime], StartNoBlock, block);
  3275. SetEntPropFloat(client, Prop_Send, "m_flStamina", 0.0);
  3276. }
  3277. else if(g_iBlocks[block]==28 || g_iBlocks[block]==57 || g_iBlocks[block]==86 || g_iBlocks[block]==115) // Delayed
  3278. {
  3279. g_bTriggered[block]=true;
  3280. CreateTimer(SpeedBoostForce_1[block], StartNoBlock, block);
  3281. }
  3282. }
  3283.  
  3284. public Action:ResetCooldownRandom(Handle:timer, any:packet)
  3285. {
  3286. ResetPack(packet)
  3287. new client = ReadPackCell(packet)
  3288. new round = ReadPackCell(packet)
  3289. if(round == RoundIndex)
  3290. {
  3291. g_bRandomCantUse[client] = false;
  3292. PrintToChat(client, "\x03%s\x04 Random block cooldown has worn off.", CHAT_TAG);
  3293. }
  3294. }
  3295.  
  3296. public Action:Stealth_SetTransmit(entity, clients)
  3297. {
  3298. if(entity == clients)
  3299. return Plugin_Continue;
  3300. return Plugin_Handled;
  3301. }
  3302.  
  3303. public Action:TimeLeft(Handle:timer, any:pack)
  3304. {
  3305. ResetPack(pack)
  3306. new round_index = ReadPackCell(pack)
  3307. if(round_index != RoundIndex)
  3308. {
  3309. KillTimer(timer, true)
  3310. return Plugin_Handled;
  3311. }
  3312. new client = ReadPackCell(pack)
  3313. if(!IsFakeClient(client))
  3314. {
  3315. if(IsClientInGame(client))
  3316. {
  3317. new time = ReadPackCell(pack)
  3318. time -= 1
  3319.  
  3320. if(time > 0)
  3321. {
  3322. decl String:effectname[32];
  3323. ReadPackString(pack, effectname, sizeof(effectname))
  3324. PrintHintText(client, "%s will worn off in: %i", effectname, time)
  3325.  
  3326. new Handle:packet = CreateDataPack()
  3327. WritePackCell(packet, RoundIndex)
  3328. WritePackCell(packet, client)
  3329. WritePackCell(packet, time)
  3330. WritePackString(packet, effectname)
  3331.  
  3332.  
  3333. CreateTimer(1.0, TimeLeft, packet)
  3334. }
  3335. }
  3336. }
  3337. return Plugin_Continue;
  3338. }
  3339.  
  3340. public Action:ResetGrav(Handle:timer, any:client)
  3341. {
  3342. if(IsValidClient(client))
  3343. {
  3344. SetEntityGravity(client, 1.0)
  3345. }
  3346. }
  3347.  
  3348. stock bool:IsValidClient(client)
  3349. {
  3350. if ( !( 1 <= client <= MaxClients ) || !IsClientInGame(client) )
  3351. return false;
  3352.  
  3353. return true;
  3354. }
  3355.  
  3356. public OnTouch(ent1, ent2)
  3357. {
  3358. new client = -1;
  3359. new block = -1;
  3360. if(1 <= ent1 <= MaxClients)
  3361. client = ent1;
  3362. else if(1 <= ent2 <= MaxClients)
  3363. client = ent2;
  3364.  
  3365. if(IsValidBlock(ent1))
  3366. block = ent1;
  3367. else if(IsValidBlock(ent2))
  3368. block = ent2;
  3369.  
  3370. if(client == -1 || block == -1)
  3371. return;
  3372.  
  3373. if(GetClientTeam(client)<2)
  3374. return;
  3375.  
  3376.  
  3377. decl Float:block_loc[3]
  3378. GetEntPropVector(block, Prop_Send, "m_vecOrigin", block_loc);
  3379. decl Float:player_loc[3]
  3380. GetClientAbsOrigin(client, player_loc)
  3381. player_loc[2] += TrueForce;
  3382.  
  3383. Block_Touching[client] = g_iBlocks[block]
  3384.  
  3385. if(!(player_loc[2] <= block_loc[2]))
  3386. {
  3387.  
  3388.  
  3389. if(g_iBlocks[block]==1 || g_iBlocks[block]==31 || g_iBlocks[block]==89 || g_iBlocks[block]==60)
  3390. {
  3391. if(!g_bTriggered[block])
  3392. CreateTimer(g_eBlocks[1][EffectTime], StartNoBlock, block);
  3393. } else if(g_iBlocks[block]==2 || g_iBlocks[block]==32 || g_iBlocks[block]==61 || g_iBlocks[block]==90)
  3394. {
  3395. } else if(g_iBlocks[block]==3 || g_iBlocks[block]==33 || g_iBlocks[block]==62 || g_iBlocks[block]==91)
  3396. {
  3397. } else if(g_iBlocks[block]==4 || g_iBlocks[block]==34 || g_iBlocks[block]==63 || g_iBlocks[block]==92)
  3398. {
  3399. } else if(g_iBlocks[block]==5 || g_iBlocks[block]==35 || g_iBlocks[block]==64 || g_iBlocks[block]==93)
  3400. {
  3401. } else if(g_iBlocks[block]==6 || g_iBlocks[block]==36 || g_iBlocks[block]==65 || g_iBlocks[block]==94)
  3402. {
  3403. } else if(g_iBlocks[block]==7 || g_iBlocks[block]==37 || g_iBlocks[block]==66 || g_iBlocks[block]==95)
  3404. {
  3405. } else if(g_iBlocks[block]==8 || g_iBlocks[block]==38 || g_iBlocks[block]==67 || g_iBlocks[block]==96)
  3406. {
  3407. }
  3408. else if(g_iBlocks[block]==9 || g_iBlocks[block]==29 || g_iBlocks[block]==58 || g_iBlocks[block]==87) // DEATHBLOCK
  3409. {
  3410. if(IsClientInGame(client) && IsPlayerAlive(client))
  3411. {
  3412. if(!g_bInv[client]) {
  3413. if(GetEntityFlags(client) & FL_ONGROUND ) {
  3414. SDKHooks_TakeDamage(client, 0, 0, 10000.0);
  3415. }
  3416. }
  3417. }
  3418. }
  3419. else if(g_iBlocks[block]==10 || g_iBlocks[block]==39 || g_iBlocks[block]==68 || g_iBlocks[block]==97)
  3420. {
  3421. } else if(g_iBlocks[block]==11 || g_iBlocks[block]==40 || g_iBlocks[block]==69 || g_iBlocks[block]==98)
  3422. {
  3423. } else if(g_iBlocks[block]==12 || g_iBlocks[block]==41 || g_iBlocks[block]==70 || g_iBlocks[block]==99)
  3424. {
  3425. } else if(g_iBlocks[block]==13 || g_iBlocks[block]==42 || g_iBlocks[block]==71 || g_iBlocks[block]==100)
  3426. {
  3427. } else if(g_iBlocks[block]==14 || g_iBlocks[block]==43 || g_iBlocks[block]==72 || g_iBlocks[block]==101)
  3428. {
  3429. } else if(g_iBlocks[block]==15 || g_iBlocks[block]==44 || g_iBlocks[block]==73 || g_iBlocks[block]==102)
  3430. {
  3431. } else if(g_iBlocks[block]==16 || g_iBlocks[block]==45 || g_iBlocks[block]==74 || g_iBlocks[block]==103)
  3432. {
  3433. } else if(g_iBlocks[block]==18 || g_iBlocks[block]==47 || g_iBlocks[block]==76 || g_iBlocks[block]==105)
  3434. {
  3435. if(!g_bTriggered[block])
  3436. CreateTimer(g_eBlocks[18][EffectTime], StartNoBlock, block);
  3437. SetEntPropFloat(client, Prop_Send, "m_flStamina", 0.0);
  3438. }
  3439. else if(g_iBlocks[block]==19 || g_iBlocks[block]==48 || g_iBlocks[block]==77 || g_iBlocks[block]==106)
  3440. {
  3441. g_bNoFallDmg[client]=true;
  3442. }
  3443. else if(g_iBlocks[block] == 20 || g_iBlocks[block]==49 || g_iBlocks[block]==78 || g_iBlocks[block]==107)
  3444. {
  3445. SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 0.4);
  3446. }
  3447. else if(g_iBlocks[block]==25 || g_iBlocks[block]==54 || g_iBlocks[block]==83 || g_iBlocks[block]==112)
  3448. {
  3449. if(g_bHEgrenadeCanUse[client])
  3450. {
  3451. if(GetClientTeam(client) == 2)
  3452. {
  3453. if(GetClientHEGrenades(client) < 1)
  3454. {
  3455. GivePlayerItem(client, "weapon_hegrenade");
  3456. g_bHEgrenadeCanUse[client] = false;
  3457. }
  3458. }
  3459. }
  3460. }
  3461. else if(g_iBlocks[block]==26 || g_iBlocks[block]==55 || g_iBlocks[block]==84 || g_iBlocks[block]==113)
  3462. {
  3463. if(g_bFlashbangCanUse[client])
  3464. {
  3465. if(GetClientTeam(client)==2)
  3466. {
  3467. if(GetClientFlashbangs(client) < 1)
  3468. {
  3469. GivePlayerItem(client, "weapon_flashbang");
  3470. g_bFlashbangCanUse[client] = false;
  3471. }
  3472. }
  3473. }
  3474. }
  3475. else if(g_iBlocks[block]==27 || g_iBlocks[block]==56 || g_iBlocks[block]==85 || g_iBlocks[block]==114)
  3476. {
  3477. if(g_bSmokegrenadeCanUse[client])
  3478. {
  3479. if(GetClientTeam(client) == 2)
  3480. {
  3481. if(GetClientSmokeGrenades(client) < 1)
  3482. {
  3483. // GivePlayerItem(client, "weapon_smokegrenade");
  3484. GivePlayerItem(client, "weapon_decoy");
  3485. g_bSmokegrenadeCanUse[client] = false;
  3486. }
  3487. }
  3488. }
  3489. }
  3490.  
  3491. // if(bRandom)
  3492. // g_iBlocks[block]=24;
  3493. }
  3494. }
  3495.  
  3496. // Thanks for those three stocks to TnTSCS (https://forums.alliedmods.net/showpost.php?p=2242491&postcount=12)
  3497.  
  3498. stock GetClientHEGrenades(client)
  3499. {
  3500. return GetEntProp(client, Prop_Data, "m_iAmmo", _, HEGrenadeOffset);
  3501. }
  3502.  
  3503. stock GetClientSmokeGrenades(client)
  3504. {
  3505. return GetEntProp(client, Prop_Data, "m_iAmmo", _, SmokegrenadeOffset);
  3506. }
  3507.  
  3508. stock GetClientFlashbangs(client)
  3509. {
  3510. return GetEntProp(client, Prop_Data, "m_iAmmo", _, FlashbangOffset);
  3511. }
  3512.  
  3513. public OnEndTouch(ent1, ent2)
  3514. {
  3515. new client = -1;
  3516. new block = -1;
  3517. if(1 <= ent1 <= MaxClients)
  3518. client = ent1;
  3519. else if(1 <= ent2 <= MaxClients)
  3520. client = ent2;
  3521.  
  3522. if(IsValidBlock(ent1))
  3523. block = ent1;
  3524. else if(IsValidBlock(ent2))
  3525. block = ent2;
  3526.  
  3527. if(client == -1 || block == -1)
  3528. return;
  3529.  
  3530. if(GetClientTeam(client)<2)
  3531. return;
  3532.  
  3533. decl Float:block_loc[3]
  3534. GetEntPropVector(block, Prop_Send, "m_vecOrigin", block_loc);
  3535.  
  3536. decl Float:player_loc[3]
  3537. GetClientAbsOrigin(client, player_loc)
  3538.  
  3539. player_loc[2] += TrueForce;
  3540. if(!(player_loc[2] <= block_loc[2]))
  3541. {
  3542.  
  3543. if(g_iBlocks[block]==1 || g_iBlocks[block]==31 || g_iBlocks[block]==89 || g_iBlocks[block]==60)
  3544. {
  3545. } else if(g_iBlocks[block]==2 || g_iBlocks[block]==32 || g_iBlocks[block]==61 || g_iBlocks[block]==90)
  3546. {
  3547. } else if(g_iBlocks[block]==3 || g_iBlocks[block]==33 || g_iBlocks[block]==62 || g_iBlocks[block]==91)
  3548. {
  3549. } else if(g_iBlocks[block]==4 || g_iBlocks[block]==34 || g_iBlocks[block]==63 || g_iBlocks[block]==92)
  3550. {
  3551. } else if(g_iBlocks[block]==5 || g_iBlocks[block]==35 || g_iBlocks[block]==64 || g_iBlocks[block]==93)
  3552. {
  3553. g_bNoFallDmg[client]=false;
  3554. } else if(g_iBlocks[block]==6 || g_iBlocks[block]==36 || g_iBlocks[block]==65 || g_iBlocks[block]==94)
  3555. {
  3556. } else if(g_iBlocks[block]==7 || g_iBlocks[block]==37 || g_iBlocks[block]==66 || g_iBlocks[block]==95)
  3557. {
  3558. } else if(g_iBlocks[block]==8 || g_iBlocks[block]==38 || g_iBlocks[block]==67 || g_iBlocks[block]==96)
  3559. {
  3560. } else if(g_iBlocks[block]==9 || g_iBlocks[block]==29 || g_iBlocks[block]==58 || g_iBlocks[block]==87)
  3561. {
  3562. } else if(g_iBlocks[block]==10 || g_iBlocks[block]==39 || g_iBlocks[block]==68 || g_iBlocks[block]==97)
  3563. {
  3564. } else if(g_iBlocks[block]==11 || g_iBlocks[block]==40 || g_iBlocks[block]==69 || g_iBlocks[block]==98)
  3565. {
  3566. g_iGravity[client]=2;
  3567. } else if(g_iBlocks[block]==12 || g_iBlocks[block]==41 || g_iBlocks[block]==70 || g_iBlocks[block]==99)
  3568. {
  3569. CreateTimer(0.2, ResetFire, client)
  3570.  
  3571. } else if(g_iBlocks[block]==13 || g_iBlocks[block]==42 || g_iBlocks[block]==71 || g_iBlocks[block]==100)
  3572. {
  3573. } else if(g_iBlocks[block]==14 || g_iBlocks[block]==43 || g_iBlocks[block]==72 || g_iBlocks[block]==101)
  3574. {
  3575. } else if(g_iBlocks[block]==15 || g_iBlocks[block]==44 || g_iBlocks[block]==73 || g_iBlocks[block]==102)
  3576. {
  3577. } else if(g_iBlocks[block]==16 || g_iBlocks[block]==45 || g_iBlocks[block]==74 || g_iBlocks[block]==103)
  3578. {
  3579. } else if(g_iBlocks[block]==18 || g_iBlocks[block]==47 || g_iBlocks[block]==76 || g_iBlocks[block]==105)
  3580. {
  3581. } else if(g_iBlocks[block]==19 || g_iBlocks[block]==48 || g_iBlocks[block]==77 || g_iBlocks[block]==106)
  3582. {
  3583. g_bNoFallDmg[client]=false;
  3584. }
  3585. else if(g_iBlocks[block]==20 || g_iBlocks[block]==49 || g_iBlocks[block]==78 || g_iBlocks[block]==107)
  3586. {
  3587. CreateTimer(0.2, ResetHoney, client)
  3588. }
  3589.  
  3590. // if(bRandom)
  3591. // {
  3592. // g_iBlocks[block]=24;
  3593. // }
  3594. }
  3595. CreateTimer(0.01, BlockTouch_End, client)
  3596. }
  3597.  
  3598. public Action:ResetFire(Handle:timer, any:client)
  3599. {
  3600. if(Block_Touching[client] != 12 && Block_Touching[client] != 41 && Block_Touching[client] != 70 && Block_Touching[client] != 99)
  3601. {
  3602. new ent = GetEntPropEnt(client, Prop_Data, "m_hEffectEntity");
  3603. if (IsValidEdict(ent))
  3604. SetEntPropFloat(ent, Prop_Data, "m_flLifetime", 0.0);
  3605. }
  3606. }
  3607.  
  3608. public Action:BlockTouch_End(Handle:timer, any:client)
  3609. {
  3610. Block_Touching[client] = 0;
  3611. }
  3612.  
  3613. public Action:ResetHoney(Handle:timer, any:client)
  3614. {
  3615. if(Block_Touching[client] != 20 && Block_Touching[client] != 49 && Block_Touching[client] != 78 && Block_Touching[client] != 107)
  3616. {
  3617. SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0);
  3618. }
  3619. }
  3620.  
  3621. // DAMAGE FUNCTION
  3622. public Action:DamagePlayer(Handle:timer, any:client)
  3623. {
  3624. if(IsClientInGame(client))
  3625. {
  3626. if(IsPlayerAlive(client))
  3627. {
  3628. if(Block_Touching[client] == 2 || Block_Touching[client] == 32 || Block_Touching[client] == 61 || Block_Touching[client] == 90)
  3629. {
  3630. if(!g_bInv[client]) {
  3631. if(GetClientHealth(client)-5>0) {
  3632. SetEntityHealth(client, GetClientHealth(client)-5);
  3633. }
  3634. else {
  3635. SDKHooks_TakeDamage(client, 0, 0, 10000.0);
  3636. }
  3637. }
  3638. Block_Timers[client] = CreateTimer(g_eBlocks[3][EffectTime], DamagePlayer, client);
  3639. }
  3640. else {
  3641. KillTimer(Block_Timers[client]);
  3642. }
  3643. }
  3644. }
  3645. return Plugin_Stop;
  3646. }
  3647.  
  3648. public Action:DamagePlayer_Fire(Handle:timer, any:client)
  3649. {
  3650. if(IsClientInGame(client))
  3651. {
  3652. if(IsPlayerAlive(client))
  3653. {
  3654. if(Block_Touching[client] == 12 || Block_Touching[client] == 41 || Block_Touching[client] == 70 || Block_Touching[client] == 99)
  3655. {
  3656. SDKHooks_TakeDamage(client, 0, 0, float(RoundFloat(GetRandomFloat(1.00, 8.00))), DMG_BURN)
  3657. Block_Timers[client] = CreateTimer(g_eBlocks[2][EffectTime], DamagePlayer_Fire, client);
  3658. }
  3659. }
  3660. }
  3661. return Plugin_Stop;
  3662. }
  3663.  
  3664. public Action:ResetCamouflage(Handle:timer, any:packet)
  3665. {
  3666. ResetPack(packet)
  3667. new index = ReadPackCell(packet)
  3668. if(index != RoundIndex)
  3669. {
  3670. KillTimer(timer, true)
  3671. return Plugin_Handled;
  3672. }
  3673. new client = ReadPackCell(packet)
  3674.  
  3675. if(!IsClientInGame(client))
  3676. return Plugin_Stop;
  3677. if(GetClientTeam(client)==3)
  3678. SetEntityModel(client, "models/player/ctm_gign.mdl");
  3679. else if(GetClientTeam(client)==2)
  3680. SetEntityModel(client, "models/player/tm_phoenix.mdl");
  3681.  
  3682. PrintToChat(client, "\x03%s\x04 Camouflage has worn off.", CHAT_TAG);
  3683. return Plugin_Stop;
  3684. }
  3685.  
  3686. public Action:ResetCamCanUse(Handle:timer, any:packet)
  3687. {
  3688. ResetPack(packet)
  3689. new index = ReadPackCell(packet)
  3690. if(index != RoundIndex)
  3691. {
  3692. KillTimer(timer, true)
  3693. return Plugin_Handled;
  3694. }
  3695. new client = ReadPackCell(packet)
  3696.  
  3697. if(!IsClientInGame(client))
  3698. return Plugin_Stop;
  3699. g_bCamCanUse[client]=true;
  3700. PrintToChat(client, "\x03%s\x04 Camouflage block cooldown has worn off.", CHAT_TAG);
  3701. return Plugin_Stop;
  3702. }
  3703.  
  3704. public Action:StartNoBlock(Handle:timer, any:block)
  3705. {
  3706. SetEntProp(block, Prop_Data, "m_CollisionGroup", 2);
  3707. SetEntityRenderMode(block, RENDER_TRANSADD);
  3708. if(Block_Transparency[block] > 0)
  3709. {
  3710. SetEntityRenderColor(block, 177, 177, 177, RoundFloat(float(Block_Transparency[block])*0.4588));
  3711. }
  3712. else
  3713. {
  3714. SetEntityRenderColor(block, 177, 177, 177, 177);
  3715. }
  3716. CreateTimer(g_eBlocks[g_iBlocks[block]][CooldownTime], CancelNoBlock, block);
  3717. return Plugin_Stop;
  3718. }
  3719.  
  3720. public Action:CancelNoBlock(Handle:timer, any:block)
  3721. {
  3722. SetEntProp(block, Prop_Data, "m_CollisionGroup", 0);
  3723. SetEntityRenderMode(block, RENDER_TRANSCOLOR);
  3724. if(Block_Transparency[block] > 0)
  3725. {
  3726. SetEntityRenderColor(block, 255, 255, 255, Block_Transparency[block]);
  3727. }
  3728. else
  3729. {
  3730. SetEntityRenderColor(block, 255, 255, 255, 255);
  3731. }
  3732. g_bTriggered[block]=false;
  3733. return Plugin_Stop;
  3734. }
  3735.  
  3736. public Action:HealPlayer(Handle:timer, any:client)
  3737. {
  3738. if(IsClientInGame(client))
  3739. {
  3740. if(IsPlayerAlive(client))
  3741. {
  3742. if(Block_Touching[client] == 3 || Block_Touching[client] == 33 || Block_Touching[client] == 62 || Block_Touching[client] == 91)
  3743. {
  3744. if(GetClientHealth(client)+5<=100) {
  3745. SetEntityHealth(client, GetClientHealth(client)+5);
  3746. }
  3747. else {
  3748. SetEntityHealth(client, 100);
  3749. }
  3750. Block_Timers[client] = CreateTimer(g_eBlocks[3][EffectTime], HealPlayer, client);
  3751. }
  3752. else {
  3753. KillTimer(Block_Timers[client]);
  3754. }
  3755. }
  3756. }
  3757. return Plugin_Stop;
  3758. }
  3759.  
  3760. public Action:ResetNoFall(Handle:timer, any:client)
  3761. {
  3762. if(!IsClientInGame(client))
  3763. return Plugin_Stop;
  3764. g_bNoFallDmg[client] = false;
  3765. return Plugin_Stop;
  3766. }
  3767.  
  3768. public Action:ResetInv(Handle:timer, any:packet)
  3769. {
  3770. ResetPack(packet)
  3771. new index = ReadPackCell(packet)
  3772. if(index != RoundIndex)
  3773. {
  3774. KillTimer(timer, true)
  3775. return Plugin_Handled;
  3776. }
  3777. new client = ReadPackCell(packet)
  3778. if(!IsClientInGame(client))
  3779. return Plugin_Stop;
  3780. g_bInv[client] = false;
  3781. PrintToChat(client, "\x03%s\x04 Invincibility has worn off.", CHAT_TAG);
  3782. return Plugin_Stop;
  3783. }
  3784.  
  3785. public Action:ResetInvCooldown(Handle:timer, any:packet)
  3786. {
  3787. ResetPack(packet)
  3788. new index = ReadPackCell(packet)
  3789. if(index != RoundIndex)
  3790. {
  3791. KillTimer(timer, true)
  3792. return Plugin_Handled;
  3793. }
  3794. new client = ReadPackCell(packet)
  3795. if(!IsClientInGame(client))
  3796. return Plugin_Stop;
  3797. g_bInvCanUse[client] = true;
  3798. PrintToChat(client, "\x03%s\x04 Invincibility block cooldown has worn off.", CHAT_TAG);
  3799. return Plugin_Stop;
  3800. }
  3801.  
  3802. public Action:ResetStealth(Handle:timer, any:packet)
  3803. {
  3804. ResetPack(packet)
  3805.  
  3806. new index = ReadPackCell(packet)
  3807.  
  3808. if(index != RoundIndex)
  3809. {
  3810. KillTimer(timer, true)
  3811. return Plugin_Handled;
  3812. }
  3813.  
  3814. new client = ReadPackCell(packet)
  3815.  
  3816. if(!IsClientInGame(client))
  3817. return Plugin_Stop;
  3818. SetEntityRenderMode(client , RENDER_NORMAL);
  3819. SDKUnhook(client, SDKHook_SetTransmit, Stealth_SetTransmit)
  3820. PrintToChat(client, "\x03%s\x04 Stealth has worn off.", CHAT_TAG);
  3821. return Plugin_Stop;
  3822. }
  3823.  
  3824. public Action:ResetStealthCooldown(Handle:timer, any:packet)
  3825. {
  3826. ResetPack(packet)
  3827. new index = ReadPackCell(packet)
  3828. if(index != RoundIndex)
  3829. {
  3830. KillTimer(timer, true)
  3831. return Plugin_Handled;
  3832. }
  3833. new client = ReadPackCell(packet)
  3834. if(!IsClientInGame(client))
  3835. return Plugin_Stop;
  3836. g_bStealthCanUse[client] = true;
  3837. PrintToChat(client, "\x03%s\x04 Stealth block cooldown has worn off.", CHAT_TAG);
  3838. return Plugin_Stop;
  3839. }
  3840.  
  3841. //public Action:ResetRandom(Handle:timer, any:packet)
  3842. //{
  3843. // ResetPack(packet)
  3844. // new index = ReadPackCell(packet)
  3845. // if(index != RoundIndex)
  3846. // {
  3847. // KillTimer(timer, true)
  3848. // return Plugin_Handled;
  3849. // }
  3850. // new client = ReadPackCell(packet)
  3851. //
  3852. // if(!IsClientInGame(client))
  3853. // return Plugin_Stop;
  3854. // g_iClientBlocks[client]=-1;
  3855. // return Plugin_Stop;
  3856. //}
  3857.  
  3858. public Action:ResetBoots(Handle:timer, any:packet)
  3859. {
  3860. ResetPack(packet)
  3861. new index = ReadPackCell(packet)
  3862. if(index != RoundIndex)
  3863. {
  3864. KillTimer(timer, true)
  3865. return Plugin_Handled;
  3866. }
  3867. new client = ReadPackCell(packet)
  3868.  
  3869. if(!IsClientInGame(client))
  3870. return Plugin_Stop;
  3871. SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0);
  3872. // PrintToChat(client, "\x03%s\x04 Boots of Speed has worn off.", CHAT_TAG);
  3873. return Plugin_Stop;
  3874. }
  3875.  
  3876. public Action:ResetBootsCooldown(Handle:timer, any:packet)
  3877. {
  3878. ResetPack(packet)
  3879. new index = ReadPackCell(packet)
  3880. if(index != RoundIndex)
  3881. {
  3882. KillTimer(timer, true)
  3883. return Plugin_Handled;
  3884. }
  3885. new client = ReadPackCell(packet)
  3886.  
  3887. if(!IsClientInGame(client))
  3888. return Plugin_Stop;
  3889.  
  3890. g_bBootsCanUse[client] = true;
  3891. PrintToChat(client, "\x03%s\x04 Boots of Speed block cooldown has worn off.", CHAT_TAG);
  3892. return Plugin_Stop;
  3893. }
  3894.  
  3895. public ShowMenuDelayed_NoSlowdown(client)
  3896. {
  3897. new Handle:menu = CreateMenu(MenuDelayed_Return, MenuAction_Select | MenuAction_End);
  3898. SetMenuTitle(menu, "Choose Delay for disappearance of the block:");
  3899. AddMenuItem(menu, "0.01", "0.01s")
  3900. AddMenuItem(menu, "0.02", "0.02s")
  3901. AddMenuItem(menu, "0.03", "0.03s")
  3902. AddMenuItem(menu, "0.04", "0.04s")
  3903. AddMenuItem(menu, "0.05", "0.05s")
  3904. AddMenuItem(menu, "0.10", "0.10s")
  3905. AddMenuItem(menu, "0.15", "0.15s")
  3906. AddMenuItem(menu, "0.20", "0.20s")
  3907. AddMenuItem(menu, "0.25", "0.25s")
  3908. AddMenuItem(menu, "0.30", "0.30s")
  3909. AddMenuItem(menu, "0.35", "0.35s")
  3910. AddMenuItem(menu, "0.40", "0.40s")
  3911. AddMenuItem(menu, "0.45", "0.45s")
  3912. AddMenuItem(menu, "0.50", "0.50s")
  3913. AddMenuItem(menu, "0.60", "0.60s")
  3914. AddMenuItem(menu, "0.70", "0.70s")
  3915. AddMenuItem(menu, "0.80", "0.80s")
  3916. AddMenuItem(menu, "0.90", "0.90s")
  3917. AddMenuItem(menu, "1", "1s")
  3918.  
  3919. DisplayMenu(menu, client, MENU_TIME_FOREVER);
  3920. }
  3921.  
  3922.  
  3923. public Action:ShowMenuDelayed_NoSlowdown2(Handle:timer, any:client)
  3924. {
  3925. new Handle:menu = CreateMenu(MenuDelayed_Return2, MenuAction_Select | MenuAction_End);
  3926. SetMenuTitle(menu, "Choose Delay for disappearance of the block:");
  3927. AddMenuItem(menu, "0.01", "0.01s")
  3928. AddMenuItem(menu, "0.02", "0.02s")
  3929. AddMenuItem(menu, "0.03", "0.03s")
  3930. AddMenuItem(menu, "0.04", "0.04s")
  3931. AddMenuItem(menu, "0.05", "0.05s")
  3932. AddMenuItem(menu, "0.10", "0.10s")
  3933. AddMenuItem(menu, "0.15", "0.15s")
  3934. AddMenuItem(menu, "0.20", "0.20s")
  3935. AddMenuItem(menu, "0.25", "0.25s")
  3936. AddMenuItem(menu, "0.30", "0.30s")
  3937. AddMenuItem(menu, "0.35", "0.35s")
  3938. AddMenuItem(menu, "0.40", "0.40s")
  3939. AddMenuItem(menu, "0.45", "0.45s")
  3940. AddMenuItem(menu, "0.50", "0.50s")
  3941. AddMenuItem(menu, "0.60", "0.60s")
  3942. AddMenuItem(menu, "0.70", "0.70s")
  3943. AddMenuItem(menu, "0.80", "0.80s")
  3944. AddMenuItem(menu, "0.90", "0.90s")
  3945. AddMenuItem(menu, "1", "1s")
  3946.  
  3947. DisplayMenu(menu, client, MENU_TIME_FOREVER);
  3948. }
  3949.  
  3950. public ShowMenuDelayed(client)
  3951. {
  3952. new Handle:menu = CreateMenu(MenuDelayed_Return, MenuAction_Select | MenuAction_End);
  3953. SetMenuTitle(menu, "Choose Delay for disappearance of the block:");
  3954. AddMenuItem(menu, "0.25", "0.25s")
  3955. AddMenuItem(menu, "0.5", "0.5s")
  3956. AddMenuItem(menu, "0.75", "0.75s")
  3957. AddMenuItem(menu, "1", "1s")
  3958. AddMenuItem(menu, "1.5", "1.5s")
  3959. AddMenuItem(menu, "2", "2s")
  3960. AddMenuItem(menu, "2.5", "2.5s")
  3961. AddMenuItem(menu, "3.0", "3s")
  3962. AddMenuItem(menu, "3.5", "3.5s")
  3963. AddMenuItem(menu, "4.0", "4s")
  3964. AddMenuItem(menu, "4.5", "4.5s")
  3965. AddMenuItem(menu, "5.0", "5s")
  3966. AddMenuItem(menu, "6", "6s")
  3967. AddMenuItem(menu, "7", "7s")
  3968. AddMenuItem(menu, "8", "8s")
  3969. AddMenuItem(menu, "9", "9s")
  3970. AddMenuItem(menu, "10", "10s")
  3971.  
  3972. DisplayMenu(menu, client, MENU_TIME_FOREVER);
  3973. }
  3974.  
  3975. public Action:ShowMenuDelayed2(Handle:timer, any:client)
  3976. {
  3977. new Handle:menu = CreateMenu(MenuDelayed_Return2, MenuAction_Select | MenuAction_End);
  3978. SetMenuTitle(menu, "Choose Delay for disappearance of the block:");
  3979. AddMenuItem(menu, "0.25", "0.25s")
  3980. AddMenuItem(menu, "0.5", "0.5s")
  3981. AddMenuItem(menu, "0.75", "0.75s")
  3982. AddMenuItem(menu, "1", "1s")
  3983. AddMenuItem(menu, "1.5", "1.5s")
  3984. AddMenuItem(menu, "2", "2s")
  3985. AddMenuItem(menu, "2.5", "2.5s")
  3986. AddMenuItem(menu, "3.0", "3s")
  3987. AddMenuItem(menu, "3.5", "3.5s")
  3988. AddMenuItem(menu, "4.0", "4s")
  3989. AddMenuItem(menu, "4.5", "4.5s")
  3990. AddMenuItem(menu, "5.0", "5s")
  3991. AddMenuItem(menu, "6", "6s")
  3992. AddMenuItem(menu, "7", "7s")
  3993. AddMenuItem(menu, "8", "8s")
  3994. AddMenuItem(menu, "9", "9s")
  3995. AddMenuItem(menu, "10", "10s")
  3996.  
  3997. DisplayMenu(menu, client, MENU_TIME_FOREVER);
  3998. }
  3999. public MenuDelayed_Return2(Handle:menu, MenuAction:action, client, param2)
  4000. {
  4001. switch (action)
  4002. {
  4003. case MenuAction_Select:
  4004. {
  4005. decl String:item[16];
  4006. GetMenuItem(menu, param2, item, sizeof(item));
  4007. SpeedBoostForce_1[CurrentModifier[client]] = StringToFloat(item)
  4008.  
  4009. SDKHook(CurrentModifier[client], SDKHook_StartTouch, OnStartTouch);
  4010. SDKHook(CurrentModifier[client], SDKHook_Touch, OnTouch);
  4011. SDKHook(CurrentModifier[client], SDKHook_EndTouch, OnEndTouch);
  4012. DisplayMenu(CreateMainMenu(client), client, 0);
  4013. }
  4014. case MenuAction_End:
  4015. {
  4016. CloseHandle(menu);
  4017. }
  4018. }
  4019. }
  4020. public MenuDelayed_Return(Handle:menu, MenuAction:action, client, param2)
  4021. {
  4022. switch (action)
  4023. {
  4024. case MenuAction_Select:
  4025. {
  4026. decl String:item[16];
  4027. GetMenuItem(menu, param2, item, sizeof(item));
  4028. SpeedBoostForce_1[CurrentModifier[client]] = StringToFloat(item)
  4029.  
  4030. DisplayMenu(CreateMainMenu(client), client, 0);
  4031. }
  4032. case MenuAction_End:
  4033. {
  4034. CloseHandle(menu);
  4035. }
  4036. }
  4037. }
  4038.  
  4039. public ShowMenu3E(client)
  4040. {
  4041. new Handle:menu = CreateMenu(TFCH_BoostF, MenuAction_Select | MenuAction_End);
  4042. SetMenuTitle(menu, "Choose Speed Boost Forward Force:");
  4043. AddMenuItem(menu, "1000", "1000");
  4044. AddMenuItem(menu, "900", "900");
  4045. AddMenuItem(menu, "800", "800 (DEFAULT)");
  4046. AddMenuItem(menu, "700", "700");
  4047. AddMenuItem(menu, "600", "600");
  4048. AddMenuItem(menu, "500", "500");
  4049. AddMenuItem(menu, "400", "400");
  4050. AddMenuItem(menu, "300", "300");
  4051. AddMenuItem(menu, "200", "200");
  4052.  
  4053. DisplayMenu(menu, client, MENU_TIME_FOREVER);
  4054. }
  4055. public Action:ShowMenu3(Handle:timer, any:client)
  4056. {
  4057. new Handle:menu = CreateMenu(TFCH_BoostF, MenuAction_Select | MenuAction_End);
  4058. SetMenuTitle(menu, "Choose Speed Boost Forward Force:");
  4059. AddMenuItem(menu, "1000", "1000");
  4060. AddMenuItem(menu, "900", "900");
  4061. AddMenuItem(menu, "800", "800 (DEFAULT)");
  4062. AddMenuItem(menu, "700", "700");
  4063. AddMenuItem(menu, "600", "600");
  4064. AddMenuItem(menu, "500", "500");
  4065. AddMenuItem(menu, "400", "400");
  4066. AddMenuItem(menu, "300", "300");
  4067. AddMenuItem(menu, "200", "200");
  4068.  
  4069. DisplayMenu(menu, client, MENU_TIME_FOREVER);
  4070. }
  4071.  
  4072. public TFCH_BoostF(Handle:menu, MenuAction:action, client, param2)
  4073. {
  4074. switch (action)
  4075. {
  4076. case MenuAction_Select:
  4077. {
  4078. decl String:item[16];
  4079. GetMenuItem(menu, param2, item, sizeof(item));
  4080. SpeedBoostForce_1[CurrentModifier[client]] = StringToFloat(item)
  4081.  
  4082. SDKHook(CurrentModifier[client], SDKHook_StartTouch, OnStartTouch);
  4083. SDKHook(CurrentModifier[client], SDKHook_Touch, OnTouch);
  4084. SDKHook(CurrentModifier[client], SDKHook_EndTouch, OnEndTouch);
  4085. ShowMenu4(client)
  4086. }
  4087. case MenuAction_End:
  4088. {
  4089. CloseHandle(menu);
  4090. }
  4091. }
  4092. }
  4093.  
  4094. public TFCH_BoostF2(Handle:menu, MenuAction:action, client, param2)
  4095. {
  4096. switch (action)
  4097. {
  4098. case MenuAction_Select:
  4099. {
  4100. decl String:item[16];
  4101. GetMenuItem(menu, param2, item, sizeof(item));
  4102. SpeedBoostForce_2[CurrentModifier[client]] = StringToFloat(item)
  4103. DisplayMenu(CreateMainMenu(client), client, 0);
  4104. }
  4105. case MenuAction_End:
  4106. {
  4107. CloseHandle(menu);
  4108. }
  4109. }
  4110. }
  4111.  
  4112. public ShowMenu4(client)
  4113. {
  4114. new Handle:menu = CreateMenu(TFCH_BoostF2, MenuAction_Select | MenuAction_End);
  4115. SetMenuTitle(menu, "Choose Speed Boost Jump Force:");
  4116. AddMenuItem(menu, "1000", "1000");
  4117. AddMenuItem(menu, "900", "900");
  4118. AddMenuItem(menu, "800", "800");
  4119. AddMenuItem(menu, "700", "700");
  4120. AddMenuItem(menu, "600", "600");
  4121. AddMenuItem(menu, "500", "500");
  4122. AddMenuItem(menu, "400", "400");
  4123. AddMenuItem(menu, "300", "300");
  4124. AddMenuItem(menu, "260", "260 (DEFAULT)");
  4125. AddMenuItem(menu, "200", "200");
  4126.  
  4127. DisplayMenu(menu, client, MENU_TIME_FOREVER);
  4128. }
  4129.  
  4130. public Action:BoostPlayer(Handle:timer, any:pack)
  4131. {
  4132. ResetPack(pack)
  4133. new client = ReadPackCell(pack)
  4134. new block = ReadPackCell(pack)
  4135.  
  4136. new Float:fAngles[3];
  4137. GetClientEyeAngles(client, fAngles);
  4138.  
  4139. new Float:fVelocity[3];
  4140. GetAngleVectors(fAngles, fVelocity, NULL_VECTOR, NULL_VECTOR);
  4141.  
  4142. NormalizeVector(fVelocity, fVelocity);
  4143.  
  4144. ScaleVector(fVelocity, SpeedBoostForce_1[block]);
  4145. fVelocity[2] = SpeedBoostForce_2[block];
  4146. TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fVelocity);
  4147. return Plugin_Stop;
  4148. }
  4149.  
  4150. public Action:JumpPlayer(Handle:timer, any:pack)
  4151. {
  4152. ResetPack(pack)
  4153. new client = ReadPackCell(pack)
  4154. new block = ReadPackCell(pack)
  4155. if(IsClientInGame(client) && IsValidBlock(block))
  4156. {
  4157. decl Float:block_loc[3]
  4158. GetEntPropVector(block, Prop_Send, "m_vecOrigin", block_loc);
  4159. decl Float:player_loc[3]
  4160. GetClientAbsOrigin(client, player_loc)
  4161. player_loc[2] += TrueForce;
  4162. if(!(player_loc[2] <= block_loc[2]))
  4163. {
  4164. new Float:fVelocity[3];
  4165. GetEntPropVector(client, Prop_Data, "m_vecVelocity", fVelocity);
  4166. fVelocity[0]*=1.5;
  4167. fVelocity[1]*=1.5;
  4168. fVelocity[2] = TrampolineForce[block]
  4169. TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fVelocity);
  4170. }
  4171. else
  4172. {
  4173. new Float:fVelocity[3];
  4174. GetEntPropVector(client, Prop_Data, "m_vecVelocity", fVelocity);
  4175. fVelocity[0]*=1.25;
  4176. fVelocity[1]*=1.25;
  4177. fVelocity[2] = 300.0
  4178. TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fVelocity);
  4179. }
  4180. }
  4181. return Plugin_Stop;
  4182. }
  4183.  
  4184. public Action:SlapPlayerBlock(Handle:timer, any:client)
  4185. {
  4186. SlapPlayer(client, 5);
  4187. new Float:fVelocity[3];
  4188. fVelocity[0] = float(GetRandomInt(-100, 100));
  4189. fVelocity[1] = float(GetRandomInt(-100, 100));
  4190. fVelocity[2] = float(GetRandomInt(260, 360));
  4191. TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fVelocity);
  4192. return Plugin_Stop;
  4193. }
  4194.  
  4195. public Handler_Teleport(Handle:menu, MenuAction:action, client, param2)
  4196. {
  4197. if (action == MenuAction_Select)
  4198. {
  4199. if(param2==0)
  4200. {
  4201. if(g_iCurrentTele[client]==-1)
  4202. CreateTeleportEntrance(client);
  4203. else
  4204. {
  4205. if(IsValidEdict(g_iCurrentTele[client]))
  4206. AcceptEntityInput(g_iCurrentTele[client], "Kill");
  4207. g_iCurrentTele[client]=-1;
  4208. }
  4209. } else if(param2==1)
  4210. {
  4211. if(g_iCurrentTele[client]==-1)
  4212. PrintToChat(client, "\x03%s\x04 You must create an entrance first", CHAT_TAG);
  4213. else
  4214. {
  4215. g_iTeleporters[g_iCurrentTele[client]]=CreateTeleportExit(client);
  4216. g_iCurrentTele[client]=-1;
  4217. }
  4218. } else if(param2==2)
  4219. {
  4220. new ent = GetClientAimTarget(client, false);
  4221. new entrance = -1;
  4222. new hexit = -1;
  4223. if(g_iTeleporters[ent]>=1)
  4224. {
  4225. if(g_iTeleporters[ent]>1)
  4226. {
  4227. entrance = ent;
  4228. hexit = g_iTeleporters[ent];
  4229. }
  4230. else
  4231. {
  4232. for(new i=MaxClients+1;i<2048;++i)
  4233. {
  4234. if(g_iTeleporters[i]==ent)
  4235. {
  4236. hexit = ent;
  4237. entrance = i;
  4238. break;
  4239. }
  4240. }
  4241. }
  4242.  
  4243. if(entrance > 0 && hexit > 0)
  4244. {
  4245. if(IsValidBlock(entrance) && IsValidBlock(hexit))
  4246. {
  4247. SetEntityModel(entrance, "models/platforms/r-tele.mdl");
  4248. SetEntityModel(hexit, "models/platforms/b-tele.mdl");
  4249. g_iTeleporters[entrance]=1;
  4250. g_iTeleporters[hexit]=entrance;
  4251. }
  4252. }
  4253. }
  4254. } else if(param2==3)
  4255. {
  4256. new ent = GetClientAimTarget(client, false);
  4257. if(IsValidBlock(ent))
  4258. {
  4259. AcceptEntityInput(ent, "Kill");
  4260. g_iBlocks[ent]=-1;
  4261. if(g_iTeleporters[ent]>=1)
  4262. {
  4263. if(g_iTeleporters[ent]>1 && IsValidBlock(g_iTeleporters[ent]))
  4264. {
  4265. AcceptEntityInput(g_iTeleporters[ent], "Kill");
  4266. g_iTeleporters[g_iTeleporters[ent]] = -1;
  4267. } else if(g_iTeleporters[ent]==1)
  4268. {
  4269. for(new i=MaxClients+1;i<2048;++i)
  4270. {
  4271. if(g_iTeleporters[i]==ent)
  4272. {
  4273. if(IsValidBlock(i))
  4274. AcceptEntityInput(i, "Kill");
  4275. g_iTeleporters[i] = -1;
  4276. break;
  4277. }
  4278. }
  4279. }
  4280.  
  4281. g_iTeleporters[ent]=-1;
  4282. }
  4283. }
  4284. } else if(param2==4)
  4285. {
  4286. new ent = GetClientAimTarget(client, false);
  4287. if(ent!=-1)
  4288. {
  4289. new entrance = -1;
  4290. new hexit = -1;
  4291. if(g_iTeleporters[ent]>=1)
  4292. {
  4293. if(g_iTeleporters[ent]>1)
  4294. {
  4295. entrance = ent;
  4296. hexit = g_iTeleporters[ent];
  4297. }
  4298. else
  4299. {
  4300. for(new i=MaxClients+1;i<2048;++i)
  4301. {
  4302. if(g_iTeleporters[i]==ent)
  4303. {
  4304. hexit = ent;
  4305. entrance = i;
  4306. break;
  4307. }
  4308. }
  4309. }
  4310. if(entrance > 0 && hexit > 0)
  4311. {
  4312. if(IsValidBlock(entrance) && IsValidBlock(hexit))
  4313. {
  4314. new color[4]={255, 0, 0, 255};
  4315. new Float:pos1[3], Float:pos2[3];
  4316. GetEntPropVector(entrance, Prop_Data, "m_vecOrigin", pos1);
  4317. GetEntPropVector(hexit, Prop_Data, "m_vecOrigin", pos2);
  4318. TE_SetupBeamPoints(pos2, pos1, g_iBeamSprite, 0, 0, 40, 15.0, 20.0, 20.0, 25, 0.0, color, 10);
  4319. TE_SendToClient(client);
  4320. }
  4321. }
  4322. }
  4323. }
  4324. else
  4325. {
  4326. PrintToChat(client, "\x03%s\x04 You must aim at a teleporter first", CHAT_TAG);
  4327. }
  4328. }
  4329. DisplayMenu(CreateTeleportMenu(client), client, 0);
  4330. }
  4331. else if ((action == MenuAction_Cancel) && (param2 == MenuCancel_ExitBack))
  4332. DisplayMenu(CreateMainMenu(client), client, 0);
  4333. }
  4334.  
  4335. public Handler_Blocks(Handle:menu, MenuAction:action, client, param2)
  4336. {
  4337. if (action == MenuAction_Select)
  4338. {
  4339. g_iBlockSelection[client]=param2;
  4340. //PrintToChat(client, "%sYou have selected block \x03%s\x04.", CHAT_TAG, g_eBlocks[param2][BlockName]);
  4341. DisplayMenu(CreateMainMenu(client), client, 0);
  4342. }
  4343. else if ((action == MenuAction_Cancel) && (param2 == MenuCancel_ExitBack))
  4344. DisplayMenu(CreateMainMenu(client), client, 0);
  4345. }
  4346.  
  4347. public Handler_Options(Handle:menu, MenuAction:action, client, param2)
  4348. {
  4349. if (action == MenuAction_Select)
  4350. {
  4351. new bool:bDontDisplay = false;
  4352. if(param2 == 0)
  4353. {
  4354. if(g_bSnapping[client])
  4355. g_bSnapping[client]=false;
  4356. else
  4357. g_bSnapping[client]=true;
  4358. }
  4359. else if(param2 == 1)
  4360. {
  4361. if(g_fSnappingGap[client]<100.0)
  4362. g_fSnappingGap[client]+=5.0;
  4363. else
  4364. g_fSnappingGap[client]=0.0;
  4365. }
  4366. else if(param2 == 2)
  4367. {
  4368. new ent = GetClientAimTarget(client, false);
  4369. if(IsValidBlock(ent))
  4370. g_bGroups[client][ent]=true;
  4371. } else if(param2 == 3)
  4372. {
  4373. for(new i=0;i<2048;++i)
  4374. g_bGroups[client][i] = false;
  4375. } else if(param2 == 4)
  4376. {
  4377. LoadBlocks_Menu(client);
  4378. bDontDisplay = true;
  4379. } else if(param2 == 5)
  4380. {
  4381. SaveBlocks_Menu(client);
  4382. bDontDisplay = true;
  4383. } else if(param2 == 6)
  4384. {
  4385. for(new i=MaxClients+1;i<2048;++i)
  4386. {
  4387. if(g_iBlocks[i]!=-1)
  4388. {
  4389. if(IsValidBlock(i))
  4390. {
  4391. AcceptEntityInput(i, "Kill");
  4392. }
  4393. g_iBlocks[i]=-1;
  4394. }
  4395. }
  4396. } else if(param2 == 7)
  4397. {
  4398. for(new i=MaxClients+1;i<2048;++i)
  4399. {
  4400. if(g_iTeleporters[i]!=-1)
  4401. {
  4402. if(IsValidBlock(i))
  4403. {
  4404. AcceptEntityInput(i, "Kill");
  4405. }
  4406. g_iTeleporters[i]=-1;
  4407. }
  4408. }
  4409. }
  4410. if(!bDontDisplay)
  4411. {
  4412. DisplayMenu(CreateOptionsMenu(client), client, 0);
  4413. }
  4414. }
  4415. else if ((action == MenuAction_Cancel) && (param2 == MenuCancel_ExitBack))
  4416. DisplayMenu(CreateMainMenu(client), client, 0);
  4417. }
  4418.  
  4419. stock SaveBlocks_Menu(client)
  4420. {
  4421. new Handle:menu = CreateMenu(SaveBlocks_Handler, MenuAction_Select | MenuAction_End | MenuAction_DisplayItem);
  4422. SetMenuTitle(menu, "Block Builder - Save Blocks?");
  4423. AddMenuItem(menu, "X", "Are you sure you want to save blocks?", ITEMDRAW_DISABLED)
  4424. AddMenuItem(menu, "1", "Yes!")
  4425. AddMenuItem(menu, "2", "No!")
  4426.  
  4427. DisplayMenu(menu, client, MENU_TIME_FOREVER);
  4428. }
  4429.  
  4430. public SaveBlocks_Handler(Handle:menu, MenuAction:action, client, param2)
  4431. {
  4432. switch (action)
  4433. {
  4434. case MenuAction_Select:
  4435. {
  4436. decl String:item[64];
  4437. GetMenuItem(menu, param2, item, sizeof(item));
  4438.  
  4439. new option = StringToInt(item)
  4440. if(option == 1)
  4441. {
  4442. SaveBlocks(true)
  4443. }
  4444. else
  4445. {
  4446. DisplayMenu(CreateOptionsMenu(client), client, 0);
  4447. }
  4448. }
  4449. case MenuAction_End:
  4450. {
  4451. CloseHandle(menu);
  4452. }
  4453. }
  4454. }
  4455.  
  4456.  
  4457. stock LoadBlocks_Menu(client)
  4458. {
  4459. new Handle:menu = CreateMenu(LoadBlocks_Handler, MenuAction_Select | MenuAction_End | MenuAction_DisplayItem);
  4460. SetMenuTitle(menu, "Block Builder - Load Blocks?");
  4461. AddMenuItem(menu, "X", "Are you sure you want to load blocks?", ITEMDRAW_DISABLED)
  4462. AddMenuItem(menu, "1", "Yes!")
  4463. AddMenuItem(menu, "2", "No!")
  4464.  
  4465. DisplayMenu(menu, client, MENU_TIME_FOREVER);
  4466. }
  4467.  
  4468. public LoadBlocks_Handler(Handle:menu, MenuAction:action, client, param2)
  4469. {
  4470. switch (action)
  4471. {
  4472. case MenuAction_Select:
  4473. {
  4474. decl String:item[64];
  4475. GetMenuItem(menu, param2, item, sizeof(item));
  4476.  
  4477. new option = StringToInt(item)
  4478. if(option == 1)
  4479. {
  4480. LoadBlocks(true)
  4481. }
  4482. else
  4483. {
  4484. DisplayMenu(CreateOptionsMenu(client), client, 0);
  4485. }
  4486. }
  4487. case MenuAction_End:
  4488. {
  4489. CloseHandle(menu);
  4490. }
  4491. }
  4492. }
  4493.  
  4494. bool:IsValidBlock(ent)
  4495. {
  4496. if(MaxClients < ent < 2048)
  4497. if((g_iBlocks[ent] != -1 || g_iTeleporters[ent]!=-1) && IsValidEdict(ent))
  4498. return true;
  4499. return false;
  4500. }
  4501.  
  4502. stock FakePrecacheSound( const String:szPath[] )
  4503. {
  4504. AddToStringTable( FindStringTable( "soundprecache" ), szPath );
  4505. }
  4506.  
  4507. stock GetCurrentWorkshopMap(String:szMap[], iMapBuf, String:szWorkShopID[], iWorkShopBuf)
  4508. {
  4509. decl String:szCurMap[128];
  4510. decl String:szCurMapSplit[2][64];
  4511.  
  4512. GetCurrentMap(szCurMap, sizeof(szCurMap));
  4513.  
  4514. ReplaceString(szCurMap, sizeof(szCurMap), "workshop/", "", false);
  4515.  
  4516. ExplodeString(szCurMap, "/", szCurMapSplit, 2, 64);
  4517.  
  4518. strcopy(szMap, iMapBuf, szCurMapSplit[1]);
  4519. strcopy(szWorkShopID, iWorkShopBuf, szCurMapSplit[0]);
  4520. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement