找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1667|回复: 9

【已解决】 各位大神,,,谁能给我一个这样的插件,,,跪求啊!!

[复制链接]

该用户从未签到

发表于 2010-9-14 13:38:11 | 显示全部楼层 |阅读模式
本帖最后由 SiMen.K. 于 2010-9-16 19:28 编辑

计时器+读存点+光波+加1000血那个+赛盟LJ服插件,跪求啊。。。各位大神

该用户从未签到

发表于 2010-9-14 14:11:04 | 显示全部楼层
去插件版主那找吧

该用户从未签到

 楼主| 发表于 2010-9-14 14:31:19 | 显示全部楼层
我就是没有找到才发的这帖。。。

该用户从未签到

发表于 2010-9-14 14:48:51 | 显示全部楼层
http://bbs.simen.cn/thread-75486-1-1.html

下载  完全符合你的要求

该用户从未签到

 楼主| 发表于 2010-9-14 15:16:30 | 显示全部楼层
下载  完全符合你的要求
SiMen.K. 发表于 2010-9-14 14:48



    不符合啊。。K神。。我的大神。。我需要的是像XJ那种。箱子不沉。USP不加消声器。按计时器不要有声音像XJ一样,地图完成时间精确到0.23这种。LJ服的LJ插件 。K大神,救救我这个可怜孩子吧

该用户从未签到

发表于 2010-9-14 17:44:41 | 显示全部楼层
这东西只有找K了。

该用户从未签到

发表于 2010-9-14 19:02:38 | 显示全部楼层
安装XJ的插件 然后加个箱子不沉的那个AMXX文件、
在换个LJ服的那个AMXX文件不就好了

该用户从未签到

发表于 2010-9-16 19:02:52 | 显示全部楼层
本帖最后由 SiMen.K. 于 2010-9-16 19:24 编辑

