Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Guest Message by DevFuse
Wklejka 4q2s14ta2328 dodana przez kamioool, 31.08.2012 17:46
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 109. 110. 111. 112. 113. 114. 115. 116. 117. 118. 119. 120. 121. 122. 123. 124. 125. 126. 127. 128. 129. 130. 131. 132. 133. 134. 135. 136. 137. 138. 139. 140. 141. 142. 143. 144. 145. 146. 147. 148. 149. 150. 151. 152. 153. 154. 155. 156. 157. 158. 159. 160.
/*================================================================================ [[ZP] Addon: Display the Current Mode Copyright (C) 2009 by meTaLiCroSS, Vińa del Mar, Chile This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. In addition, as a special exception, the author gives permission to link the code of this program with the Half-Life Game Engine ("HL Engine") and Modified Game Libraries ("MODs") developed by Valve, L.L.C ("Valve"). You must obey the GNU General Public License in all respects for all of the code used other than the HL Engine and MODs from Valve. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. ** Credits: - Exolent[jNr]: Big plugin optimization =================================================================================*/ #include <amxmodx> #include <zombieplague> /*================================================================================ [Customizations] =================================================================================*/ // Hudmessage tag new const hud_tag[] = "Mode Actual : " // Name for each Hudmessage Mode new const mode_names[][] = { "Waiting for New Mode...", // No mode Started "[Normal Infection]", // Normal Infection, single round "[Nemesis Mode]", // Nemesis Mode (zombie boss) "[Survivor Mode]", // Survivor Mode (human boss) "[Swarm Mode]", // Swarm round (no infections) "[Multi-Infection]", // Multiple Infection (like single round, but, more than 1 zombie) "[Plague Mode]", // Plague round (nemesis & zombies vs. survivors & humans) "[Sniper Mode]", // Sniper Mode (human boss) "[Assassin Mode]", // Assasin Mode (zombie boss) "[Armageddon Mode]", // LNJ round (nemesis & zombies vs. survivors & humans) "[Snipers VS Assassins]" // An unofficial mode (edited/created/modified by user) } // RGB Colors for each Hudmessage Mode // See here some RGB Colors: http://web.njit.edu/~kevin/rgb.txt.html new const rgb_hud_colors[sizeof(mode_names)][3] = { // R G B {255, 255, 255}, // No mode Started {0, 255, 0}, // Normal Infection, single round {255, 0, 0}, // Nemesis Mode (zombie boss) {255, 70, 0}, // Survivor Mode (human boss) {0, 0, 255}, // Swarm round (no infections) {0, 255, 255}, // Multiple Infection (like single round, but, more than 1 zombie) {255, 255, 0}, // Plague round (nemesis & zombies vs. survivors & humans) {0, 255, 0}, {255, 0, 0}, // Multiple Infection (like single round, but, more than 1 zombie) {150, 0, 150}, {255, 70, 0} // An unofficial mode (edited/created/modified by user) } // X Hudmessage Position ( --- ) const Float:HUD_MODE_X = 0.65 // Y Hudmessage Position ( ||| ) const Float:HUD_MODE_Y = 0.2 // Time at which the Hudmessage is displayed. (when user is puted into the Server) const Float:START_TIME = 6.0 /*================================================================================ Customization ends here! Yes, that's it. Editing anything beyond here is not officially supported. Proceed at your own risk... =================================================================================*/ // Variables new g_SyncHud, g_Mode // Cvar pointers new cvar_enable, cvar_central public plugin_init() { // Plugin Info register_plugin("[ZP] Addon: Display the Current Mode", "0.1.6", "meTaLiCroSS") // Round Start Event register_event("HLTV", "event_RoundStart", "a", "1=0", "2=0") // Enable Cvar cvar_enable = register_cvar("zp_display_mode", "1") // Server Cvar register_cvar("zp_addon_dtcm", "v0.1.6 by meTaLiCroSS", FCVAR_SERVER|FCVAR_SPONLY) // Variables g_SyncHud = CreateHudSyncObj() // Getting "zp_on" cvar if(cvar_exists("zp_on")) cvar_central = get_cvar_pointer("zp_on") // If Zombie Plague is not running (bugfix) if(!get_pcvar_num(cvar_central)) pause("a") } public client_putinserver(id) { // Setting Hud set_task(START_TIME, "mode_hud", id, _, _, "b") } public event_RoundStart() { // Update var (no mode started / in delay) g_Mode = 0 } public mode_hud(id) { // If the Cvar isn't enabled if(!get_pcvar_num(cvar_enable)) return; // Hud Options set_hudmessage(rgb_hud_colors[g_Mode][0], rgb_hud_colors[g_Mode][1], rgb_hud_colors[g_Mode][2], HUD_MODE_X, HUD_MODE_Y, 0, 6.0, 12.0) // Now the hud appears ShowSyncHudMsg(id, g_SyncHud, "%s%s", (g_Mode == 0 ? "" : hud_tag), mode_names[g_Mode]) } public zp_round_started(mode, id) { // Update var with Mode num g_Mode = mode // An unofficial mode if(!(1 <= mode < (sizeof(mode_names) - 1))) g_Mode = sizeof(mode_names) - 1 }
Dodanych wklejek: 11179
Powered By (Pav32) Pastebin © 2011