daily pastebin goal
15%
SHARE
TWEET

Prokreedz Timer with trigger_multiple

a guest Jun 18th, 2017 112 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. // uncomment this line for top15 sql database saving
  4. //#define USING_SQL
  5.  
  6. // uncomment this line for recieving grenades on cmd /weapons
  7. //#define GIVE_GRENADES
  8.  
  9. #include <amxmodx>
  10. #include <amxmisc>
  11. #include <cstrike>
  12. #include <fakemeta>
  13. #include <hamsandwich>
  14. #include <engine>
  15. #include <fun>
  16.  
  17. #if defined USING_SQL
  18. #include <sqlx>
  19. #endif
  20.  
  21. #define PLUGIN "ProKreedz Ultimativ"
  22. #define VERSION "v2.4"
  23. #define AUTHOR "vato loco [GE-S]"
  24. #define PLUGIN_CVAR "prokreedz_ultimativ"
  25.  
  26. #define PLUGIN_HOOK    "PK_Hook_v2.4.amxx"
  27. #define PLUGIN_JETPACK "PK_Jetpack_v2.4.amxx"
  28. #define KZ_HOOK        "kz_prize_hook"
  29. #define KZ_JETPACK     "kz_prize_jetpack"
  30. #define KZ_HOOK_OFF    "HookOff"
  31. #define KZ_JET_OFF     "JetPackOff"
  32.  
  33. #define KZ_ACCESS         ADMIN_KICK
  34. #define KZ_ADMIN_MENU     ADMIN_RCON
  35. #define CP_MAX_PRO        get_pcvar_num(g_kz_maxpro_cp)
  36. #define CP_DISTANCE       35.0
  37. #define DISTANCE          120
  38. #define M_RADIOS_LEFT     192
  39.  
  40. #define TASK_INFO         12222
  41. #define TASK_RESPAWN      13333
  42. #define TASK_AUTOJOIN     14444
  43. #define TASK_ADMINGLOW    15555
  44. #define TASK_CREATEBOT    16666
  45. #define TASK_FUNCTIONS    17777
  46. #define TASK_NVG          18888
  47.  
  48. #define MENU_KEYS MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_0
  49. #define MENU_KEYS_ADMIN MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
  50.  
  51. // Kz ColorChat          
  52. enum color {
  53.     normal = 1, // clients scr_concolor cvar color
  54.     green,      // Green Color
  55.     team        // Red, grey, blue
  56. }
  57.  
  58. #if !defined USING_SQL
  59. new const g_iTopColors[][] = {
  60.     "#ff0000",
  61.     "#07fcff",
  62.     "#fff007"
  63. }
  64. #endif
  65.  
  66. #if !defined GIVE_GRENADES
  67. new const SKIP_WEAPONS = (1<<CSW_HEGRENADE) | (1<<CSW_FLASHBANG) | (1<<CSW_SMOKEGRENADE)
  68. #endif
  69.  
  70. new const SayCmdsClient[][64] = {
  71.     "menu","KzPlayerMenu","usp", "cmd_usp","scout", "cmd_scout","spawn","cmd_restart",
  72.     "respawn","cmd_restart","start","cmd_restart","restart","cmd_restart","reset","cmd_reset",
  73.     "checkpoint","cmd_checkpoint","cp","cmd_checkpoint","check","cmd_checkpoint",
  74.     "gocheck","cmd_gocheck","gc","cmd_gocheck","tp","cmd_gocheck",
  75.     "stuck","cmd_stuck","unstuck","cmd_stuck","showkeys", "cmd_showplayerkeys",
  76.     "spec","cmd_spec","unspec","cmd_spec","pause","cmd_pause","unpause","cmd_pause","help", "cmd_help",
  77.     "top10","cmd_top15","top15","cmd_top15","nub10","show_nub15","nub15","show_nub15",
  78.     "pro10","show_pro15","pro15","show_pro15","weapons", "cmd_weapons", "drop", "cmd_drop"
  79. }
  80.  
  81. new const SayCmdsAdmin[][64] = {
  82.     "amenu","KzAdminMenuShow", "adminmenu","KzAdminMenuShow",
  83.     "setstart","cmd_admin_setstart", "delstart","cmd_admin_delstart"
  84. }
  85.  
  86. new const g_start_sounds[][] = {
  87.     "barney/beertopside",
  88.     "scientist/c3a2_sci_portopen",
  89.     "barney/c1a2_ba_climb"
  90. }
  91.  
  92. new const g_block_commands[][] = {
  93.     "chooseteam", "buy", "buyammo1", "buyammo2", "buyequip",
  94.     "cl_autobuy", "cl_rebuy", "cl_setautobuy", "cl_setrebuy"
  95. }
  96.  
  97. new const g_radio_commands[][] = {"radio1", "radio2", "radio3"}
  98.  
  99. new const KZ_PROKREEDZ_DIR[] = "addons/amxmodx/configs/prokreedz"
  100. new const KZ_TOP15_DIR[] = "addons/amxmodx/configs/prokreedz/kz_top15"
  101. new const KZ_START_DIR[] = "addons/amxmodx/configs/prokreedz/kz_start"
  102. new const KZ_CONFIG[] = "prokreedz/ProKreedz.cfg"
  103.  
  104. new const Float:VEC_DUCK_HULL_MIN[3] = {-16.0, -16.0, -18.0}
  105. new const Float:VEC_DUCK_HULL_MAX[3] = {16.0, 16.0, 18.0}
  106.  
  107. #if defined USING_SQL
  108. new Handle:g_hSqlTuple
  109. #else
  110. new pro15_names[24][32], pro15_authid[24][32], Float:pro15_times[24], pro15_cp[24], pro15_gocp[24]
  111. new nub15_names[24][32], nub15_authid[24][32], Float:nub15_times[24], nub15_cp[24], nub15_gocp[24]
  112. #endif
  113.  
  114. new Float:g_fStartPosition[3]
  115. new bool:g_bStartPos
  116. new g_StartFile[128]
  117.  
  118. new Float:g_fPlayerStartPosition[33][3]
  119. new bool:g_bStartPosition[33]
  120.  
  121. new Float:g_fCheckpoints[33][3]  
  122. new Float: g_fCheckStuck[33][3]
  123. new bool:g_bPlayerUsedStuck[33]
  124. new g_iCheckpointNum[33]
  125. new g_iGoCheckNum[33]
  126.  
  127. new is_plr_alive[33]
  128. new is_plr_bot[33]
  129. new is_plr_connected[33]
  130.  
  131. new bool:g_bFirstSpawn[33]
  132. new bool:g_bHasScout[33]
  133. new bool:g_bShowTimer[33]
  134. new bool:g_bNoclip[33]
  135. new g_iBunnyHop[33]
  136. new g_iPlayerKeys[33]
  137. new bool:g_bShowKeys[33]
  138. new Float:fShowKeyTime
  139. new plr_key[33][64]
  140. new bool:g_bPlayerNvgUse[33]
  141. new bool:g_bWeapons[33]
  142. new g_iPlayerName[33][32]
  143. new g_iTarget[33]
  144.  
  145. new Float:g_iPlayerTime[33]
  146. new bool:g_bPlayerStart[33]
  147. new Float:g_iPlayerPauseTime[33]
  148. new g_bPlayerPaused[33]
  149. new g_bPlayerSpec[33]
  150. new Float:g_fSpecPosition[33][3]
  151. new Float:g_iPlayerHealth[33]
  152.  
  153. new g_iPlayerModel[33][32]
  154. new g_iEntPlayerModel[33]                      
  155. new g_iEntWeaponModel[33]
  156. new g_bPlayerIsAdmin[33]
  157.  
  158. new g_szMapName[64]
  159.  
  160. new g_kz_modname_enable
  161. new g_kz_checkpoints
  162. new g_kz_semiclip
  163. new g_kz_transparency
  164. new g_kz_scout
  165. new g_kz_pause
  166. new g_kz_spec
  167. new g_kz_sounds
  168. new g_kz_vip
  169. new g_kz_adminglow
  170. new g_kz_money
  171. new g_kz_autojoin
  172. new g_kz_bhop
  173. new g_kz_cheatdetect
  174. new g_kz_godmode
  175. new g_kz_nokill
  176. new g_kz_help
  177. new g_kz_bot
  178. new g_kz_prize
  179. new g_kz_doorsound
  180. new g_kz_painsound
  181. new g_kz_watersound
  182. new g_kz_botname
  183. new g_kz_tag
  184. new g_kz_advert_time
  185. new g_kz_autoheal
  186. new g_kz_autoheal_hp
  187. new g_kz_weaponspeed
  188. new g_kz_weaponspeed_color
  189. new g_kz_weaponspeed_xypos
  190. new g_kz_showkeys
  191. new g_kz_showkeys_color
  192. new g_kz_showkeys_xypos
  193. new g_kz_nvg_enabled
  194. new g_kz_nvg_radius
  195. new g_kz_nvg_color  
  196. new g_kz_time_color
  197. new g_kz_status_color
  198. new g_kz_showhealth_color
  199. new g_kz_showhealth_xypos
  200. new g_kz_maxpro_cp
  201. new g_kz_weapons
  202. new g_kz_autostart
  203. new g_kz_statustext
  204. new g_kz_statustext_color
  205. new g_kz_statustext_xypos
  206. #if defined USING_SQL
  207. new g_kz_sql_host
  208. new g_kz_sql_user
  209. new g_kz_sql_pass
  210. new g_kz_sql_db
  211. new g_kz_weburl
  212. #endif
  213.  
  214. new g_mp_fiendlyfire
  215. new g_mp_autoteambalance
  216. new g_mp_limitteams
  217. new g_mp_freezetime
  218. new g_mp_autokick
  219. new g_mp_flashlight
  220. new g_sv_airaccelerate
  221. new g_sv_gravity
  222.  
  223. new g_SyncTimer
  224. new g_SyncWeapon
  225. new g_SyncShowKeys
  226. new g_SyncShowHealth
  227. new g_SyncStatusText
  228.  
  229. new g_SayText
  230. new g_ScoreAttrib
  231. new g_TeamInfo
  232. new g_StatusValue
  233. new g_StatusText
  234. new g_Money
  235. new g_ClCorpse
  236. new g_ShowMenu
  237. new g_VguiMenu
  238. new g_RoundTime
  239. new g_ScreenFade
  240. new g_NVGToggle
  241. new g_Health
  242. new g_StatusIcon
  243.  
  244. new Trie:g_tStartTargets
  245. new Trie:g_tFinishTargets
  246. new Trie:g_tRemoveEntities
  247. new Trie:g_tWeaponCommands
  248. new Trie:g_tdoorSnd
  249. new Trie:g_tpainSnd
  250. new Trie:g_twaterSnd
  251.  
  252. new g_iMaxPlayers
  253.  
  254. public plugin_init()
  255. {
  256.     register_plugin(PLUGIN, VERSION, AUTHOR)
  257.     register_cvar(PLUGIN_CVAR, VERSION, FCVAR_SERVER|FCVAR_SPONLY, 0.0)
  258.     register_dictionary("prokreedz_v2.4.txt")
  259.     register_menucmd(register_menuid("ProKreedz Ultimativ v2.4 - Adminmenu"),MENU_KEYS_ADMIN,"AdminMenuHandler")
  260.     register_menucmd(register_menuid("ProKreedz v2.4 - Playermenu"),MENU_KEYS,"PlayerMenuHandler")
  261.    
  262.     RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn", 1)
  263.     RegisterHam(Ham_Killed, "player", "fw_PlayerKilled", 1)
  264.     RegisterHam(Ham_Player_PreThink, "player", "fw_PreThink_Post", 1)
  265.     RegisterHam(Ham_Use, "func_button", "fw_UseButton", 0)
  266.     RegisterHam(Ham_Touch, "trigger_multiple", "fw_PlayerTouch", 0)
  267.     RegisterHam(Ham_Spawn, "weaponbox", "fw_Weaponbox", 1)
  268.     RegisterHam(Ham_Player_Jump, "player", "fw_PlayerJump")
  269.    
  270.     register_forward(FM_Think,"fw_ThinkEntity")
  271.     register_forward(FM_EmitSound, "fw_EmitSound")
  272.     register_forward(FM_ClientKill,"fw_ClientKill")
  273.     register_forward(FM_StartFrame, "fw_StartFrame")
  274.     register_forward(FM_AddToFullPack, "fw_AddToFullPack_Post", 1)
  275.    
  276.     register_event("CurWeapon", "ev_CheckWeapon", "be", "1=1")
  277.     register_event("Health", "ev_Health", "be", "1>0")
  278.    
  279.     register_clcmd("nightvision","cmd_toggle_nvg")
  280.     register_clcmd("kz_noclip","cmd_admin_noclip", KZ_ACCESS, "<name|#userid|steamid|@ALL> <on/off>")
  281.     register_clcmd("kz_gravity", "cmd_admin_gravity", KZ_ACCESS, "<name|#userid|steamid|@ALL> <gravity>")
  282.    
  283.     new i
  284.     kz_register_saycmd("noclip", "cmd_admin_noclip", KZ_ACCESS)
  285.     for(i = 0; i < sizeof(SayCmdsAdmin); i = i+2)
  286.         kz_register_saycmd(SayCmdsAdmin[i], SayCmdsAdmin[i+1], KZ_ADMIN_MENU)
  287.    
  288.     for(i = 0; i < sizeof(SayCmdsClient); i = i+2)
  289.         kz_register_saycmd(SayCmdsClient[i], SayCmdsClient[i+1], 0)
  290.    
  291.     g_kz_modname_enable = register_cvar("kz_modname_enable","1")
  292.     g_kz_checkpoints = register_cvar("kz_checkpoints","1")
  293.     g_kz_semiclip = register_cvar("kz_semiclip","1")
  294.     g_kz_transparency = register_cvar("kz_transparency","1")
  295.     g_kz_scout = register_cvar("kz_scout","1")
  296.     g_kz_pause = register_cvar("kz_pause","1")
  297.     g_kz_spec = register_cvar("kz_spec","1")
  298.     g_kz_sounds = register_cvar("kz_sounds","1")
  299.     g_kz_vip = register_cvar("kz_vip","1")
  300.     g_kz_adminglow = register_cvar("kz_adminglow","1")
  301.     g_kz_money = register_cvar("kz_money","1337")
  302.     g_kz_autojoin = register_cvar("kz_autojoin","1")
  303.     g_kz_bhop = register_cvar("kz_bhop","1")
  304.     g_kz_cheatdetect = register_cvar("kz_cheatdetect","1")
  305.     g_kz_godmode = register_cvar("kz_godmode","1")
  306.     g_kz_nokill = register_cvar("kz_nokill","1")
  307.     g_kz_help = register_cvar("kz_help","1")
  308.     g_kz_bot = register_cvar("kz_bot","1")
  309.     g_kz_prize = register_cvar("kz_prize","1")
  310.     g_kz_doorsound = register_cvar("kz_doorsound","1")
  311.     g_kz_painsound = register_cvar("kz_painsound","1")
  312.     g_kz_watersound = register_cvar("kz_watersound","1")
  313.     g_kz_botname = register_cvar("kz_botname", "ProKreedz Ultimativ v2.4")
  314.     g_kz_tag = register_cvar("kz_tag", "[ProKreedz]")
  315.     g_kz_advert_time = register_cvar("kz_advert_time","60")
  316.     g_kz_autoheal = register_cvar("kz_autoheal", "1")
  317.     g_kz_autoheal_hp = register_cvar("kz_autoheal_hp", "50")
  318.     g_kz_weapons = register_cvar("kz_weapons","1")
  319.     g_kz_weaponspeed = register_cvar("kz_weaponspeed","1")
  320.     g_kz_weaponspeed_color = register_cvar("kz_weaponspeed_color","0 255 255")
  321.     g_kz_weaponspeed_xypos = register_cvar("kz_weaponspeed_xypos","0.35 0.75")
  322.     g_kz_showkeys = register_cvar("kz_showkeys","1")
  323.     g_kz_showkeys_color = register_cvar("kz_showkeys_color","0 255 255")
  324.     g_kz_showkeys_xypos = register_cvar("kz_showkeys_xypos","-1.0 -0.40")
  325.     g_kz_nvg_enabled = register_cvar("kz_nvg_enabled","1")
  326.     g_kz_nvg_radius = register_cvar("kz_nvg_radius","70")
  327.     g_kz_nvg_color = register_cvar("kz_nvg_color","0 255 255")
  328.     g_kz_time_color = register_cvar("kz_time_color","0 255 255")
  329.     g_kz_status_color = register_cvar("kz_status_color","255 0 0")
  330.     g_kz_showhealth_color = register_cvar("kz_showhealth_color", "255 50 0")
  331.     g_kz_showhealth_xypos = register_cvar("kz_showhealth_xypos ", "-1.0 0.9")
  332.     g_kz_maxpro_cp = register_cvar("kz_maxpro_cp","10000")
  333.     g_kz_autostart = register_cvar("kz_autostart","1")
  334.     g_kz_statustext = register_cvar("kz_statustext","1")
  335.     g_kz_statustext_color = register_cvar("kz_statustext_color","255 255 0")
  336.     g_kz_statustext_xypos = register_cvar("kz_statustext_xypos","-1.0 0.52")
  337. #if defined USING_SQL
  338.     g_kz_sql_host = register_cvar("kz_sql_host", "")
  339.     g_kz_sql_user = register_cvar("kz_sql_user", "")
  340.     g_kz_sql_pass = register_cvar("kz_sql_pass", "", FCVAR_PROTECTED)
  341.     g_kz_sql_db = register_cvar("kz_sql_db", "")
  342.     g_kz_weburl = register_cvar("kz_weburl", "http://your.domain.com/path/to/top15.php")
  343. #else
  344.     register_cvar("kz_sql_host", "")
  345.     register_cvar("kz_sql_user", "")
  346.     register_cvar("kz_sql_pass", "", FCVAR_PROTECTED)
  347.     register_cvar("kz_sql_db", "")
  348.     register_cvar("kz_weburl", "")
  349. #endif
  350.    
  351.     g_mp_fiendlyfire = get_cvar_pointer("mp_friendlyfire")
  352.     g_mp_autoteambalance = get_cvar_pointer("mp_autoteambalance")
  353.     g_mp_limitteams = get_cvar_pointer("mp_limitteams")
  354.     g_mp_freezetime = get_cvar_pointer("mp_freezetime")
  355.     g_mp_autokick = get_cvar_pointer("mp_autokick")
  356.     g_mp_flashlight = get_cvar_pointer("mp_flashlight")
  357.     g_sv_airaccelerate = get_cvar_pointer("sv_airaccelerate")
  358.     g_sv_gravity = get_cvar_pointer("sv_gravity")
  359.    
  360.     set_pcvar_num(g_mp_fiendlyfire, 0)
  361.     set_pcvar_num(g_mp_autoteambalance, 0)
  362.     set_pcvar_num(g_mp_limitteams, 0)
  363.     set_pcvar_num(g_mp_freezetime, 0)
  364.     set_pcvar_num(g_mp_autokick, 0)
  365.     set_pcvar_num(g_mp_flashlight, 1)
  366.     set_pcvar_num(g_sv_airaccelerate, 10)
  367.    
  368.     g_Health = get_user_msgid("Health")
  369.     g_ScreenFade = get_user_msgid("ScreenFade")
  370.     g_NVGToggle = get_user_msgid("NVGToggle")
  371.     g_SayText = get_user_msgid("SayText")
  372.     g_ScoreAttrib = get_user_msgid("ScoreAttrib")
  373.     g_TeamInfo = get_user_msgid("TeamInfo")
  374.     g_StatusValue = get_user_msgid("StatusValue")
  375.     g_StatusText = get_user_msgid("StatusText")
  376.     g_Money = get_user_msgid("Money")
  377.     g_ClCorpse = get_user_msgid("ClCorpse")
  378.     g_ShowMenu = get_user_msgid("ShowMenu")
  379.     g_VguiMenu = get_user_msgid("VGUIMenu")
  380.     g_RoundTime = get_user_msgid("RoundTime")
  381.     g_StatusIcon = get_user_msgid("StatusIcon")
  382.     register_message(g_Health, "MsgHealth")
  383.     register_message(g_Money, "MsgMoney")
  384.     register_message(g_ClCorpse, "MsgClCorpse")
  385.     register_message(g_ShowMenu, "MsgShowMenu")
  386.     register_message(g_VguiMenu, "MsgVguiMenu")
  387.     register_message(g_RoundTime,"MsgRoundTime")
  388.     register_message(g_StatusIcon , "MsgStatusIcon")
  389.     register_message(g_StatusValue , "MsgStatusValue")
  390.     set_msg_block(g_ClCorpse, BLOCK_SET)
  391.     set_msg_block(g_StatusText, BLOCK_SET)
  392.    
  393.     new iEnt
  394.     iEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString , "info_target"))
  395.     set_pev(iEnt, pev_classname, "kz_time_think")
  396.     set_pev(iEnt, pev_nextthink, get_gametime() + 1.0)
  397.    
  398.     iEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString , "info_target"))
  399.     set_pev(iEnt, pev_classname, "kz_player_statustext")
  400.     set_pev(iEnt, pev_nextthink, get_gametime() + 1.0)
  401.    
  402.     set_task(5.0, "kz_CreateBot", TASK_CREATEBOT, _, _, "b")
  403.     set_task(1.0, "kz_Functions", TASK_FUNCTIONS, _, _, "b")
  404.    
  405.     g_SyncTimer = CreateHudSyncObj()
  406.     g_SyncWeapon = CreateHudSyncObj()
  407.     g_SyncShowKeys = CreateHudSyncObj()
  408.     g_SyncShowHealth = CreateHudSyncObj()
  409.     g_SyncStatusText = CreateHudSyncObj()
  410.    
  411.     new const g_iStartTargets[][] = {
  412.         "counter_start","clockstartbutton",
  413.         "firsttimerelay","but_start",
  414.         "counter_start_button","multi_start",
  415.         "timer_startbutton","start_timer_emi",
  416.         "gogogo"
  417.     }
  418.     g_tStartTargets = TrieCreate()
  419.     for(i = 0; i < sizeof(g_iStartTargets); i++)
  420.     {
  421.         TrieSetCell(g_tStartTargets, g_iStartTargets[i], i)
  422.     }
  423.     new const g_iFinishTargets[][] = {
  424.         "counter_off","clockstopbutton",
  425.         "clockstop","but_stop",
  426.         "counter_stop_button","multi_stop",
  427.         "stop_counter","m_counter_end_emi"
  428.     }
  429.     g_tFinishTargets = TrieCreate()
  430.     for(i = 0; i < sizeof(g_iFinishTargets); i++)
  431.     {
  432.         TrieSetCell(g_tFinishTargets, g_iFinishTargets[i], i)
  433.     }
  434.     new const g_iWeaponCommands[][] = {
  435.         "usp", "glock", "deagle", "p228", "elites",
  436.         "fn57", "m3", "xm1014", "mp5", "tmp", "p90",
  437.         "mac10", "ump45", "ak47", "galil", "famas",
  438.         "sg552", "m4a1", "aug", "scout", "awp", "g3sg1",
  439.         "sg550", "m249", "vest", "vesthelm", "flash",
  440.         "hegren", "sgren", "defuser", "nvgs", "shield",
  441.         "primammo", "secammo", "km45", "9x19mm", "nighthawk",
  442.         "228compact", "fiveseven", "12gauge", "autoshotgun",
  443.         "mp", "c90", "cv47", "defender", "clarion", "krieg552",
  444.         "bullpup", "magnum", "d3au1", "krieg550"
  445.     }
  446.     g_tWeaponCommands = TrieCreate()
  447.     for(i = 0; i < sizeof(g_iWeaponCommands); i++)
  448.     {
  449.         TrieSetCell(g_tWeaponCommands, g_iWeaponCommands[i], i)
  450.     }
  451.     new const g_doorSnd[][] = {
  452.         "doors/doorstop1.wav",
  453.         "doors/doorstop2.wav",
  454.         "doors/doorstop3.wav"
  455.     }
  456.     g_tdoorSnd = TrieCreate()
  457.     for(i = 0; i < sizeof(g_doorSnd); i++)
  458.     {
  459.         TrieSetCell(g_tdoorSnd, g_doorSnd[i], i)
  460.     }
  461.     new const g_painSnd[][] = {
  462.         "player/pl_pain2.wav", "player/pl_pain3.wav",
  463.         "player/pl_pain4.wav", "player/pl_pain5.wav",
  464.         "player/pl_pain6.wav", "player/pl_pain7.wav",
  465.         "player/bhit_kevlar-1.wav", "player/bhit_flesh-1.wav",
  466.         "player/bhit_flesh-2.wav", "player/bhit_flesh-3.wav"
  467.     }
  468.     g_tpainSnd = TrieCreate()
  469.     for(i = 0; i < sizeof(g_painSnd); i++)
  470.     {
  471.         TrieSetCell(g_tpainSnd, g_painSnd[i], i)
  472.     }
  473.     new const g_waterSnd[][] = {
  474.         "player/pl_swim1.wav", "player/pl_swim2.wav",
  475.         "player/pl_swim3.wav", "player/pl_swim4.wav",
  476.         "player/waterrun.wav"
  477.     }
  478.     g_twaterSnd = TrieCreate()
  479.     for(i = 0; i < sizeof(g_waterSnd); i++)
  480.     {
  481.         TrieSetCell(g_twaterSnd, g_waterSnd[i], i)
  482.     }
  483.     get_mapname(g_szMapName, charsmax(g_szMapName))
  484.     strtolower(g_szMapName)
  485.    
  486.     g_iMaxPlayers = get_maxplayers()
  487. }
  488.  
  489. public plugin_cfg()
  490. {
  491.     new KzConfig[64], KzCfg[128]
  492.     get_configsdir(KzConfig, 63)
  493.     format(KzCfg, 127, "%s/%s", KzConfig, KZ_CONFIG)
  494.    
  495.     if(file_exists(KzCfg))
  496.     {
  497.         server_cmd("exec %s", KzCfg)
  498.         server_exec()
  499.     }
  500.     else
  501.     {
  502.         kz_make_config(KzCfg)
  503.     }
  504.    
  505.     if(!dir_exists(KZ_START_DIR))
  506.     {
  507.         mkdir(KZ_START_DIR)
  508.     }
  509.     format(g_StartFile, 127, "%s/%s.txt", KZ_START_DIR, g_szMapName)
  510.    
  511.     if(file_exists(g_StartFile))
  512.     {
  513.         g_bStartPos = true
  514.        
  515.         new Data[64], x[13], y[13], z[13]
  516.         new f = fopen(g_StartFile, "rt")
  517.        
  518.         while(!feof(f))
  519.         {
  520.             fgets(f, Data, 63)
  521.             parse(Data, x, 12, y, 12, z, 12)
  522.            
  523.             g_fStartPosition[0] = str_to_float(x)
  524.             g_fStartPosition[1] = str_to_float(y)
  525.             g_fStartPosition[2] = str_to_float(z)
  526.         }
  527.         fclose(f)
  528.     }
  529.     else
  530.     {
  531.         g_bStartPos = false
  532.     }
  533.     if(get_pcvar_num(g_kz_prize))
  534.         set_task(get_pcvar_float(g_kz_advert_time),"Hook")
  535.    
  536.     if(get_pcvar_num(g_kz_autoheal))
  537.         kz_create_healer() 
  538.    
  539.     if(get_pcvar_num(g_kz_modname_enable))
  540.         register_forward(FM_GetGameDescription, "fw_GameDescription")
  541.    
  542.     for(new i = 0; i < sizeof(g_radio_commands); i++)
  543.         register_clcmd(g_radio_commands[i], "BlockCommands")
  544.    
  545.     for(new i = 0; i < sizeof(g_block_commands) ; i++)
  546.         register_clcmd(g_block_commands[i], "BlockCommands")
  547.    
  548. #if defined USING_SQL
  549.     new szHost[64], szUser[64], szPass[64], szDb[64]
  550.     get_pcvar_string(g_kz_sql_host, szHost, charsmax(szHost))
  551.     get_pcvar_string(g_kz_sql_user, szUser, charsmax(szUser))
  552.     get_pcvar_string(g_kz_sql_pass, szPass, charsmax(szPass))
  553.     get_pcvar_string(g_kz_sql_db, szDb, charsmax(szDb))
  554.    
  555.     g_hSqlTuple = SQL_MakeDbTuple(szHost, szUser, szPass, szDb)
  556.    
  557.     if(g_hSqlTuple == Empty_Handle)
  558.     {
  559.         log_amx("Failed to connect to SQL database. Please check login info.")
  560.     }
  561.     else
  562.     {
  563.         SQL_ThreadQuery(g_hSqlTuple, "QueryCreateTable", "CREATE TABLE IF NOT EXISTS kz_pro15 (name VARCHAR(32) NOT NULL, steamid VARCHAR(35) NOT NULL, map VARCHAR(64) NOT NULL, time DOUBLE NOT NULL, cp INT NOT NULL, gc INT NOT NULL, PRIMARY KEY (steamid, map));");
  564.         SQL_ThreadQuery(g_hSqlTuple, "QueryCreateTable", "CREATE TABLE IF NOT EXISTS kz_nub15 (name VARCHAR(32) NOT NULL, steamid VARCHAR(35) NOT NULL, map VARCHAR(64) NOT NULL, time DOUBLE NOT NULL, cp INT NOT NULL, gc INT NOT NULL, PRIMARY KEY (steamid, map));");
  565.     }
  566. #else
  567.     for(new i = 0 ; i < 15; ++i)
  568.     {
  569.         pro15_times[i] = 999999999.00000
  570.         nub15_times[i] = 999999999.00000
  571.     }
  572.     read_pro15()
  573.     read_nub15()
  574. #endif
  575. }
  576.  
  577. #if defined USING_SQL
  578. public QueryCreateTable(iFailState, Handle:hQuery, szError[], iError, iData[], iDataSize, Float:flQueueTime)
  579. {
  580.     switch(iFailState)
  581.     {
  582.         case TQUERY_CONNECT_FAILED:
  583.         {
  584.             log_amx("Failed to connect to database (%i): %s", iError, szError)
  585.         }
  586.         case TQUERY_QUERY_FAILED:
  587.         {
  588.             log_amx("Error on query for QueryCreateTable() (%i): %s", iError, szError)
  589.         }
  590.         default: {
  591.             // successfully created tables
  592.         }
  593.     }
  594. }
  595. #endif
  596.  
  597. public plugin_precache()
  598. {
  599.     if(!dir_exists(KZ_PROKREEDZ_DIR))
  600.         mkdir(KZ_PROKREEDZ_DIR)
  601.    
  602.     if(!dir_exists(KZ_TOP15_DIR))
  603.         mkdir(KZ_TOP15_DIR)
  604. }
  605. public plugin_end()
  606. {
  607.     TrieDestroy(g_tStartTargets)
  608.     TrieDestroy(g_tFinishTargets)
  609.     TrieDestroy(g_tWeaponCommands)
  610. }
  611.  
  612. public client_connect(id)
  613. {
  614.     g_iCheckpointNum[id] = 0
  615.     g_iGoCheckNum[id] = 0
  616.     g_bPlayerSpec[id] = false
  617.     g_bPlayerPaused[id] = false
  618.     g_iPlayerPauseTime[id] = 0.0
  619.     g_iPlayerTime[id] = 0.0
  620.     g_bPlayerStart[id] = false
  621.     g_bFirstSpawn[id] = true
  622.     g_bHasScout[id] = false
  623.     g_iBunnyHop[id] = 0
  624.     g_bShowTimer[id] = true
  625.     g_bPlayerIsAdmin[id] = false
  626.     g_bStartPosition[id] = false
  627.     g_iTarget[id] = 0
  628.     get_user_name(id, g_iPlayerName[id], 31)
  629. }
  630.  
  631. public client_putinserver(id)
  632. {
  633.     is_plr_connected[id] = true
  634.    
  635.     if(!is_user_bot(id))
  636.     {
  637.         if(get_user_flags(id) & KZ_ACCESS)
  638.         {  
  639.             g_bPlayerIsAdmin[id] = true
  640.         }
  641.     }
  642.     else
  643.     {
  644.         is_plr_bot[id] = true
  645.     }
  646. }
  647.  
  648. public client_disconnect(id)
  649. {
  650.     if(g_bPlayerIsAdmin[id])
  651.         fm_remove_model_ents(id)
  652.     g_bPlayerSpec[id] = false
  653.     is_plr_alive[id] = false
  654.     is_plr_bot[id] = false
  655.     is_plr_connected[id] = false
  656. }
  657.  
  658. public client_infochanged(id)
  659. {
  660.     get_user_info(id, "name", g_iPlayerName[id], 31)
  661. }
  662.  
  663. public ev_CheckWeapon(id)
  664. {
  665.     static weapon_used[33]            
  666.    
  667.     static weapon_active, weapon_num
  668.     weapon_active = read_data(1)      
  669.     weapon_num = read_data(2)      
  670.    
  671.     if(!g_bHasScout[id] && !g_bWeapons[id] && is_plr_alive[id])
  672.     {
  673.         if(weapon_num == CSW_SCOUT)
  674.         {
  675.             ham_strip_weapon(id, "weapon_scout")
  676.         }
  677.     }
  678.     if((weapon_num != weapon_used[id]) && weapon_active && get_pcvar_num(g_kz_weaponspeed))
  679.     {
  680.         weapon_used[id] = weapon_num
  681.        
  682.         static Float:maxspeed, r, g, b, Float:x, Float:y
  683.         pev(id, pev_maxspeed, maxspeed)
  684.        
  685.         if(maxspeed < 0.0)
  686.             maxspeed = 250.0
  687.        
  688.         GetCvarPosition(g_kz_weaponspeed_xypos, x, y)
  689.         GetCvarColor(g_kz_weaponspeed_color, r, g, b)
  690.         set_hudmessage(r, g, b, x, y, _, _, 1.0, _, _, 2)
  691.         ShowSyncHudMsg(id, g_SyncWeapon, "%L", id, "PKU_WEAPON_SPEED", floatround( maxspeed, floatround_floor))
  692.     }
  693.     if(g_bPlayerIsAdmin[id])
  694.     {
  695.         fm_set_admin_weaponmodel(id)
  696.     }
  697. }
  698.  
  699. public ev_Health(id)
  700. {
  701.     if(!get_pcvar_num(g_kz_godmode))
  702.     {
  703.         new Float:fHealth
  704.         pev(id, pev_health, fHealth)
  705.         if(fHealth > 255.0)
  706.         {
  707.             static r, g, b, Float:x, Float:y
  708.             GetCvarPosition(g_kz_showhealth_xypos, x, y)
  709.             GetCvarColor(g_kz_showhealth_color, r, g, b)
  710.             set_hudmessage(r, g, b, x, y, 0, _, 2.0, _, _, 2)
  711.             ShowSyncHudMsg(id, g_SyncShowHealth, "HP: %d", floatround(fHealth))
  712.         }
  713.     }
  714. }
  715.  
  716. public cmd_help(id)
  717. {
  718.     if(get_pcvar_num(g_kz_help))
  719.     {
  720.         static MOTD[2048], MLTITEL[24], Pos
  721.        
  722.         formatex(MLTITEL,23,"%L", id, "PKU_IMOTD_HELP_TITEL")
  723.        
  724.         Pos = formatex(MOTD,sizeof MOTD - 1,"<style type=^"text/css^"><!--.h1 { color:#4e8791;font-weight:bold;};.h2 { color:#5796a2; font-weight:bold; };font-family: Times New Roman}--></style><body bgcolor=^"#FFFFFF^"><table width=^"100%%^" border=^"0^">")
  725.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"%L", id, "PKU_IMOTD_HELP_MENU")
  726.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /menu")
  727.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"%L", id, "PKU_IMOTD_SCOUT")
  728.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /scout")
  729.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"%L", id, "PKU_IMOTD_USP")
  730.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /usp")
  731.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"%L", id, "PKU_IMOTD_TOP15")
  732.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /nub15")
  733.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /pro15")
  734.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"%L", id, "PKU_IMOTD_CHECKPOINT")
  735.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /checkpoint")
  736.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /cp")
  737.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"%L", id, "PKU_IMOTD_GOCHECK")
  738.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /gocheck")
  739.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /tp")
  740.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"%L", id, "PKU_IMOTD_STUCK")
  741.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /stuck")
  742.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /unstuck")
  743.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"%L", id, "PKU_IMOTD_START")
  744.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /start")
  745.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /respawn")
  746.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"%L", id, "PKU_IMOTD_RESET")
  747.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /reset")
  748.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"%L", id, "PKU_IMOTD_PAUSE")
  749.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /pause")
  750.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"%L", id, "PKU_IMOTD_SPEC")
  751.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /spec")
  752.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"%L", id, "PKU_IMOTD_SHOWKEYS")
  753.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /showkeys")
  754.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"%L", id, "PKU_IMOTD_WEAPONS")
  755.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /weapons")
  756.         Pos += formatex(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td class=h2>say /drop")
  757.        
  758.         show_motd(id,MOTD,MLTITEL)
  759.     }
  760.     return PLUGIN_CONTINUE
  761. }
  762.  
  763. public cmd_top15(id)
  764. {
  765.     kz_colorchat(id, green,"^x03Top15: ^x01'^x04/pro15^x01'^x03 - ^x01'^x04/nub15^x01'")
  766. }
  767.  
  768. public cmd_showplayerkeys(id)
  769. {
  770.     g_bShowKeys[id] = !g_bShowKeys[id]
  771. }
  772.  
  773. public cmd_toggle_nvg(id)
  774. {
  775.     g_bPlayerNvgUse[id] = !g_bPlayerNvgUse[id]
  776.    
  777.     if(get_pcvar_num(g_kz_nvg_enabled))
  778.     {
  779.         kz_set_nvg_msg(id, false)
  780.        
  781.         if(g_bPlayerNvgUse[id])
  782.             kz_make_nvg(id)
  783.         else
  784.             kz_remove_nvg(id)
  785.     }
  786.     else
  787.     {
  788.         kz_set_nvg_msg(id, g_bPlayerNvgUse[id])
  789.     }
  790.     if(g_bPlayerNvgUse[id])
  791.         emit_sound(id, CHAN_ITEM, "items/nvg_on.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  792.     else
  793.         emit_sound(id, CHAN_ITEM, "items/nvg_off.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  794.    
  795.     return PLUGIN_HANDLED
  796. }
  797.  
  798. public cmd_restart(id)
  799. {
  800.     if(g_bPlayerPaused[id] || !is_plr_alive[id])
  801.         return PLUGIN_HANDLED
  802.    
  803.     cmd_reset(id)
  804.     if(g_bStartPos)
  805.     {
  806.         PlayerSpawnPost(id)
  807.         set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
  808.         engfunc(EngFunc_SetOrigin, id, g_fStartPosition)
  809.     }
  810.     else
  811.     {
  812.         if(g_bStartPosition[id])
  813.         {
  814.             PlayerSpawnPost(id)
  815.             set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
  816.             engfunc(EngFunc_SetOrigin, id, g_fPlayerStartPosition[id])
  817.         }
  818.         else
  819.             ExecuteHamB(Ham_CS_RoundRespawn, id)
  820.     }
  821.     return PLUGIN_HANDLED
  822. }
  823.  
  824. public cmd_reset(id)
  825. {
  826.     if(g_bPlayerPaused[id] || !is_plr_alive[id])
  827.         return PLUGIN_HANDLED
  828.    
  829.     if(g_bPlayerStart[id])
  830.         kz_colorchat(id, green,"%L", id, "PKU_CMD_RESET")
  831.    
  832.     g_iCheckpointNum[id] = 0
  833.     g_iGoCheckNum[id] = 0
  834.     g_iPlayerPauseTime[id] = 0.0
  835.     g_iPlayerTime[id] = 0.0
  836.     g_bPlayerStart[id] = false
  837.     set_pev(id, pev_frags, 0.0)
  838.     cs_set_user_deaths(id, 0)
  839.     return PLUGIN_HANDLED
  840. }
  841.  
  842. public cmd_drop(id)
  843. {
  844.     if(is_plr_alive[id] && g_bWeapons[id] && !g_bPlayerPaused[id])
  845.         kz_set_weapons(id)
  846. }
  847.  
  848. public cmd_weapons(id)
  849. {
  850.     if(!get_pcvar_num(g_kz_weapons))
  851.         return PLUGIN_HANDLED
  852.    
  853.     if(is_plr_alive[id] && !g_bPlayerPaused[id])
  854.     {
  855.         new szWeaponName[20]
  856.         for(new iCswId = CSW_P228; iCswId <= CSW_P90; iCswId++)
  857.         {
  858. #if !defined GIVE_GRENADES         
  859.             if(SKIP_WEAPONS & (1<<iCswId))
  860.                 continue
  861. #endif
  862.             if(!user_has_weapon(id, iCswId) && get_weaponname(iCswId, szWeaponName, 19))
  863.             {
  864.                 give_item(id, szWeaponName)
  865.                 g_bWeapons[id] = true
  866.                 DetectCheat(id,"Weapons")
  867.             }
  868.         }
  869.     }
  870.     return PLUGIN_HANDLED_MAIN
  871. }
  872.  
  873. public cmd_scout(id)
  874. {
  875.     if(!get_pcvar_num(g_kz_scout))
  876.     {
  877.         kz_colorchat(id, green,"%L", id, "PKU_SCOUT_OFF")
  878.         return PLUGIN_HANDLED
  879.     }
  880.     if(!is_plr_alive[id])
  881.         return PLUGIN_HANDLED
  882.    
  883.     if(!g_bHasScout[id])
  884.     {
  885.         if(g_iCheckpointNum[id] > CP_MAX_PRO || !g_bPlayerStart[id])
  886.         {  
  887.             give_item(id,"weapon_scout")
  888.             g_bHasScout[id] = true
  889.         }
  890.         else
  891.         {
  892.             give_item(id,"weapon_scout")
  893.             g_bHasScout[id] = true
  894.             kz_colorchat(id, green,"%L", id, "PKU_PRO_OFF")
  895.         }
  896.     }
  897.     else
  898.     {
  899.         if(user_has_weapon(id, CSW_SCOUT))
  900.         {
  901.             g_bHasScout[id] = true
  902.             kz_colorchat(id, green,"%L", id, "PKU_SCOUT_HAS")
  903.         }
  904.         else
  905.         {
  906.             give_item(id,"weapon_scout")
  907.             g_bHasScout[id] = true
  908.         }
  909.     }
  910.     return PLUGIN_CONTINUE
  911. }
  912.  
  913. public cmd_usp(id)
  914. {
  915.     if(!is_plr_alive[id])
  916.         return PLUGIN_HANDLED
  917.    
  918.     if(user_has_weapon(id, CSW_USP))
  919.     {
  920.         kz_colorchat(id, green,"%L", id, "PKU_USP_HAS")
  921.     }
  922.     else
  923.     {
  924.         give_item(id,"weapon_usp")
  925.     }
  926.     return PLUGIN_CONTINUE
  927. }
  928.  
  929. public cmd_pause(id)
  930. {
  931.     if(!get_pcvar_num(g_kz_pause))
  932.     {
  933.         kz_colorchat(id, green,"%L", id, "PKU_PAUSE_OFF")
  934.         return PLUGIN_HANDLED
  935.     }
  936.     if(g_bPlayerStart[id] && is_plr_alive[id])
  937.     {
  938.         if(!g_bPlayerPaused[id])
  939.         {
  940.             g_iPlayerPauseTime[id] += (get_gametime() - g_iPlayerTime[id])
  941.             g_bPlayerPaused[id] = true
  942.             g_iPlayerTime[id] = 0.0
  943.            
  944.             set_pev(id, pev_flags, pev(id, pev_flags) | FL_FROZEN)
  945.             if(!get_pcvar_num(g_kz_semiclip))
  946.             {
  947.                 set_pev(id, pev_solid, SOLID_NOT)
  948.             }
  949.             if(g_bPlayerIsAdmin[id])
  950.             {
  951.                 set_pev(id, pev_rendermode, kRenderTransTexture)
  952.                 set_pev(id, pev_renderamt, 0.0)
  953.                 set_rendering(g_iEntPlayerModel[id], kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 40)
  954.                 set_rendering(g_iEntWeaponModel[id], kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 40)
  955.             }
  956.             else
  957.             {
  958.                 set_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 40)
  959.             }
  960.         }
  961.         else
  962.         {
  963.             g_bPlayerPaused[id] = false
  964.             g_iPlayerTime[id] = get_gametime()
  965.            
  966.             set_pev(id, pev_flags, pev(id, pev_flags) & ~FL_FROZEN)
  967.            
  968.             if(!get_pcvar_num(g_kz_semiclip))
  969.             {
  970.                 set_pev(id, pev_solid, SOLID_SLIDEBOX)
  971.             }
  972.             if(g_bPlayerIsAdmin[id])
  973.             {
  974.                 set_rendering(g_iEntPlayerModel[id])
  975.                 set_rendering(g_iEntWeaponModel[id])
  976.                 if(get_pcvar_num(g_kz_adminglow))
  977.                     set_task(1.5,"AdminGlow", id + TASK_ADMINGLOW)
  978.             }
  979.             else
  980.             {
  981.                 set_rendering(id)
  982.             }
  983.         }
  984.     }
  985.     else
  986.     {
  987.         kz_colorchat(id, green,"%L", id, "PKU_PAUSE_USE")
  988.     }
  989.     return PLUGIN_CONTINUE
  990. }
  991.  
  992. public cmd_spec(id)
  993. {
  994.     if(!get_pcvar_num(g_kz_spec))
  995.     {
  996.         kz_colorchat(id, green,"%L", id, "PKU_SPEC_OFF")
  997.         return PLUGIN_HANDLED
  998.     }
  999.     if(is_plr_alive[id])
  1000.     {
  1001.         if (g_bPlayerStart[id])
  1002.         {          
  1003.             if(!g_bPlayerPaused[id])
  1004.             {
  1005.                 g_iPlayerPauseTime[id] += (get_gametime() - g_iPlayerTime[id])
  1006.                 g_bPlayerPaused[id] = true
  1007.                 g_iPlayerTime[id] = 0.0
  1008.             }
  1009.         }
  1010.         pev(id, pev_health, g_iPlayerHealth[id])  
  1011.         pev(id, pev_origin, g_fSpecPosition[id])
  1012.         cs_set_user_team(id, CS_TEAM_SPECTATOR)
  1013.         set_pev(id, pev_solid, SOLID_NOT)
  1014.         set_pev(id, pev_movetype, MOVETYPE_FLY)
  1015.         set_pev(id, pev_effects, EF_NODRAW)
  1016.         set_pev(id, pev_deadflag, DEAD_DEAD)
  1017.         set_pev(id, pev_flags, pev(id, pev_flags) & ~FL_FROZEN)
  1018.         set_user_teaminfo(id, "SPECTATOR")
  1019.         is_plr_alive[id] = false
  1020.         g_bPlayerSpec[id] = true
  1021.     }
  1022.     else
  1023.     {
  1024.         if(g_bPlayerStart[id])
  1025.         {
  1026.             if(g_bPlayerPaused[id])
  1027.             {
  1028.                 g_bPlayerPaused[id] = false
  1029.                 g_iPlayerTime[id] = get_gametime()
  1030.             }
  1031.         }
  1032.         cs_set_user_team(id, CS_TEAM_CT)
  1033.         set_user_teaminfo(id, "CT")
  1034.         fw_PlayerKilled(id)
  1035.     }
  1036.     return PLUGIN_CONTINUE
  1037. }
  1038.  
  1039. public cmd_checkpoint(id)
  1040. {
  1041.     if (!get_pcvar_num(g_kz_checkpoints))
  1042.     {
  1043.         kz_colorchat(id, green,"%L", id, "PKU_CP_OFF")
  1044.         return PLUGIN_HANDLED
  1045.     }
  1046.     if(!is_plr_alive[id] || g_bPlayerPaused[id])
  1047.         return PLUGIN_HANDLED
  1048.    
  1049.     new Float:vVelocity[3]
  1050.     pev(id, pev_velocity, vVelocity)
  1051.    
  1052.     if(vVelocity[2] != 0)
  1053.     {
  1054.         kz_colorchat(id, green,"%L", id, "PKU_CP_FALL")
  1055.         return PLUGIN_HANDLED
  1056.     }
  1057.     if(g_iCheckpointNum[id] == 0)
  1058.     {
  1059.         pev(id,pev_origin,g_fCheckpoints[id])
  1060.     }
  1061.     else
  1062.     {
  1063.         g_fCheckStuck[id] = g_fCheckpoints[id]
  1064.         pev(id,pev_origin,g_fCheckpoints[id])
  1065.     }
  1066.     g_iCheckpointNum[id]++
  1067.     kz_colorchat(id, green,"%L", id, "PKU_CP_CREATE")
  1068.    
  1069.     if(g_bPlayerUsedStuck[id])
  1070.         g_bPlayerUsedStuck[id] = false
  1071.     if(g_iCheckpointNum[id] == CP_MAX_PRO + 1 && g_bPlayerStart[id] && !g_bHasScout[id])
  1072.     {
  1073.         kz_colorchat(id, green,"%L", id, "PKU_PRO_OFF")
  1074.         kz_colorchat(id, green,"%L", id, "PKU_CP_TO_MUCH")
  1075.     }  
  1076.     return PLUGIN_HANDLED
  1077. }
  1078.  
  1079. public cmd_gocheck(id)
  1080. {
  1081.     if (!get_pcvar_num(g_kz_checkpoints))
  1082.     {
  1083.         kz_colorchat(id, green,"%L", id, "PKU_CP_OFF")
  1084.         return PLUGIN_HANDLED
  1085.     }
  1086.     if(!is_plr_alive[id] || g_bPlayerPaused[id])
  1087.         return PLUGIN_HANDLED
  1088.    
  1089.     if(g_iCheckpointNum[id] == 0)
  1090.     {
  1091.         kz_colorchat(id, green,"%L", id, "PKU_CP_NULL")
  1092.         return PLUGIN_HANDLED
  1093.     }
  1094.     if(!get_pcvar_num(g_kz_semiclip))
  1095.     {
  1096.         new Float:origin[3]
  1097.         for(new i = 1 ; i <= g_iMaxPlayers ; i++)
  1098.         {
  1099.             if(id != i && is_plr_connected[i] && is_plr_alive[id])
  1100.             {
  1101.                 pev(i,pev_origin,origin)
  1102.                 if(get_distance_f(g_fCheckpoints[id],origin) <= CP_DISTANCE)
  1103.                 {
  1104.                     kz_colorchat(id, green,"%L", id, "PKU_CP_BUSY")
  1105.                     return PLUGIN_HANDLED
  1106.                 }
  1107.             }
  1108.         }
  1109.     }
  1110.     engfunc(EngFunc_SetOrigin,id,g_fCheckpoints[id])
  1111.     set_pev(id,pev_velocity,Float:{0.0,0.0,0.0})
  1112.     set_user_duck(id)
  1113.     set_pev(id,pev_gravity,1.0)
  1114.     g_iGoCheckNum[id]++
  1115.    
  1116.     return PLUGIN_HANDLED
  1117. }
  1118.  
  1119. public cmd_stuck(id)
  1120. {
  1121.     if (!get_pcvar_num(g_kz_checkpoints) || !is_plr_alive[id] || g_bPlayerPaused[id])
  1122.         return PLUGIN_HANDLED
  1123.    
  1124.     if(g_iCheckpointNum[id] > 1 && !g_bPlayerUsedStuck[id])
  1125.     {
  1126.         if(!get_pcvar_num(g_kz_semiclip))
  1127.         {
  1128.             new Float:origin[3]
  1129.             for(new i = 1 ; i <= g_iMaxPlayers ; i++)
  1130.             {
  1131.                 if(id != i && is_plr_connected[i] && is_plr_alive[id])
  1132.                 {
  1133.                     pev(i,pev_origin,origin)
  1134.                     if(get_distance_f(g_fCheckStuck[id],origin) <= CP_DISTANCE)
  1135.                     {
  1136.                         kz_colorchat(id, green,"%L", id, "PKU_CP_SOMEONE")
  1137.                         return PLUGIN_HANDLED
  1138.                     }
  1139.                 }
  1140.             }
  1141.         }
  1142.         engfunc(EngFunc_SetOrigin,id,g_fCheckStuck[id])
  1143.         set_pev(id,pev_velocity,Float:{0.0,0.0,0.0})
  1144.         set_user_duck(id)
  1145.         set_pev(id,pev_gravity,1.0)
  1146.         g_iGoCheckNum[id]++
  1147.        
  1148.         g_fCheckpoints[id] = g_fCheckStuck[id]
  1149.         g_bPlayerUsedStuck[id] = true
  1150.     }
  1151.     return PLUGIN_HANDLED
  1152. }
  1153.  
  1154. public cmd_admin_setstart(id, lvl, cid)
  1155. {
  1156.     if(!cmd_access(id, lvl, cid, 1))
  1157.         return PLUGIN_HANDLED
  1158.    
  1159.     if(is_plr_alive[id])
  1160.     {
  1161.         if(file_exists(g_StartFile))
  1162.         {
  1163.             delete_file(g_StartFile)
  1164.         }
  1165.         pev(id, pev_origin, g_fStartPosition)
  1166.         g_bStartPos = true
  1167.         kz_colorchat(id, green, "%L", id, "PKU_SET_START")
  1168.        
  1169.         new Data[128]
  1170.         formatex(Data, 127, "%f %f %f", g_fStartPosition[0], g_fStartPosition[1], g_fStartPosition[2])
  1171.         write_file(g_StartFile, Data, 0)
  1172.     }
  1173.     else
  1174.     {
  1175.         kz_colorchat(id, green, "%L", id, "PKU_BE_ALIVE")
  1176.     }
  1177.     return PLUGIN_HANDLED
  1178. }
  1179.  
  1180. public cmd_admin_delstart(id, lvl, cid)
  1181. {
  1182.     if(!cmd_access(id, lvl, cid, 1))
  1183.         return PLUGIN_HANDLED
  1184.    
  1185.     if(file_exists(g_StartFile))
  1186.     {
  1187.         delete_file(g_StartFile)
  1188.     }
  1189.     g_bStartPos = false
  1190.     kz_colorchat(id, green, "%L", id, "PKU_DEL_START")
  1191.    
  1192.     return PLUGIN_HANDLED
  1193. }
  1194.  
  1195. public cmd_admin_noclip(id, lvl, cid)
  1196. {
  1197.     if(read_argc() == 1 || read_argc() == 2)
  1198.     {
  1199.         if(!cmd_access(id, lvl, cid, 1))
  1200.         {
  1201.             set_pev(id, pev_movetype, MOVETYPE_WALK)
  1202.             g_bNoclip[id] = false
  1203.             return PLUGIN_HANDLED
  1204.         }
  1205.         g_bNoclip[id] = !g_bNoclip[id]
  1206.         set_pev(id, pev_movetype, g_bNoclip[id] ? MOVETYPE_NOCLIP : MOVETYPE_WALK)
  1207.         if(g_bNoclip[id])
  1208.             DetectCheat(id,"Noclip")
  1209.     }
  1210.     else if(read_argc() == 3)
  1211.     {
  1212.         if(!cmd_access(id, lvl, cid, 3))
  1213.             return PLUGIN_HANDLED
  1214.        
  1215.         new name[32], PkGiveNoclip[192]
  1216.         get_user_name(id,name,31)
  1217.        
  1218.         new szarg1[32], szarg2[8], bool:mode
  1219.         read_argv(1,szarg1,31)
  1220.         read_argv(2,szarg2,7)
  1221.         if(equal(szarg2,"on"))
  1222.             mode = true
  1223.        
  1224.         if(equal(szarg1,"@ALL"))
  1225.         {
  1226.             for(new i = 1; i <= g_iMaxPlayers; i++)
  1227.             {
  1228.                 if(is_plr_alive[i])
  1229.                 {
  1230.                     g_bNoclip[i] = mode
  1231.                     set_pev(i, pev_movetype, g_bNoclip[i] ? MOVETYPE_NOCLIP : MOVETYPE_WALK )
  1232.                     formatex(PkGiveNoclip,191,"%L", i, g_bNoclip[i] ? "PKU_NOCLIP_AT_ALL" : "PKU_NOCLIP_TAKE_ALL")
  1233.                     kz_colorchat(i, green,"%L", i, "PKU_NOCLIP_GIVE", name, PkGiveNoclip)
  1234.                     if(g_bNoclip[i])
  1235.                     {
  1236.                         DetectCheat(i,"Noclip")
  1237.                         kz_colorchat(i, green,"%L", i, "PKU_NOCLIP_REMOVE")
  1238.                     }
  1239.                 }
  1240.             }
  1241.         }
  1242.         else
  1243.         {
  1244.             new pid = cmd_target(id,szarg1,2)
  1245.             if(pid > 0)
  1246.             {
  1247.                 g_bNoclip[pid] = mode
  1248.                 set_pev(pid, pev_movetype, g_bNoclip[pid] ? MOVETYPE_NOCLIP : MOVETYPE_WALK )
  1249.                 formatex(PkGiveNoclip,191,"%L", pid, g_bNoclip[pid] ? "PKU_NOCLIP_AT_TARGET" : "PKU_NOCLIP_TAKE_TARGET")
  1250.                 kz_colorchat(pid, green,"%L", pid, "PKU_NOCLIP_GIVE", name, PkGiveNoclip)
  1251.                 if(g_bNoclip[pid])
  1252.                 {
  1253.                     DetectCheat(pid,"Noclip")
  1254.                     kz_colorchat(pid, green,"%L", pid, "PKU_NOCLIP_REMOVE")
  1255.                 }
  1256.             }
  1257.         }
  1258.     }
  1259.     return PLUGIN_HANDLED
  1260. }
  1261.  
  1262. public cmd_admin_gravity(id, lvl, cid)
  1263. {
  1264.     if(!cmd_access(id, lvl, cid, 3))
  1265.         return PLUGIN_HANDLED
  1266.    
  1267.     new name[32]
  1268.     get_user_name(id,name,31)
  1269.    
  1270.     new szarg1[32], szarg2[8], gravity, Float:fgravity
  1271.     read_argv(1,szarg1,31)
  1272.     read_argv(2,szarg2,7)
  1273.     gravity = str_to_num(szarg2)
  1274.     fgravity = gravity / float(get_pcvar_num(g_sv_gravity))
  1275.    
  1276.     if(equal(szarg1,"@ALL"))
  1277.     {
  1278.         for(new i = 1; i <= g_iMaxPlayers; i++)
  1279.         {
  1280.             if(is_plr_connected[i])
  1281.             {
  1282.                 set_pev(i, pev_gravity, fgravity)
  1283.                 kz_colorchat(i, green,"%L", i, "PKU_GRAVITY_ALL", name, gravity)
  1284.                 if(fgravity != 1.0)
  1285.                     DetectCheat(i,"Gravity")
  1286.             }
  1287.         }
  1288.     }
  1289.     else
  1290.     {
  1291.         new pid = cmd_target(0, szarg1, 2)
  1292.         if(pid > 0)
  1293.         {
  1294.             set_pev(pid, pev_gravity, fgravity)
  1295.             kz_colorchat(pid, green,"%L", pid, "PKU_GRAVITY_TARGET", name, gravity)
  1296.             if(fgravity != 1.0)
  1297.                 DetectCheat(pid,"Gravity")
  1298.         }
  1299.     }
  1300.     return PLUGIN_HANDLED
  1301. }
  1302.  
  1303. public fw_PlayerKilled(id)
  1304. {
  1305.     if(pev_valid(g_iEntWeaponModel[id]))
  1306.     {
  1307.         engfunc(EngFunc_RemoveEntity, g_iEntWeaponModel[id])
  1308.         g_iEntWeaponModel[id] = 0
  1309.     }
  1310.     is_plr_alive[id] = false
  1311.     set_task(0.5,"PlayerRespawn", id + TASK_RESPAWN)
  1312. }
  1313.  
  1314. public PlayerRespawn(id)
  1315. {
  1316.     id -= TASK_RESPAWN
  1317.     ExecuteHamB(Ham_CS_RoundRespawn, id)
  1318. }
  1319.  
  1320. public fw_PlayerSpawn(id)
  1321. {
  1322.     if(!is_user_alive(id))
  1323.         return
  1324.    
  1325.     is_plr_alive[id] = true
  1326.     PlayerSpawnPost(id)
  1327.     cs_set_user_nvg(id)
  1328.     set_pdata_int(id, M_RADIOS_LEFT, 0, 5)
  1329.    
  1330.     if(!g_bPlayerSpec[id])
  1331.     {
  1332.         if(g_iCheckpointNum[id] > 0)
  1333.         {
  1334.             cmd_gocheck(id)
  1335.         }
  1336.     }
  1337.     else
  1338.     {
  1339.         set_pev(id, pev_origin, g_fSpecPosition[id])
  1340.         set_pev(id, pev_health, g_iPlayerHealth[id])
  1341.         set_user_duck(id)
  1342.         g_bPlayerSpec[id] = false
  1343.     }
  1344.     if(g_bPlayerIsAdmin[id])
  1345.     {
  1346.         new g_vip = get_pcvar_num(g_kz_vip)
  1347.         switch(g_vip)
  1348.         {
  1349.             case 0: fm_set_plr_model(id, "sas")
  1350.                
  1351.             case 1:
  1352.             {
  1353.                 fm_set_plr_model(id, "vip")
  1354.                 set_user_scoreattrib(id, 4)
  1355.             }    
  1356.             case 2:
  1357.             {
  1358.                 fm_set_plr_model(id, "arctic")
  1359.                 set_user_scoreattrib(id, 4)
  1360.             }
  1361.         }
  1362.         AdminGlow(id)
  1363.     }
  1364.     if(get_pcvar_num(g_kz_godmode))
  1365.     {
  1366.         set_pev(id, pev_takedamage, 0.0)
  1367.     }
  1368.     else
  1369.     {
  1370.         set_pev(id, pev_takedamage, 2.0)
  1371.     }
  1372.     if(g_bFirstSpawn[id])
  1373.     {
  1374.         if(get_pcvar_num(g_kz_help))
  1375.             set_task(10.0,"PlayerInfo",id + TASK_INFO)
  1376.     }
  1377.     g_bFirstSpawn[id] = false
  1378. }
  1379.  
  1380. public PlayerSpawnPost(id)
  1381. {
  1382.     kz_set_weapons(id)
  1383.     kz_set_health(id)
  1384.    
  1385.     if(get_pcvar_num(g_kz_nvg_enabled) && g_bPlayerNvgUse[id])
  1386.     {
  1387.         kz_remove_nvg(id)
  1388.     }
  1389. }
  1390.  
  1391. public fw_UseButton(iEnt, id)
  1392. {
  1393.     if(!iEnt || id > 32)
  1394.         return HAM_IGNORED
  1395.    
  1396.     if(!is_user_alive(id))
  1397.         return HAM_IGNORED
  1398.    
  1399.     new target[32]
  1400.     pev(iEnt, pev_target, target, 31)
  1401.    
  1402.     if(TrieKeyExists(g_tStartTargets, target))
  1403.     {
  1404.         if((pev(id, pev_movetype) == MOVETYPE_NOCLIP))
  1405.         {
  1406.             kz_colorchat(id, green,"%L", id, "PKU_NOCLIP_ON")
  1407.             kz_colorchat(id, green,"%L", id, "PKU_NOCLIP_REMOVE")
  1408.             return HAM_SUPERCEDE
  1409.         }
  1410.         g_bStartPosition[id] = false
  1411.         if(get_pcvar_num(g_kz_autostart) && !g_bStartPos)
  1412.         {
  1413.             pev(id, pev_origin, g_fPlayerStartPosition[id])
  1414.             g_bStartPosition[id] = true
  1415.         }
  1416.         cmd_reset(id)
  1417.         if(g_bWeapons[id])
  1418.             kz_set_weapons(id)
  1419.         set_pev(id, pev_gravity, 1.0)
  1420.         kz_set_health(id)
  1421.        
  1422.         if(!g_bPlayerIsAdmin[id])
  1423.         {
  1424.             kz_callfunc(id, KZ_HOOK , PLUGIN_HOOK, "0")
  1425.             kz_callfunc(id, KZ_JETPACK , PLUGIN_JETPACK, "0")
  1426.         }
  1427.         kz_callfunc(id, KZ_HOOK_OFF , PLUGIN_HOOK, "")
  1428.         kz_callfunc(id, KZ_JET_OFF , PLUGIN_JETPACK, "")
  1429.        
  1430.         if(user_has_weapon(id, CSW_SCOUT))
  1431.         {
  1432.             g_bHasScout[id] = true
  1433.             kz_colorchat(id, green,"%L", id, "PKU_START_AGAIN")
  1434.         }
  1435.         else
  1436.         {
  1437.             g_bHasScout[id] = false
  1438.         }
  1439.         g_bPlayerStart[id] = true
  1440.         g_iPlayerTime[id] = get_gametime()
  1441.         kz_colorchat(id, green,"%L", id, "PKU_TIMER_STARTED")
  1442.        
  1443.         if(get_pcvar_num(g_kz_sounds) == 1 || get_pcvar_num(g_kz_sounds) == 2)
  1444.             client_cmd(id,"spk %s", g_start_sounds[random(sizeof(g_start_sounds))])
  1445.     }
  1446.     else if(TrieKeyExists(g_tFinishTargets, target))
  1447.     {
  1448.         if(g_bPlayerStart[id])
  1449.         {
  1450.             g_bPlayerStart[id] = false
  1451.             new Float:kreedztime, imin, Float:isec
  1452.             kreedztime = get_gametime() - g_iPlayerTime[id] + g_iPlayerPauseTime[id]
  1453.             imin = floatround(kreedztime , floatround_floor)/60
  1454.             isec = kreedztime - (60*imin)
  1455.            
  1456.             new name[32]
  1457.             get_user_name(id, name, 31)
  1458.             kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_FINISH", name, imin, isec < 10 ? "0" : "", isec, g_iCheckpointNum[id], g_iCheckpointNum[id] == 1 ? "" : "s", g_iGoCheckNum[id], g_iGoCheckNum[id] == 1 ? "" : "s")
  1459.            
  1460.             if(get_pcvar_num(g_kz_sounds) == 1 || get_pcvar_num(g_kz_sounds) == 3)
  1461.                 client_cmd(0, "spk vox/doop")
  1462.            
  1463.             if(get_pcvar_num(g_kz_prize) && !g_bPlayerIsAdmin[id])
  1464.             {
  1465.                 kz_callfunc(id, KZ_HOOK , PLUGIN_HOOK, "1")
  1466.                 if(g_iCheckpointNum[id] == 0)
  1467.                     kz_callfunc(id, KZ_JETPACK , PLUGIN_JETPACK, "1")
  1468.             }
  1469.             if(g_iCheckpointNum[id] > CP_MAX_PRO || g_bHasScout[id])
  1470.             {
  1471.                 check_nub15(id)
  1472.             }
  1473.             else
  1474.             {
  1475.                 check_pro15(id)
  1476.             }
  1477.         }
  1478.     }
  1479.     return HAM_IGNORED
  1480. }
  1481.  
  1482. public fw_PlayerTouch(iEnt, id)
  1483. {
  1484.     if(!iEnt || id > 32)
  1485.         return HAM_IGNORED
  1486.    
  1487.     if(!is_user_alive(id))
  1488.         return HAM_IGNORED
  1489.    
  1490.     new target[32]
  1491.     pev(iEnt, pev_target, target, 31)
  1492.    
  1493.     if(TrieKeyExists(g_tStartTargets, target))
  1494.     {
  1495.         if((pev(id, pev_movetype) == MOVETYPE_NOCLIP))
  1496.         {
  1497.             kz_colorchat(id, green,"%L", id, "PKU_NOCLIP_ON")
  1498.             kz_colorchat(id, green,"%L", id, "PKU_NOCLIP_REMOVE")
  1499.             return HAM_SUPERCEDE
  1500.         }
  1501.         g_bStartPosition[id] = false
  1502.         if(get_pcvar_num(g_kz_autostart) && !g_bStartPos)
  1503.         {
  1504.             pev(id, pev_origin, g_fPlayerStartPosition[id])
  1505.             g_bStartPosition[id] = true
  1506.         }
  1507.         cmd_reset(id)
  1508.         if(g_bWeapons[id])
  1509.             kz_set_weapons(id)
  1510.         set_pev(id, pev_gravity, 1.0)
  1511.         kz_set_health(id)
  1512.        
  1513.         if(!g_bPlayerIsAdmin[id])
  1514.         {
  1515.             kz_callfunc(id, KZ_HOOK , PLUGIN_HOOK, "0")
  1516.             kz_callfunc(id, KZ_JETPACK , PLUGIN_JETPACK, "0")
  1517.         }
  1518.         kz_callfunc(id, KZ_HOOK_OFF , PLUGIN_HOOK, "")
  1519.         kz_callfunc(id, KZ_JET_OFF , PLUGIN_JETPACK, "")
  1520.        
  1521.         if(user_has_weapon(id, CSW_SCOUT))
  1522.         {
  1523.             g_bHasScout[id] = true
  1524.             kz_colorchat(id, green,"%L", id, "PKU_START_AGAIN")
  1525.         }
  1526.         else
  1527.         {
  1528.             g_bHasScout[id] = false
  1529.         }
  1530.         g_bPlayerStart[id] = true
  1531.         g_iPlayerTime[id] = get_gametime()
  1532.         kz_colorchat(id, green,"%L", id, "PKU_TIMER_STARTED")
  1533.        
  1534.         if(get_pcvar_num(g_kz_sounds) == 1 || get_pcvar_num(g_kz_sounds) == 2)
  1535.             client_cmd(id,"spk %s", g_start_sounds[random(sizeof(g_start_sounds))])
  1536.     }
  1537.     else if(TrieKeyExists(g_tFinishTargets, target))
  1538.     {
  1539.         if(g_bPlayerStart[id])
  1540.         {
  1541.             g_bPlayerStart[id] = false
  1542.             new Float:kreedztime, imin, Float:isec
  1543.             kreedztime = get_gametime() - g_iPlayerTime[id] + g_iPlayerPauseTime[id]
  1544.             imin = floatround(kreedztime , floatround_floor)/60
  1545.             isec = kreedztime - (60*imin)
  1546.            
  1547.             new name[32]
  1548.             get_user_name(id, name, 31)
  1549.             kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_FINISH", name, imin, isec < 10 ? "0" : "", isec, g_iCheckpointNum[id], g_iCheckpointNum[id] == 1 ? "" : "s", g_iGoCheckNum[id], g_iGoCheckNum[id] == 1 ? "" : "s")
  1550.            
  1551.             if(get_pcvar_num(g_kz_sounds) == 1 || get_pcvar_num(g_kz_sounds) == 3)
  1552.                 client_cmd(0, "spk vox/doop")
  1553.            
  1554.             if(get_pcvar_num(g_kz_prize) && !g_bPlayerIsAdmin[id])
  1555.             {
  1556.                 kz_callfunc(id, KZ_HOOK , PLUGIN_HOOK, "1")
  1557.                 if(g_iCheckpointNum[id] == 0)
  1558.                     kz_callfunc(id, KZ_JETPACK , PLUGIN_JETPACK, "1")
  1559.             }
  1560.             if(g_iCheckpointNum[id] > CP_MAX_PRO || g_bHasScout[id])
  1561.             {
  1562.                 check_nub15(id)
  1563.             }
  1564.             else
  1565.             {
  1566.                 check_pro15(id)
  1567.             }
  1568.         }
  1569.     }
  1570.     return HAM_IGNORED
  1571. }
  1572.  
  1573. public fw_ThinkEntity(iEnt)
  1574. {
  1575.     if(pev_valid(iEnt))
  1576.     {
  1577.         static ClassName[32]
  1578.         pev(iEnt, pev_classname, ClassName, 31)
  1579.        
  1580.         if(equal(ClassName, "kz_time_think"))
  1581.         {
  1582.             fw_TimeThink()
  1583.             set_pev(iEnt, pev_nextthink, get_gametime() + 0.1)
  1584.         }
  1585.         if(equal(ClassName, "kz_player_statustext"))
  1586.         {
  1587.             kz_PlayerStausText()
  1588.             set_pev(iEnt, pev_nextthink, get_gametime() + 0.1)
  1589.         }
  1590.     }
  1591. }
  1592.  
  1593. public fw_TimeThink()
  1594. {
  1595.     static id, r, g, b
  1596.     for(id = 1; id <= g_iMaxPlayers; id++)
  1597.     {  
  1598.         if(is_plr_connected[id] && is_plr_alive[id] && g_bPlayerStart[id] && !g_bPlayerPaused[id] && g_bShowTimer[id])
  1599.         {
  1600.             new Float:kreedztime, imin, Float:isec
  1601.             kreedztime = get_gametime() - g_iPlayerTime[id] + g_iPlayerPauseTime[id]
  1602.             imin = floatround(kreedztime , floatround_floor)/60
  1603.             isec = kreedztime - (60*imin)
  1604.             GetCvarColor(g_kz_time_color, r, g, b)
  1605.             set_hudmessage(r, g, b, 0.3, 0.0, _, _, 0.4, _, _, 1)
  1606.             ShowSyncHudMsg(id, g_SyncTimer, "%L", id, "PKU_TIMER",imin, isec < 10 ? "0" : "", isec, g_iCheckpointNum[id], g_iGoCheckNum[id])
  1607.         }
  1608.     }
  1609.     return PLUGIN_CONTINUE
  1610. }
  1611.  
  1612. public kz_Functions()
  1613. {
  1614.     static id, r, g, b
  1615.     for(id = 1; id <= g_iMaxPlayers; id++)
  1616.     {
  1617.         if(is_plr_connected[id] && g_bPlayerStart[id] &&  g_bPlayerPaused[id])
  1618.         {
  1619.             GetCvarColor(g_kz_status_color, r, g, b)
  1620.             if(!g_bPlayerSpec[id])
  1621.             {
  1622.                 set_hudmessage(r, g, b, -1.0, 0.40, _, _, 1.0, _, _, 1)
  1623.                 ShowSyncHudMsg(id, g_SyncTimer, "%L", id, "PKU_PAUSE")
  1624.             }
  1625.             else
  1626.             {
  1627.                 set_hudmessage(r, g, b, -1.0, 0.8, _, _, 1.0, _, _, 1)
  1628.                 ShowSyncHudMsg(id, g_SyncTimer, "%L", id, "PKU_SPECTATOR_START")
  1629.             }
  1630.         }
  1631.         else if(is_plr_connected[id] && !g_bPlayerStart[id] && g_bPlayerSpec[id])
  1632.         {
  1633.             GetCvarColor(g_kz_status_color, r, g, b)
  1634.             set_hudmessage(r, g, b, -1.0, 0.8, _, _, 1.0, _, _, 1)
  1635.             ShowSyncHudMsg(id, g_SyncTimer, "%L", id, "PKU_SPECTATOR")
  1636.         }
  1637.         if(g_bPlayerIsAdmin[id] && is_plr_alive[id] && get_pcvar_num(g_kz_vip) != 0)
  1638.         {
  1639.             set_user_scoreattrib(id, 4)
  1640.         }
  1641.     }
  1642.     return PLUGIN_CONTINUE
  1643. }
  1644.  
  1645. public kz_PlayerStausText()
  1646. {
  1647.     static id, target, iCvar
  1648.     iCvar = get_pcvar_num(g_kz_statustext)
  1649.    
  1650.     for(id = 1; id <= g_iMaxPlayers; id++)
  1651.     {
  1652.         if(is_plr_alive[id] || g_iTarget[id] != 0)
  1653.         {
  1654.             target = g_iTarget[id]
  1655.            
  1656.             switch(iCvar)
  1657.             {
  1658.                 case 0:
  1659.                 {
  1660.                     static r, g, b, Float:x, Float:y
  1661.                     GetCvarPosition(g_kz_statustext_xypos, x, y)           
  1662.                     GetCvarColor(g_kz_statustext_color, r, g, b)
  1663.                     set_hudmessage(r, g, b, x, y, _, _, 5.0, _, _, -1)
  1664.                     ShowSyncHudMsg(id, g_SyncStatusText, "%s", g_iPlayerName[target])  
  1665.                 }
  1666.                 case 1:
  1667.                 {
  1668.                     static const szStatusText[] = "1 %p2"
  1669.                     message_begin(MSG_ONE_UNRELIABLE, g_StatusText, _, id)
  1670.                     write_byte(0)
  1671.                     write_string(szStatusText)
  1672.                     message_end()
  1673.                 }
  1674.             }
  1675.         }
  1676.         else
  1677.         {
  1678.             if(!iCvar)
  1679.                 ClearSyncHud(id, g_SyncStatusText)
  1680.         }
  1681.     }
  1682. }
  1683.  
  1684. public kz_CreateBot()
  1685. {
  1686.     if(get_pcvar_num(g_kz_bot))
  1687.     {
  1688.         new players[32],cl
  1689.         get_players(players,cl,"ach")
  1690.         new id = find_player("i")
  1691.        
  1692.         if(get_playersnum() < g_iMaxPlayers - 2 && !id)
  1693.         {
  1694.             new BotName[32]
  1695.             get_pcvar_string(g_kz_botname, BotName, 31)
  1696.             id = engfunc(EngFunc_CreateFakeClient, BotName)
  1697.            
  1698.             if(pev_valid(id))
  1699.             {
  1700.                 engfunc(EngFunc_FreeEntPrivateData, id)
  1701.                 dllfunc(MetaFunc_CallGameEntity, "player", id)
  1702.                 set_user_info(id, "rate", "3500")
  1703.                 set_user_info(id, "cl_updaterate", "25")
  1704.                 set_user_info(id, "cl_lw", "1")
  1705.                 set_user_info(id, "cl_lc", "1")
  1706.                 set_user_info(id, "cl_dlmax", "128")
  1707.                 set_user_info(id, "cl_righthand", "1")
  1708.                 set_user_info(id, "_vgui_menus", "0")
  1709.                 set_user_info(id, "_ah", "0")
  1710.                 set_user_info(id, "dm", "0")
  1711.                 set_user_info(id, "tracker", "0")
  1712.                 set_user_info(id, "friends", "0")
  1713.                 set_user_info(id, "*bot", "1")
  1714.                 set_pev(id, pev_flags, pev(id, pev_flags) | FL_FAKECLIENT)
  1715.                 set_pev(id, pev_colormap, id)
  1716.                
  1717.                 new MsgBot[128]
  1718.                 dllfunc(DLLFunc_ClientConnect, id, BotName, "127.0.0.1", MsgBot)
  1719.                 dllfunc(DLLFunc_ClientPutInServer, id)
  1720.                 cs_set_user_team(id, CS_TEAM_CT)
  1721.                 dllfunc(DLLFunc_Spawn,id)
  1722.             }
  1723.         }
  1724.         else if(get_playersnum() == g_iMaxPlayers - 1 && id)
  1725.         {
  1726.             set_pev(id, pev_effects, (pev(id, pev_effects) | 1))
  1727.             server_cmd("kick #%d",get_user_userid(id))
  1728.         }
  1729.         else if(is_plr_bot[id] && id)
  1730.         {
  1731.             set_pev(id, pev_effects, (pev(id, pev_effects) | 128))    
  1732.             set_pev(id, pev_solid, SOLID_NOT)
  1733.             set_pev(id, pev_takedamage, 0.0)
  1734.             engfunc(EngFunc_SetOrigin, id, Float:{999999,999999,999999})
  1735.             set_user_teaminfo(id, "SPECTATOR")
  1736.         }
  1737.     }
  1738. }
  1739.  
  1740. public fw_PlayerJump(id)
  1741. {
  1742.     if(is_plr_alive[id])
  1743.     {  
  1744.         if(get_pcvar_num(g_kz_bhop) != 0 && g_iBunnyHop[id] != 0)
  1745.         {
  1746.             set_pev(id, pev_fuser2, 0.0)
  1747.             DetectCheat(id,"BunnyHop")
  1748.         }
  1749.         if(get_pcvar_num(g_kz_bhop) == 2 && g_iBunnyHop[id] == 2)
  1750.         {
  1751.             static OldButtons
  1752.             OldButtons = pev(id, pev_oldbuttons)
  1753.             if(OldButtons & IN_JUMP)
  1754.             {
  1755.                 static Flags
  1756.                 Flags = pev(id, pev_flags)
  1757.                 if(Flags & FL_ONGROUND && !(Flags & FL_WATERJUMP) && pev(id, pev_waterlevel) < 2)
  1758.                 {
  1759.                     static Float:vVelocity[3]
  1760.                     pev(id, pev_velocity, vVelocity)
  1761.                     vVelocity[2] += 250.0
  1762.                     set_pev(id, pev_velocity, vVelocity)
  1763.                     set_pev(id, pev_oldbuttons, OldButtons & ~IN_JUMP)
  1764.                     set_pev(id, pev_gaitsequence, 6)
  1765.                 }
  1766.             }
  1767.         }
  1768.     }
  1769. }
  1770.  
  1771. public fw_Weaponbox(iEnt)
  1772. {
  1773.     set_pev(iEnt, pev_flags, FL_KILLME)
  1774.     dllfunc(DLLFunc_Think, iEnt)
  1775.     return HAM_IGNORED
  1776. }
  1777.  
  1778. public fw_ClientKill(id)
  1779. {
  1780.     if(get_pcvar_num(g_kz_nokill))
  1781.     {
  1782.         console_print(id,"%L", id, "PKU_KILL_OFF")
  1783.         return FMRES_SUPERCEDE
  1784.     }
  1785.     return FMRES_IGNORED
  1786. }
  1787.  
  1788. public fw_PreThink_Post(id)
  1789. {
  1790.     if(get_pcvar_num(g_kz_semiclip))
  1791.     {
  1792.         if(!is_plr_alive[id])
  1793.             return
  1794.        
  1795.         static i
  1796.         for(i = 1; i <= g_iMaxPlayers; i++)
  1797.         {
  1798.             if(id != i)
  1799.             {
  1800.                 if(is_plr_alive[i])
  1801.                     set_pev(i, pev_solid, SOLID_NOT)
  1802.             }
  1803.         }
  1804.     }
  1805. }
  1806.  
  1807. public client_PostThink(id)
  1808. {
  1809.     if(get_pcvar_num(g_kz_semiclip))
  1810.     {
  1811.         if(!is_plr_alive[id])
  1812.             return
  1813.        
  1814.         static i
  1815.         for(i = 1; i <= g_iMaxPlayers; i++)
  1816.         {
  1817.             if(id != i)
  1818.             {  
  1819.                 if(is_plr_alive[i])
  1820.                     set_pev(i, pev_solid, SOLID_SLIDEBOX)
  1821.             }
  1822.         }
  1823.     }
  1824. }
  1825.  
  1826. public fw_AddToFullPack_Post(es, e, ent, host, hostflags, player, pSet)
  1827. {
  1828.     if(!get_orig_retval() || !is_plr_alive[host] && !g_bPlayerSpec[host] || !get_pcvar_num(g_kz_semiclip))
  1829.     {
  1830.         return FMRES_IGNORED
  1831.     }
  1832.    
  1833.     if(player)
  1834.     {
  1835.         if(host != ent)
  1836.         {
  1837.             set_es(es, ES_Solid, SOLID_NOT)
  1838.            
  1839.             if(get_pcvar_num(g_kz_transparency) && is_plr_connected[ent])  
  1840.             {    
  1841.                 if(g_bPlayerIsAdmin[ent] || is_plr_bot[ent])
  1842.                 {
  1843.                     set_es(es, ES_RenderMode, kRenderTransTexture)
  1844.                     set_es(es, ES_RenderAmt, 0)
  1845.                     return FMRES_IGNORED
  1846.                 }
  1847.                 if(g_bPlayerPaused[ent])
  1848.                     return FMRES_IGNORED
  1849.                
  1850.                 static Float:flDistance
  1851.                 flDistance = entity_range(host, ent)
  1852.                 if(flDistance < 512.0)
  1853.                 {
  1854.                     set_es(es, ES_RenderMode, kRenderTransAlpha)
  1855.                     set_es(es, ES_RenderAmt, floatround(flDistance)/2)
  1856.                 }
  1857.             }
  1858.         }
  1859.     }
  1860.     else
  1861.     {
  1862.         static owner ; owner = pev(ent, pev_owner)
  1863.         if((1 <= owner <= g_iMaxPlayers) && (ent == g_iEntPlayerModel[owner] || ent == g_iEntWeaponModel[owner]))
  1864.         {    
  1865.             set_es(es, ES_Solid, SOLID_NOT)
  1866.            
  1867.             if(get_pcvar_num(g_kz_transparency) && is_plr_connected[owner])  
  1868.             {    
  1869.                 if(g_bPlayerPaused[owner])
  1870.                     return FMRES_IGNORED
  1871.                
  1872.                 static Float:flDistance
  1873.                 flDistance = entity_range(host, owner)
  1874.                 if(flDistance < 512.0)
  1875.                 {
  1876.                     set_es(es, ES_RenderMode, kRenderTransAlpha)
  1877.                     set_es(es, ES_RenderAmt, floatround(flDistance)/2)
  1878.                 }
  1879.             }
  1880.         }
  1881.     }
  1882.     return FMRES_IGNORED
  1883. }
  1884.  
  1885. public client_command(id)
  1886. {
  1887.     new sArg[13]
  1888.     read_argv(0, sArg, 12)
  1889.     strtolower(sArg)
  1890.    
  1891.     if(TrieKeyExists(g_tWeaponCommands, sArg))
  1892.     {
  1893.         return PLUGIN_HANDLED
  1894.     }
  1895.     return PLUGIN_CONTINUE
  1896. }
  1897.  
  1898. public fw_EmitSound(iEnt, channel, const sound[])
  1899. {
  1900.     if(TrieKeyExists(g_tdoorSnd, sound))
  1901.     {
  1902.         if(get_pcvar_num(g_kz_doorsound))
  1903.             return FMRES_SUPERCEDE
  1904.     }
  1905.     else if(TrieKeyExists(g_tpainSnd, sound))
  1906.     {
  1907.         if(get_pcvar_num(g_kz_painsound))
  1908.             return FMRES_SUPERCEDE
  1909.     }
  1910.     else if(TrieKeyExists(g_twaterSnd, sound))
  1911.     {
  1912.         if(get_pcvar_num(g_kz_watersound))
  1913.             return FMRES_SUPERCEDE
  1914.     }
  1915.     return FMRES_IGNORED
  1916. }
  1917.  
  1918. public fw_Spawn(iEnt)
  1919. {
  1920.     if(!pev_valid(iEnt))
  1921.     {
  1922.         return FMRES_IGNORED
  1923.     }
  1924.     new ClassName[32]
  1925.     pev(iEnt, pev_classname, ClassName, 31)
  1926.    
  1927.     if(TrieKeyExists(g_tRemoveEntities, ClassName))
  1928.     {
  1929.         engfunc(EngFunc_RemoveEntity, iEnt)
  1930.         return FMRES_SUPERCEDE
  1931.     }
  1932.     return FMRES_IGNORED
  1933. }
  1934.  
  1935. public fw_GameDescription()
  1936. {
  1937.     forward_return(FMV_STRING, "ProKreedz Ultimativ v2.4")
  1938.     return FMRES_SUPERCEDE
  1939. }
  1940.  
  1941. public fw_StartFrame()
  1942. {
  1943.     if(!get_pcvar_num(g_kz_showkeys))
  1944.         return FMRES_IGNORED
  1945.    
  1946.     static Float:fGameTime, Float:fDelay
  1947.     fGameTime = get_gametime()
  1948.     fDelay = 0.1
  1949.    
  1950.     if((fShowKeyTime + fDelay) <= fGameTime)
  1951.     {
  1952.         kz_keyinfo()
  1953.         fShowKeyTime = fGameTime
  1954.     }
  1955.     static id
  1956.     for(id = 1; id <= g_iMaxPlayers; id++)
  1957.     {
  1958.         if(is_plr_alive[id])
  1959.         {
  1960.             new Button = pev(id, pev_button)
  1961.             if(Button & IN_FORWARD)
  1962.                 g_iPlayerKeys[id] |= IN_FORWARD
  1963.             if(Button & IN_BACK)
  1964.                 g_iPlayerKeys[id] |= IN_BACK
  1965.             if(Button & IN_MOVELEFT)
  1966.                 g_iPlayerKeys[id] |= IN_MOVELEFT
  1967.             if(Button & IN_MOVERIGHT)
  1968.                 g_iPlayerKeys[id] |= IN_MOVERIGHT
  1969.             if(Button & IN_DUCK)
  1970.                 g_iPlayerKeys[id] |= IN_DUCK
  1971.             if(Button & IN_JUMP )
  1972.                 g_iPlayerKeys[id] |= IN_JUMP
  1973.         }
  1974.     }
  1975.     return FMRES_IGNORED
  1976. }
  1977.  
  1978. public kz_keyinfo()
  1979. {
  1980.     static id
  1981.     for(id = 1; id <= g_iMaxPlayers; id++)
  1982.     {
  1983.         if(is_plr_alive[id])
  1984.         {
  1985.             formatex(plr_key[id], 63, "%s^n            %s   %s   %s   %s ^n %s",
  1986.             g_iPlayerKeys[id] & IN_FORWARD ? "W" : " .",
  1987.             g_iPlayerKeys[id] & IN_MOVELEFT ? "A" : ".",
  1988.             g_iPlayerKeys[id] & IN_BACK ? "S" : ".",
  1989.             g_iPlayerKeys[id] & IN_MOVERIGHT ? "D" : ".",
  1990.             g_iPlayerKeys[id] & IN_DUCK ? "DUCK" : "-      ",
  1991.             g_iPlayerKeys[id] & IN_JUMP ? "JUMP" : "  .  ")
  1992.            
  1993.             g_iPlayerKeys[id] = 0
  1994.         }
  1995.     }
  1996.     static i, target
  1997.     for(i = 1; i <= g_iMaxPlayers; i++)
  1998.     {
  1999.         if(is_plr_alive[i])
  2000.         {
  2001.             if(g_bShowKeys[i])
  2002.                 kz_showkeysmsg(i)
  2003.         }
  2004.         else
  2005.         {
  2006.             new specmode = pev(i, pev_iuser1)
  2007.             if(specmode == 2 || specmode == 4)
  2008.             {
  2009.                 target = pev(i, pev_iuser2)
  2010.                 if(target && target != i)
  2011.                     kz_showkeysmsg(i)
  2012.                
  2013.             }
  2014.         }
  2015.     }
  2016.     return PLUGIN_CONTINUE
  2017. }
  2018.  
  2019. public kz_showkeysmsg(id)
  2020. {
  2021.     if(!id) return
  2022.    
  2023.     new bool:g_bShowOwnKeys = false
  2024.    
  2025.     if(is_plr_alive[id] && g_bShowKeys[id])
  2026.         g_bShowOwnKeys = true
  2027.    
  2028.     new target
  2029.     if(g_bShowOwnKeys)
  2030.         target = id
  2031.     else
  2032.     {
  2033.         new specmode = pev(id, pev_iuser1)
  2034.         if(specmode == 2 || specmode == 4)
  2035.         {
  2036.             target = pev(id, pev_iuser2)
  2037.         }
  2038.     }
  2039.     if(!target)
  2040.         return
  2041.    
  2042.     new Msg[256]
  2043.     formatex(Msg, 255, "%s", plr_key[target][0])
  2044.     static r, g, b, Float:x, Float:y
  2045.     GetCvarPosition(g_kz_showkeys_xypos, x, y)
  2046.     GetCvarColor(g_kz_showkeys_color, r, g, b)
  2047.     set_hudmessage(r, g, b, x, y, 0, _, 0.1, _, _, 3)
  2048.     ShowSyncHudMsg(id, g_SyncShowKeys, Msg)
  2049. }
  2050.  
  2051. public DetectCheat(id, reason[])
  2052. {
  2053.     if(get_pcvar_num(g_kz_cheatdetect) && g_bPlayerStart[id])
  2054.     {
  2055.         kz_colorchat(id, green, "%L", id, "PKU_CHEAT_DETECTED", reason)
  2056.         g_bPlayerStart[id] = false
  2057.     }
  2058. }
  2059.  
  2060. public AdminGlow(id)
  2061. {
  2062.     new pid = id < TASK_ADMINGLOW ? id : id - TASK_ADMINGLOW
  2063.     if(get_pcvar_num(g_kz_adminglow))
  2064.     {
  2065.         set_rendering(g_iEntPlayerModel[pid], kRenderFxGlowShell, random_num(0,255), random_num(0,255), random_num(0,255), kRenderNormal, 25)  
  2066.     }
  2067.     else
  2068.     {
  2069.         set_rendering(g_iEntPlayerModel[pid])
  2070.     }
  2071. }
  2072.  
  2073. public kz_set_nvg(id)
  2074. {
  2075.     id -= TASK_NVG
  2076.    
  2077.     if(get_pcvar_num(g_kz_nvg_enabled))
  2078.     {
  2079.         if(!is_plr_alive[id])
  2080.         {
  2081.             kz_remove_nvg(id)
  2082.             return
  2083.         }
  2084.         static Float:fOrigin[3], r, g, b
  2085.        
  2086.         pev(id, pev_origin, fOrigin)
  2087.         GetCvarColor(g_kz_nvg_color, r, g, b)
  2088.         kz_make_lgt(id, fOrigin, r, g, b)
  2089.     }
  2090.     else
  2091.     {
  2092.         kz_remove_nvg(id)
  2093.     }
  2094. }
  2095.  
  2096. public GetCvarColor(cvar, &r, &g, &b)
  2097. {
  2098.     static colors[16], piece[5]
  2099.     get_pcvar_string(cvar, colors, 15)
  2100.    
  2101.     strbreak(colors, piece, 4, colors, 15)
  2102.     r = str_to_num(piece)
  2103.    
  2104.     strbreak(colors, piece, 4, colors, 15)
  2105.     g = str_to_num(piece)
  2106.     b = str_to_num(colors)
  2107. }
  2108.  
  2109. public GetCvarPosition(cvar, &Float:x, &Float:y)
  2110. {
  2111.     static coords[16], piece[10]
  2112.     get_pcvar_string(cvar, coords, 15)
  2113.    
  2114.     strbreak(coords, piece, 9, coords, 15)
  2115.     x = str_to_float(piece)
  2116.     y = str_to_float(coords)
  2117. }
  2118.  
  2119. public PlayerInfo(id)
  2120. {
  2121.     id -= TASK_INFO
  2122.     kz_colorchat(id, green, "%L", id, "PKU_HELP")
  2123. }
  2124.  
  2125. public BlockCommands(id)
  2126. {
  2127.     return PLUGIN_HANDLED
  2128. }
  2129.  
  2130. public Hook()
  2131. {
  2132.     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_BEAT_MAP_A")
  2133.     set_task(get_pcvar_float(g_kz_advert_time),"JetPack")
  2134. }
  2135.  
  2136. public JetPack()
  2137. {
  2138.     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_BEAT_MAP_B")
  2139.     set_task(get_pcvar_float(g_kz_advert_time),"Hook")
  2140. }
  2141.  
  2142. public MsgHealth(Msgid, Dest, id)
  2143. {
  2144.     if(get_msg_arg_int(1) >= 255)
  2145.     {
  2146.         set_msg_arg_int(1, ARG_BYTE, 255)
  2147.     }
  2148. }
  2149.  
  2150. public MsgStatusIcon(Msgid, Dest, id)
  2151. {
  2152.     new szBuyzoneIcon[8]
  2153.     get_msg_arg_string(2, szBuyzoneIcon, 7)
  2154.    
  2155.     if(equal(szBuyzoneIcon, "buyzone"))
  2156.     {
  2157.         return PLUGIN_HANDLED
  2158.     }
  2159.     return PLUGIN_CONTINUE
  2160. }
  2161.  
  2162. public MsgStatusValue(Msgid, Dest, id)
  2163. {
  2164.     if(get_msg_arg_int(1) == 2)
  2165.     {
  2166.         g_iTarget[id] = get_msg_arg_int(2)
  2167.     }
  2168. }
  2169.  
  2170. public MsgClCorpse()
  2171. {
  2172.     static id ; id = get_msg_arg_int(12)
  2173.    
  2174.     if(g_bPlayerIsAdmin[id] && is_plr_alive[id])
  2175.     {
  2176.         set_msg_arg_string(1, g_iPlayerModel[id])
  2177.     }
  2178. }
  2179.  
  2180. public MsgRoundTime(Msgid, Dest, id)
  2181. {
  2182.     set_msg_arg_int(1, ARG_SHORT, 0)
  2183. }
  2184.  
  2185. public MsgMoney(Msgid, Dest, id)
  2186. {
  2187.     new iMoney = get_pcvar_num(g_kz_money)
  2188.     set_msg_arg_int(1, ARG_LONG, iMoney)
  2189.     set_pdata_int(id, 115, 0)
  2190. }
  2191.  
  2192. public MsgShowMenu(Msgid, Dest, id)
  2193. {
  2194.     static iTeamSelect[] = "#Team_Select"
  2195.     static sMenuCode[sizeof iTeamSelect]
  2196.     get_msg_arg_string(4, sMenuCode, sizeof sMenuCode - 1)
  2197.    
  2198.     if(equal(sMenuCode, iTeamSelect))
  2199.     {
  2200.         if(ShouldAutoJoin(id))
  2201.         {  
  2202.             kz_set_autojoin_task(id, Msgid)
  2203.             return PLUGIN_HANDLED
  2204.         }
  2205.     }
  2206.     return PLUGIN_CONTINUE
  2207. }
  2208.  
  2209. public MsgVguiMenu(Msgid, Dest, id)
  2210. {
  2211.     if (get_msg_arg_int(1) != 2 || !ShouldAutoJoin(id))
  2212.         return PLUGIN_CONTINUE
  2213.    
  2214.     kz_set_autojoin_task(id, Msgid)
  2215.     return PLUGIN_HANDLED
  2216. }
  2217.  
  2218. public PlayerTeamJoin(MenuMsgid[], id)
  2219. {
  2220.     id -= TASK_AUTOJOIN
  2221.    
  2222.     if(get_user_team(id))
  2223.         return
  2224.    
  2225.     static g_autojoin ; g_autojoin = get_pcvar_num(g_kz_autojoin)
  2226.     switch(g_autojoin)
  2227.     {
  2228.         case 0:
  2229.         {
  2230.             static Team[] = "2", Class[] = "0"
  2231.             kz_team_join(id, MenuMsgid[0], Team, Class)
  2232.         }
  2233.         case 1:
  2234.         {
  2235.             static Team[] = "2", Class[] = "5"
  2236.             kz_team_join(id, MenuMsgid[0], Team, Class)
  2237.         }
  2238.     }
  2239. }
  2240.  
  2241. public KzPlayerMenu(id)
  2242. {
  2243.     new menu[512], szbhop[64], sznoblock[64], szscout[64], szshowtime[64]
  2244.    
  2245.     new g_smiclip = get_pcvar_num(g_kz_semiclip)
  2246.     switch(g_smiclip)
  2247.     {
  2248.         case 0: formatex(sznoblock,63,"%L", id, "PKU_PM_SEMI_OFF")
  2249.            
  2250.         case 1: formatex(sznoblock,63,"%L", id, "PKU_PM_SEMI_ON")
  2251.            
  2252.     }
  2253.     new g_bhop = get_pcvar_num(g_kz_bhop)
  2254.     new g_bunny = g_iBunnyHop[id]
  2255.     switch(g_bhop)
  2256.     {
  2257.         case 0: formatex(szbhop,63,"%L", id, "PKU_PM_BHOP_OFF")
  2258.            
  2259.         case 1:
  2260.         {
  2261.             switch(g_bunny)
  2262.             {
  2263.                 case 0: formatex(szbhop,63,"%L", id, "PKU_PM_BHOP")
  2264.                    
  2265.                 case 1: formatex(szbhop,63,"%L", id, "PKU_PM_BHOP_NOSLOW")
  2266.                    
  2267.             }
  2268.         }
  2269.         case 2:
  2270.         {
  2271.             switch(g_bunny)
  2272.             {
  2273.                 case 0: formatex(szbhop,63,"%L", id, "PKU_PM_BHOP")
  2274.                    
  2275.                 case 1: formatex(szbhop,63,"%L", id, "PKU_PM_BHOP_NOSLOW")
  2276.                    
  2277.                 case 2: formatex(szbhop,63,"%L", id, "PKU_PM_BHOP_AUTO")
  2278.                    
  2279.             }
  2280.         }
  2281.     }
  2282.     new g_showtime = g_bShowTimer[id]
  2283.     switch(g_showtime)
  2284.     {
  2285.         case false: formatex(szshowtime,63,"%L", id, "PKU_PM_SHOWTIMER_OFF")
  2286.            
  2287.         case true: formatex(szshowtime,63,"%L", id, "PKU_PM_SHOWTIMER_ON")
  2288.            
  2289.     }
  2290.     new g_scout = get_pcvar_num(g_kz_scout)
  2291.     switch(g_scout)
  2292.     {
  2293.         case 0: formatex(szscout,63,"%L", id, "PKU_PM_SCOUT_OFF")
  2294.            
  2295.         case 1: formatex(szscout,63,"%L", id, "PKU_PM_SCOUT_ON")
  2296.            
  2297.     }
  2298.     formatex(menu,512,"%L", id, "PKU_PM_MENU",sznoblock, szbhop, szshowtime, szscout)
  2299.     show_menu(id,MENU_KEYS,menu, -1, "ProKreedz v2.4 - Playermenu")
  2300. }
  2301.  
  2302. public PlayerMenuHandler(id,key)
  2303. {
  2304.     switch(key)
  2305.     {
  2306.         case 0: KzPlayerMenu(id)
  2307.            
  2308.         case 1:
  2309.         {
  2310.             new g_bhop = get_pcvar_num(g_kz_bhop)
  2311.             new g_bunny = g_iBunnyHop[id]
  2312.             switch(g_bhop)
  2313.             {
  2314.                 case 1:
  2315.                 {
  2316.                     switch(g_bunny)
  2317.                     {
  2318.                         case 0: g_iBunnyHop[id] = 1
  2319.                            
  2320.                         case 1: g_iBunnyHop[id] = 0
  2321.                            
  2322.                     }
  2323.                 }
  2324.                 case 2:
  2325.                 {
  2326.                     switch(g_bunny)
  2327.                     {
  2328.                         case 0: g_iBunnyHop[id] = 1
  2329.                            
  2330.                         case 1: g_iBunnyHop[id] = 2
  2331.                            
  2332.                         case 2: g_iBunnyHop[id] = 0
  2333.                            
  2334.                     }
  2335.                 }
  2336.             }
  2337.             KzPlayerMenu(id)
  2338.         }
  2339.         case 2:
  2340.         {
  2341.             g_bShowTimer[id] = !g_bShowTimer[id]
  2342.             KzPlayerMenu(id)
  2343.         }
  2344.         case 3: cmd_scout(id)
  2345.            
  2346.         case 4: cmd_usp(id)
  2347.            
  2348.         case 5: cmd_restart(id)
  2349.            
  2350.         case 6: cmd_reset(id)
  2351.            
  2352.         case 9: show_menu(id,0,"")
  2353.            
  2354.     }
  2355. }
  2356.  
  2357. public KzAdminMenuShow(id, lvl, cid)
  2358. {
  2359.     if(cmd_access(id, lvl, cid, 1))
  2360.         KzAdminMenu(id)
  2361.     return PLUGIN_HANDLED
  2362. }
  2363.  
  2364. public KzAdminMenu(id)
  2365. {
  2366.     new menu[512], szcheckpoints[32], szgodmode[32], szautojoin[32], szscout[32], szadminglow[32], sznoblock[32], sztransparency[32], szcheatdetect[32], szbhop[32]
  2367.    
  2368.     new g_checkpoints = get_pcvar_num(g_kz_checkpoints)
  2369.     switch(g_checkpoints)
  2370.     {
  2371.         case 0: formatex(szcheckpoints,31,"%L", id, "PKU_AM_CP_OFF")
  2372.            
  2373.         case 1: formatex(szcheckpoints,31,"%L", id, "PKU_AM_CP_ON")
  2374.            
  2375.     }
  2376.     new g_godmode = get_pcvar_num(g_kz_godmode)
  2377.     switch(g_godmode)
  2378.     {
  2379.         case 0: formatex(szgodmode,31,"%L", id, "PKU_AM_GODMODE_OFF")
  2380.            
  2381.         case 1: formatex(szgodmode,31,"%L", id, "PKU_AM_GODMODE_ON")
  2382.            
  2383.     }
  2384.     new g_autojoin = get_pcvar_num(g_kz_autojoin)
  2385.     switch(g_autojoin)
  2386.     {
  2387.         case 0: formatex(szautojoin,31,"%L", id, "PKU_AM_AUTOJOIN_OFF")
  2388.            
  2389.         case 1: formatex(szautojoin,31,"%L", id, "PKU_AM_AUTOJOIN_ON")
  2390.            
  2391.     }
  2392.     new g_scout = get_pcvar_num(g_kz_scout)
  2393.     switch(g_scout)
  2394.     {
  2395.         case 0: formatex(szscout,31,"%L", id, "PKU_AM_SCOUT_OFF")
  2396.            
  2397.         case 1: formatex(szscout,31,"%L", id, "PKU_AM_SCOUT_ON")
  2398.            
  2399.     }
  2400.     new g_adminglow = get_pcvar_num(g_kz_adminglow)
  2401.     switch(g_adminglow)
  2402.     {
  2403.         case 0: formatex(szadminglow,31,"%L", id, "PKU_AM_GLOW_OFF")
  2404.            
  2405.         case 1: formatex(szadminglow,31,"%L", id, "PKU_AM_GLOW_ON")
  2406.            
  2407.     }
  2408.     new g_semiclip = get_pcvar_num(g_kz_semiclip)
  2409.     switch(g_semiclip)
  2410.     {
  2411.         case 0: formatex(sznoblock,31,"%L", id, "PKU_AM_SEMI_OFF")
  2412.            
  2413.         case 1: formatex(sznoblock,31,"%L", id, "PKU_AM_SEMI_ON")
  2414.            
  2415.     }
  2416.     new g_bhop = get_pcvar_num(g_kz_bhop)
  2417.     switch(g_bhop)
  2418.     {
  2419.         case 0: formatex(szbhop,31,"%L", id, "PKU_AM_BHOP")
  2420.            
  2421.         case 1: formatex(szbhop,31,"%L", id, "PKU_AM_BHOP_NOSLOW")
  2422.            
  2423.         case 2: formatex(szbhop,31,"%L", id, "PKU_AM_BHOP_AUTO")
  2424.            
  2425.     }
  2426.     new g_transparency = get_pcvar_num(g_kz_transparency)
  2427.     switch(g_transparency)
  2428.     {
  2429.         case 0: formatex(sztransparency,31,"%L", id, "PKU_AM_TRANS_OFF")
  2430.            
  2431.         case 1: formatex(sztransparency,31,"%L", id, "PKU_AM_TRANS_ON")
  2432.            
  2433.     }
  2434.     new g_cheatdetect = get_pcvar_num(g_kz_cheatdetect)
  2435.     switch(g_cheatdetect)
  2436.     {
  2437.         case 0: formatex(szcheatdetect,31,"%L", id, "PKU_AM_CHEATD_OFF")
  2438.            
  2439.         case 1: formatex(szcheatdetect,31,"%L", id, "PKU_AM_CHEATD_ON")
  2440.            
  2441.     }
  2442.     formatex(menu,512,"%L", id, "PKU_AM_MENU",szcheckpoints,szgodmode,szautojoin,szscout,szadminglow,sznoblock,szbhop,sztransparency,szcheatdetect)
  2443.     show_menu(id,MENU_KEYS_ADMIN,menu, -1, "ProKreedz Ultimativ v2.4 - Adminmenu")
  2444. }
  2445.  
  2446. public AdminMenuHandler(id,key)
  2447. {
  2448.     switch(key)
  2449.     {
  2450.         case 0:
  2451.         {
  2452.             new g_checkpoints = get_pcvar_num(g_kz_checkpoints)
  2453.             switch(g_checkpoints)
  2454.             {
  2455.                 case 0:
  2456.                 {
  2457.                     set_pcvar_num(g_kz_checkpoints, 1)
  2458.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_CP_ENABLED")
  2459.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_CP_INFO")
  2460.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_CP_GO_INFO")
  2461.                 }
  2462.                 case 1:
  2463.                 {
  2464.                     set_pcvar_num(g_kz_checkpoints, 0)
  2465.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_CP_DISABLED")
  2466.                 }
  2467.             }
  2468.             KzAdminMenu(id)
  2469.         }
  2470.         case 1:
  2471.         {
  2472.             new g_godmode = get_pcvar_num(g_kz_godmode)
  2473.             switch(g_godmode)
  2474.             {
  2475.                 case 0:
  2476.                 {
  2477.                     set_pcvar_num(g_kz_godmode, 1)
  2478.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_GODMODE_ENABLED")
  2479.                    
  2480.                     for(new i = 1; i <= g_iMaxPlayers; i++)
  2481.                     {
  2482.                         if(is_plr_connected[i] && !is_plr_bot[i])
  2483.                             set_pev(i, pev_takedamage, 0.0)
  2484.                     }
  2485.                 }
  2486.                 case 1:
  2487.                 {
  2488.                     set_pcvar_num(g_kz_godmode, 0)
  2489.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_GODMODE_DISABLED")
  2490.                    
  2491.                     for(new i = 1; i <= g_iMaxPlayers; i++)
  2492.                     {
  2493.                         if(is_plr_connected[i] && !is_plr_bot[i])
  2494.                             set_pev(i, pev_takedamage, 2.0)
  2495.                     }
  2496.                 }
  2497.             }
  2498.             KzAdminMenu(id)
  2499.         }
  2500.         case 2:
  2501.         {
  2502.             new g_autojoin = get_pcvar_num(g_kz_autojoin)
  2503.             switch(g_autojoin)
  2504.             {
  2505.                 case 0:
  2506.                 {
  2507.                     set_pcvar_num(g_kz_autojoin, 1)
  2508.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_AUTOJOIN_ENABLED")
  2509.                 }
  2510.                 case 1:
  2511.                 {
  2512.                     set_pcvar_num(g_kz_autojoin, 0)
  2513.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_AUTOJOIN_DISABLED")  
  2514.                 }
  2515.             }
  2516.             KzAdminMenu(id)
  2517.         }
  2518.         case 3:
  2519.         {
  2520.             new g_scout = get_pcvar_num(g_kz_scout)
  2521.             switch(g_scout)
  2522.             {
  2523.                 case 0:
  2524.                 {
  2525.                     set_pcvar_num(g_kz_scout, 1)
  2526.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_SCOUT_ENABLED")
  2527.                 }
  2528.                 case 1:
  2529.                 {
  2530.                     set_pcvar_num(g_kz_scout, 0)
  2531.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_SCOUT_DISABLED")
  2532.                 }
  2533.             }
  2534.             KzAdminMenu(id)
  2535.         }
  2536.         case 4:
  2537.         {
  2538.             new g_adminglow = get_pcvar_num(g_kz_adminglow)
  2539.             switch(g_adminglow)
  2540.             {
  2541.                 case 0:
  2542.                 {
  2543.                     set_pcvar_num(g_kz_adminglow, 1)
  2544.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_ADMINGLOW_ENABLED")
  2545.                    
  2546.                     for(new i = 1; i <= g_iMaxPlayers; i++)
  2547.                     {
  2548.                         if(is_plr_connected[i] && g_bPlayerIsAdmin[i])
  2549.                             AdminGlow(i)
  2550.                     }
  2551.                 }
  2552.                 case 1:
  2553.                 {
  2554.                     set_pcvar_num(g_kz_adminglow, 0)
  2555.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_ADMINGLOW_DISABLED")
  2556.                    
  2557.                     for(new i = 1; i <= g_iMaxPlayers; i++)
  2558.                     {
  2559.                         if(is_plr_connected[i] && g_bPlayerIsAdmin[i])
  2560.                             AdminGlow(i)
  2561.                     }
  2562.                 }
  2563.             }
  2564.             KzAdminMenu(id)
  2565.         }
  2566.         case 5:
  2567.         {
  2568.             new g_semiclip = get_pcvar_num(g_kz_semiclip)
  2569.             switch(g_semiclip)
  2570.             {
  2571.                 case 0:
  2572.                 {
  2573.                     set_pcvar_num(g_kz_semiclip, 1)
  2574.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_SEMICLIP_ENABLED")  
  2575.                 }
  2576.                 case 1:
  2577.                 {
  2578.                     set_pcvar_num(g_kz_semiclip, 0)
  2579.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_SEMICLIP_DISABLED")
  2580.                 }
  2581.             }
  2582.             KzAdminMenu(id)
  2583.         }
  2584.         case 6:
  2585.         {
  2586.             new g_bhop = get_pcvar_num(g_kz_bhop)
  2587.             switch(g_bhop)
  2588.             {
  2589.                 case 0:
  2590.                 {
  2591.                     set_pcvar_num(g_kz_bhop, 1)
  2592.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_BHOP_NOSLOW_DOWN")
  2593.                 }
  2594.                 case 1:
  2595.                 {
  2596.                     set_pcvar_num(g_kz_bhop, 2)
  2597.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_BHOP_AUTOMATIC")
  2598.                 }
  2599.                 case 2:
  2600.                 {
  2601.                     set_pcvar_num(g_kz_bhop, 0)
  2602.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_BHOP_DISABLED")
  2603.                 }
  2604.             }
  2605.             KzAdminMenu(id)
  2606.         }
  2607.         case 7:
  2608.         {
  2609.             new g_transparency = get_pcvar_num(g_kz_transparency)
  2610.             switch(g_transparency)
  2611.             {
  2612.                 case 0:
  2613.                 {
  2614.                     set_pcvar_num(g_kz_transparency, 1)
  2615.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_TRANSPARENCY_ENABLED")
  2616.                 }
  2617.                 case 1:
  2618.                 {
  2619.                     set_pcvar_num(g_kz_transparency, 0)
  2620.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_TRANSPARENCY_DISABLED")
  2621.                 }
  2622.             }
  2623.             KzAdminMenu(id)
  2624.         }
  2625.         case 8:
  2626.         {
  2627.             new g_cheatdetect = get_pcvar_num(g_kz_cheatdetect)
  2628.             switch(g_cheatdetect)
  2629.             {
  2630.                 case 0:
  2631.                 {
  2632.                     set_pcvar_num(g_kz_cheatdetect, 1)
  2633.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_CHEATD_ENABLED")
  2634.                 }
  2635.                 case 1:
  2636.                 {
  2637.                     set_pcvar_num(g_kz_cheatdetect, 0)
  2638.                     kz_colorchat(0, green, "%L", LANG_PLAYER , "PKU_CHEATD_DISABLED")
  2639.                 }
  2640.             }
  2641.             KzAdminMenu(id)
  2642.         }
  2643.         case 9: show_menu(id,0,"")
  2644.            
  2645.     }
  2646. }
  2647.  
  2648. #if defined USING_SQL
  2649. public check_pro15(iPlayer)
  2650. {
  2651.     check_top15(iPlayer, true)
  2652. }
  2653.  
  2654. public show_pro15(iPlayer)
  2655. {
  2656.     return show_top15(iPlayer, true)
  2657. }
  2658. #else
  2659. public check_pro15(id)
  2660. {
  2661.     new name[32], authid[32]
  2662.     get_user_name(id, name, 31)
  2663.     get_user_authid(id, authid ,31)
  2664.    
  2665.     new bool:is_plr_pro15
  2666.     is_plr_pro15 = false
  2667.    
  2668.     for(new i = 0; i < 15; i++)
  2669.     {
  2670.         if(equali(pro15_authid[i], authid))
  2671.         {
  2672.             is_plr_pro15 = true
  2673.         }
  2674.     }
  2675.     new Float:kzTime, Float:FailTime, Float:BestTime, Float:OldTime
  2676.     for(new i = 0; i < 15; i++)
  2677.     {
  2678.         kzTime = get_gametime() - g_iPlayerTime[id] + g_iPlayerPauseTime[id]
  2679.         FailTime = kzTime - pro15_times[i]
  2680.         BestTime = pro15_times[i] - kzTime
  2681.         OldTime = pro15_times[i]
  2682.        
  2683.         if(kzTime < pro15_times[i])
  2684.         {
  2685.             new pos = i
  2686.             while(!equal(pro15_authid[pos], authid) && pos < 15)
  2687.             {
  2688.                 pos++
  2689.             }
  2690.             for(new j = pos; j > i; j--)
  2691.             {
  2692.                 formatex(pro15_authid[j], 31, pro15_authid[j-1])
  2693.                 formatex(pro15_names[j], 31, pro15_names[j-1])
  2694.                 pro15_times[j] = pro15_times[j-1]
  2695.                 pro15_cp[j] = pro15_cp[j-1]
  2696.                 pro15_gocp[j] = pro15_gocp[j-1]
  2697.             }
  2698.             formatex(pro15_authid[i], 31, authid)
  2699.             formatex(pro15_names[i], 31, name)
  2700.             pro15_times[i] = kzTime
  2701.             pro15_cp[i] = g_iCheckpointNum[id]
  2702.             pro15_gocp[i] = g_iGoCheckNum[id]
  2703.            
  2704.             save_pro15()
  2705.            
  2706.             if(is_plr_pro15)
  2707.             {          
  2708.                 if(kzTime < OldTime)
  2709.                 {
  2710.                     new imin, Float:isec
  2711.                     imin = floatround(BestTime, floatround_floor)/60
  2712.                     isec = BestTime - (60*imin)
  2713.                     kz_colorchat(0, green, "%L", LANG_PLAYER, "PKU_TOP15_NPBT", name, imin, isec < 10 ? "0" : "", isec)
  2714.                    
  2715.                     if((i + 1) == 1)
  2716.                     {
  2717.                         client_cmd(0, "spk woop")
  2718.                         kz_colorchat(0, green, "%L", LANG_PLAYER, "PKU_PRO15_LEET", name)
  2719.                     }
  2720.                     else
  2721.                     {
  2722.                         kz_colorchat(0, green, "%L", LANG_PLAYER, "PKU_PRO15_RANK", name, (i+1))
  2723.                     }
  2724.                 }
  2725.             }
  2726.             else  
  2727.             {
  2728.                 if((i + 1) == 1)
  2729.                 {
  2730.                     client_cmd(0, "spk woop")
  2731.                     kz_colorchat(0, green, "%L", LANG_PLAYER, "PKU_PRO15_LEET", name)
  2732.                 }
  2733.                 else
  2734.                 {
  2735.                     kz_colorchat(0, green, "%L", LANG_PLAYER, "PKU_PRO15_RANK", name, (i+1))
  2736.                 }
  2737.             }
  2738.             return
  2739.         }
  2740.         if(equali(pro15_authid[i], authid))
  2741.         {
  2742.             if(kzTime > OldTime)
  2743.             {
  2744.                 new imin, Float:isec
  2745.                 imin = floatround(FailTime  , floatround_floor)/60
  2746.                 isec = FailTime - (60*imin)
  2747.                 kz_colorchat(0, green, "%L", LANG_PLAYER, "PKU_TOP15_FAIL", name, imin, isec < 10 ? "0" : "", isec)
  2748.                 return
  2749.             }
  2750.         }
  2751.     }
  2752. }
  2753.  
  2754. public save_pro15()  
  2755. {
  2756.     new profile[128]
  2757.     formatex(profile, 127, "%s/pro_%s.cfg", KZ_TOP15_DIR, g_szMapName)
  2758.    
  2759.     if(file_exists(profile))
  2760.     {
  2761.         delete_file(profile)
  2762.     }
  2763.    
  2764.     new Data[256]
  2765.     new f = fopen(profile, "at")
  2766.    
  2767.     for(new i = 0; i < 15; i++)
  2768.     {
  2769.         formatex(Data, 255, "^"%.5f^" ^"%s^" ^"%s^" ^"%d^" ^"%d^"^n", pro15_times[i], pro15_authid[i], pro15_names[i], pro15_cp[i], pro15_gocp[i])
  2770.         fputs(f, Data)
  2771.     }
  2772.     fclose(f)
  2773. }
  2774.  
  2775. public read_pro15()
  2776. {
  2777.     new profile[128], prodata[256]
  2778.     formatex(profile, 127, "%s/pro_%s.cfg", KZ_TOP15_DIR, g_szMapName)
  2779.    
  2780.     new f = fopen(profile, "rt")
  2781.     new i = 0
  2782.     while(!feof(f) && i < 16)
  2783.     {
  2784.         fgets(f, prodata, 255)
  2785.         new ReadKzTime[25], ReadChecks[5], ReadGoChecks[5]
  2786.         parse(prodata, ReadKzTime, 24, pro15_authid[i], 31, pro15_names[i], 31, ReadChecks, 4, ReadGoChecks, 4)
  2787.         pro15_times[i] = str_to_float(ReadKzTime)
  2788.         pro15_cp[i] = str_to_num(ReadChecks)
  2789.         pro15_gocp[i] = str_to_num(ReadGoChecks)
  2790.         i++;
  2791.     }
  2792.     fclose(f)
  2793. }
  2794.  
  2795. public show_pro15(id)
  2796. {
  2797.     new buffer[2048], name[32]
  2798.     new len = formatex(buffer, sizeof buffer -1,"<body bgcolor=#94AEC6><table width=100%% cellpadding=2 cellspacing=0 border=0>")
  2799.     len += formatex(buffer[len], sizeof buffer -1 -len,"%L", id, "PKU_TOP15_MOTD")
  2800.    
  2801.     new iMaxColors = sizeof(g_iTopColors)
  2802.    
  2803.     for(new i = 0; i < 15; ++i)
  2804.     {      
  2805.         if(pro15_times[i] > 9999999.0)
  2806.             len += formatex(buffer[len], sizeof buffer -1 -len, "<tr align=center %s><td>%d<td align=left>%s<td>%s<td>%s<td>%s", ((i%2)==0) ? "" : "bgcolor=#B0C4DE", (i + 1), "", "", "", "")
  2807.         else
  2808.         {
  2809.             name = pro15_names[i]
  2810.             new Float:kzTime, imin, Float:isec
  2811.             kzTime = pro15_times[i]
  2812.             imin = floatround(kzTime  , floatround_floor)/60
  2813.             isec = kzTime  - (60*imin)
  2814.            
  2815.             while (containi(name, "<") != -1)
  2816.                 replace(name, 63, "<", "&lt;")
  2817.             while (containi(name, ">") != -1)
  2818.                 replace(name, 63, ">", "&gt;")
  2819.            
  2820.             if( i < iMaxColors )
  2821.             {
  2822.                 len += formatex(buffer[len], sizeof buffer -1 -len, "<tr align=center bgcolor=%s><td>%d<td align=left>%s<td>%02d:%s%.2f<td>%d<td>%d", g_iTopColors[i], (i + 1), pro15_names[i], imin, isec < 10 ? "0" : "", isec, pro15_cp[i], pro15_gocp[i])
  2823.             }
  2824.             else
  2825.             {
  2826.                 len += formatex(buffer[len], sizeof buffer -1 -len, "<tr align=center %s><td>%d<td align=left>%s<td>%02d:%s%.2f<td>%d<td>%d", ((i%2)==0) ? "" : "bgcolor=#B0C4DE", (i + 1), pro15_names[i], imin, isec < 10 ? "0" : "", isec, pro15_cp[i], pro15_gocp[i])
  2827.             }
  2828.         }
  2829.     }
  2830.     len += formatex(buffer[len], sizeof buffer -1 -len, "</table></body>")
  2831.    
  2832.     show_motd(id, buffer, "ProKreedz Pro15")
  2833.     return PLUGIN_HANDLED
  2834. }
  2835. #endif
  2836.  
  2837. #if defined USING_SQL
  2838. public check_nub15(iPlayer)
  2839. {
  2840.     check_top15(iPlayer, false)
  2841. }
  2842.  
  2843. public show_nub15(iPlayer)
  2844. {
  2845.     return show_top15(iPlayer, false)
  2846. }
  2847. #else
  2848. public check_nub15(id)
  2849. {
  2850.     new name[32], authid[32]
  2851.     get_user_name(id, name, 31)
  2852.     get_user_authid(id, authid ,31)
  2853.    
  2854.     new bool:is_plr_nub15
  2855.     is_plr_nub15 = false
  2856.    
  2857.     for(new i = 0; i < 15; i++)
  2858.     {
  2859.         if(equali(nub15_authid[i], authid))
  2860.         {
  2861.             is_plr_nub15 = true
  2862.         }
  2863.     }
  2864.     new Float:kzTime, Float:FailTime, Float:BestTime, Float:OldTime
  2865.     for(new i = 0; i < 15; i++)
  2866.     {
  2867.         kzTime = get_gametime() - g_iPlayerTime[id] + g_iPlayerPauseTime[id]
  2868.         FailTime = kzTime - nub15_times[i]
  2869.         BestTime = nub15_times[i] - kzTime
  2870.         OldTime = nub15_times[i]
  2871.        
  2872.         if(kzTime < nub15_times[i])
  2873.         {
  2874.             new pos = i
  2875.             while(!equal(nub15_authid[pos], authid) && pos < 15)
  2876.             {
  2877.                 pos++
  2878.             }
  2879.             for(new j = pos; j > i; j--)
  2880.             {
  2881.                 formatex(nub15_authid[j], 31, nub15_authid[j-1])
  2882.                 formatex(nub15_names[j], 31, nub15_names[j-1])
  2883.                 nub15_times[j] = nub15_times[j-1]
  2884.                 nub15_cp[j] = nub15_cp[j-1]
  2885.                 nub15_gocp[j] = nub15_gocp[j-1]
  2886.             }
  2887.             formatex(nub15_authid[i], 31, authid)
  2888.             formatex(nub15_names[i], 31, name)
  2889.             nub15_times[i] = kzTime
  2890.             nub15_cp[i] = g_iCheckpointNum[id]
  2891.             nub15_gocp[i] = g_iGoCheckNum[id]
  2892.            
  2893.             save_nub15()
  2894.            
  2895.             if(is_plr_nub15)
  2896.             {          
  2897.                 if(kzTime < OldTime)
  2898.                 {
  2899.                     new imin, Float:isec
  2900.                     imin = floatround(BestTime, floatround_floor)/60
  2901.                     isec = BestTime - (60*imin)
  2902.                     kz_colorchat(0, green, "%L", LANG_PLAYER, "PKU_TOP15_NPBT", name, imin, isec < 10 ? "0" : "", isec)
  2903.                    
  2904.                     if((i + 1) == 1)
  2905.                     {
  2906.                         client_cmd(0, "spk woop")
  2907.                         kz_colorchat(0, green, "%L", LANG_PLAYER, "PKU_NUB15_LEET", name)
  2908.                     }
  2909.                     else
  2910.                     {
  2911.                         kz_colorchat(0, green, "%L", LANG_PLAYER, "PKU_NUB15_RANK", name, (i+1))
  2912.                     }
  2913.                 }
  2914.             }
  2915.             else  
  2916.             {
  2917.                 if((i + 1) == 1)
  2918.                 {
  2919.                     client_cmd(0, "spk woop")
  2920.                     kz_colorchat(0, green, "%L", LANG_PLAYER, "PKU_NUB15_LEET", name)
  2921.                 }
  2922.                 else
  2923.                 {
  2924.                     kz_colorchat(0, green, "%L", LANG_PLAYER,"PKU_NUB15_RANK", name, (i+1))
  2925.                 }
  2926.             }
  2927.             return
  2928.         }
  2929.         if(equali(nub15_authid[i], authid))
  2930.         {
  2931.             if(kzTime > OldTime)
  2932.             {
  2933.                 new imin, Float:isec
  2934.                 imin = floatround(FailTime  , floatround_floor)/60
  2935.                 isec = FailTime - (60*imin)
  2936.                 kz_colorchat(0, green, "%L", LANG_PLAYER,"PKU_TOP15_FAIL", name, imin, isec < 10 ? "0" : "", isec) 
  2937.                 return
  2938.             }
  2939.         }
  2940.     }
  2941. }
  2942.  
  2943. public save_nub15()  
  2944. {
  2945.     new nubfile[128]
  2946.     formatex(nubfile, 127, "%s/nub_%s.cfg", KZ_TOP15_DIR, g_szMapName)
  2947.    
  2948.     if(file_exists(nubfile))
  2949.     {
  2950.         delete_file(nubfile)
  2951.     }
  2952.    
  2953.     new Data[256]
  2954.     new f = fopen(nubfile, "at")
  2955.    
  2956.     for(new i = 0; i < 15; i++)
  2957.     {
  2958.         formatex(Data, 255, "^"%.5f^" ^"%s^" ^"%s^" ^"%d^" ^"%d^"^n", nub15_times[i], nub15_authid[i], nub15_names[i], nub15_cp[i], nub15_gocp[i])
  2959.         fputs(f, Data)
  2960.     }
  2961.     fclose(f)
  2962. }
  2963.  
  2964. public read_nub15()
  2965. {
  2966.     new nubfile[128], nubdata[256]
  2967.     formatex(nubfile, 127, "%s/nub_%s.cfg", KZ_TOP15_DIR, g_szMapName)
  2968.    
  2969.     new f = fopen(nubfile, "rt")
  2970.     new i = 0
  2971.     while(!feof(f) && i < 16)
  2972.     {
  2973.         fgets(f, nubdata, 255)
  2974.         new ReadKzTime[25], ReadChecks[5], ReadGoChecks[5]
  2975.         parse(nubdata, ReadKzTime, 24, nub15_authid[i], 31, nub15_names[i], 31, ReadChecks, 4, ReadGoChecks, 4)
  2976.         nub15_times[i] = str_to_float(ReadKzTime)
  2977.         nub15_cp[i] = str_to_num(ReadChecks)
  2978.         nub15_gocp[i] = str_to_num(ReadGoChecks)
  2979.         i++;
  2980.     }
  2981.     fclose(f)
  2982. }
  2983.  
  2984. public show_nub15(id)
  2985. {
  2986.     new buffer[2048], name[32]
  2987.     new len = formatex(buffer, sizeof buffer -1,"<body bgcolor=#94AEC6><table width=100%% cellpadding=2 cellspacing=0 border=0>")
  2988.     len += formatex(buffer[len], sizeof buffer -1 -len,"%L", id, "PKU_TOP15_MOTD")
  2989.    
  2990.     new iMaxColors = sizeof(g_iTopColors)
  2991.    
  2992.     for(new i = 0; i < 15; ++i)
  2993.     {      
  2994.         if(nub15_times[i] > 9999999.0)
  2995.             len += formatex(buffer[len], sizeof buffer -1 -len, "<tr align=center %s><td>%d<td align=left>%s<td>%s<td>%s<td>%s", ((i%2)==0) ? "" : "bgcolor=#B0C4DE", (i + 1), "", "", "", "")
  2996.         else
  2997.         {
  2998.             name = nub15_names[i]
  2999.             new Float:kzTime, imin, Float:isec
  3000.             kzTime = nub15_times[i]
  3001.             imin = floatround(kzTime , floatround_floor)/60
  3002.             isec = kzTime  - (60*imin)
  3003.            
  3004.             while (containi(name, "<") != -1)
  3005.                 replace(name, 63, "<", "&lt;")
  3006.             while (containi(name, ">") != -1)
  3007.                 replace(name, 63, ">", "&gt;")
  3008.            
  3009.             if( i < iMaxColors )
  3010.             {
  3011.                 len += formatex(buffer[len], sizeof buffer -1 -len, "<tr align=center bgcolor=%s><td>%d<td align=left>%s<td>%02d:%s%.2f<td>%d<td>%d", g_iTopColors[i], (i + 1), nub15_names[i], imin, isec < 10 ? "0" : "", isec, nub15_cp[i], nub15_gocp[i])
  3012.             }
  3013.             else
  3014.             {
  3015.                 len += formatex(buffer[len], sizeof buffer -1 -len, "<tr align=center %s><td>%d<td align=left>%s<td>%02d:%s%.2f<td>%d<td>%d", ((i%2)==0) ? "" : "bgcolor=#B0C4DE", (i + 1), nub15_names[i], imin, isec < 10 ? "0" : "", isec, nub15_cp[i], nub15_gocp[i])
  3016.             }
  3017.         }
  3018.     }
  3019.     len += formatex(buffer[len], sizeof buffer -1 -len, "</table></body>")
  3020.    
  3021.     show_motd(id, buffer, "ProKreedz Nub15")
  3022.     return PLUGIN_HANDLED
  3023. }
  3024. #endif
  3025.  
  3026. #if defined USING_SQL
  3027. public check_top15(iPlayer, bool:bPro)
  3028. {
  3029.     if(g_hSqlTuple == Empty_Handle)
  3030.     {
  3031.         return
  3032.     }
  3033.    
  3034.     new iError, szError[128]
  3035.     new Handle:hDb = SQL_Connect(g_hSqlTuple, iError, szError, charsmax(szError))
  3036.    
  3037.     if(hDb == Empty_Handle)
  3038.     {
  3039.         log_amx("Failed connecting to database (%i): %s", iError, szError)
  3040.         return
  3041.     }
  3042.    
  3043.     new szName[32], szAuthID[35]
  3044.     get_user_name(iPlayer, szName ,charsmax(szName))
  3045.     get_user_authid(iPlayer, szAuthID, charsmax(szAuthID))
  3046.    
  3047.     new Float:flTime = get_gametime() - g_iPlayerTime[iPlayer] + g_iPlayerPauseTime[iPlayer]
  3048.    
  3049.     new iTopPos = 0;
  3050.    
  3051.     new Handle:hQuery = SQL_PrepareQuery(hDb, "SELECT * FROM kz_%s15 WHERE map = ^"%s^" ORDER BY time LIMIT 15;", bPro ? "pro" : "nub", g_szMapName)
  3052.    
  3053.     if(!SQL_Execute(hQuery))
  3054.     {
  3055.         SQL_QueryError(hQuery, szError, charsmax(szError))
  3056.         log_amx("Error on query selecting %s15: %s", bPro ? "pro" : "nub", szError)
  3057.     }
  3058.     else if(SQL_NumResults(hQuery))
  3059.     {
  3060.         new iFieldSteamID = SQL_FieldNameToNum(hQuery, "steamid")
  3061.         new iPos = 1, szDbAuthID[35]
  3062.        
  3063.         while(SQL_MoreResults(hQuery))
  3064.         {
  3065.             SQL_ReadResult(hQuery, iFieldSteamID, szDbAuthID, charsmax(szDbAuthID))
  3066.            
  3067.             if(equal(szAuthID, szDbAuthID))
  3068.             {
  3069.                 iTopPos = iPos
  3070.                 break
  3071.             }
  3072.            
  3073.             iPos++;
  3074.            
  3075.             SQL_NextRow(hQuery)
  3076.         }
  3077.        
  3078.         SQL_Rewind(hQuery)
  3079.        
  3080.         iPos = 1
  3081.         new iFieldTime = SQL_FieldNameToNum(hQuery, "time")
  3082.         new Float:flDbTime
  3083.        
  3084.         while(SQL_MoreResults(hQuery))
  3085.         {
  3086.             SQL_ReadResult(hQuery, iFieldTime, flDbTime)
  3087.            
  3088.             if(flTime < flDbTime)
  3089.             {
  3090.                 if(iTopPos)
  3091.                 {
  3092.                     new Float:flTimeDiff = flDbTime - flTime
  3093.                     new iMinutes = floatround(flTimeDiff, floatround_floor) / 60
  3094.                     flTimeDiff -= (iMinutes * 60)
  3095.                    
  3096.                     kz_colorchat(0, green, "%L", LANG_PLAYER, "PKU_TOP15_NPBT", szName, iMinutes, flTimeDiff < 10 ? "0" : "", flTimeDiff)
  3097.                 }
  3098.                
  3099.                 if(iPos == 1)
  3100.                 {
  3101.                     client_cmd(0, "spk woop" )
  3102.                     kz_colorchat(0, green, "%L", LANG_PLAYER, bPro ? "PKU_PRO15_LEET" : "PKU_NUB15_LEET", szName)
  3103.                 }
  3104.                 else
  3105.                 {
  3106.                     kz_colorchat(0, green, "%L", LANG_PLAYER, bPro ? "PKU_PRO15_RANK" : "PKU_NUB15_RANK", szName, iPos)
  3107.                 }
  3108.                
  3109.                 break
  3110.             }
  3111.             if(iTopPos == iPos)
  3112.             {
  3113.                 if(flTime > flDbTime)
  3114.                 {
  3115.                     new Float:flTimeDiff = flTime - flDbTime
  3116.                     new iMinutes = floatround(flTimeDiff, floatround_floor) / 60
  3117.                     flTimeDiff -= (iMinutes * 60)
  3118.                    
  3119.                     kz_colorchat(0, green, "%L", LANG_PLAYER, "PKU_TOP15_FAIL", szName, iMinutes, flTimeDiff < 10 ? "0" : "", flTimeDiff)
  3120.                 }
  3121.                
  3122.                 break
  3123.             }
  3124.            
  3125.             iPos++;
  3126.            
  3127.             SQL_NextRow(hQuery)
  3128.         }
  3129.     }
  3130.    
  3131.     SQL_FreeHandle(hQuery)
  3132.    
  3133.     hQuery = SQL_PrepareQuery(hDb, "SELECT time FROM kz_%s15 WHERE steamid = ^"%s^" AND map = ^"%s^";", bPro ? "pro" : "nub", szAuthID, g_szMapName)
  3134.    
  3135.     if( !SQL_Execute(hQuery))
  3136.     {
  3137.         SQL_QueryError(hQuery, szError, charsmax(szError))
  3138.         log_amx("Error on query selecting player %s time: %s", bPro ? "pro" : "nub", szError)
  3139.     }
  3140.     else
  3141.     {
  3142.         new bool:bUpdate = true
  3143.        
  3144.         if(SQL_NumResults(hQuery))
  3145.         {
  3146.             new Float:flDbTime
  3147.             SQL_ReadResult(hQuery, SQL_FieldNameToNum(hQuery, "time"), flDbTime)
  3148.            
  3149.             if(flDbTime < flTime)
  3150.             {
  3151.                 bUpdate = false
  3152.             }
  3153.         }
  3154.        
  3155.         if(bUpdate)
  3156.         {
  3157.             SQL_FreeHandle(hQuery)
  3158.            
  3159.             hQuery = SQL_PrepareQuery(hDb, "REPLACE INTO kz_%s15 (name, steamid, map, time, cp, gc) VALUES (^"%s^", ^"%s^", ^"%s^", %f, %i, %i);",
  3160.             bPro ? "pro" : "nub", szName, szAuthID, g_szMapName, flTime, g_iCheckpointNum[iPlayer], g_iGoCheckNum[iPlayer])
  3161.            
  3162.             if(!SQL_Execute(hQuery))
  3163.             {
  3164.                 SQL_QueryError(hQuery, szError, charsmax( szError))
  3165.                 log_amx("Error on query saving player %s time: %s", bPro ? "pro" : "nub", szError)
  3166.             }
  3167.         }
  3168.     }
  3169.    
  3170.     SQL_FreeHandle(hQuery)
  3171.    
  3172.     SQL_FreeHandle(hDb)
  3173. }
  3174.  
  3175. public show_top15(iPlayer, bool:bPro)
  3176. {
  3177.     new szURL[128]
  3178.     get_pcvar_string(g_kz_weburl, szURL, charsmax(szURL))
  3179.    
  3180.     new iLen = strlen(szURL)
  3181.     formatex(szURL[iLen], charsmax(szURL) - iLen, "?map=%s&pro=%i&a=%i", g_szMapName, bPro, random(15000))
  3182.    
  3183.     show_motd(iPlayer, szURL, bPro ? "ProKreedz Pro15" : "ProKreedz Nub15")
  3184.    
  3185.     return PLUGIN_HANDLED
  3186. }
  3187. #endif
  3188.  
  3189. kz_create_healer() {
  3190.     new iEntHealer, Float:fHealthValue = (get_pcvar_float(g_kz_autoheal_hp)*2.0)
  3191.     if(fHealthValue < 2.0)
  3192.         fHealthValue = 20.0
  3193.     iEntHealer = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString , "trigger_hurt"))
  3194.     dllfunc(DLLFunc_Spawn, iEntHealer)
  3195.     engfunc(EngFunc_SetSize, iEntHealer, Float:{-8192.0, -8192.0, -8192.0} , Float:{8192.0, 8192.0, 8192.0})
  3196.     set_pev(iEntHealer, pev_spawnflags, SF_TRIGGER_HURT_CLIENTONLYTOUCH)
  3197.     set_pev(iEntHealer, pev_dmg, -1.0 * fHealthValue)
  3198. }
  3199.  
  3200. kz_colorchat(id, color:type, const msg[], {Float,Sql,Result,_}:...) {
  3201.    
  3202.     static message[256], pkmsg[180], changed[8], argscount,j
  3203.     argscount = numargs()
  3204.    
  3205.     switch(type)
  3206.     {
  3207.         case normal: message[0] = 0x01
  3208.            
  3209.         case green: message[0] = 0x04
  3210.            
  3211.         default: message[0] = 0x03
  3212.        
  3213.     }
  3214.     new pktag[32]
  3215.     get_pcvar_string(g_kz_tag, pktag, 31)
  3216.    
  3217.     if(id)
  3218.     {
  3219.         if(is_plr_connected[id])
  3220.         {
  3221.             vformat(pkmsg, 179, msg, 4)
  3222.             formatex(message[1], 255, "%s %s", pktag, pkmsg)
  3223.             message[192] = '^0'
  3224.            
  3225.             replace_all(message, 191, "!g", "^x04")
  3226.             replace_all(message, 191, "!n", "^x01")
  3227.             replace_all(message, 191, "!t", "^x03")
  3228.             kz_print_msg(id, message)
  3229.         }
  3230.     }
  3231.     else
  3232.     {
  3233.         for(new i = 1; i <= g_iMaxPlayers; i++)
  3234.         {
  3235.             if(is_plr_connected[i])
  3236.             {
  3237.                 new changedcount = 0
  3238.                
  3239.                 for(j = 2; j < argscount; j++)
  3240.                 {
  3241.                     if(getarg(j) == LANG_PLAYER)
  3242.                     {
  3243.                         setarg(j, 0, i);
  3244.                         changed[changedcount++] = j;
  3245.                     }
  3246.                 }
  3247.                 vformat(pkmsg, 179, msg, 4)
  3248.                 formatex(message[1], 255, "%s %s", pktag, pkmsg)
  3249.                 message[192] = '^0'
  3250.                
  3251.                 replace_all(message, 191, "!g", "^x04")
  3252.                 replace_all(message, 191, "!n", "^x01")
  3253.                 replace_all(message, 191, "!t", "^x03")
  3254.                 kz_print_msg(i, message)
  3255.                
  3256.                 for(j = 0; j < changedcount; j++)
  3257.                 {
  3258.                     setarg(changed[j], 0, LANG_PLAYER)
  3259.                 }
  3260.             }
  3261.         }
  3262.     }
  3263. }
  3264.  
  3265. stock kz_print_msg(id, const msg[])
  3266. {
  3267.     message_begin(MSG_ONE_UNRELIABLE, g_SayText, _, id)
  3268.     write_byte(id)     
  3269.     write_string(msg)
  3270.     message_end()
  3271. }
  3272.  
  3273. stock set_user_duck(id)
  3274. {
  3275.     set_pev(id, pev_flags, pev(id, pev_flags) | FL_DUCKING)
  3276.     engfunc( EngFunc_SetSize, id, VEC_DUCK_HULL_MIN, VEC_DUCK_HULL_MAX)
  3277. }
  3278.  
  3279. stock set_user_scoreattrib(id, attrib = 0)
  3280. {
  3281.     message_begin(MSG_BROADCAST, g_ScoreAttrib, _, 0)
  3282.     write_byte(id)
  3283.     write_byte(attrib)
  3284.     message_end()
  3285. }
  3286.  
  3287. stock set_user_teaminfo(id, teamstatus[])
  3288. {
  3289.     emessage_begin(MSG_BROADCAST, g_TeamInfo)
  3290.     ewrite_byte(id)
  3291.     ewrite_string(teamstatus)
  3292.     emessage_end()
  3293. }
  3294.  
  3295. stock fm_set_plr_model(id, const Model[])
  3296. {
  3297.     copy(g_iPlayerModel[id], charsmax(g_iPlayerModel[]), Model)
  3298.     fm_set_admin_vipmodel(id, g_iPlayerModel[id])
  3299. }
  3300.  
  3301. stock fm_set_admin_vipmodel(id, const model[])
  3302. {
  3303.     set_pev(id, pev_rendermode, kRenderTransTexture)
  3304.     set_pev(id, pev_renderamt, 1.0)
  3305.    
  3306.     static modelpath[100]
  3307.     formatex(modelpath, 99, "models/player/%s/%s.mdl", model, model)
  3308.    
  3309.     if(!pev_valid(g_iEntPlayerModel[id]))
  3310.     {
  3311.         g_iEntPlayerModel[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
  3312.        
  3313.         if (!pev_valid(g_iEntPlayerModel[id])) return
  3314.        
  3315.         set_pev(g_iEntPlayerModel[id], pev_classname, "ent_playermodel")
  3316.         set_pev(g_iEntPlayerModel[id], pev_movetype, MOVETYPE_FOLLOW)
  3317.         set_pev(g_iEntPlayerModel[id], pev_aiment, id)
  3318.         set_pev(g_iEntPlayerModel[id], pev_owner, id)
  3319.     }
  3320.     engfunc(EngFunc_SetModel, g_iEntPlayerModel[id], modelpath)
  3321. }
  3322.  
  3323. stock fm_set_admin_weaponmodel(id)
  3324. {
  3325.     static model[100]
  3326.     pev(id, pev_weaponmodel2, model, 99)
  3327.    
  3328.     if(!pev_valid(g_iEntWeaponModel[id]))
  3329.     {
  3330.         g_iEntWeaponModel[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
  3331.        
  3332.         if (!pev_valid(g_iEntWeaponModel[id])) return
  3333.        
  3334.         set_pev(g_iEntWeaponModel[id], pev_classname, "ent_weaponmodel")
  3335.         set_pev(g_iEntWeaponModel[id], pev_movetype, MOVETYPE_FOLLOW)
  3336.         set_pev(g_iEntWeaponModel[id], pev_aiment, id)
  3337.         set_pev(g_iEntWeaponModel[id], pev_owner, id)
  3338.     }
  3339.     engfunc(EngFunc_SetModel, g_iEntWeaponModel[id], model)
  3340. }
  3341.  
  3342. stock fm_remove_model_ents(id)
  3343. {
  3344.     set_pev(id, pev_rendermode, kRenderNormal)
  3345.    
  3346.     if(pev_valid(g_iEntPlayerModel[id]))
  3347.     {
  3348.         engfunc(EngFunc_RemoveEntity, g_iEntPlayerModel[id])
  3349.         g_iEntPlayerModel[id] = 0
  3350.     }
  3351.     if(pev_valid(g_iEntWeaponModel[id]))
  3352.     {
  3353.         engfunc(EngFunc_RemoveEntity, g_iEntWeaponModel[id])
  3354.         g_iEntWeaponModel[id] = 0
  3355.     }
  3356. }
  3357.  
  3358. stock ham_strip_weapon(id,weapon[])
  3359. {
  3360.     if(!equal(weapon,"weapon_",7)) return 0
  3361.    
  3362.     new wId = get_weaponid(weapon)
  3363.     if(!wId) return 0
  3364.    
  3365.     new wEnt
  3366.     while((wEnt = engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapon)) && pev(wEnt,pev_owner) != id) {}
  3367.     if(!wEnt) return 0
  3368.    
  3369.     if(get_user_weapon(id) == wId) ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt)
  3370.    
  3371.     if(!ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) return 0
  3372.     ExecuteHamB(Ham_Item_Kill,wEnt)
  3373.    
  3374.     set_pev(id,pev_weapons,pev(id,pev_weapons) & ~(1<<wId))
  3375.    
  3376.     return 1
  3377. }
  3378.  
  3379. stock kz_set_health(id)
  3380. {
  3381.     new Float:fHealth = 255.0
  3382.     if(pev(id, pev_health) < fHealth)
  3383.     {
  3384.         set_pev(id, pev_health, fHealth)
  3385.         set_pev(id, pev_max_health, fHealth)
  3386.     }
  3387. }
  3388.  
  3389. stock kz_set_weapons(id)
  3390. {
  3391.     if(!is_plr_bot[id])
  3392.     {
  3393.         strip_user_weapons(id)
  3394.         give_item(id, "weapon_knife")
  3395.         give_item(id, "weapon_usp")
  3396.         if(g_bHasScout[id])
  3397.             give_item(id, "weapon_scout")
  3398.         g_bWeapons[id] = false
  3399.     }
  3400. }
  3401.  
  3402. stock kz_team_join(id, MenuMsgid, Team[], Class[])
  3403. {
  3404.     static jointeam[] = "jointeam"
  3405.     if (Class[0] == '0' )
  3406.     {
  3407.         engclient_cmd(id, jointeam, Team)
  3408.         return
  3409.     }
  3410.     static MsgBlock, joinclass[] = "joinclass"
  3411.     MsgBlock = get_msg_block(MenuMsgid)
  3412.     set_msg_block(MenuMsgid, BLOCK_SET)
  3413.     engclient_cmd(id, jointeam, Team)
  3414.     engclient_cmd(id, joinclass, Class)
  3415.     set_msg_block(MenuMsgid, MsgBlock)
  3416. }
  3417.  
  3418. stock kz_set_autojoin_task(id, MenuMsgid)
  3419. {
  3420.     static ParamMenuMsgid[2]
  3421.     ParamMenuMsgid[0] = MenuMsgid
  3422.     set_task(0.1, "PlayerTeamJoin", id + TASK_AUTOJOIN, ParamMenuMsgid, sizeof ParamMenuMsgid)
  3423. }
  3424.  
  3425. stock bool:ShouldAutoJoin(id)
  3426. {
  3427.     return (!get_user_team(id) && !task_exists(id + TASK_AUTOJOIN))
  3428. }
  3429.  
  3430. stock kz_callfunc(id, function[], plugin[], onoff[])
  3431. {      
  3432.     if(callfunc_begin(function, plugin) == 1)
  3433.     {
  3434.         callfunc_push_int(id)
  3435.         callfunc_push_str(onoff)
  3436.         callfunc_end()
  3437.     }
  3438. }
  3439.  
  3440. stock kz_make_lgt(id, Float:origin[3], Red, Green, Blue)
  3441. {
  3442.     message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id)
  3443.     write_byte(TE_DLIGHT)  
  3444.     engfunc(EngFunc_WriteCoord, origin[0])
  3445.     engfunc(EngFunc_WriteCoord, origin[1])
  3446.     engfunc(EngFunc_WriteCoord, origin[2])
  3447.     write_byte(get_pcvar_num(g_kz_nvg_radius))                
  3448.     write_byte(Red)  
  3449.     write_byte(Green)  
  3450.     write_byte(Blue)  
  3451.     write_byte(2)              
  3452.     write_byte(0)                
  3453.     message_end()
  3454. }
  3455.  
  3456. stock kz_make_nvg(id)
  3457. {
  3458.     new r, g, b
  3459.     GetCvarColor(g_kz_nvg_color, r, g, b)
  3460.    
  3461.     message_begin( MSG_ONE_UNRELIABLE, g_ScreenFade, _, id)
  3462.     write_short(1<<0)
  3463.     write_short(1<<0)
  3464.     write_short(0x0004)
  3465.     write_byte(r)
  3466.     write_byte(g)
  3467.     write_byte(b)
  3468.     write_byte(50)
  3469.     message_end()
  3470.    
  3471.     set_task(0.1, "kz_set_nvg", id + TASK_NVG, _, _, "b")
  3472. }
  3473.  
  3474. stock kz_remove_nvg(id)
  3475. {
  3476.     message_begin( MSG_ONE_UNRELIABLE, g_ScreenFade, _, id)
  3477.     write_short(0)
  3478.     write_short(0)
  3479.     write_short(0x0000)
  3480.     write_byte(0)
  3481.     write_byte(0)
  3482.     write_byte(0)
  3483.     write_byte(0)
  3484.     message_end()
  3485.    
  3486.     remove_task(id + TASK_NVG)
  3487.     g_bPlayerNvgUse[id] = false
  3488. }
  3489.  
  3490. stock kz_set_nvg_msg(id, bool:toggle)
  3491. {
  3492.     message_begin(MSG_ONE_UNRELIABLE, g_NVGToggle, _, id)
  3493.     write_byte(toggle)
  3494.     message_end()
  3495. }
  3496.  
  3497. stock kz_register_saycmd(const saycommand[], const function[], flags)
  3498. {
  3499.     new temp[64]
  3500.     formatex(temp, 63, "say /%s", saycommand)
  3501.     register_clcmd(temp, function, flags)
  3502.     formatex(temp, 63, "say .%s", saycommand)
  3503.     register_clcmd(temp, function, flags)
  3504.     formatex(temp, 63, "say_team /%s", saycommand)
  3505.     register_clcmd(temp, function, flags)
  3506.     formatex(temp, 63, "say_team .%s", saycommand)
  3507.     register_clcmd(temp, function, flags)
  3508. }
  3509.  
  3510. kz_make_config(const sConfig[]) {
  3511.    
  3512.     new f = fopen(sConfig, "wt")
  3513.    
  3514.     new sCvarSrting[32]
  3515.    
  3516.     fprintf(f, "// %s %s by %s - Cvars Config ^n^n", PLUGIN, VERSION, AUTHOR)
  3517.    
  3518.     fprintf(f, "// Game Description^n")
  3519.     fprintf(f, "// 0 - Disabled^n")
  3520.     fprintf(f, "// 1 - Enabled^n")
  3521.     fprintf(f, "//^n")
  3522.     fprintf(f, "// Default: 1^n")
  3523.     fprintf(f, "kz_modname_enable %i^n^n", get_pcvar_num(g_kz_modname_enable))
  3524.    
  3525.     fprintf(f, "// Recommend to set this Cvars via Admin Menu^n")
  3526.     fprintf(f, "// Type /amenu in chat to open the Admin Menu^n")
  3527.     fprintf(f, "// kz_checkpoints %i^n", get_pcvar_num(g_kz_checkpoints))
  3528.     fprintf(f, "// kz_godmode %i^n", get_pcvar_num(g_kz_godmode))
  3529.     fprintf(f, "// kz_autojoin %i^n", get_pcvar_num(g_kz_autojoin))
  3530.     fprintf(f, "// kz_scout %i^n", get_pcvar_num(g_kz_scout))
  3531.     fprintf(f, "// kz_adminglow %i^n", get_pcvar_num(g_kz_adminglow))
  3532.     fprintf(f, "// kz_semiclip %i^n", get_pcvar_num(g_kz_semiclip))
  3533.     fprintf(f, "// kz_bhop %i^n", get_pcvar_num(g_kz_bhop))
  3534.     fprintf(f, "// kz_transparency %i^n", get_pcvar_num(g_kz_transparency))
  3535.     fprintf(f, "// kz_cheatdetect %i^n^n", get_pcvar_num(g_kz_cheatdetect))
  3536.    
  3537.     fprintf(f, "// Set how many Checkpoint are allowed to use for^n")
  3538.     fprintf(f, "// pro climber to get on Pro15 rank^n")
  3539.     fprintf(f, "// 0 - Only climber with No Checks get on Pro15 rank^n")
  3540.     fprintf(f, "//^n")
  3541.     fprintf(f, "// Default: 10000^n")
  3542.     fprintf(f, "kz_maxpro_cp %i^n^n", get_pcvar_num(g_kz_maxpro_cp))
  3543.    
  3544.     fprintf(f, "// Set Player Individually Auto-Start-Position^n")
  3545.     fprintf(f, "// 0 - Disabled^n")
  3546.     fprintf(f, "// 1 - Enabled^n")
  3547.     fprintf(f, "//^n")
  3548.     fprintf(f, "// Default: 1^n")
  3549.     fprintf(f, "kz_autostart %i^n^n", get_pcvar_num(g_kz_autostart))
  3550.    
  3551.     fprintf(f, "// Allows started Player to pause his time^n")
  3552.     fprintf(f, "// 0 - Disabled^n")
  3553.     fprintf(f, "// 1 - Enabled^n")
  3554.     fprintf(f, "//^n")
  3555.     fprintf(f, "// Default: 1^n")
  3556.     fprintf(f, "kz_pause %i^n^n", get_pcvar_num(g_kz_pause))
  3557.    
  3558.     fprintf(f, "// Allows Player to join team Spectator^n")
  3559.     fprintf(f, "// 0 - Disabled^n")
  3560.     fprintf(f, "// 1 - Enabled^n")
  3561.     fprintf(f, "//^n")
  3562.     fprintf(f, "// Default: 1^n")
  3563.     fprintf(f, "kz_spec %i^n^n", get_pcvar_num(g_kz_spec))
  3564.    
  3565.     fprintf(f, "// Kz Start and Finish sounds^n")
  3566.     fprintf(f, "// 0 - Disabled^n")
  3567.     fprintf(f, "// 1 - Start & Finish sound Enabled^n")
  3568.     fprintf(f, "// 2 - Only Start sound Enabled^n")
  3569.     fprintf(f, "// 3 - Only Finish sound Enabled^n")
  3570.     fprintf(f, "//^n")
  3571.     fprintf(f, "// Default: 1^n")
  3572.     fprintf(f, "kz_sounds %i^n^n", get_pcvar_num(g_kz_sounds))
  3573.    
  3574.     fprintf(f, "// Set Admin Model^n")
  3575.     fprintf(f, "// 0 - Sas Model^n")
  3576.     fprintf(f, "// 1 - Vip Model and Scoreboard Attribute Vip^n")
  3577.     fprintf(f, "// 2 - Arctic Model and Scoreboard Attribute Vip^n")
  3578.     fprintf(f, "//^n")
  3579.     fprintf(f, "// Default: 1^n")
  3580.     fprintf(f, "kz_vip %i^n^n", get_pcvar_num(g_kz_vip))
  3581.    
  3582.     fprintf(f, "// Kz Startmoney^n")
  3583.     fprintf(f, "//^n")
  3584.     fprintf(f, "// Default: 1337^n")
  3585.     fprintf(f, "kz_money %i^n^n", get_pcvar_num(g_kz_money))
  3586.    
  3587.     fprintf(f, "// Player self kill command^n")
  3588.     fprintf(f, "// 0 - Self kill allowed^n")
  3589.     fprintf(f, "// 1 - Self kill not allowed^n")
  3590.     fprintf(f, "//^n")
  3591.     fprintf(f, "// Default: 1^n")
  3592.     fprintf(f, "kz_nokill %i^n^n", get_pcvar_num(g_kz_nokill))
  3593.    
  3594.     fprintf(f, "// Help Motd with all kz commands^n")
  3595.     fprintf(f, "// 0 - Disabled^n")
  3596.     fprintf(f, "// 1 - Enabled^n")
  3597.     fprintf(f, "//^n")
  3598.     fprintf(f, "// Default: 1^n")
  3599.     fprintf(f, "kz_help %i^n^n", get_pcvar_num(g_kz_help))
  3600.    
  3601.     fprintf(f, "// Create Kz Bot^n")
  3602.     fprintf(f, "// 0 - Disabled^n")
  3603.     fprintf(f, "// 1 - Enabled^n")
  3604.     fprintf(f, "//^n")
  3605.     fprintf(f, "// Default: 1^n")
  3606.     fprintf(f, "kz_bot %i^n^n", get_pcvar_num(g_kz_bot))
  3607.    
  3608.     fprintf(f, "// Kz Bot Name^n")
  3609.     fprintf(f, "//^n")
  3610.     fprintf(f, "// Default: ProKreedz Ultimativ v2.4^n")
  3611.     get_pcvar_string(g_kz_botname, sCvarSrting, 31)
  3612.     fprintf(f, "kz_botname ^"%s^"^n^n", sCvarSrting)
  3613.    
  3614.     fprintf(f, "// Player rewards Hook and Jetpack^n")
  3615.     fprintf(f, "// 0 - Disabled^n")
  3616.     fprintf(f, "// 1 - Enabled^n")
  3617.     fprintf(f, "//^n")
  3618.     fprintf(f, "// Default: 1^n")
  3619.     fprintf(f, "kz_prize %i^n^n", get_pcvar_num(g_kz_prize))
  3620.    
  3621.     fprintf(f, "// Info Msgs about receiving rewards^n")
  3622.     fprintf(f, "//^n")
  3623.     fprintf(f, "// Default: 60^n")
  3624.     fprintf(f, "kz_advert_time %i^n^n", get_pcvar_num(g_kz_advert_time))
  3625.    
  3626.     fprintf(f, "// Door sounds^n")
  3627.     fprintf(f, "// 0 - Enabled^n")
  3628.     fprintf(f, "// 1 - Disabled^n")
  3629.     fprintf(f, "//^n")
  3630.     fprintf(f, "// Default: 1^n")
  3631.     fprintf(f, "kz_doorsound %i^n^n", get_pcvar_num(g_kz_doorsound))
  3632.    
  3633.     fprintf(f, "// Pain sounds^n")
  3634.     fprintf(f, "// 0 - Enabled^n")
  3635.     fprintf(f, "// 1 - Disabled^n")
  3636.     fprintf(f, "//^n")
  3637.     fprintf(f, "// Default: 1^n")
  3638.     fprintf(f, "kz_painsound %i^n^n", get_pcvar_num(g_kz_painsound))
  3639.    
  3640.     fprintf(f, "// Water sounds^n")
  3641.     fprintf(f, "// 0 - Enabled^n")
  3642.     fprintf(f, "// 1 - Disabled^n")
  3643.     fprintf(f, "//^n")
  3644.     fprintf(f, "// Default: 1^n")
  3645.     fprintf(f, "kz_watersound %i^n^n", get_pcvar_num(g_kz_watersound))
  3646.    
  3647.     fprintf(f, "// Kz chat prefix^n")
  3648.     fprintf(f, "//^n")
  3649.     fprintf(f, "// Default: [ProKreedz]^n")
  3650.     get_pcvar_string(g_kz_tag, sCvarSrting, 31)
  3651.     fprintf(f, "kz_tag ^"%s^"^n^n", sCvarSrting)
  3652.    
  3653.     fprintf(f, "// Player Autohealing^n")
  3654.     fprintf(f, "// 0 - Disabled^n")
  3655.     fprintf(f, "// 1 - Enabled^n")
  3656.     fprintf(f, "//^n")
  3657.     fprintf(f, "// Default: 1^n")
  3658.     fprintf(f, "kz_autoheal %i^n^n", get_pcvar_num(g_kz_autoheal))
  3659.    
  3660.     fprintf(f, "// Set HP Amount for Autohealing^n")
  3661.     fprintf(f, "//^n")
  3662.     fprintf(f, "// Default: 50^n")
  3663.     fprintf(f, "kz_autoheal_hp %i^n^n", get_pcvar_num(g_kz_autoheal_hp))
  3664.    
  3665.     fprintf(f, "// Give player all weapons^n")
  3666.     fprintf(f, "// 0 - Disabled^n")
  3667.     fprintf(f, "// 1 - Enabled^n")
  3668.     fprintf(f, "//^n")
  3669.     fprintf(f, "// Default: 1^n")
  3670.     fprintf(f, "kz_weapons %i^n^n", get_pcvar_num(g_kz_weapons))
  3671.    
  3672.     fprintf(f, "// Show maxspeed of weapons^n")
  3673.     fprintf(f, "// 0 - Disabled^n")
  3674.     fprintf(f, "// 1 - Enabled^n")
  3675.     fprintf(f, "//^n")
  3676.     fprintf(f, "// Default: 1^n")
  3677.     fprintf(f, "kz_weaponspeed %i^n^n", get_pcvar_num(g_kz_weaponspeed))
  3678.    
  3679.     fprintf(f, "// Set the color of weaponspeed Msg^n")
  3680.     fprintf(f, "//^n")
  3681.     fprintf(f, "// Default: 0 255 255^n")
  3682.     get_pcvar_string(g_kz_weaponspeed_color, sCvarSrting, 31)
  3683.     fprintf(f, "kz_weaponspeed_color ^"%s^"^n^n", sCvarSrting)
  3684.    
  3685.     fprintf(f, "// Set the position of weaponspeed Msg^n")
  3686.     fprintf(f, "//^n")
  3687.     fprintf(f, "// Default: 0.35 0.75^n")
  3688.     get_pcvar_string(g_kz_weaponspeed_xypos, sCvarSrting, 31)
  3689.     fprintf(f, "kz_weaponspeed_xypos ^"%s^"^n^n", sCvarSrting)
  3690.    
  3691.     fprintf(f, "// Show Player Keys^n")
  3692.     fprintf(f, "// 0 - Disabled^n")
  3693.     fprintf(f, "// 1 - Enabled^n")
  3694.     fprintf(f, "//^n")
  3695.     fprintf(f, "// Default: 1^n")
  3696.     fprintf(f, "kz_showkeys %i^n^n", get_pcvar_num(g_kz_showkeys))
  3697.    
  3698.     fprintf(f, "// Set the color of showkeys Msg^n")
  3699.     fprintf(f, "//^n")
  3700.     fprintf(f, "// Default: 0 255 255^n")
  3701.     get_pcvar_string(g_kz_showkeys_color, sCvarSrting, 31)
  3702.     fprintf(f, "kz_showkeys_color ^"%s^"^n^n", sCvarSrting)
  3703.    
  3704.     fprintf(f, "// Set the position of showkeys Msg^n")
  3705.     fprintf(f, "//^n")
  3706.     fprintf(f, "// Default: -1.0 -0.40^n")
  3707.     get_pcvar_string(g_kz_showkeys_xypos, sCvarSrting, 31)
  3708.     fprintf(f, "kz_showkeys_xypos ^"%s^"^n^n", sCvarSrting)
  3709.    
  3710.     fprintf(f, "// Kz Custom Nightvision^n")
  3711.     fprintf(f, "// 0 - Disabled^n")
  3712.     fprintf(f, "// 1 - Enabled^n")
  3713.     fprintf(f, "//^n")
  3714.     fprintf(f, "// Default: 1^n")
  3715.     fprintf(f, "kz_nvg_enabled %i^n^n", get_pcvar_num(g_kz_nvg_enabled))
  3716.    
  3717.     fprintf(f, "// Kz Custom Nightvision Radius^n")
  3718.     fprintf(f, "//^n")
  3719.     fprintf(f, "// Default: 70^n")
  3720.     fprintf(f, "kz_nvg_radius %i^n^n", get_pcvar_num(g_kz_nvg_radius))
  3721.    
  3722.     fprintf(f, "// Set the color of custom Nvg^n")
  3723.     fprintf(f, "//^n")
  3724.     fprintf(f, "// Default: 0 255 255^n")
  3725.     get_pcvar_string(g_kz_nvg_color, sCvarSrting, 31)
  3726.     fprintf(f, "kz_nvg_color ^"%s^"^n^n", sCvarSrting)
  3727.    
  3728.     fprintf(f, "// Set the color of Palyer time Msg^n")
  3729.     fprintf(f, "//^n")
  3730.     fprintf(f, "// Default: 0 255 255^n")
  3731.     get_pcvar_string(g_kz_time_color, sCvarSrting, 31)
  3732.     fprintf(f, "kz_time_color ^"%s^"^n^n", sCvarSrting)
  3733.    
  3734.     fprintf(f, "// Set the color of pause and spec Msg^n")
  3735.     fprintf(f, "//^n")
  3736.     fprintf(f, "// Default: 255 0 0^n")
  3737.     get_pcvar_string(g_kz_status_color, sCvarSrting, 31)
  3738.     fprintf(f, "kz_status_color ^"%s^"^n^n", sCvarSrting)
  3739.    
  3740.     fprintf(f, "// Set the color of Health Msg^n")
  3741.     fprintf(f, "// Health Msg will be shown when Health is greater 255 HP^n")
  3742.     fprintf(f, "//^n")
  3743.     fprintf(f, "// Default: 255 50 0^n")
  3744.     get_pcvar_string(g_kz_showhealth_color, sCvarSrting, 31)
  3745.     fprintf(f, "kz_showhealth_color ^"%s^"^n^n", sCvarSrting)
  3746.    
  3747.     fprintf(f, "// Set the positionof Health Msg^n")
  3748.     fprintf(f, "//^n")
  3749.     fprintf(f, "// Default: -1.0 0.9^n")
  3750.     get_pcvar_string(g_kz_showhealth_xypos, sCvarSrting, 31)
  3751.     fprintf(f, "kz_showhealth_xypos ^"%s^"^n^n", sCvarSrting)
  3752.    
  3753.     fprintf(f, "// StatusText Types^n")
  3754.     fprintf(f, "// 0 - Show Hud Msg as Staustext - (Show only player name)^n")
  3755.     fprintf(f, "// 1 - Show Original Staustext - (Show only player name)^n")
  3756.     fprintf(f, "//^n")
  3757.     fprintf(f, "// Default: 1^n")
  3758.     fprintf(f, "kz_statustext %i^n^n", get_pcvar_num(g_kz_statustext))
  3759.    
  3760.     fprintf(f, "// Set the color of Statustext Msg^n")
  3761.     fprintf(f, "//^n")
  3762.     fprintf(f, "// Default: 255 255 0^n")
  3763.     get_pcvar_string(g_kz_statustext_color, sCvarSrting, 31)
  3764.     fprintf(f, "kz_statustext_color ^"%s^"^n^n", sCvarSrting)
  3765.    
  3766.     fprintf(f, "// Set the position of Statustext Msg^n")
  3767.     fprintf(f, "//^n")
  3768.     fprintf(f, "// Default: -1.0 0.52^n")
  3769.     get_pcvar_string(g_kz_statustext_xypos, sCvarSrting, 31)
  3770.     fprintf(f, "kz_statustext_xypos ^"%s^"^n^n", sCvarSrting)
  3771.    
  3772.     fclose(f)
  3773.    
  3774.     server_cmd("exec %s", sConfig)
  3775.     server_exec()
  3776. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top