回复 7# GOoo


    prokreedz +  mpbhop + uq_jumpstats  = u need

  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <engine>
  5. #include <fakemeta>
  6. #include <colorchat>
  7. #include <hamsandwich>

  8. #define KZ_LEVEL ADMIN_KICK
  9. #define MAX_ENTITYS 900+15*32
  10. #define SCOREATTRIB_NONE    0
  11. #define SCOREATTRIB_DEAD    ( 1 << 0 )
  12. #define SCOREATTRIB_BOMB    ( 1 << 1 )
  13. #define SCOREATTRIB_VIP  ( 1 << 2 )
  14. #if cellbits == 32
  15. #define OFFSET_BUYZONE 235
  16. #else
  17. #define OFFSET_BUYZONE 268
  18. #endif
  19. new g_iPlayers[32], g_iNum, g_iPlayer
  20. new const g_szAliveFlags[] = "a"
  21. #define RefreshPlayersList()    get_players(g_iPlayers, g_iNum, g_szAliveFlags)
  22. new const KZ_TOP15_DIR[] = "addons/amxmodx/configs/kz/top15"
  23. new Float:Pro_Times[24]
  24. new Pro_AuthIDS[24][32]
  25. new Pro_Names[24][32]
  26. new Pro_Date[24][32]
  27. new Float:Noob_Tiempos[24]
  28. new Noob_AuthIDS[24][32]
  29. new Noob_Names[24][32]
  30. new Noob_Date[24][32]
  31. new Noob_CheckPoints[24]
  32. new Noob_GoChecks[24]
  33. new Float:Checkpoints[33][2][3]
  34. new Float:timer_time[33]
  35. new Float:g_pausetime[33]
  36. new bool:g_bCpAlternate[33]
  37. new bool:timer_started[33]
  38. new bool:IsPaused[33]
  39. new bool:firstspawn[33]
  40. new bool:canusehook[33]
  41. new bool:ishooked[33]
  42. new bool:NightVisionUse[33]
  43. new bool:HealsOnMap
  44. new bool:Safe
  45. new bool:gViewInvisible[33]
  46. new bool:gMarkedInvisible[33] = { true, ...};
  47. new bool:gWaterInvisible[33]
  48. new bool:gWaterEntity[MAX_ENTITYS]
  49. new bool:gWaterFound
  50. new bool:AutoStart[33]
  51. new PauseOrigin[33][3]
  52. new Trie:g_tStarts
  53. new Trie:g_tStops;
  54. new checknumbers[33]
  55. new gochecknumbers[33]
  56. new g_WeaponUsed[33]
  57. new ShowTime[33]
  58. new g_Mapname[64]
  59. new g_Filename[128]
  60. new g_KzDir[128]
  61. new g_StartDir[128]
  62. new g_TopDir[128]
  63. new SpecLoc[33][3]
  64. new SavedStart[33][3]
  65. new kz_checkpoints
  66. new kz_godmode
  67. new kz_cheatdetect
  68. new kz_spawn_mainmenu
  69. new kz_show_timer
  70. new kz_chatorhud
  71. new kz_hud_color
  72. new hud_message
  73. new kz_other_weapons
  74. new kz_maxspeedmsg
  75. new kz_drop_weapons
  76. new kz_remove_drops
  77. new kz_strip_other_weapons
  78. new kz_use_radio
  79. new kz_hook_prize
  80. new kz_hook_sound
  81. new kz_pause
  82. new hookorigin[33][3]
  83. new kz_nvg
  84. new kz_nvg_colors
  85. new kz_vip
  86. new kz_respawn_ct
  87. new kz_semiclip
  88. new kz_spec_saves
  89. new kz_save_autostart
  90. new MaxPlayers
  91. new MsgStatusText
  92. new TeamInfo
  93. new const other_top_weapons[8] =
  94. {
  95. CSW_SCOUT, CSW_P90, CSW_FAMAS, CSW_SG552,
  96. CSW_M4A1, CSW_M249, CSW_AK47, CSW_AWP
  97. }
  98. // Sprites
  99. new Sbeam = 0

  100. // =================================================================================================

  101. public plugin_init()
  102. {
  103. register_plugin("ProKreedz","2.0w","p4ddY & Diggz & nucLeaR")
  104. register_cvar("prokreedz_version","2.0w",FCVAR_SERVER)
  105. kz_checkpoints = register_cvar("kz_checkpoints","1")
  106. kz_godmode = register_cvar("kz_godmode","1")
  107. kz_cheatdetect = register_cvar("kz_cheatdetect","1")
  108. kz_spawn_mainmenu = register_cvar("kz_spawn_mainmenu", "1")
  109. kz_show_timer = register_cvar("kz_show_timer", "1")
  110. kz_chatorhud = register_cvar("kz_chatorhud", "2")
  111. kz_hud_color = register_cvar("kz_hud_color", "12 122 221")
  112. kz_other_weapons = register_cvar("kz_other_weapons","1")
  113. kz_drop_weapons = register_cvar("kz_drop_weapons", "0")
  114. kz_remove_drops = register_cvar("kz_remove_drops", "1")
  115. kz_strip_other_weapons = register_cvar("kz_strip_other_weapons", "1")
  116. kz_maxspeedmsg = register_cvar("kz_maxspeedmsg","1")
  117. kz_hook_prize = register_cvar("kz_hook_prize","1")
  118. kz_hook_sound = register_cvar("kz_hook_sound","1")
  119. kz_use_radio = register_cvar("kz_use_radio", "0")
  120. kz_pause = register_cvar("kz_pause", "1")
  121. kz_nvg = register_cvar("kz_nvg","1")
  122. kz_nvg_colors = register_cvar("kz_nvg_colors","5 0 255")
  123. kz_vip = register_cvar("kz_vip","1")
  124. kz_respawn_ct = register_cvar("kz_respawn_ct", "1")
  125. kz_semiclip = register_cvar("kz_semiclip", "1")
  126. kz_spec_saves = register_cvar("kz_spec_saves", "1")
  127. kz_save_autostart = register_cvar("kz_save_autostart", "1")

  128. register_clcmd("say .kreedz","kz_menu")
  129. register_clcmd("say /kreedz","kz_menu")
  130. register_clcmd("say .menu","kz_menu")
  131. register_clcmd("say /menu","kz_menu")
  132. register_clcmd("say /timer", "ShowTimer_Task" )
  133. register_clcmd( "say_team /timer", "ShowTimer_Task" );
  134. register_clcmd("say /showtimer", "ShowTimer_Task")
  135.    
  136. register_clcmd("cp","CheckPoint")
  137. register_clcmd("/cp","CheckPoint")
  138. register_clcmd(".cp","CheckPoint")
  139. register_clcmd("say /cp","CheckPoint")
  140. register_clcmd("say /checkpoint","CheckPoint")
  141. register_clcmd("tp","GoCheck")
  142. register_clcmd("/tp","GoCheck")
  143. register_clcmd(".tp","GoCheck")
  144. register_clcmd("say /tp", "GoCheck")
  145. register_clcmd("say /teleport", "GoCheck")
  146. register_clcmd("gc","GoCheck")
  147. register_clcmd("/gc","GoCheck")
  148. register_clcmd(".gc","GoCheck")
  149. register_clcmd("say /gc", "GoCheck")
  150. register_clcmd("say /gocheck", "GoCheck")
  151. register_clcmd("stuck","Stuck")
  152. register_clcmd("/stuck","Stuck")
  153. register_clcmd(".stuck", "Stuck")
  154. register_clcmd("say .stuck","Stuck")
  155. register_clcmd("say /stuck","Stuck")
  156. register_clcmd("say .reset","reset_checkpoints")
  157. register_clcmd("say /reset","reset_checkpoints")
  158.    
  159. register_clcmd("say .noclip","noclip")
  160. register_clcmd("say /noclip","noclip")
  161. register_clcmd("say /nc","noclip")
  162. register_clcmd("say /spec","ct")
  163. register_clcmd("say /ct","ct")
  164. register_clcmd("say /pause", "Pause")
  165. register_clcmd("say /invis", "InvisMenu")
  166. register_clcmd("say /winvis", "cmdWaterInvisible")
  167. register_clcmd("say /pinvis", "cmdInvisible")
  168.    
  169. register_concmd("kz_hook","give_hook",KZ_LEVEL,"<name|#userid|steamid|@ALL> <on/off>")
  170. register_concmd("nightvision","ToggleNVG")
  171. register_clcmd("say .top15","top15menu")
  172. register_clcmd("say /top15","top15menu")
  173. register_clcmd("say .top10","top15menu")
  174. register_clcmd("say /top10","top15menu")
  175. register_clcmd("say .noob10","NoobTop_show")
  176. register_clcmd("say /noob10","NoobTop_show")
  177. register_clcmd("say .noob15","NoobTop_show")
  178. register_clcmd("say /noob15","NoobTop_show")
  179. register_clcmd("say .nub10","NoobTop_show")
  180. register_clcmd("say /nub10","NoobTop_show")
  181. register_clcmd("say .nub15","NoobTop_show")
  182. register_clcmd("say /nub15","NoobTop_show")
  183. register_clcmd("say .pro10","ProTop_show")
  184. register_clcmd("say /pro10","ProTop_show")
  185. register_clcmd("say .pro15","ProTop_show")
  186. register_clcmd("say /pro15","ProTop_show")
  187.    
  188. register_clcmd("say /weapons","weapons")
  189. register_clcmd("say /scout", "cmdScout")   
  190. register_clcmd("say /usp", "cmdUsp")
  191. register_clcmd("say /knife", "cmdUsp")
  192. register_clcmd("say /start", "goStart");
  193. register_clcmd("/start", "goStart");
  194. register_clcmd("say /respawn", "goStart");
  195. register_clcmd("/respawn", "goStart");
  196. register_clcmd("say /setstart", "setStart", KZ_LEVEL, "")
  197. register_clcmd("say /delstart", "delStart", KZ_LEVEL, "")
  198. register_clcmd("+hook","hook_on",KZ_LEVEL)
  199. register_clcmd("-hook","hook_off",KZ_LEVEL)
  200. register_clcmd("say /demo", "Demo_CVars", KZ_LEVEL, "")
  201. register_clcmd("say /record", "Demo_CVars", KZ_LEVEL, "")
  202. register_clcmd("say /public", "Public_CVars", KZ_LEVEL, "")
  203. register_clcmd("say /pub", "Public_CVars", KZ_LEVEL, "")

  204. register_event("ResetHUD","resethud","be")
  205. register_event("CurWeapon","curweapon","be")
  206. register_event( "StatusValue", "EventStatusValue", "b", "1>0", "2>0" );
  207. register_forward(FM_StartFrame, "fw_StartFrame")
  208. register_forward(FM_AddToFullPack, "FM_client_AddToFullPack_Post", 1)
  209. RegisterHam( Ham_Player_PreThink, "player", "Ham_CBasePlayer_PreThink_Post", 1)
  210. RegisterHam( Ham_Use, "func_button", "fwdUse", 0)
  211. RegisterHam( Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", 1)
  212. RegisterHam( Ham_Spawn, "weaponbox", "FwdSpawnWeaponbox", 1 )
  213. RegisterHam( Ham_Spawn, "player", "FwdHamPlayerSpawn", 1 )
  214. RegisterHam( Ham_Touch, "weaponbox", "GroundWeapon_Touch")
  215. register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib" )
  216. register_message( get_user_msgid( "StatusIcon" ), "msgStatusIcon" );
  217. TeamInfo = get_user_msgid("TeamInfo")
  218. MsgStatusText = get_user_msgid( "StatusText" )
  219. hud_message = CreateHudSyncObj()
  220. MaxPlayers = get_maxplayers()
  221. set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET)
  222. set_task(0.5,"timer_task",2000,"",0,"ab")
  223.     new cfgdir[64]
  224. get_configsdir(cfgdir,64)   
  225. formatex(g_KzDir, 127, "%s/kz",cfgdir)
  226. if( !dir_exists(g_KzDir) )
  227.   mkdir(g_KzDir)
  228. formatex(g_StartDir, 127, "%s/start",g_KzDir)
  229. if( !dir_exists(g_StartDir) )
  230.   mkdir(g_StartDir)
  231. formatex(g_TopDir, 127, "%s/top15",g_KzDir)
  232. if( !dir_exists(g_TopDir) )
  233.   mkdir(g_TopDir)
  234. get_mapname(g_Mapname, 63);
  235. formatex(g_Filename, 127, "%s/%s.txt", g_StartDir, g_Mapname)
  236.    
  237. new kreedz_cfg[128]
  238. formatex(kreedz_cfg,128,"%s/kz/kreedz.cfg",cfgdir)
  239.         
  240. if( file_exists( kreedz_cfg ) )
  241. {
  242.   server_exec()
  243.   server_cmd("exec %s",kreedz_cfg)
  244. }
  245. g_tStarts = TrieCreate( )
  246. g_tStops  = TrieCreate( )
  247. new const szStarts[ ][ ] =
  248. {
  249.   "counter_start", "clockstartbutton", "firsttimerelay", "but_start", "counter_start_button",
  250.   "multi_start", "timer_startbutton", "start_timer_emi", "gogogo"
  251. }
  252. new const szStops[ ][ ]  =
  253. {
  254.   "counter_off", "clockstopbutton", "clockstop", "but_stop", "counter_stop_button",
  255.   "multi_stop", "stop_counter", "m_counter_end_emi"
  256. }
  257. for( new i = 0; i < sizeof szStarts; i++ )
  258.   TrieSetCell( g_tStarts, szStarts[ i ], 1 )

  259. for( new i = 0; i < sizeof szStops; i++ )
  260.   TrieSetCell( g_tStops, szStops[ i ], 1 )
  261. }

  262. public plugin_end( )
  263. {
  264. TrieDestroy( g_tStarts )
  265. TrieDestroy( g_tStops )
  266. }
  267. public plugin_precache()
  268. {
  269. RegisterHam( Ham_Spawn, "func_door", "FwdHamDoorSpawn", 1 )
  270. precache_sound("weapons/xbow_hit2.wav")
  271. Sbeam = precache_model("sprites/laserbeam.spr")
  272. }
  273. public plugin_cfg()
  274. {
  275. new ent = -1;
  276. while( ( ent = engfunc(EngFunc_FindEntityByString, ent, "classname", "func_water") ) != 0 )
  277. {
  278.   if( !gWaterFound )
  279.   {
  280.    gWaterFound = true;
  281.   }
  282.   gWaterEntity[ent] = true;
  283. }

  284. ent = -1;
  285. while( ( ent = engfunc(EngFunc_FindEntityByString, ent, "classname", "func_illusionary") ) != 0 )
  286. {
  287.   if( pev( ent, pev_skin ) ==  CONTENTS_WATER )
  288.   {
  289.    if( !gWaterFound )
  290.    {
  291.     gWaterFound = true;
  292.    }

  293.    gWaterEntity[ent] = true;
  294.   }
  295. }

  296. ent = -1;
  297. while( ( ent = engfunc(EngFunc_FindEntityByString, ent, "classname", "func_conveyor") ) != 0 )
  298. {
  299.   if( pev( ent, pev_spawnflags ) == 3 )
  300.   {
  301.    if( !gWaterFound )
  302.    {
  303.     gWaterFound = true;
  304.    }

  305.    gWaterEntity[ent] = true;
  306.   }
  307. }
  308. for (new i = 0 ; i < 15; ++i)
  309. {
  310.   Pro_Times[i] = 999999999.00000;
  311.   Noob_Tiempos[i] = 999999999.00000;
  312. }
  313. read_pro15()
  314. read_Noob15()
  315. }
  316. // =================================================================================================
  317. // Global Functions
  318. // =================================================================================================
  319. public Pause(id)
  320. {
  321. if (get_pcvar_num(kz_pause) == 0)
  322. {
  323.   kz_hud_message(id, "Pause is disabled")
  324.   return PLUGIN_HANDLED
  325. }
  326. if(! timer_started[id])
  327. {
  328.   kz_hud_message(id, "Timer is not started")
  329.   return PLUGIN_HANDLED
  330. }

  331. if(! is_user_alive(id) )
  332. {
  333.   kz_hud_message(id, "You must be alive to use this command")
  334.   return PLUGIN_HANDLED
  335. }
  336. new Float:velocity[3]
  337. entity_get_vector(id,EV_VEC_velocity,velocity)
  338. if( velocity[2] == 0 )
  339. {
  340.   if(!IsPaused[id])
  341.   {
  342.    g_pausetime[id] =   thetime() - timer_time[id]
  343.    timer_time[id] = 0.0
  344.    IsPaused[id] = true
  345.    kz_hud_message(id, "Your timer has been paused")
  346.    set_pev(id, pev_flags, pev(id, pev_flags) | FL_FROZEN)
  347.    pev(id, pev_origin, PauseOrigin[id])
  348.   }
  349.   else
  350.   {
  351.    timer_time[id] = thetime() - g_pausetime[id] + timer_time[id]
  352.    IsPaused[id] = false
  353.    kz_hud_message(id, "Your timer has been unpaused")
  354.    set_pev(id, pev_flags, pev(id, pev_flags) & ~FL_FROZEN)
  355.   }
  356. }
  357. else
  358.   kz_hud_message(id, "You must be on ground to get paused")
  359. return PLUGIN_HANDLED
  360. }
  361. public ShowTimer_Task(id)
  362. {
  363. if (get_pcvar_num(kz_show_timer) == 0 )
  364. {
  365.   kz_hud_message(id, "HUD Timer is disabled by CVar")
  366.   return PLUGIN_HANDLED
  367. }
  368. ShowTime[id] = ShowTime[id] ? false : true
  369. kz_hud_message( id, "You have %sabled your timer", ShowTime[ id ] ? "en" : "dis" )
  370. return PLUGIN_HANDLED
  371. }
  372. public timer_task()
  373. {
  374. if (get_pcvar_num(kz_show_timer) == 1 )
  375. {
  376.   for(new i=1;i<=MaxPlayers;i++)
  377.   {
  378.    if ( ShowTime[i] )
  379.    {
  380.     if (is_user_alive(i))
  381.     {
  382.      if( is_user_connected(i) && timer_started[i])
  383.      {
  384.       new Float:kreedztime = thetime() - (IsPaused[i] ? thetime() - g_pausetime[i] : timer_time[i])
  385.       new imin = floatround(kreedztime / 60.0,floatround_floor)
  386.       new isec = floatround(kreedztime - imin * 60.0,floatround_floor)
  387.    
  388.       new colors[12], r[4], g[4], b[4];
  389.       get_pcvar_string(kz_hud_color, colors, 11)
  390.       parse(colors, r, 3, g, 3, b, 4)
  391.       set_hudmessage(str_to_num(r), str_to_num(g), str_to_num(b), 0.40, 0.10, 0, 0.0, 1.0, 0.0, 0.0, 1)
  392.       show_hudmessage(i, "Time: %02d:%02d  | CPs: %d | TPs: %d ",imin, isec,checknumbers[i], gochecknumbers[i])
  393.      }
  394.     }
  395.     else
  396.     {
  397.      new specmode = pev(i, pev_iuser1)
  398.      if(specmode == 2 || specmode == 4)
  399.      {
  400.       new target = pev(i, pev_iuser2)
  401.       if(target != i)
  402.        if(is_user_alive(target) && timer_started[target])
  403.        {
  404.         new name[32], colors[12], r[4], g[4], b[4];
  405.         get_user_name (target, name, 31)
  406.         new Float:kreedztime = thetime() - (IsPaused[target] ? thetime() - g_pausetime[target] : timer_time[target])
  407.         new imin = floatround(kreedztime / 60.0,floatround_floor)
  408.         new isec = floatround(kreedztime - imin * 60.0,floatround_floor)
  409.         get_pcvar_string(kz_hud_color, colors, 11)
  410.         parse(colors, r, 3, g, 3, b, 4)
  411.         set_hudmessage(str_to_num(r), str_to_num(g), str_to_num(b), 0.40, 0.10, 0, 0.0, 1.0, 0.0, 0.0, 1)
  412.         show_hudmessage(i, "Time: %02d:%02d  | CPs: %d | TPs: %d %s ",imin, isec, checknumbers[target], gochecknumbers[target], IsPaused[target] ? "| *Paused*" : "")  
  413.        }
  414.      }
  415.     }
  416.    }
  417.   }
  418. }
  419. }
  420. // ============================ Block Commands ================================
  421. public client_command(id)
  422. {
  423. static szCmd[13]
  424. read_argv(0, szCmd, 12)

  425. static const commands_block[][] =
  426. {
  427.   "radio1", "radio2", "radio3",
  428.   "coverme", "takepoint", "holdpos",
  429.   "regroup", "followme", "takingfire",
  430.   "go", "fallback", "sticktog",
  431.   "getinpos", "stormfront", "report",
  432.   "roger", "enemyspot", "needbackup",
  433.   "sectorclear", "inposition", "reportingin",
  434.   "getout", "negative", "enemydown",
  435.   "chooseteam", "jointeam 1"
  436. }
  437.   
  438. static const drop_weapons[][] =
  439. {
  440.   "drop"
  441. }

  442. if (get_pcvar_num(kz_use_radio) == 0)
  443.   for ( new i = 0 ; i < sizeof( commands_block ) ; i++ )
  444.   {
  445.    if(equal(szCmd, commands_block[i]))
  446.    return PLUGIN_HANDLED;
  447.   }
  448. else
  449.   return PLUGIN_CONTINUE
  450. if (get_pcvar_num(kz_drop_weapons) == 0)
  451.   for ( new i = 0 ; i < sizeof( drop_weapons ) ; i++ )
  452.   {
  453.    if(equal(szCmd, drop_weapons[i]))
  454.    return PLUGIN_HANDLED
  455.   }
  456. else
  457.   return PLUGIN_CONTINUE
  458. return PLUGIN_CONTINUE
  459. }
  460. public msgStatusIcon( const iMsgId, const iMsgDest, const iPlayer )
  461. {
  462. static szMsg[ 8 ];
  463. get_msg_arg_string( 2, szMsg, 7 );
  464. if( equal( szMsg, "buyzone" ) )
  465. {
  466.   set_pdata_int( iPlayer, OFFSET_BUYZONE, get_pdata_int( iPlayer, OFFSET_BUYZONE ) & ~( 1<<0 ) )
  467.   return PLUGIN_HANDLED
  468. }
  469. return PLUGIN_CONTINUE
  470. }
  471. public CmdRespawn(id)
  472. {
  473. if ( get_user_team(id) == 3 )
  474.   return PLUGIN_HANDLED
  475. else
  476.   ExecuteHamB(Ham_CS_RoundRespawn, id)
  477. return PLUGIN_HANDLED
  478. }
  479. public ct(id)
  480. {
  481. new CsTeams:team = cs_get_user_team(id)
  482. if (team == CS_TEAM_CT)
  483. {
  484.   new Float:velocity[3]
  485.   entity_get_vector(id,EV_VEC_velocity,velocity)
  486.   if ( velocity[ 2 ] != 0 && timer_started[id] )
  487.    return PLUGIN_HANDLED
  488.   if (get_pcvar_num(kz_spec_saves) == 1)
  489.   {
  490.    pev(id, pev_origin, SpecLoc[id])
  491.    if ( timer_started[id] )
  492.    {
  493.     if ( IsPaused[id] )
  494.      Pause(id)
  495.     g_pausetime[id] =   thetime() - timer_time[id]
  496.     timer_time[id] = 0.0
  497.     ColorChat(id, GREEN, "[XJ]^x03 Your timer has been paused.")
  498.    }
  499.   }
  500.   if(gViewInvisible[id])
  501.    gViewInvisible[id] = false
  502.   entity_set_int(id,EV_INT_deadflag,DEAD_DISCARDBODY)
  503.   cs_set_user_team(id,CS_TEAM_SPECTATOR)
  504. }
  505. else
  506. {
  507.   cs_set_user_team(id,CS_TEAM_CT)
  508.   cs_user_spawn(id)
  509.   fm_give_item(id,"weapon_knife")
  510.   fm_give_item(id,"weapon_usp")
  511.   fm_give_item(id,"weapon_usp")
  512.   fm_give_item(id,"weapon_usp")
  513.   if (get_pcvar_num(kz_spec_saves) == 1)
  514.   {
  515.    set_pev(id, pev_origin, SpecLoc[id])
  516.    if ( timer_started [id] )
  517.     timer_time[id] = thetime() - g_pausetime[id] + timer_time[id]
  518.   }
  519.   
  520.   CmdRespawn(id)
  521. }
  522. return PLUGIN_HANDLED
  523. }

  524. //=================== Weapons ==============
  525. public curweapon(id)
  526. {
  527. new WeaponNum = read_data(2)
  528. new WeaponActive = read_data(1)
  529.   if ((WeaponNum != g_WeaponUsed[id]) && WeaponActive)  // if weapon has changed and its the active weapon continue
  530. {
  531.   g_WeaponUsed[id] = WeaponNum
  532.   
  533.   if(get_pcvar_num(kz_maxspeedmsg) == 1)
  534.   {
  535.    new clip, ammo, speed
  536.     switch(get_user_weapon(id,clip,ammo))
  537.    {
  538.     case CSW_SCOUT: speed = 260
  539.     case CSW_C4, CSW_P228, CSW_MAC10, CSW_MP5NAVY, CSW_USP, CSW_TMP, CSW_FLASHBANG, CSW_DEAGLE, CSW_GLOCK18, CSW_SMOKEGRENADE, CSW_ELITE, CSW_FIVESEVEN, CSW_UMP45, CSW_HEGRENADE, CSW_KNIFE:   speed = 250
  540.     case CSW_P90:   speed = 245
  541.     case CSW_XM1014, CSW_AUG, CSW_GALIL, CSW_FAMAS: speed = 240
  542.     case CSW_SG552:  speed = 235
  543.     case CSW_M3, CSW_M4A1:   speed= 230
  544.     case CSW_AK47:   speed = 221
  545.     case CSW_M249:   speed = 220
  546.     case CSW_G3SG1, CSW_SG550, CSW_AWP: speed = 210   
  547.       }
  548.    kz_hud_message(id,"This weapons maxspeed is %d",speed)
  549.   }
  550. }

  551. return PLUGIN_HANDLED
  552. }

  553. public weapons(id)
  554. {
  555. if (!timer_started[id])
  556. {
  557.   if(get_pcvar_num(kz_other_weapons) == 1)
  558.   {
  559.    if(is_user_alive(id))
  560.    {
  561.    new bool:weaponsgiven
  562.    if(!user_has_weapon(id,CSW_KNIFE))
  563.     fm_give_item(id,"weapon_knife")
  564.    if(!user_has_weapon(id,CSW_USP)) {
  565.     fm_give_item(id,"weapon_usp")
  566.     }
  567.    if(!user_has_weapon(id,CSW_SCOUT)) {
  568.     fm_give_item(id, "weapon_scout")
  569.     weaponsgiven = true
  570.     }
  571.    if(!user_has_weapon(id,CSW_P90)) {
  572.     fm_give_item(id, "weapon_p90")
  573.     weaponsgiven = true
  574.     }
  575.    if(!user_has_weapon(id,CSW_FAMAS)) {
  576.     fm_give_item(id, "weapon_famas")
  577.     weaponsgiven = true
  578.    }
  579.    if(!user_has_weapon(id,CSW_SG552)) {
  580.     fm_give_item(id, "weapon_sg552")
  581.     weaponsgiven = true
  582.     }
  583.    if(!user_has_weapon(id,CSW_M4A1)) {
  584.     fm_give_item(id, "weapon_m4a1")
  585.     weaponsgiven = true
  586.     }
  587.    if(!user_has_weapon(id,CSW_M249)) {
  588.     fm_give_item(id, "weapon_m249")
  589.     weaponsgiven = true
  590.    }
  591.    if(!user_has_weapon(id,CSW_AK47)) {
  592.     fm_give_item(id, "weapon_ak47")
  593.     weaponsgiven = true
  594.    }
  595.    if(!user_has_weapon(id,CSW_AWP)) {
  596.     fm_give_item(id, "weapon_awp")
  597.     weaponsgiven = true
  598.    }
  599.    if(weaponsgiven)
  600.     kz_hud_message(id, "You were given some weapons with different speed")
  601.    }
  602.    else
  603.     kz_hud_message(id, "You have to be alive to use this function")
  604.         }
  605.   else
  606.    kz_hud_message(id, "Different weapons are disabled")
  607. }
  608. else
  609.   kz_hud_message(id, "You can not get different weapons during a run, type /reset")

  610. return PLUGIN_HANDLED
  611. }

  612. // ========================= Scout =======================
  613. public cmdScout(id)
  614. {
  615. fm_give_item(id,"weapon_scout")

  616. return PLUGIN_HANDLED
  617. }
  618. public cmdUsp(id)
  619. {
  620. fm_give_item(id,"weapon_usp")
  621. fm_give_item(id,"weapon_knife")

  622. return PLUGIN_HANDLED
  623. }
  624. // ========================== Start location =================

  625. public goStart(id)
  626. {
  627. if( !is_user_alive( id ) )
  628. {
  629.   if (get_pcvar_num(kz_chatorhud) == 1)
  630.    ColorChat(id, GREEN, "[XJ]^x01 You must be alive to use this command.")
  631.   else if (get_pcvar_num(kz_chatorhud) == 2)
  632.    kz_hud_message(id, "You must be alive to use this command")
  633.   return PLUGIN_HANDLED
  634. }
  635. if (IsPaused[id])
  636. {
  637.   kz_hud_message(id, "You can't teleport in pause")
  638.   return PLUGIN_HANDLED
  639. }
  640. if (file_exists(g_Filename))
  641. {
  642.   if(get_pcvar_num(kz_save_autostart) == 1 && AutoStart [id] )
  643.   {
  644.    set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
  645.    set_pev( id, pev_flags, pev(id, pev_flags) | FL_DUCKING )
  646.    set_pev(id, pev_origin, SavedStart [id] )
  647.    if (get_pcvar_num(kz_chatorhud) == 1)
  648.     ColorChat(id, GREEN, "[XJ]^x01 You have been teleported to the start button.")
  649.    else if (get_pcvar_num(kz_chatorhud) == 2)
  650.     kz_hud_message(id, "You have been teleported to the start button")
  651.   }
  652.   else
  653.   {
  654.    new data[64], pos[3], str1[13], str2[13], str3[13]
  655.    new file = fopen(g_Filename, "rt+")
  656.    while(!feof(file))
  657.    {
  658.     fgets(file, data, 63)
  659.     parse(data, str1, 12, str2, 12, str3, 12)
  660.         
  661.     pos[0] = str_to_num(str1)
  662.     pos[1] = str_to_num(str2)
  663.     pos[2] = str_to_num(str3)
  664.         
  665.     set_pev( id, pev_velocity, Float:{ 0.0, 0.0, 0.0 } )
  666.     set_pev( id, pev_gravity, 1.0 )
  667.     engfunc(EngFunc_SetOrigin, id, pos)
  668.    }
  669.    if (get_pcvar_num(kz_chatorhud) == 1)
  670.     ColorChat(id, GREEN, "[XJ]^x01 You have been teleported to the start button.")
  671.    else if (get_pcvar_num(kz_chatorhud) == 2)
  672.     kz_hud_message(id, "You have been teleported to the start button")
  673.    fclose(file)
  674.   }
  675. }
  676. else
  677. {
  678.   if (get_pcvar_num(kz_chatorhud) == 1)
  679.    ColorChat(id, GREEN, "[XJ]^x01 No start position set for this map.")
  680.   else if (get_pcvar_num(kz_chatorhud) == 2)
  681.    kz_hud_message(id, "No start position set for this map")
  682.   CmdRespawn(id)
  683.      }
  684. return PLUGIN_HANDLED
  685. }
  686. public setStart(id, level, cid)
  687. {
  688. if (!cmd_access(id, level, cid, 1))
  689. {
  690.   if (get_pcvar_num(kz_chatorhud) == 1)
  691.    ColorChat(id, GREEN, "[XJ]^x01 You have no acces to that command.")
  692.   else if (get_pcvar_num(kz_chatorhud) == 2)
  693.    kz_hud_message(id, "You have no acces to that command")
  694.    
  695.   return PLUGIN_HANDLED
  696. }
  697.    
  698. if (file_exists(g_Filename))
  699.    delete_file(g_Filename)
  700. new i[3], data[128]
  701. pev(id, pev_origin, i)
  702. formatex(data, 127, "%d %d %d", i[0], i[1], i[2])
  703. write_file(g_Filename, data, 1)
  704. ColorChat(id, GREEN, "[XJ]^x01 Start position set for this map")

  705. return PLUGIN_HANDLED
  706. }
  707. public delStart(id, level, cid)
  708. {
  709. if (!cmd_access(id, level, cid, 1))
  710. {
  711.   if (get_pcvar_num(kz_chatorhud) == 1)
  712.    ColorChat(id, GREEN, "[XJ]^x01 You have no acces to that command.")
  713.   else if (get_pcvar_num(kz_chatorhud) == 2)
  714.    kz_hud_message(id, "You have no acces to that command")
  715.   return PLUGIN_HANDLED
  716. }
  717.    
  718. if (file_exists(g_Filename))
  719. {
  720.   delete_file(g_Filename);
  721.   if (get_pcvar_num(kz_chatorhud) == 1)
  722.    ColorChat(id, GREEN, "[XJ]^x01 Start position deleted.")
  723.   else if (get_pcvar_num(kz_chatorhud) == 2)
  724.    kz_hud_message(id, "Start position deleted")
  725. }
  726. else
  727. {
  728.   if (get_pcvar_num(kz_chatorhud) == 1)
  729.    ColorChat(id, GREEN, "[XJ]^x01 No start position set for this map.")
  730.   else if (get_pcvar_num(kz_chatorhud) == 2)
  731.    kz_hud_message(id, "No start position set for this map")
  732. }
  733. return PLUGIN_HANDLED
  734. }
  735. // ========= Respawn CT if dies ========
  736. public Ham_CBasePlayer_Killed_Post(id)
  737. {
  738. if(get_pcvar_num(kz_respawn_ct) == 1)
  739. {
  740.   if( get_pdata_int(id, 114) == 2 )
  741.   {
  742.    set_pev(id, pev_deadflag, DEAD_RESPAWNABLE)
  743.       fm_set_user_deaths(id, 0)
  744.    fm_set_user_frags(id, 0)
  745.   }
  746. }
  747. }

  748. // ============================= NightVision ================================================
  749. public ToggleNVG(id)
  750. {
  751. if(get_pcvar_num(kz_nvg) == 0)
  752. return PLUGIN_CONTINUE;
  753.    
  754. if ( NightVisionUse[id]  || !is_user_alive(id) )
  755.   StopNVG(id)
  756. else
  757.   StartNVG(id)
  758. return PLUGIN_HANDLED;
  759. }
  760. public StartNVG(id)
  761. {
  762.   
  763. emit_sound(id,CHAN_ITEM,"items/nvg_on.wav",1.0,ATTN_NORM,0,PITCH_NORM)
  764.    
  765. set_task(0.1,"RunNVG",id+111111,_,_,"b")
  766.    
  767. NightVisionUse[id] = true;
  768.    
  769. return PLUGIN_HANDLED
  770. }

  771. public StopNVG(id)
  772. {
  773. emit_sound(id,CHAN_ITEM,"items/nvg_off.wav",1.0,ATTN_NORM,0,PITCH_NORM)
  774. remove_task(id+111111)
  775.    
  776. NightVisionUse[id] = false;
  777. return PLUGIN_HANDLED;
  778. }

  779. public RunNVG(taskid)
  780. {
  781. new id = taskid - 111111
  782.   
  783. if (!is_user_alive(id)) return
  784.    
  785. new origin[3]
  786. get_user_origin(id,origin,3)
  787.    
  788. new color[17];
  789. get_pcvar_string(kz_nvg_colors,color,16);
  790.    
  791. new iRed[5], iGreen[7], iBlue[5]
  792. parse(color,iRed,4,iGreen,6,iBlue,4)
  793.    
  794. message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id)
  795. write_byte(TE_DLIGHT)
  796. write_coord(origin[0])
  797. write_coord(origin[1])
  798. write_coord(origin[2])
  799. write_byte(80)
  800. write_byte(str_to_num(iRed))
  801. write_byte(str_to_num(iGreen))
  802. write_byte(str_to_num(iBlue))
  803. write_byte(2)
  804. write_byte(0)
  805. message_end()
  806. }
  807. // ============================ Hook ==============================================================
  808. public give_hook(id,level,cid)
  809. {
  810. if (!cmd_access(id,level,cid,3) )
  811.   return PLUGIN_HANDLED
  812. new szarg1[32], szarg2[8], bool:mode
  813. read_argv(1,szarg1,32)
  814. read_argv(2,szarg2,32)
  815. if(equal(szarg2,"on"))
  816.   mode = true
  817.   
  818. if(equal(szarg1,"@ALL"))
  819. {
  820.   for(new i=1;i<=MaxPlayers;i++)
  821.   {
  822.    if(is_user_connected(i) && is_user_alive(i))
  823.    {
  824.     canusehook[i] = mode
  825.     if(mode)
  826.     {
  827.      ColorChat(i, GREEN, "[XJ]^x01 Hook has been enabled, bind any key '+hook' to use it.")
  828.     }
  829.    }
  830.   }
  831. }
  832. else
  833. {
  834.   new pid = cmd_target(id,szarg1,2)
  835.   if(pid > 0)
  836.   {
  837.    canusehook[pid] = mode
  838.    if(mode)
  839.    {
  840.     ColorChat(pid, GREEN, "[XJ]^x01 Hook has been enabled, bind any key '+hook' to use it.")
  841.    }
  842.   }
  843. }

  844. return PLUGIN_HANDLED
  845. }
  846. // =================================================================================================
  847. public hook_on(id,level,cid)
  848. {
  849. if( !canusehook[id] && !cmd_access(id,level,cid,1) || !is_user_alive(id) )
  850.   return PLUGIN_HANDLED
  851. if (IsPaused[id])
  852. {
  853.   kz_hud_message(id, "You can't use hook while paused")
  854.   return PLUGIN_HANDLED
  855. }

  856. get_user_origin(id,hookorigin[id],3)
  857. detect_cheat(id,"Hook")
  858. ishooked[id] = true

  859. if (get_pcvar_num(kz_hook_sound) == 1)
  860. emit_sound(id,CHAN_STATIC,"weapons/xbow_hit2.wav",1.0,ATTN_NORM,0,PITCH_NORM)
  861. set_task(0.1,"hook_task",id,"",0,"ab")
  862. hook_task(id)

  863. return PLUGIN_HANDLED
  864. }
  865. // =================================================================================================
  866. public is_hooked(id) {
  867. return ishooked[id]
  868. }
  869. // =================================================================================================
  870. public hook_off(id) {
  871. remove_hook(id)

  872. return PLUGIN_HANDLED
  873. }
  874. // =================================================================================================
  875. public hook_task(id)
  876. {
  877. if(!is_user_connected(id) || !is_user_alive(id))
  878.   remove_hook(id)

  879. remove_beam(id)
  880. draw_hook(id)

  881. new origin[3], Float:velocity[3]
  882. get_user_origin(id,origin)
  883. new distance = get_distance(hookorigin[id],origin)
  884. if(distance > 25)
  885. {
  886.   velocity[0] = (hookorigin[id][0] - origin[0]) * (2.0 * 300 / distance)
  887.   velocity[1] = (hookorigin[id][1] - origin[1]) * (2.0 * 300 / distance)
  888.   velocity[2] = (hookorigin[id][2] - origin[2]) * (2.0 * 300 / distance)
  889.   
  890.   entity_set_vector(id,EV_VEC_velocity,velocity)
  891. }
  892. else
  893. {
  894.   entity_set_vector(id,EV_VEC_velocity,Float:{0.0,0.0,0.0})
  895.   remove_hook(id)
  896. }
  897. }
  898. // =================================================================================================
  899. public draw_hook(id) {
  900. message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  901. write_byte(1)    // TE_BEAMENTPOINT
  902. write_short(id)    // entid
  903. write_coord(hookorigin[id][0]) // origin
  904. write_coord(hookorigin[id][1]) // origin
  905. write_coord(hookorigin[id][2]) // origin
  906. write_short(Sbeam)   // sprite index
  907. write_byte(0)    // start frame
  908. write_byte(0)    // framerate
  909. write_byte(random_num(1,100))    // life
  910. write_byte(random_num(1,20))    // width
  911. write_byte(random_num(1,0))    // noise
  912. if(get_user_team(id) == 1)      // Terrorist
  913. {
  914.   write_byte(random_num(1,255))   // r
  915.   write_byte(random_num(1,255))   // g
  916.   write_byte(random_num(1,255))   // b
  917. }
  918. else       // Counter-Terrorist
  919. {     
  920.   write_byte(random_num(1,255))   // r
  921.   write_byte(random_num(1,255))   // g
  922.   write_byte(random_num(1,255))   // b
  923. }
  924. write_byte(random_num(1,500))    // brightness
  925. write_byte(random_num(1,200))    // speed
  926. message_end()
  927. }
  928. public remove_hook(id)
  929. {
  930. if(task_exists(id))
  931.   remove_task(id)
  932. remove_beam(id)
  933. ishooked[id] = false
  934. }
  935. public remove_beam(id)
  936. {
  937. message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  938. write_byte(99) // TE_KILLBEAM
  939. write_short(id)
  940. message_end()
  941. }

  942. public Demo_CVars(id, level, cid)
  943. {
  944. if (!cmd_access(id, level, cid, 1))
  945. {
  946.   if (get_pcvar_num(kz_chatorhud) == 1)
  947.    ColorChat(id, GREEN, "[XJ]^x01 You have no acces to that command.")
  948.   else if (get_pcvar_num(kz_chatorhud) == 2)
  949.    kz_hud_message(id, "You have no acces to that command")
  950.    
  951.   return PLUGIN_HANDLED
  952. }
  953. set_cvar_num("kz_respawn_ct", 0)
  954. set_cvar_num("kz_drop_weapons",  1)
  955. set_cvar_num("kz_show_timer", 0)
  956. set_cvar_num("kz_remove_drops",  0)
  957. set_cvar_num("kz_drop_weapons",  1)
  958. set_cvar_num("kz_other_weapons",  1)
  959. set_cvar_num("kz_use_radio",  1)
  960. set_cvar_num("kz_pause",  0)
  961. set_cvar_num("kz_semiclip",  0)
  962. set_cvar_num("kz_save_autostart", 0)
  963. Safe = true
  964. ColorChat(id, GREEN, "[XJ]^x01 Plugin is now ^x03safe^x01 for recording.")
  965. return PLUGIN_HANDLED
  966. }
  967. public Public_CVars(id, level, cid)
  968. {
  969. if (!cmd_access(id, level, cid, 1))
  970. {
  971.   if (get_pcvar_num(kz_chatorhud) == 1)
  972.    ColorChat(id, GREEN, "[XJ]^x01 You have no acces to that command.")
  973.   else if (get_pcvar_num(kz_chatorhud) == 2)
  974.    kz_hud_message(id, "You have no acces to that command")
  975.    
  976.   return PLUGIN_HANDLED
  977. }
  978. new kreedz_cfg[128], cfgdir[64]
  979. get_configsdir(cfgdir,64)   
  980. formatex(kreedz_cfg,128,"%s/kz/kreedz.cfg",cfgdir)
  981.         
  982. if( file_exists( kreedz_cfg ) )
  983. {
  984.   server_cmd("exec %s",kreedz_cfg)
  985.   Safe = false
  986. }
  987. else
  988. {
  989.   set_cvar_num("kz_respawn_ct", 0)
  990.   set_cvar_num("kz_drop_weapons",  0)
  991.   set_cvar_num("kz_show_timer", 1)
  992.   set_cvar_num("kz_remove_drops",  1)
  993.   set_cvar_num("kz_drop_weapons",  0)
  994.   set_cvar_num("kz_use_radio",  0)
  995.   set_cvar_num("kz_pause",  1)
  996.   set_cvar_num("kz_semiclip",  1)
  997.   set_cvar_num("kz_save_autostart", 1)
  998.   Safe = false
  999. }
  1000. if (!Safe)
  1001. ColorChat(id, GREEN, "[XJ]^x01 Plugin is now ^x03not safe^x01 for recording.")
  1002. return PLUGIN_HANDLED
  1003. }
  1004. public EventStatusValue( const id )
  1005. {
  1006.    
  1007. new szMessage[ 34 ], Target, aux
  1008. get_user_aiming(id, Target, aux)
  1009. formatex( szMessage, 33, "1 %s: %%p2", get_user_flags( Target ) & KZ_LEVEL ? "VIP" : "Player" )
  1010.    
  1011. message_begin( MSG_ONE_UNRELIABLE, MsgStatusText, _, id )
  1012. write_byte( 0 )
  1013. write_string( szMessage )
  1014. message_end( )
  1015. }
  1016. //============================ VIP In ScoreBoard =================================================
  1017. public MessageScoreAttrib( iMsgID, iDest, iReceiver )
  1018. {
  1019. if( get_pcvar_num(kz_vip) )
  1020. {
  1021.   new iPlayer = get_msg_arg_int( 1 )
  1022.   if( is_user_connected( iPlayer ) && ( get_user_flags( iPlayer ) & KZ_LEVEL ) )
  1023.   {
  1024.    set_msg_arg_int( 2, ARG_BYTE, is_user_alive( iPlayer ) ? SCOREATTRIB_VIP : SCOREATTRIB_DEAD );
  1025.   }
  1026. }
  1027. }  

  1028. // =================================================================================================

  1029. public detect_cheat(id,reason[]) { // I saw this feature in kz_multiplugin :o
  1030.     if(timer_started[id] && get_pcvar_num(kz_cheatdetect) == 1)
  1031.     {
  1032. if (get_pcvar_num(kz_chatorhud) == 1)
  1033.   ColorChat(id, GREEN, "[XJ]^x01 %s detected. Timer resetted.",reason)
  1034. else if (get_pcvar_num(kz_chatorhud) == 2)
  1035.   kz_hud_message(id, "%s detected. Timer resetted.",reason)
  1036. timer_started[id] = false
  1037.     }
  1038. }

  1039. // =================================================================================================
  1040. // Cmds
  1041. // =================================================================================================
  1042. public CheckPoint(id)
  1043. {
  1044. if(get_pcvar_num(kz_checkpoints) == 1)
  1045. {
  1046.   new Float:velocity[3]
  1047.   entity_get_vector(id,EV_VEC_velocity,velocity)
  1048.   if( !is_user_alive( id ) )
  1049.   {
  1050.    if (get_pcvar_num(kz_chatorhud) == 1)
  1051.     ColorChat(id, GREEN, "[XJ]^x01 You must be alive to use this command.")
  1052.    else if (get_pcvar_num(kz_chatorhud) == 2)
  1053.     kz_hud_message(id, "You must be alive to use this command")
  1054.    return PLUGIN_HANDLED
  1055.   }
  1056.   if ( velocity[2]!=0 )
  1057.   {
  1058.    if (get_pcvar_num(kz_chatorhud) == 1)
  1059.     ColorChat(id, GREEN, "[XJ]^x01 You can't make a checkpoint in the air.")
  1060.    else if (get_pcvar_num(kz_chatorhud) == 2)
  1061.     kz_hud_message(id, "You can't make a checkpoint in the air")
  1062.    return PLUGIN_HANDLED
  1063.   }
  1064.   
  1065.   if( IsPaused[id] )
  1066.   {
  1067.    if (get_pcvar_num(kz_chatorhud) == 1 )
  1068.     ColorChat(id, GREEN, "[XJ]^x01 You can't make a checkpoint in pause.")
  1069.    else if (get_pcvar_num(kz_chatorhud) == 2)
  1070.     kz_hud_message(id, "You can't make a checkpoint in pause")
  1071.    
  1072.    return PLUGIN_HANDLED
  1073.   }
  1074.   
  1075.   pev(id, pev_origin, Checkpoints[id][g_bCpAlternate[id] ? 1 : 0])
  1076.   g_bCpAlternate[id] = !g_bCpAlternate[id]
  1077.   checknumbers[id]++
  1078.   if (get_pcvar_num(kz_chatorhud) == 1)
  1079.    ColorChat(id, GREEN, "[XJ]^x01 Checkpoint #%d created.",checknumbers[id])
  1080.   else if (get_pcvar_num(kz_chatorhud) == 2)
  1081.    kz_hud_message(id, "Checkpoint #%d",checknumbers[id])

  1082. }
  1083. else
  1084. {
  1085.   if (get_pcvar_num(kz_chatorhud) == 1)
  1086.    ColorChat(id, GREEN, "[XJ]^x01 Checkpoints are off.")
  1087.   else if (get_pcvar_num(kz_chatorhud) == 2)
  1088.    kz_hud_message(id, "Checkpoints are off")
  1089. }
  1090. return PLUGIN_HANDLED
  1091. }
  1092. public GoCheck(id)
  1093. {
  1094. if( !is_user_alive( id ) )
  1095. {
  1096.   if (get_pcvar_num(kz_chatorhud) == 1)
  1097.    ColorChat(id, GREEN, "[XJ]^x01 You must be alive to use this command.")
  1098.   else if (get_pcvar_num(kz_chatorhud) == 2)
  1099.    kz_hud_message(id, "You must be alive to use this command")
  1100.   return PLUGIN_HANDLED
  1101. }
  1102. if( checknumbers[id] == 0  )
  1103. {
  1104.   if (get_pcvar_num(kz_chatorhud) == 1 )
  1105.    ColorChat(id, GREEN, "[XJ]^x01 You don't have enough Checkpoints.")
  1106.   else if (get_pcvar_num(kz_chatorhud) == 2)
  1107.    kz_hud_message(id, "You don't have enough Checkpoints")
  1108.   return PLUGIN_HANDLED
  1109. }
  1110. if( IsPaused[id] )
  1111. {
  1112.   if (get_pcvar_num(kz_chatorhud) == 1 )
  1113.    ColorChat(id, GREEN, "[XJ]^x01 You can't teleport in pause.")
  1114.   else if (get_pcvar_num(kz_chatorhud) == 2)
  1115.    kz_hud_message(id, "You can't teleport in pause")
  1116.    
  1117.   return PLUGIN_HANDLED
  1118. }

  1119. set_pev( id, pev_velocity, Float:{0.0, 0.0, 0.0} );
  1120. set_pev( id, pev_flags, pev(id, pev_flags) | FL_DUCKING );
  1121. set_pev( id, pev_fuser2, 0.0 );
  1122. engfunc( EngFunc_SetSize, id, {-16.0, -16.0, -18.0 }, { 16.0,  16.0,  18.0 } );
  1123. set_pev(id, pev_origin, Checkpoints[ id ][ !g_bCpAlternate[id] ] )
  1124. gochecknumbers[id]++
  1125. if (get_pcvar_num(kz_chatorhud) == 1)
  1126.   ColorChat(id, GREEN, "[XJ]^x01 GoCheck #%d",gochecknumbers[id])
  1127. else if (get_pcvar_num(kz_chatorhud) == 2)
  1128.   kz_hud_message(id, "GoCheck #%d",gochecknumbers[id])

  1129. return PLUGIN_HANDLED
  1130. }
  1131. public Stuck(id)
  1132. {
  1133. if( !is_user_alive( id ) )
  1134. {
  1135.   if (get_pcvar_num(kz_chatorhud) == 1)
  1136.    ColorChat(id, GREEN, "[XJ]^x01 You must be alive to use this command.")
  1137.   else if (get_pcvar_num(kz_chatorhud) == 2)
  1138.    kz_hud_message(id, "You must be alive to use this command")
  1139.   return PLUGIN_HANDLED
  1140. }
  1141. if( checknumbers[id] < 2 )
  1142. {
  1143.   if (get_pcvar_num(kz_chatorhud) == 1 )
  1144.    ColorChat(id, GREEN, "[XJ]^x01 You don't have enough Checkpoints.")
  1145.   else if (get_pcvar_num(kz_chatorhud) == 2)
  1146.    kz_hud_message(id, "You don't have enough Checkpoints")
  1147.   return PLUGIN_HANDLED
  1148. }
  1149. set_pev( id, pev_velocity, Float:{0.0, 0.0, 0.0} );
  1150. set_pev( id, pev_flags, pev(id, pev_flags) | FL_DUCKING );
  1151. set_pev( id, pev_fuser2, 0.0 );
  1152. engfunc( EngFunc_SetSize, id, {-16.0, -16.0, -18.0 }, { 16.0,  16.0,  18.0 } );
  1153. set_pev(id, pev_origin, Checkpoints[id][g_bCpAlternate[id]] )
  1154. g_bCpAlternate[id] = !g_bCpAlternate[id];

  1155. gochecknumbers[id]++
  1156. if (get_pcvar_num(kz_chatorhud) == 1)
  1157.   ColorChat(id, GREEN, "[XJ]^x01 GoCheck #%d",gochecknumbers[id])
  1158. else if (get_pcvar_num(kz_chatorhud) == 2)
  1159.   kz_hud_message(id, "GoCheck #%d",gochecknumbers[id])

  1160. return PLUGIN_HANDLED;
  1161. }

  1162. // =================================================================================================

  1163. public reset_checkpoints(id)
  1164. {
  1165. checknumbers[id] = 0
  1166. gochecknumbers[id] = 0
  1167. timer_started[id] = false
  1168. timer_time[id] = 0.0
  1169. return PLUGIN_HANDLED
  1170. }

  1171. // =================================================================================================
  1172. //===== Invis =======
  1173. public cmdInvisible(id)
  1174. {
  1175. if(!gViewInvisible[id])
  1176. {
  1177.   gViewInvisible[id] = true
  1178.   if (get_pcvar_num(kz_chatorhud) == 1)
  1179.    ColorChat(id, GREEN, "[XJ]^x01 Players are now ^x03invisible^x01")
  1180.   else if (get_pcvar_num(kz_chatorhud) == 2)
  1181.    kz_hud_message(id, "Players are now invisible")
  1182. }

  1183. else
  1184. {
  1185.   gViewInvisible[id] = false
  1186.   if (get_pcvar_num(kz_chatorhud) == 1)
  1187.    ColorChat(id, GREEN, "[XJ]^x01 Players are now ^x03visible^x01")
  1188.   else if (get_pcvar_num(kz_chatorhud) == 2)
  1189.    kz_hud_message(id, "Players are now visible")
  1190. }
  1191. return PLUGIN_HANDLED
  1192. }
  1193. public cmdWaterInvisible(id)
  1194. {
  1195. if( gWaterFound )
  1196. {
  1197.   if(!gWaterInvisible[id])
  1198.   {
  1199.    gWaterInvisible[id] = true
  1200.    if (get_pcvar_num(kz_chatorhud) == 1)
  1201.     ColorChat(id, GREEN, "[XJ]^x01 Water is now ^x03invisible^x01")
  1202.    else if (get_pcvar_num(kz_chatorhud) == 2)
  1203.     kz_hud_message(id, "Water is now invisible")
  1204.   }
  1205.   else
  1206.   {
  1207.    gWaterInvisible[id] = false
  1208.    if (get_pcvar_num(kz_chatorhud) == 1)
  1209.     ColorChat(id, GREEN, "[XJ]^x01 Water is now ^x03visible^x01")
  1210.    else if (get_pcvar_num(kz_chatorhud) == 2)
  1211.     kz_hud_message(id, "Water is now visible")
  1212.   }
  1213. }
  1214. else
  1215. {
  1216.   if (get_pcvar_num(kz_chatorhud) == 1)
  1217.    ColorChat(id, GREEN, "[XJ]^x01 There is no water on the map.")
  1218.   else if (get_pcvar_num(kz_chatorhud) == 2)
  1219.    kz_hud_message(id, "There is not water on the map")
  1220. }
  1221. return PLUGIN_HANDLED
  1222. }
  1223. public InvisMenu(id)
  1224. {
  1225. new menu = menu_create("\yInvis Menu\w", "InvisMenuHandler")
  1226. menu_setprop(menu, MPROP_PERPAGE, 7)  
  1227. new msginvis[64], msgwaterinvis[64]

  1228. formatex(msginvis, 63, "Players - %s",  gViewInvisible[id] ? "\yON" : "\rOFF" )
  1229. formatex(msgwaterinvis, 63, "Water - %s^n^n", gWaterInvisible[id] ? "\yON" : "\rOFF" )

  1230. menu_additem( menu, msginvis, "1" )
  1231. menu_additem( menu, msgwaterinvis, "2" )
  1232. menu_display(id, menu, 0)
  1233. return PLUGIN_HANDLED
  1234. }
  1235. public InvisMenuHandler (id, menu, item)
  1236. {
  1237. if( item == MENU_EXIT )
  1238. {
  1239.   menu_destroy(menu)
  1240.   return PLUGIN_HANDLED
  1241. }
  1242.    
  1243. new data[6]
  1244. new access, callback
  1245.    
  1246. menu_item_getinfo(menu, item, access, data, 5, _, _, callback)
  1247.    
  1248. new key = str_to_num(data)
  1249. switch(key)
  1250. {
  1251.   case 1:
  1252.   {
  1253.    cmdInvisible(id)
  1254.    InvisMenu(id)
  1255.   }
  1256.   case 2:
  1257.   {
  1258.    cmdWaterInvisible(id)
  1259.    InvisMenu(id)
  1260.   }
  1261.   case 9:
  1262.   {
  1263.    show_menu(id,0,"")
  1264.   }
  1265. }
  1266. return PLUGIN_HANDLED
  1267. }
  1268. public FM_client_AddToFullPack_Post(es, e, ent, host, hostflags, player, pSet)
  1269. {
  1270. if( player )
  1271. {
  1272.   if (get_pcvar_num(kz_semiclip) == 1)
  1273.   {
  1274.    if ( host != ent && get_orig_retval() && is_user_alive(host) )
  1275.        {
  1276.     set_es(es, ES_Solid, SOLID_NOT)
  1277.     set_es(es, ES_RenderMode, kRenderTransAlpha)
  1278.     set_es(es, ES_RenderAmt, 85)
  1279.    }
  1280.   }
  1281.   if(gMarkedInvisible[ent] && gViewInvisible[host])
  1282.   {
  1283.       set_es(es, ES_RenderMode, kRenderTransTexture)
  1284.    set_es(es, ES_RenderAmt, 0)
  1285.    set_es(es, ES_Origin, { 999999999.0, 999999999.0, 999999999.0 } )
  1286.   }
  1287. }
  1288. else
  1289.   if( gWaterInvisible[host] && gWaterEntity[ent] )
  1290.   {
  1291.    set_es(es, ES_Effects, get_es( es, ES_Effects ) | EF_NODRAW )
  1292.   }

  1293. return FMRES_IGNORED
  1294. }
  1295. public Ham_CBasePlayer_PreThink_Post(id)
  1296. {
  1297. if( !is_user_alive(id) )
  1298. {
  1299.   return
  1300. }
  1301. RefreshPlayersList()
  1302. if (get_pcvar_num(kz_semiclip) == 1)
  1303. {
  1304.   for(new i = 0; i<g_iNum; i++)
  1305.   {
  1306.    g_iPlayer = g_iPlayers[i]
  1307.    if( id != g_iPlayer )
  1308.    {
  1309.     set_pev(g_iPlayer, pev_solid, SOLID_NOT)
  1310.    }
  1311.   }
  1312. }
  1313. }
  1314. public client_PostThink(id)
  1315. {
  1316. if( !is_user_alive(id) )
  1317.   return
  1318. RefreshPlayersList()
  1319. if (get_pcvar_num(kz_semiclip) == 1)
  1320.   for(new i = 0; i<g_iNum; i++)
  1321.      {
  1322.          g_iPlayer = g_iPlayers[i]
  1323.          if( g_iPlayer != id )
  1324.     set_pev(g_iPlayer, pev_solid, SOLID_SLIDEBOX)
  1325.      }
  1326. }
  1327. //=================================================================================================

  1328. public noclip(id)
  1329. {
  1330. if(read_argc() == 1 || read_argc() == 2)
  1331. {
  1332.   fm_set_user_noclip(id,fm_get_user_noclip(id) == 1 ? 0 : 1)
  1333.   if(fm_get_user_noclip(id) == 1)
  1334.    detect_cheat(id,"Noclip")
  1335. }
  1336.    
  1337. return PLUGIN_HANDLED
  1338. }

  1339. // =================================================================================================


  1340. stock _fm_set_entity_flags(index, flag, onoff)
  1341. {
  1342. new flags = pev(index, pev_flags)
  1343. if ((flags & flag) > 0)
  1344.   return onoff == 1 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags - flag)
  1345. else
  1346.   return onoff == 0 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags + flag)

  1347. return 0
  1348. }
  1349. stock fm_set_user_deaths(index, deaths) //fun
  1350. {
  1351.   set_pdata_int(index, 444, deaths, 5)
  1352. }
  1353. stock Float:thetime()
  1354. {
  1355. return get_gametime()
  1356. }
  1357. stock fm_set_user_frags(index, frags) //fun
  1358. {
  1359. set_pev ( index, pev_frags, float(frags) )

  1360. return 1
  1361. }
  1362. stock fix_score_team(id, const TEAM[])
  1363. {
  1364. emessage_begin(MSG_BROADCAST, TeamInfo );
  1365. ewrite_byte(id);
  1366. ewrite_string(TEAM);
  1367. emessage_end();
  1368. }
  1369. stock fm_give_item(index, const item[])
  1370. {
  1371. if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))
  1372.   return 0;
  1373. new ent = fm_create_entity(item);
  1374. if (!pev_valid(ent))
  1375.   return 0;
  1376. new Float:origin[3];
  1377. pev(index, pev_origin, origin);
  1378. set_pev(ent, pev_origin, origin);
  1379. set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN);
  1380. dllfunc(DLLFunc_Spawn, ent);
  1381. new save = pev(ent, pev_solid);
  1382. dllfunc(DLLFunc_Touch, ent, index);
  1383. if (pev(ent, pev_solid) != save)
  1384.   return ent;
  1385. engfunc(EngFunc_RemoveEntity, ent);
  1386. return -1;
  1387. }
  1388. stock fm_create_entity(const classname[]) // I dont like macros ;P
  1389. return engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, classname))
  1390. stock fm_strip_user_weapons(index)
  1391. {
  1392. new ent = fm_create_entity("player_weaponstrip");
  1393. if( !pev_valid(ent) )
  1394.   return 0;

  1395. set_pev(ent, pev_owner, index)
  1396. dllfunc(DLLFunc_Spawn, ent);
  1397. dllfunc(DLLFunc_Use, ent, index);
  1398. engfunc(EngFunc_RemoveEntity, ent);
  1399. return 1;
  1400. }
  1401. stock fm_set_user_godmode(index, godmode = 0)
  1402. {
  1403. set_pev(index, pev_takedamage, godmode == 1 ? 0.0 : 2.0)
  1404. return 1;
  1405. }

  1406. stock fm_set_user_noclip(index, noclip = 0)
  1407. {
  1408. set_pev(index, pev_movetype, noclip == 1 ? MOVETYPE_NOCLIP : MOVETYPE_WALK);
  1409. return 1;
  1410. }
  1411. stock fm_get_user_noclip(index)
  1412. {
  1413. return (pev(index, pev_movetype) == MOVETYPE_NOCLIP )
  1414. }
  1415. stock kz_hud_message(id, const message[], {Float,Sql,Result,_}:...)
  1416. {
  1417. static msg[192], colors[12], r[4], g[4], b[4];
  1418. vformat(msg, 191, message, 3);

  1419. get_pcvar_string(kz_hud_color, colors, 11)
  1420. parse(colors, r, 3, g, 3, b, 4)

  1421. set_hudmessage(str_to_num(r), str_to_num(g), str_to_num(b), -1.0, 0.90, 0, 0.0, 2.0, 0.0, 1.0, -1);
  1422. ShowSyncHudMsg(id, hud_message, msg);
  1423. }

  1424. public FwdSpawnWeaponbox( iEntity )
  1425. {
  1426. if(get_pcvar_num(kz_remove_drops) == 1)
  1427. {
  1428.   set_pev( iEntity, pev_flags, FL_KILLME )
  1429.   dllfunc( DLLFunc_Think, iEntity )
  1430. }

  1431. return HAM_IGNORED
  1432. }
  1433. public FwdHamDoorSpawn( iEntity )
  1434. {
  1435. static const szNull[ ] = "common/null.wav";

  1436. new Float:flDamage;
  1437. pev( iEntity, pev_dmg, flDamage );

  1438. if( flDamage < -999.0 ) {
  1439.   set_pev( iEntity, pev_noise1, szNull );
  1440.   set_pev( iEntity, pev_noise2, szNull );
  1441.   set_pev( iEntity, pev_noise3, szNull );
  1442.   
  1443.   if( !HealsOnMap )
  1444.    HealsOnMap = true
  1445. }
  1446. }
  1447. public FwdHamPlayerSpawn( id )
  1448. {
  1449. if( !is_user_alive( id ) )
  1450.   return;
  1451. if( HealsOnMap )
  1452.   set_pev( id, pev_health, 50175.0 )
  1453.   
  1454. if( IsPaused[id] )
  1455. {
  1456.   set_pev(id, pev_flags, pev(id, pev_flags) | FL_FROZEN)
  1457.   set_pev(id, pev_origin, PauseOrigin[id])
  1458. }
  1459. }
  1460. public GroundWeapon_Touch(iWeapon, id)
  1461. {
  1462. if( is_user_alive(id) && timer_started[id] && !Safe )
  1463.   return HAM_SUPERCEDE
  1464. return HAM_IGNORED
  1465. }

  1466. // =================================================================================================
  1467. // Events / Forwards
  1468. // =================================================================================================

  1469. public resethud(id)
  1470. {
  1471. if( get_pcvar_num(kz_godmode) == 1 )
  1472.   fm_set_user_godmode(id,1)
  1473. else
  1474.   fm_set_user_godmode(id,0)
  1475.    
  1476. if( !user_has_weapon(id,CSW_KNIFE) )
  1477.   fm_give_item( id,"weapon_knife" )
  1478.    
  1479.    
  1480. if(firstspawn[id])
  1481. {
  1482.   ColorChat(id, GREEN, "[XJ]^x01 Welcome to ^x03nucLeaRKz.Idle.Ro ^x01")
  1483.   ColorChat(id, GREEN, "[XJ]^x01 Visit ^x03www.KZ-Romania.com ^x01")
  1484.   if(get_pcvar_num(kz_checkpoints) == 0)
  1485.    ColorChat(id, GREEN, "[XJ]^x01 Checkpoints are off.")
  1486.   if(get_pcvar_num(kz_spawn_mainmenu) == 1)
  1487.    kz_menu (id)
  1488. }
  1489. firstspawn[id] = false
  1490. }

  1491. //=================================================================================================

  1492. public client_disconnect(id)
  1493. {
  1494. checknumbers[id] = 0
  1495. gochecknumbers[id] = 0
  1496. timer_started[id] = false
  1497. ShowTime[id] = true
  1498. firstspawn[id] = true
  1499. NightVisionUse[id] = false
  1500. IsPaused[id] = false
  1501. remove_hook(id)
  1502. }

  1503. public client_putinserver(id)
  1504. {
  1505. checknumbers[id] = 0
  1506. gochecknumbers[id] = 0
  1507. timer_started[id] = false
  1508. ShowTime[id] = true
  1509. firstspawn[id] = true
  1510. NightVisionUse[id] = false
  1511. IsPaused[id] = false
  1512. remove_hook(id)
  1513. }

  1514. // =================================================================================================
  1515. // Menu
  1516. // =================================================================================================

  1517. public kz_menu(id)
  1518. {
  1519. new menu = menu_create("\yProKreedz Menu\w", "MenuHandler")
  1520. menu_setprop(menu, MPROP_PERPAGE, 0)  
  1521. new msgcheck[64], msggocheck[64], msgshowtimer[64], msgpause[64]
  1522. formatex(msgcheck, 63, "Checkpoint - \y#%i", checknumbers[id])
  1523. formatex(msggocheck, 63, "Gocheck - \y#%i",  gochecknumbers[id])
  1524. formatex(msgshowtimer, 63, "Timer - %s",  ShowTime[id] ? "\yON" : "\rOFF" )
  1525. formatex(msgpause, 63, "Pause - %s^n", IsPaused[id] ? "\yON" : "\rOFF" )

  1526. menu_additem( menu, msgcheck, "1" )
  1527. menu_additem( menu, msggocheck, "2" )
  1528. menu_additem( menu, "Top 15^n", "3")
  1529. menu_additem( menu, "Start", "4")
  1530. menu_additem( menu, msgshowtimer, "5" )
  1531. menu_additem( menu, msgpause, "6" )
  1532. menu_additem( menu, "Invisible Menu", "7" )
  1533. menu_additem( menu, "Spectator/CT", "8" )
  1534. menu_additem( menu, "Reset Time^n", "9")
  1535. menu_additem( menu, "Exit", "*" )

  1536. menu_display(id, menu, 0)
  1537. return PLUGIN_HANDLED
  1538. }
  1539. public MenuHandler(id , menu, item)
  1540. {
  1541. if( item == MENU_EXIT ) {
  1542.   menu_destroy(menu)
  1543.   return PLUGIN_HANDLED
  1544. }
  1545.    
  1546. new data[6], name[32]
  1547. new access, callback
  1548.    
  1549. menu_item_getinfo(menu, item, access, data, 5, _, _, callback)
  1550.    
  1551. new key = str_to_num(data)
  1552. get_user_name(id, name, 31)
  1553. switch(key) {
  1554.   case 1:{
  1555.    CheckPoint(id)
  1556.    kz_menu(id)
  1557.   }
  1558.   case 2:{
  1559.    GoCheck(id)
  1560.    kz_menu(id)
  1561.   }
  1562.   case 3:{
  1563.    top15menu(id)
  1564.   }
  1565.   case 4:{
  1566.    goStart(id)
  1567.    kz_menu(id)
  1568.   }
  1569.   case 5:{
  1570.    ShowTimer_Task(id)
  1571.    kz_menu(id)
  1572.   }
  1573.   case 6:{
  1574.    Pause(id)
  1575.    kz_menu(id)
  1576.   }
  1577.   case 7:{
  1578.    InvisMenu(id)
  1579.   }
  1580.   case 8:{
  1581.    ct(id)
  1582.    
  1583.   }
  1584.   case 9:{
  1585.    reset_checkpoints(id)
  1586.    kz_menu(id)
  1587.   }
  1588.   case '*':{
  1589.   }
  1590. }
  1591. return PLUGIN_HANDLED
  1592. }
  1593. public top15menu(id)
  1594. {
  1595. new menu = menu_create("\r[nucLeaR-Kz] \yTop15 \w", "top15handler")
  1596. menu_additem(menu, "\wPro 15", "1", 0)
  1597. menu_additem(menu, "\wNoob 15^n^n", "2", 0)
  1598. menu_additem(menu, "\wMain Menu", "5", 0)

  1599. menu_display(id, menu, 0);

  1600. return PLUGIN_HANDLED;
  1601. }
  1602. public top15handler(id, menu, item)
  1603. {
  1604. if(item == MENU_EXIT)
  1605. {
  1606.   menu_destroy(menu)
  1607.   return PLUGIN_HANDLED
  1608. }

  1609. new data[6], iName[64]
  1610. new iaccess, callback

  1611. menu_item_getinfo(menu, item, iaccess, data,5, iName, 63, callback)

  1612. new key = str_to_num(data);

  1613. switch(key)
  1614. {
  1615.   case 1:
  1616.   {
  1617.    ProTop_show(id)
  1618.   }
  1619.   case 2:
  1620.   {
  1621.    NoobTop_show(id)
  1622.   }
  1623.   case 5:
  1624.   {
  1625.    kz_menu(id)
  1626.   }
  1627.   case 9:
  1628.   {
  1629.    show_menu(id,0,"")
  1630.   }
  1631. }

  1632. return PLUGIN_HANDLED;
  1633. }
  1634. // =================================================================================================
  1635. //
  1636. // Timersystem
  1637. // =================================================================================================
  1638. public fwdUse(ent, id)
  1639. {
  1640. if( !ent || id > 32 )
  1641. {
  1642.   return HAM_IGNORED;
  1643. }

  1644. if( !is_user_alive(id) )
  1645. {
  1646.   return HAM_IGNORED;
  1647. }

  1648. new name[32]
  1649. get_user_name(id, name, 31)

  1650. new szTarget[ 32 ];
  1651. entity_get_string( ent, EV_SZ_target, szTarget, 31 );

  1652. if( TrieKeyExists( g_tStarts, szTarget ) )
  1653. {
  1654.   if ( reset_checkpoints(id) && !timer_started[id] && !ishooked[id] )
  1655.   {
  1656.    start_climb(id)
  1657.    
  1658.    if(get_pcvar_num(kz_strip_other_weapons) == 1)
  1659.     for(new i = 0; i < 8; i++)
  1660.      if( user_has_weapon(id, other_top_weapons[i])  )
  1661.      {
  1662.       fm_strip_user_weapons(id)
  1663.       fm_give_item(id,"weapon_knife")
  1664.       fm_give_item(id,"weapon_usp")
  1665.       set_pdata_int(id, 382, 24, 5)
  1666.      }
  1667.    if( pev(id, pev_health) < 100 )
  1668.     set_pev(id, pev_health, 100.0)
  1669.    if( !file_exists(g_Filename))
  1670.    {
  1671.     new i[3], data[128];
  1672.     pev(id, pev_origin, i);
  1673.     formatex(data, 127, "%d %d %d", i[0], i[1], i[2]);
  1674.     write_file(g_Filename, data, 1);
  1675.          
  1676.     ColorChat(id, GREEN, "[XJ]^x01 Start position set for this map." )
  1677.    }
  1678.   
  1679.    if(get_pcvar_num(kz_save_autostart) == 1)
  1680.    {
  1681.     AutoStart[id] = true;
  1682.     pev(id, pev_origin, SavedStart[id])
  1683.    }
  1684.    remove_hook(id)
  1685.   }
  1686.   
  1687. }

  1688. if( TrieKeyExists( g_tStops, szTarget ) )
  1689. {
  1690.   if( timer_started[id] )
  1691.   {
  1692.    finish_climb(id)
  1693.    if(get_pcvar_num(kz_hook_prize) == 1 && !canusehook[id])
  1694.    {
  1695.     canusehook[id] = true
  1696.     ColorChat(id, GREEN, "[XJ]^x01 Hook has been enabled, bind any key '+hook' to use it.")
  1697.    }
  1698.   }
  1699.   else
  1700.    kz_hud_message(id, "You must press the start button first")
  1701.   }
  1702. return HAM_IGNORED
  1703. }
  1704. public start_climb(id)
  1705. {

  1706. if (get_pcvar_num(kz_chatorhud) == 1)
  1707.   ColorChat(id, GREEN, "[XJ]^x01 Timer started.")
  1708. else
  1709.   kz_hud_message(id, "Timer started")
  1710. set_pev(id, pev_gravity, 1.0);
  1711. if (get_pcvar_num(kz_godmode) == 0)
  1712.   set_pev(id, pev_takedamage, DAMAGE_AIM)
  1713. set_pev(id, pev_movetype, MOVETYPE_WALK)
  1714. reset_checkpoints(id)
  1715. IsPaused[id] = false
  1716. timer_started[id] = true
  1717. timer_time[id] = thetime()  
  1718. }

  1719. public finish_climb(id)
  1720. {
  1721. if (!is_user_alive (id))
  1722. {
  1723.   return;
  1724. }
  1725. new Float: time
  1726. time = thetime() - timer_time[id]
  1727. show_finish_message(id, time)
  1728. timer_started[id] = false
  1729. if (gochecknumbers[id] == 0 &&  !user_has_weapon(id,CSW_SCOUT) )
  1730.   ProTop_update(id, time)
  1731. if (gochecknumbers[id] > 0 || user_has_weapon(id,CSW_SCOUT) )
  1732.   NoobTop_update(id, time, checknumbers[id], gochecknumbers[id])
  1733. }
  1734. public show_finish_message(id, Float:kreedztime)
  1735. {
  1736. new name[32]
  1737. new imin,isec,ims
  1738. get_user_name(id, name, 31)
  1739. kreedztime = thetime() - timer_time[id]
  1740. imin = floatround(kreedztime / 60.0, floatround_floor)
  1741. isec = floatround(kreedztime - imin * 60.0,floatround_floor)
  1742. ims = floatround( ( kreedztime - ( imin * 60.0 + isec ) ) * 100.0, floatround_floor )

  1743. ColorChat(0, GREEN, "[XJ]^x01 ^x03%s^x01 finished the map in^x04 %02i:%02i.%02i ^x01(%d CP%s, %d TP%s) %s!",name,imin,isec,ims,checknumbers[id],checknumbers[id] == 1 ? "" : "s",gochecknumbers[id],gochecknumbers[id] == 1 ? "" : "s", user_has_weapon(id,CSW_SCOUT) ? "^x03using scout": "")
  1744. }
  1745. //==========================================================
  1746. public ProTop_update(id, Float:time)
  1747. {
  1748. new authid[32], name[32], thetime[32];
  1749. get_user_name(id, name, 31);
  1750. get_user_authid(id, authid, 31);
  1751. get_time(" %d/%m/%Y ", thetime, 31);
  1752. new bool:Is_in_pro15
  1753. Is_in_pro15 = false

  1754. for(new i = 0; i < 15; i++)
  1755. {
  1756.   if( equali(Pro_AuthIDS[i], authid) )
  1757.   {
  1758.    Is_in_pro15 = true
  1759.   }
  1760. }

  1761. for (new i = 0; i < 15; i++)
  1762. {
  1763.   new Float:protiempo = Pro_Times[i]
  1764.   
  1765.   if( time < Pro_Times[i])
  1766.   {
  1767.    new pos = i
  1768.    
  1769.    while( !equal(Pro_AuthIDS[pos], authid) && pos < 15 )
  1770.    {
  1771.     pos++;
  1772.    }
  1773.    
  1774.    for (new j = pos; j > i; j--)
  1775.    {
  1776.     formatex(Pro_AuthIDS[j], 31, Pro_AuthIDS[j-1]);
  1777.     formatex(Pro_Names[j], 31, Pro_Names[j-1]);
  1778.     formatex(Pro_Date[j], 31, Pro_Date[j-1])
  1779.     Pro_Times[j] = Pro_Times[j-1];
  1780.    }
  1781.    
  1782.    formatex(Pro_AuthIDS[i], 31, authid);
  1783.    formatex(Pro_Names[i], 31, name);
  1784.    formatex(Pro_Date[i], 31, thetime)
  1785.    Pro_Times[i] = time
  1786.    
  1787.    //No olvidarse !! Aca poner para que lo Grabe :D
  1788.    save_pro15()
  1789.    
  1790.    if( Is_in_pro15 )
  1791.    {
  1792.     if( time < protiempo )
  1793.     {
  1794.      
  1795.      if( (i + 1) == 1)
  1796.      {
  1797.       client_cmd(0, "spk woop");
  1798.       ColorChat(0, GREEN, "[XJ]^x01 ^x03%s^x01 is now ^x03Leet^x01 in ^x04Pro 15^x01" , name);
  1799.      }
  1800.      else
  1801.      {
  1802.       client_cmd(0, "spk buttons/bell1");
  1803.       ColorChat(0, GREEN, "[XJ]^x01 ^x03%s^x01 is now on place ^x03%d^x01 in ^x04Pro 15^x01" , name , (i+1));
  1804.      }
  1805.     }
  1806.    }
  1807.    else
  1808.    {
  1809.     if( (i + 1) == 1)
  1810.     {
  1811.      client_cmd(0, "spk woop");
  1812.      ColorChat(0, GREEN, "[XJ]^x01 ^x03%s^x01 is now ^x03Leet^x01 in ^x04Pro 15^x01" , name);
  1813.     }
  1814.     else
  1815.     {
  1816.      client_cmd(0, "spk buttons/bell1");
  1817.      ColorChat(0, GREEN, "[XJ]^x01 ^x03%s^x01 is now on place ^x03%d^x01 in ^x04Pro 15^x01" , name , (i+1));
  1818.     }
  1819.    }
  1820.    
  1821.    return;
  1822.   }
  1823.   if( equali(Pro_AuthIDS[i], authid) )
  1824.   {
  1825.    if( time > protiempo )
  1826.    {
  1827.     return;
  1828.    }
  1829.   }
  1830.   
  1831. }
  1832. }
  1833. public save_pro15()
  1834. {
  1835. new mapname[33], profile[128]
  1836. get_mapname(mapname, 32)
  1837. formatex(profile, 127, "%s/pro_%s.cfg", KZ_TOP15_DIR, mapname)

  1838. if( file_exists(profile) )
  1839. {
  1840.   delete_file(profile)
  1841. }
  1842.    
  1843. new Data[256];
  1844. new f = fopen(profile, "at")

  1845. for(new i = 0; i < 15; i++)
  1846. {
  1847.   formatex(Data, 255, "^"%.2f^"   ^"%s^"   ^"%s^"   ^"%s^"^n", Pro_Times[i], Pro_AuthIDS[i], Pro_Names[i], Pro_Date[i])
  1848.   fputs(f, Data)
  1849. }
  1850. fclose(f);
  1851. }
  1852. public read_pro15()
  1853. {
  1854. new mapname[33], profile[128], prodata[256]
  1855. get_mapname(mapname, 32)
  1856. formatex(profile, 127, "%s/pro_%s.cfg", KZ_TOP15_DIR, mapname)

  1857. new f = fopen(profile, "rt" )
  1858. new i = 0
  1859. while( !feof(f) && i < 16)
  1860. {
  1861.   fgets(f, prodata, 255)
  1862.   new totime[25]
  1863.   parse(prodata, totime, 24, Pro_AuthIDS[i], 31, Pro_Names[i], 31, Pro_Date[i], 31)
  1864.   Pro_Times[i] = str_to_float(totime)
  1865.   i++;
  1866. }
  1867. fclose(f)
  1868. }
  1869. //==================================================================================================
  1870. public NoobTop_update(id, Float:time, checkpoints, gochecks)
  1871. {
  1872. new authid[32], name[32], thetime[32];
  1873. get_user_name(id, name, 31);
  1874. get_user_authid(id, authid, 31);
  1875. get_time(" %d/%m/%Y ", thetime, 31);
  1876. new bool:Is_in_noob15
  1877. Is_in_noob15 = false

  1878. for(new i = 0; i < 15; i++)
  1879. {
  1880.   if( equali(Noob_AuthIDS[i], authid) )
  1881.   {
  1882.    Is_in_noob15 = true
  1883.   }
  1884. }

  1885. for (new i = 0; i < 15; i++)
  1886. {
  1887.   new Float:noobtiempo = Noob_Tiempos[i]
  1888.   
  1889.   if( time < Noob_Tiempos[i])
  1890.   {
  1891.    new pos = i
  1892.    
  1893.    while( !equal(Noob_AuthIDS[pos], authid) && pos < 15 )
  1894.    {
  1895.     pos++;
  1896.    }
  1897.    
  1898.    for (new j = pos; j > i; j--)
  1899.    {
  1900.     formatex(Noob_AuthIDS[j], 31, Noob_AuthIDS[j-1]);
  1901.     formatex(Noob_Names[j], 31, Noob_Names[j-1]);
  1902.     formatex(Noob_Date[j], 31, Noob_Date[j-1])
  1903.     Noob_Tiempos[j] = Noob_Tiempos[j-1]
  1904.     Noob_CheckPoints[j] = Noob_CheckPoints[j-1]
  1905.     Noob_GoChecks[j] = Noob_GoChecks[j-1]
  1906.    }
  1907.    
  1908.    formatex(Noob_AuthIDS[i], 31, authid);
  1909.    formatex(Noob_Names[i], 31, name);
  1910.    formatex(Noob_Date[i], 31, thetime)
  1911.    Noob_Tiempos[i] = time
  1912.    Noob_CheckPoints[i] = checkpoints
  1913.    Noob_GoChecks[i] = gochecks
  1914.    
  1915.    save_Noob15()
  1916.    
  1917.    if( Is_in_noob15 )
  1918.    {
  1919.     if( time < noobtiempo )
  1920.     {
  1921.      if( (i + 1) == 1)
  1922.      {
  1923.       client_cmd(0, "spk woop")
  1924.       ColorChat(0, GREEN, "[XJ]^x01 ^x03%s^x01 is now ^x03Leet^x01 in ^x04Noob 15^x01" , name);
  1925.      }
  1926.      else
  1927.      {
  1928.       client_cmd(0, "spk buttons/bell1")
  1929.       ColorChat(0, GREEN, "[XJ]^x01 ^x03%s^x01 is now on place ^x03%d^x01 in ^x04Noob 15^x01" , name , (i+1));
  1930.      }
  1931.     }
  1932.    }
  1933.    else
  1934.    {
  1935.     if( (i + 1) == 1)
  1936.     {
  1937.      client_cmd(0, "spk woop");
  1938.      ColorChat(0, GREEN, "[XJ]^x01 ^x03%s^x01 is now ^x03Leet^x01 in ^x04Noob 15^x01" , name);
  1939.     }
  1940.     else
  1941.     {
  1942.      client_cmd(0, "spk buttons/bell1");
  1943.      ColorChat(0, GREEN, "[XJ]^x01 ^x03%s^x01 is now on place ^x03%d^x01 in ^x04Noob 15^x01" , name , (i+1));
  1944.     }
  1945.    }
  1946.    
  1947.    return;
  1948.   }
  1949.   if( equali(Noob_AuthIDS[i], authid) )
  1950.   {
  1951.    if( time > noobtiempo )
  1952.    {
  1953.     return;
  1954.    }
  1955.   }
  1956.   
  1957. }
  1958. }
  1959. public save_Noob15()
  1960. {
  1961. new mapname[33], profile[128]
  1962. get_mapname(mapname, 32)
  1963. formatex(profile, 127, "%s/Noob_%s.cfg", KZ_TOP15_DIR, mapname)

  1964. if( file_exists(profile) )
  1965. {
  1966.   delete_file(profile)
  1967. }
  1968.    
  1969. new Data[256];
  1970. new f = fopen(profile, "at")

  1971. for(new i = 0; i < 15; i++)
  1972. {
  1973.   formatex(Data, 255, "^"%.2f^"   ^"%s^"   ^"%s^"   ^"%i^"   ^"%i^"   ^"%s^" ^n", Noob_Tiempos[i], Noob_AuthIDS[i], Noob_Names[i],Noob_CheckPoints[i], Noob_GoChecks[i],Noob_Date[i])
  1974.   fputs(f, Data)
  1975. }
  1976. fclose(f);
  1977. }
  1978. public read_Noob15()
  1979. {
  1980. new mapname[33], profile[128], prodata[256]
  1981. get_mapname(mapname, 32)
  1982. formatex(profile, 127, "%s/Noob_%s.cfg", KZ_TOP15_DIR, mapname)

  1983. new f = fopen(profile, "rt" )
  1984. new i = 0
  1985. while( !feof(f) && i < 16)
  1986. {
  1987.   fgets(f, prodata, 255)
  1988.   new totime[25], checks[5], gochecks[5]
  1989.   parse(prodata, totime, 24, Noob_AuthIDS[i], 31, Noob_Names[i], 31,  checks, 4, gochecks, 4, Noob_Date[i], 31)
  1990.   Noob_Tiempos[i] = str_to_float(totime)
  1991.   Noob_CheckPoints[i] = str_to_num(checks)
  1992.   Noob_GoChecks[i] = str_to_num(gochecks)
  1993.   i++;
  1994. }
  1995. fclose(f)
  1996. }

  1997. //==================================================================================================

  1998. public ProTop_show(id)
  1999. {  
  2000. new  buffer[2048], len, name[32]
  2001. len = formatex(buffer, 2047, "<body bgcolor=#000000><table width=100%% cellpadding=2 cellspacing=0 border=0>")
  2002. len += formatex(buffer[len], 2047-len, "<tr  align=center bgcolor=#52697B><th width=5%%> # <th width=30%% align=left> Player <th  width=25%%> Time <th width=20%%> Date ")
  2003.   
  2004. for (new i = 0; i < 15; i++)
  2005. {
  2006.   name = Pro_Names[i]
  2007.   
  2008.   if( Pro_Times[i] > 9999999.0 )
  2009.   {
  2010.    len += formatex(buffer[len], 2047-len, "<tr align=center%s><td> %d <td align=left> %s <td> %s <td> %s", ((i%2)==0) ? " bgcolor=#FFFFFF" : " bgcolor=#A8A8A8", (i+1), "", "", "")
  2011.   }
  2012.   else
  2013.   {
  2014.    new minutos, Float:segundos
  2015.    minutos = floatround(Pro_Times[i], floatround_floor)/60
  2016.    segundos = Pro_Times[i] - (60*minutos)
  2017.    len += formatex(buffer[len], 2047-len, "<tr align=center%s><td> %d <td align=left> %s <td> %02d:%s%.2f <td> %s", ((i%2)==0) ? " bgcolor=#FFFFFF" : " bgcolor=#A8A8A8", (i+1), Pro_Names[i], minutos, segundos < 10 ? "0" : "", segundos, Pro_Date[i])
  2018.   }
  2019. }
  2020. len += formatex(buffer[len], 2047-len, "</table></body>")
  2021.   
  2022. show_motd(id, buffer, "Pro15 Climbers")
  2023. return PLUGIN_HANDLED
  2024. }
  2025. public NoobTop_show(id)
  2026. {
  2027. new buffer[2048], name[32], len
  2028. len = formatex(buffer, 2047, "<body bgcolor=#000000><table width=100%% cellpadding=2 cellspacing=0 border=0>")
  2029. len += formatex(buffer[len], 2047-len, "<tr  align=center bgcolor=#52697B><th width=5%%> # <th width=25%% align=left> Player <th  width=20%%> Time  <th width=15%%> Checkpoints <th width=15%%> GoChecks <th width=20%%> Date ")
  2030.   
  2031. for (new i = 0; i < 15; i++)
  2032. {  
  2033.   if( Noob_Tiempos[i] > 9999999.0 )
  2034.   {
  2035.    len += formatex(buffer[len], 2047-len, "<tr align=center%s><td> %d <td align=left> %s <td> %s <td> %s <td> %s <td> %s", ((i%2)==0) ? " bgcolor=#FFFFFF" : " bgcolor=#A8A8A8", (i+1), "", "", "", "", "")
  2036.   }
  2037.   else
  2038.   {
  2039.    name = Noob_Names[i]
  2040.    new minutos, Float:segundos
  2041.    minutos = floatround(Noob_Tiempos[i], floatround_floor)/60
  2042.    segundos = Noob_Tiempos[i] - (60*minutos)
  2043.    
  2044.    len += formatex(buffer[len], 2047-len, "<tr align=center%s><td> %d <td align=left> %s <td> %02d:%s%.2f <td> %d <td> %d <td> %s", ((i%2)==0) ? " bgcolor=#FFFFFF" : " bgcolor=#A8A8A8", (i+1), Noob_Names[i], minutos, segundos < 10 ? "0" : "", segundos, Noob_CheckPoints[i], Noob_GoChecks[i], Noob_Date[i])
  2045.   }
  2046. }

  2047. len += formatex(buffer[len], 2047-len, "</table></body>")
  2048.   
  2049. show_motd(id, buffer, "Noob15 Climbers")
  2050. return PLUGIN_HANDLED
  2051. }
复制代码
  1. /* Copyright ?2008, ConnorMcLeod
  2. func_door is free software;
  3. you can redistribute it and/or modify it under the terms of the
  4. GNU General Public License as published by the Free Software Foundation.
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License
  10. along with func_door; if not, write to the
  11. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  12. Boston, MA 02111-1307, USA.
  13. */
  14. #include <amxmodx>
  15. #include <amxmisc>
  16. #include <fakemeta>
  17. #include <hamsandwich>
  18. #include <xs>
  19. #define VERSION "1.0.3"
  20. #pragma semicolon 1
  21. #define MAKE_DOORS_SILENT
  22. //#define MAKE_TELEPORT_FX
  23. #define MAX_PLAYERS 32
  24. #define MAX_ENTSARRAYS_SIZE 64
  25. #define SF_BUTTON_TOUCH_ONLY 256
  26. #define SetIdBits(%1,%2)  %1 |= 1<<(%2 & 31)
  27. #define ClearIdBits(%1,%2) %1 &= ~( 1<<(%2 & 31) )
  28. #define GetIdBits(%1,%2)  %1 &  1<<(%2 & 31)
  29. #define SetEntBits(%1,%2) %1[%2>>5] |=  1<<(%2 & 31)
  30. #define ClearEntBits(%1,%2) %1[%2>>5] &= ~( 1 << (%2 & 31) )
  31. #define GetEntBits(%1,%2) %1[%2>>5] &   1<<(%2 & 31)
  32. enum _:BlocksClasses
  33. {
  34. FUNC_DOOR,
  35. FUNC_WALL_TOGGLE,
  36. FUNC_BUTTON,
  37. TRIGGER_MULTIPLE
  38. }
  39. enum _:Colors {
  40. DONT_CHANGE,
  41. TERRORIST,
  42. CT,
  43. SPECTATOR
  44. }
  45. new g_bitPresentClass;
  46. const KEYS = ((1<<0)|(1<<1)|(1<<9));
  47. const FL_ONGROUND2 = (FL_ONGROUND | FL_PARTIALGROUND | FL_INWATER | FL_CONVEYOR | FL_FLOAT);
  48. new g_iBlock[MAX_PLAYERS+1];
  49. new Float:g_flFirstTouch[MAX_PLAYERS+1];
  50. new Float:g_flJumpOrigin[MAX_PLAYERS+1][3];
  51. new Float:g_flJumpAnglesGravity[MAX_PLAYERS+1][3];
  52. new g_bBlocks[MAX_ENTSARRAYS_SIZE], g_bBlocksByPlugin[MAX_ENTSARRAYS_SIZE];
  53. new g_bAlives, g_bOnGround, g_bTeleported, g_bAdmin;
  54. new bool:g_bBlockEntityTouch;
  55. new bool:g_bActive;
  56. new bool:g_bSafeInform = true;
  57. new g_iFhAddToFullPack;
  58. new g_iAdminDoor[MAX_PLAYERS+1];
  59. new szConfigFile[64];
  60. new Trie:g_iBlocksClass;
  61. new g_iMaxPlayers, g_iMaxEnts;
  62. #define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
  63. public plugin_init()
  64. {
  65. register_plugin("MultiPlayer Bhop", VERSION, "ConnorMcLeod");
  66. new pCvar = register_cvar("mp_bhop_version", VERSION, FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY);
  67. set_pcvar_string(pCvar, VERSION);
  68. new const szPossibleBlockClass[][] = {"func_door", "func_wall_toggle", "func_button", "trigger_multiple"};
  69. g_iBlocksClass = TrieCreate();
  70. for(new i; i<sizeof(szPossibleBlockClass); i++)
  71. {
  72.   TrieSetCell(g_iBlocksClass, szPossibleBlockClass[i], i);
  73. }
  74. register_event("Health", "Event_Health", "b");
  75. register_event("ResetHUD", "Event_ResetHUD", "b");
  76. register_concmd("kz_mpbhop", "ConsoleCommand_MpBhop", ADMIN_CFG, "<0/1>");
  77. register_concmd("kz_mpbhop_entitytouch", "ConsoleCommand_EntityTouch", ADMIN_CFG, "<0/1>");
  78. register_concmd("kz_safe_inform", "ConsoleCommand_SafeInform", ADMIN_CFG, "<0/1>");
  79. register_clcmd("kz_mpbhopmenu", "ClientCommand_BhopMenu", ADMIN_CFG);
  80. register_clcmd("kz_showblocks", "ClientCommand_ShowBlocks", ADMIN_CFG);

  81. register_clcmd("fullupdate", "ClientCommand_FullUpdate");
  82. register_menucmd(register_menuid("MpBhop Menu"), KEYS ,"MpBhopMenuAction");
  83. g_iMaxPlayers = get_maxplayers();
  84. g_iMaxEnts = global_get(glb_maxEntities);
  85. Set_Doors();
  86. Set_Wall_Toggle();
  87. Set_Buttons();
  88. SetBlocksByFile();
  89. SetTriggerMultiple();
  90. }
  91. public ClientCommand_FullUpdate( id )
  92. {
  93. if( g_bSafeInform )
  94. {
  95.   if( g_bActive )
  96.   {
  97.    client_print(id, print_console, "MpBhop is Activated, recording is NOT SAFE");
  98.    ColorChat(id, TERRORIST, "^1 * ^4[MpBhop] ^1MpBhop is ^4Activated^1, recording is ^3NOT SAFE");
  99.   }
  100.   else
  101.   {
  102.    client_print(id, print_console, "MpBhop is De-Activated, recording is SAFE");
  103.    ColorChat(id, TERRORIST, "^1 * ^4[MpBhop] ^1MpBhop is ^3De-Activated^1, recording is ^4SAFE");
  104.   }
  105. }
  106. }
  107. public ConsoleCommand_SafeInform(id, lvl, cid)
  108. {
  109. if( cmd_access(id, lvl, cid, 2) )
  110. {
  111.   new szStatus[2];
  112.   read_argv(1, szStatus, charsmax(szStatus));
  113.   g_bSafeInform = !!str_to_num(szStatus);
  114. }
  115. return PLUGIN_HANDLED;
  116. }
  117. public client_putinserver(id)
  118. {
  119. if( get_user_flags(id) & ADMIN_CFG )
  120. {
  121.   SetIdBits(g_bAdmin, id);
  122. }
  123. else
  124. {
  125.   ClearIdBits(g_bAdmin, id);
  126. }
  127. ClearIdBits(g_bAlives, id);
  128. ClearIdBits(g_bOnGround, id);
  129. ClearIdBits(g_bTeleported, id);
  130. }
  131. public client_disconnect(id)
  132. {
  133. ClearIdBits(g_bAdmin, id);
  134. ClearIdBits(g_bAlives, id);
  135. ClearIdBits(g_bOnGround, id);
  136. ClearIdBits(g_bTeleported, id);
  137. }
  138. public ClientCommand_ShowBlocks(id, level, cid)
  139. {
  140. if( cmd_access(id, level, cid, 2) )
  141. {
  142.   new szStatus[2];
  143.   read_argv(1, szStatus, charsmax(szStatus));
  144.   if( szStatus[0] == '1' )
  145.   {
  146.    if( !g_iFhAddToFullPack )
  147.    {
  148.     g_iFhAddToFullPack = register_forward(FM_AddToFullPack, "AddToFullPack", 1);
  149.     client_print(id, print_console, "Recording with this feature Activated is NOT SAFE");
  150.     ColorChat(id, TERRORIST, "^1 * ^4[MpBhop] ^1Recording with this feature ^4Activated ^1is ^3NOT SAFE");
  151.    }
  152.   }
  153.   else
  154.   {
  155.    if( g_iFhAddToFullPack )
  156.    {
  157.     unregister_forward(FM_AddToFullPack, g_iFhAddToFullPack, 1);
  158.     g_iFhAddToFullPack = 0;
  159.    }
  160.   }
  161. }
  162. return PLUGIN_HANDLED;
  163. }
  164. public MpBhopMenuAction(id, iKey)
  165. {
  166. new iEnt = g_iAdminDoor[id];
  167. switch( iKey )
  168. {
  169.   case 0:
  170.   {
  171.    if( GetEntBits(g_bBlocks, iEnt) )
  172.    {
  173.     ClearEntBits(g_bBlocks, iEnt);
  174.     ColorChat(id, _, "^1 * ^4[MpBhop] ^1Block has been set ^4movable^1.");
  175.    }
  176.    else
  177.    {
  178.     ColorChat(id, _, "^1 * ^4[MpBhop] ^1Block is already ^4movable^1.");
  179.    }
  180.   }
  181.   case 1:
  182.   {
  183.    if( GetEntBits(g_bBlocks, iEnt) )
  184.    {
  185.     ColorChat(id, TERRORIST, "^1 * ^4[MpBhop] ^1Block is already ^3unmovable^1.");
  186.    }
  187.    else
  188.    {
  189.     SetEntBits(g_bBlocks, iEnt);
  190.     ColorChat(id, TERRORIST, "^1 * ^4[MpBhop] ^1Block has been set ^3unmovable^1.");
  191.    }
  192.   }
  193. }
  194. return PLUGIN_HANDLED;
  195. }
  196. ShowMpBhopMenu(id, bIsBlocked)
  197. {
  198. new szMenuBody[150];
  199. formatex(szMenuBody, charsmax(szMenuBody), "\rMpBhop Menu^n\dThis block is actually \
  200.   \y%smovable \d:^n^n\r1\w. Mark this block as movable^n\r2\w. Mark this block as \
  201.   unmovable^n^n\r0\w. Exit", bIsBlocked ? "un" : "");
  202. show_menu(id, KEYS, szMenuBody, _, "MpBhop Menu");
  203. }
  204. public ClientCommand_BhopMenu(id, level, cid)
  205. {
  206. if( cmd_access(id, level, cid, 1) )
  207. {
  208.   new iEnt, crap, iClassType;
  209.   get_user_aiming(id, iEnt, crap);
  210.   if( iEnt && pev_valid(iEnt) )
  211.   {
  212.    new szClassName[32];
  213.    pev(iEnt, pev_classname, szClassName, charsmax(szClassName));
  214.    if( TrieGetCell(g_iBlocksClass, szClassName, iClassType) )
  215.    {
  216.     g_bitPresentClass |= 1<<iClassType;
  217.     g_iAdminDoor[id] = iEnt;
  218.     ShowMpBhopMenu(id, !!(GetEntBits(g_bBlocks, iEnt)));
  219.    }
  220.   }
  221. }
  222. return PLUGIN_HANDLED;
  223. }
  224. public AddToFullPack(es, e, iEnt, id, hostflags, player, pSet)
  225. {
  226. if( !player && GetIdBits(g_bAdmin, id) && GetEntBits(g_bBlocks, iEnt) )
  227. {
  228.   set_es(es, ES_RenderMode, kRenderTransColor);
  229.   set_es(es, ES_RenderAmt, 150);
  230.   set_es(es, ES_RenderColor, {120,75,170});
  231.   set_es(es, ES_RenderFx, kRenderFxGlowShell);
  232. }
  233. }
  234. public Event_Health(id)
  235. {
  236. if( is_user_alive(id) )
  237. {
  238.   SetIdBits(g_bAlives, id);
  239. }
  240. else
  241. {
  242.   ClearIdBits(g_bAlives, id);
  243. }
  244. }
  245. public Event_ResetHUD(id)
  246. {
  247. if( is_user_alive(id) )
  248. {
  249.   SetIdBits(g_bAlives, id);
  250. }
  251. else
  252. {
  253.   ClearIdBits(g_bAlives, id);
  254. }
  255. }
  256. public CBasePlayer_PreThink(id)
  257. {
  258. if( GetIdBits(g_bAlives, id) )
  259. {
  260.   if( GetIdBits(g_bTeleported, id) )
  261.   {
  262.    ClearIdBits(g_bTeleported, id);
  263.    set_pev(id, pev_velocity, 0);
  264.    return;
  265.   }
  266.   static fFlags;
  267.   fFlags = pev(id, pev_flags);
  268.   if( fFlags & FL_ONGROUND )
  269.   {
  270.    static iEnt, Float:flVelocity[3], Float:flVecOrigin[3];
  271.    iEnt = pev(id, pev_groundentity);
  272.    if( !iEnt || !(GetEntBits(g_bBlocks, iEnt)) )
  273.    {
  274.     if( iEnt )
  275.     {
  276.      pev(iEnt, pev_velocity, flVelocity);
  277.      if( flVelocity[0] || flVelocity[1] || flVelocity[2] )
  278.      {
  279.       ClearIdBits(g_bOnGround, id);
  280.       return;
  281.      }
  282.     }
  283.     if( fFlags & FL_DUCKING )
  284.     {
  285.      pev(id, pev_origin, flVecOrigin);
  286.      flVecOrigin[2] += 18.0;
  287.      engfunc(EngFunc_TraceHull, flVecOrigin, flVecOrigin, IGNORE_MONSTERS, HULL_HUMAN, id, 0);
  288.      if( !get_tr2(0, TR_StartSolid) && !get_tr2(0, TR_AllSolid) && get_tr2(0, TR_InOpen) )
  289.      {
  290.       flVecOrigin[2] -= 18.0;
  291.       xs_vec_copy(flVecOrigin, g_flJumpOrigin[id]);
  292.       SetIdBits(g_bOnGround, id);
  293.      }
  294.      else
  295.      {
  296.       ClearIdBits(g_bOnGround, id);
  297.       return;
  298.      }
  299.     }
  300.     else
  301.     {
  302.      pev(id, pev_origin, g_flJumpOrigin[id]);
  303.      SetIdBits(g_bOnGround, id);
  304.     }
  305.    }
  306.    else
  307.    {
  308.     ClearIdBits(g_bOnGround, id);
  309.    }
  310.   }
  311.   else if( GetIdBits(g_bOnGround, id) )
  312.   {
  313.    ClearIdBits(g_bOnGround, id);
  314.    pev(id, pev_v_angle, g_flJumpAnglesGravity[id]);
  315.    pev(id, pev_gravity, g_flJumpAnglesGravity[id][2]);
  316.   }
  317. }
  318. }
  319. public TriggerMultiple_Touch(iEnt, id)
  320. {
  321. if( (IsPlayer(id) || g_bBlockEntityTouch) && GetEntBits(g_bBlocks, iEnt) )
  322. {
  323.   return HAM_SUPERCEDE;
  324. }
  325. return HAM_IGNORED;
  326. }
  327. public Touch_Block(iBlock, id)
  328. {
  329. if( !(GetEntBits(g_bBlocks, iBlock)) )
  330. {
  331.   return HAM_IGNORED;
  332. }
  333. if( IsPlayer(id) )
  334. {
  335.   if( ~GetIdBits(g_bAlives, id) )
  336.   {
  337.    return HAM_SUPERCEDE;
  338.   }
  339. }
  340. else
  341. {
  342.   return g_bBlockEntityTouch ? HAM_SUPERCEDE : HAM_IGNORED;
  343. }
  344. if( pev(id, pev_groundentity) != iBlock )
  345. {
  346.   return HAM_SUPERCEDE;
  347. }
  348. if( g_iBlock[id] != iBlock )
  349. {
  350.   g_iBlock[id] = iBlock;
  351.   g_flFirstTouch[id] = get_gametime();
  352.   return HAM_SUPERCEDE;
  353. }
  354. static Float:flTime;
  355. flTime = get_gametime();
  356. if( flTime - g_flFirstTouch[id] > 0.25 ) // 0.3 == exploit on cg_cbblebhop oO
  357. {
  358.   if( flTime - g_flFirstTouch[id] > 0.7 )
  359.   {
  360.    g_flFirstTouch[id] = flTime;
  361.    return HAM_SUPERCEDE;
  362.   }
  363. #if defined MAKE_TELEPORT_FX
  364.   new iOrigin[3];
  365.   get_user_origin(id, iOrigin);
  366.   message_begin(MSG_PVS, SVC_TEMPENTITY, iOrigin);
  367.   write_byte(TE_TELEPORT);
  368.   write_coord(iOrigin[0]);
  369.   write_coord(iOrigin[1]);
  370.   write_coord(iOrigin[2]);
  371.   message_end();
  372. #endif
  373.   static const Float:VEC_DUCK_HULL_MIN[3] = {-16.0, -16.0, -18.0 };
  374.   static const Float:VEC_DUCK_HULL_MAX[3] = { 16.0,  16.0,  32.0 };
  375.   static const Float:VEC_DUCK_VIEW[3] = { 0.0, 0.0, 12.0 };
  376.   set_pev(id, pev_flags, pev(id, pev_flags) | FL_DUCKING);
  377.   engfunc(EngFunc_SetSize, id, VEC_DUCK_HULL_MIN, VEC_DUCK_HULL_MAX);
  378.   engfunc(EngFunc_SetOrigin, id, g_flJumpOrigin[id]);
  379.   set_pev(id, pev_view_ofs, VEC_DUCK_VIEW);
  380.   set_pev(id, pev_v_angle, 0);
  381.   set_pev(id, pev_velocity, 0);
  382.   set_pev(id, pev_angles, g_flJumpAnglesGravity[id]);
  383.   set_pev(id, pev_punchangle, 0);
  384.   set_pev(id, pev_fixangle, 1);
  385.   set_pev(id, pev_gravity, g_flJumpAnglesGravity[id][2]);
  386.   SetIdBits(g_bTeleported, id);
  387. }
  388. return HAM_SUPERCEDE;
  389. }
  390. public ConsoleCommand_MpBhop(id, lvl, cid)
  391. {
  392. if( cmd_access(id, lvl, cid, 2) )
  393. {
  394.   new szStatus[2];
  395.   read_argv(1, szStatus, charsmax(szStatus));
  396.   static HamHook:iHhPlayerPreThink;
  397.   switch( szStatus[0] )
  398.   {
  399.    case '0':
  400.    {
  401.     if( !g_bActive )
  402.     {
  403.      return PLUGIN_HANDLED;
  404.     }
  405.     if( iHhPlayerPreThink )
  406.     {
  407.      DisableHamForward( iHhPlayerPreThink );
  408.     }
  409.     SetTouch( false );
  410.     g_bActive = false;
  411.     if( g_bSafeInform )
  412.     {
  413.      client_print(0, print_console, "MpBhop has been De-Activated, recording is now SAFE");
  414.      ColorChat(0, TERRORIST, "^1 * ^4[MpBhop] ^1MpBhop has been ^3De-Activated^1, recording is now ^4SAFE");
  415.     }
  416.    }
  417.    case '1':
  418.    {
  419.     if( g_bActive )
  420.     {
  421.      return PLUGIN_HANDLED;
  422.     }
  423.     if( !iHhPlayerPreThink )
  424.     {
  425.      RegisterHam(Ham_Player_PreThink, "player", "CBasePlayer_PreThink");
  426.     }
  427.     else
  428.     {
  429.      EnableHamForward( iHhPlayerPreThink );
  430.     }
  431.     SetTouch( true );
  432.     g_bActive = true;
  433.     if( g_bSafeInform )
  434.     {
  435.      client_print(0, print_console, "MpBhop has been Activated, recording is now NOT SAFE");
  436.      ColorChat(0, TERRORIST, "^1 * ^4[MpBhop] ^1MpBhop has been ^4Activated^1, recording is now ^3NOT SAFE");
  437.     }
  438.    }
  439.    default:
  440.    {
  441.     client_print(id, print_console, "Usage: kz_mpbhop <0/1>");
  442.    }
  443.   }
  444. }
  445. return PLUGIN_HANDLED;
  446. }
  447. public ConsoleCommand_EntityTouch(id, lvl, cid)
  448. {
  449. if( cmd_access(id, lvl, cid, 2) )
  450. {
  451.   new szStatus[2];
  452.   read_argv(1, szStatus, charsmax(szStatus));
  453.   g_bBlockEntityTouch = !!str_to_num(szStatus);
  454. }
  455. return PLUGIN_HANDLED;
  456. }
  457. Set_Doors()
  458. {
  459. new iDoor = FM_NULLENT;
  460. new Float:flMovedir[3], szNoise[32], Float:flSize[3], Float:flDmg, Float:flSpeed;
  461. new const szNull[] = "common/null.wav";
  462. while( (iDoor = engfunc(EngFunc_FindEntityByString, iDoor, "classname", "func_door")) )
  463. {
  464.   // definitly not a bhop block
  465.   pev(iDoor, pev_dmg, flDmg);
  466.   if( flDmg )
  467.   {
  468. #if defined MAKE_DOORS_SILENT
  469.    set_pev(iDoor, pev_noise1, szNull); // while here, set healing doors silent xD
  470.    set_pev(iDoor, pev_noise2, szNull);
  471.    set_pev(iDoor, pev_noise3, szNull);
  472. #endif
  473.    continue;
  474.   }
  475.   // this func_door goes UP, not a bhop block ?
  476.   // or bhop block but let them move up (kz_megabhop for example)
  477.   pev(iDoor, pev_movedir, flMovedir);
  478.   if( flMovedir[2] > 0.0 )
  479.   {
  480.    continue;
  481.   }
  482.   
  483.   // too small : real door ? could this one be skipped ?
  484.   pev(iDoor, pev_size, flSize);
  485.   if( flSize[0] < 24.0 || flSize[1] < 24.0 )
  486.   {
  487.    continue;
  488.   }
  489.   // real door ? not all doors make sound though...
  490.   pev(iDoor, pev_noise1, szNoise, charsmax(szNoise));
  491.   if( szNoise[0] && !equal(szNoise, szNull) )
  492.   {
  493.    continue;
  494.   }
  495.   pev(iDoor, pev_noise2, szNoise, charsmax(szNoise));
  496.   if( szNoise[0] && !equal(szNoise, szNull) )
  497.   {
  498.    continue;
  499.   }
  500.   // not a bhop block ? too slow // this at least detects the big ent on kzsca_sewerbhop
  501.   pev(iDoor, pev_speed, flSpeed);
  502.   if( flSpeed < 100.0 )
  503.   {
  504.    continue;
  505.   }
  506.   // Pray for this to be a bhop block
  507.   SetEntBits(g_bBlocksByPlugin, iDoor);
  508.   SetEntBits(g_bBlocks, iDoor);
  509.   g_bitPresentClass |= 1<<FUNC_DOOR;
  510. }
  511. }
  512. Set_Wall_Toggle()
  513. {
  514. new iEnt = FM_NULLENT;
  515. while( (iEnt = engfunc(EngFunc_FindEntityByString, iEnt, "classname", "func_wall_toggle")) )
  516. {
  517.   g_bitPresentClass |= 1<<FUNC_WALL_TOGGLE;
  518.   SetEntBits(g_bBlocksByPlugin, iEnt);
  519.   SetEntBits(g_bBlocks, iEnt);
  520. }
  521. }
  522. Set_Buttons()
  523. {
  524. new const szStartStopButtons[][] = {"counter_start", "clockstartbutton", "firsttimerelay", "multi_start",
  525.   "counter_start_button", "counter_off", "clockstop", "clockstopbutton", "multi_stop", "stop_counter" };
  526. new Trie:tButtons = TrieCreate();
  527. for(new i; i<sizeof(szStartStopButtons); i++)
  528. {
  529.   TrieSetCell(tButtons, szStartStopButtons[i], 1);
  530. }
  531. new iEnt = FM_NULLENT, szTarget[32];
  532. while( (iEnt = engfunc(EngFunc_FindEntityByString, iEnt, "classname", "func_button")) )
  533. {
  534.   if( pev(iEnt, pev_spawnflags) & SF_BUTTON_TOUCH_ONLY )
  535.   {
  536.    pev(iEnt, pev_target, szTarget, charsmax(szTarget));
  537.    if( !szTarget[0] || !TrieKeyExists(tButtons, szTarget))
  538.    {
  539.     pev(iEnt, pev_targetname, szTarget, charsmax(szTarget));
  540.     if( !szTarget[0] || !TrieKeyExists(tButtons, szTarget))
  541.     {
  542.      g_bitPresentClass |= 1<<FUNC_BUTTON;
  543.      SetEntBits(g_bBlocksByPlugin, iEnt);
  544.      SetEntBits(g_bBlocks, iEnt);
  545.     }
  546.    }
  547.   }
  548. }
  549. TrieDestroy(tButtons);
  550. }
  551. SetTouch(bool:bActive)
  552. {
  553. static HamHook:iHhBlockTouch[BlocksClasses];
  554. if( bActive )
  555. {
  556.   static const szClassesAndHandlers[BlocksClasses][][] = {
  557.    {"func_door", "Touch_Block"},
  558.    {"func_wall_toggle", "Touch_Block"},
  559.    {"func_button", "Touch_Block"},
  560.    {"trigger_multiple", "TriggerMultiple_Touch"}
  561.   };
  562.   for(new i; i<sizeof(iHhBlockTouch); i++)
  563.   {
  564.    if( g_bitPresentClass & (1<<i) )
  565.    {
  566.     if( iHhBlockTouch[i] )
  567.     {
  568.      EnableHamForward( iHhBlockTouch[i] );
  569.     }
  570.     else
  571.     {
  572.      iHhBlockTouch[i] = RegisterHam(Ham_Touch, szClassesAndHandlers[i][0], szClassesAndHandlers[i][1]);
  573.     }
  574.    }
  575.   }
  576. }
  577. else
  578. {
  579.   for(new i; i<sizeof(iHhBlockTouch); i++)
  580.   {
  581.    if( g_bitPresentClass & (1<<i) && iHhBlockTouch[i] )
  582.    {
  583.     DisableHamForward( iHhBlockTouch[i] );
  584.    }
  585.   }
  586. }
  587. }
  588. SetBlocksByFile()
  589. {
  590. get_localinfo("amxx_datadir", szConfigFile, charsmax(szConfigFile));
  591. format(szConfigFile, charsmax(szConfigFile), "%s/mpbhop", szConfigFile);
  592. if( !dir_exists(szConfigFile) )
  593. {
  594.   mkdir(szConfigFile);
  595. }
  596. new szMapName[32];
  597. get_mapname(szMapName, charsmax(szMapName));
  598. format(szConfigFile, charsmax(szConfigFile), "%s/%s.dat", szConfigFile, szMapName);
  599. new iFile = fopen(szConfigFile, "rt");
  600. if( iFile )
  601. {
  602.   new szDatas[48], szBrushOrigin[3][13], szType[2], Float:flBrushOrigin[3], i, iEnt;
  603.   new szClassName[32], iClassType;
  604.   while( !feof(iFile) )
  605.   {
  606.    fgets(iFile, szDatas, charsmax(szDatas));
  607.    trim(szDatas);
  608.    if(!szDatas[0] || szDatas[0] == ';' || szDatas[0] == '#' || (szDatas[0] == '/' && szDatas[1] == '/'))
  609.    {
  610.     continue;
  611.    }
  612.    parse(szDatas, szBrushOrigin[0], 12, szBrushOrigin[1], 12, szBrushOrigin[2], 12, szType, charsmax(szType));
  613.    for(i=0; i<3; i++)
  614.    {
  615.     flBrushOrigin[i] = str_to_float( szBrushOrigin[i] );
  616.    }
  617.    iEnt = FindEntByBrushOrigin( flBrushOrigin );
  618.    if( iEnt )
  619.    {
  620.     if( szType[0] == '1' )
  621.     {
  622.      pev(iEnt, pev_classname, szClassName, charsmax(szClassName));
  623.      if( TrieGetCell(g_iBlocksClass, szClassName, iClassType) )
  624.      {
  625.       g_bitPresentClass |= 1<<iClassType;
  626.      }
  627.      SetEntBits(g_bBlocks, iEnt);
  628.     }
  629.     else
  630.     {
  631.      ClearEntBits(g_bBlocks, iEnt);
  632.     }
  633.    }
  634.   }
  635.   fclose(iFile);
  636. }
  637. }
  638. FindEntByBrushOrigin(Float:flOrigin[3])
  639. {
  640. new Float:flBrushOrigin[3];
  641. for( new iEnt=g_iMaxPlayers+1; iEnt<=g_iMaxEnts; iEnt++ )
  642. {
  643.   if( pev_valid(iEnt) )
  644.   {
  645.    fm_get_brush_entity_origin(iEnt, flBrushOrigin);
  646.    if( xs_vec_nearlyequal(flBrushOrigin, flOrigin) )
  647.    {
  648.     return iEnt;
  649.    }
  650.   }
  651. }
  652. return 0;
  653. }
  654. fm_get_brush_entity_origin(ent, Float:orig[3])
  655. {
  656. new Float:Min[3], Float:Max[3];
  657. pev(ent, pev_origin, orig);
  658. pev(ent, pev_mins, Min);
  659. pev(ent, pev_maxs, Max);

  660. orig[0] += (Min[0] + Max[0]) * 0.5;
  661. orig[1] += (Min[1] + Max[1]) * 0.5;
  662. orig[2] += (Min[2] + Max[2]) * 0.5;
  663. return 1;
  664. }
  665. SetTriggerMultiple()
  666. {
  667. new iEnt = FM_NULLENT, szTarget[32], iBlock;
  668. while( (iEnt = engfunc(EngFunc_FindEntityByString, iEnt, "classname", "trigger_multiple")) )
  669. {
  670.   pev(iEnt, pev_target, szTarget, charsmax(szTarget));
  671.   iBlock = engfunc(EngFunc_FindEntityByString, -1, "targetname", szTarget);
  672.   if( iBlock && GetEntBits(g_bBlocks, iBlock) )
  673.   {
  674.    g_bitPresentClass |= 1<<TRIGGER_MULTIPLE;
  675.    SetEntBits(g_bBlocksByPlugin, iEnt);
  676.    SetEntBits(g_bBlocks, iEnt);
  677.   }
  678. }
  679. }
  680. public plugin_end()
  681. {
  682. TrieDestroy(g_iBlocksClass);
  683. delete_file(szConfigFile);
  684. new iFile;
  685. new Float:flBrushOrigin[3], bool:bUnMovable;
  686. for(new iEnt=g_iMaxPlayers+1; iEnt<=g_iMaxEnts; iEnt++)
  687. {
  688.   if( pev_valid(iEnt) )
  689.   {
  690.    bUnMovable = !!( GetEntBits(g_bBlocks, iEnt) );
  691.    if( bUnMovable
  692.    != !!( GetEntBits(g_bBlocksByPlugin, iEnt) ) )
  693.    {
  694.     if( !iFile )
  695.     {
  696.      iFile = fopen(szConfigFile, "wt");
  697.     }
  698.     fm_get_brush_entity_origin(iEnt, flBrushOrigin);
  699.     fprintf(iFile, "%f %f %f %d^n",
  700.     flBrushOrigin[0], flBrushOrigin[1], flBrushOrigin[2], bUnMovable);
  701.    }
  702.   }
  703. }
  704. if( iFile )
  705. {
  706.   fclose( iFile );
  707. }
  708. }
  709. ColorChat(id, COLOR=DONT_CHANGE, fmt[], any:...)
  710. {
  711. new szMsg[192];
  712. szMsg[0] = 0x04;
  713. vformat(szMsg[1], charsmax(szMsg)-1, fmt, 4);
  714. new szTeam[11], MSG_DEST = id ? MSG_ONE : MSG_ALL;
  715. static const szTeamNames[Colors][] = {"", "TERRORIST", "CT", "SPECTATOR"};
  716. if( COLOR )
  717. {
  718.   Send_TeamInfo(id, szTeamNames[COLOR], MSG_DEST);
  719. }
  720. static iSayText;
  721. if( iSayText || (iSayText = get_user_msgid("SayText")) )
  722. {
  723.   message_begin(MSG_DEST, iSayText, _, id);
  724.   {
  725.    write_byte(id ? id : g_iMaxPlayers);
  726.    write_string(szMsg);
  727.   }
  728.   message_end();
  729. }
  730. if( COLOR )
  731. {
  732.   if( id || is_user_connected(g_iMaxPlayers) )
  733.   {
  734.    get_user_team(id ? id : g_iMaxPlayers, szTeam, charsmax(szTeam));
  735.    Send_TeamInfo(id, szTeam, MSG_DEST);
  736.   }
  737.   else
  738.   {
  739.    Send_TeamInfo(0, "UNASSIGNED", MSG_DEST);
  740.   }
  741. }
  742. }
  743. Send_TeamInfo(const id, const szTeam[], MSG_DEST)
  744. {
  745. static iTeamInfo;
  746. if( iTeamInfo || (iTeamInfo = get_user_msgid("TeamInfo")) )
  747. {
  748.   message_begin(MSG_DEST, iTeamInfo, _, id);
  749.   {
  750.    write_byte(id ? id : g_iMaxPlayers);
  751.    write_string(szTeam);
  752.   }
  753.   message_end();
  754.     }
  755. }
复制代码

[code][/code]

该用户从未签到

发表于 2010-9-16 19:17:12 | 显示全部楼层
回复 8# SiMen.K.


    其实我只是给他建议而已。。我自己的弄好了。。不过看着这么多的数据上。。谢了。

该用户从未签到

发表于 2010-9-18 23:37:21 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表