hlmod.hu
https://hlmod.hu/

Jelenlegi mód kiiró átirva
https://hlmod.hu/viewtopic.php?f=9&t=7275
Oldal: 1 / 1

Szerző:  Tomos [ 2013.01.26. 11:03 ]
Hozzászólás témája:  Jelenlegi mód kiiró átirva

Átirtam ezt a plugint hogy kiirja a világvége módot mesterlövész módot valaki megnézné hogy jó e

/*================================================================================

[[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[] = "Jelenlegi mod: "

// Name for each Hudmessage Mode
new const mode_names[][] =
{
"Varakozas az uj modra...", // No mode Started
"Normal fertozeses", // Normal Infection, single round
"Nemesis mod", // Nemesis Mode (zombie boss)
"Tulelo mod", // Survivor Mode (human boss)
"Raj mod", // Swarm round (no infections)
"Tobbszoros fertozeses mod", // Multiple Infection (like single round, but, more than 1 zombie)
"Mesterlovesz mod", // Sniper mode
"Assasin mod", // Assasin mod
"Vilagvege mod", // Vilagvege mod
"Pestis mod", // Plague round (nemesis & zombies vs. survivors & humans)
"Ismeretlen mod" // 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, 255, 0}, // Assasin mod
{0, 0, 255}, // Survivor Mode (human boss)
{255, 255, 0}, // Swarm round (no infections)
{255, 0, 0}, // Sniper mode
{0, 255, 0}, // Multiple Infection (like single round, but, more than 1 zombie)
{255, 0, 0}, // Plague round (nemesis & zombies vs. survivors & humans)
{255, 0, 255}, // Vilagvege mod
{255, 255, 255} // 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 = 3.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
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/

Szerző:  crazy` [ 2013.01.26. 11:12 ]
Hozzászólás témája:  Re: Jelenlegi mód kiiró átirva

Tomos írta:
Átirtam ezt a plugint hogy kiirja a világvége módot mesterlövész módot valaki megnézné hogy jó e

/*================================================================================

[[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[] = "Jelenlegi mod: "

// Name for each Hudmessage Mode
new const mode_names[][] =
{
"Varakozas az uj modra...", // No mode Started
"Normal fertozeses", // Normal Infection, single round
"Nemesis mod", // Nemesis Mode (zombie boss)
"Tulelo mod", // Survivor Mode (human boss)
"Raj mod", // Swarm round (no infections)
"Tobbszoros fertozeses mod", // Multiple Infection (like single round, but, more than 1 zombie)
"Mesterlovesz mod", // Sniper mode
"Assasin mod", // Assasin mod
"Vilagvege mod", // Vilagvege mod
"Pestis mod", // Plague round (nemesis & zombies vs. survivors & humans)
"Ismeretlen mod" // 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, 255, 0}, // Assasin mod
{0, 0, 255}, // Survivor Mode (human boss)
{255, 255, 0}, // Swarm round (no infections)
{255, 0, 0}, // Sniper mode
{0, 255, 0}, // Multiple Infection (like single round, but, more than 1 zombie)
{255, 0, 0}, // Plague round (nemesis & zombies vs. survivors & humans)
{255, 0, 255}, // Vilagvege mod
{255, 255, 255} // 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 = 3.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
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/

használd a
SMA Forráskód: [ Mindet kijelol ]
  1.  
-t

Szerző:  Tomos [ 2013.01.26. 11:17 ]
Hozzászólás témája:  Re: Jelenlegi mód kiiró átirva

Valamiért keveri az újonnal beirt módokat mi lehet a gond?

SMA Forráskód: [ Mindet kijelol ]
  1. /*================================================================================
  2.  
  3. [[ZP] Addon: Display the Current Mode
  4. Copyright (C) 2009 by meTaLiCroSS, Vińa del Mar, Chile
  5.  
  6. This program is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program. If not, see <http://www.gnu.org/licenses/>.
  18.  
  19. In addition, as a special exception, the author gives permission to
  20. link the code of this program with the Half-Life Game Engine ("HL
  21. Engine") and Modified Game Libraries ("MODs") developed by Valve,
  22. L.L.C ("Valve"). You must obey the GNU General Public License in all
  23. respects for all of the code used other than the HL Engine and MODs
  24. from Valve. If you modify this file, you may extend this exception
  25. to your version of the file, but you are not obligated to do so. If
  26. you do not wish to do so, delete this exception statement from your
  27. version.
  28.  
  29. ** Credits:
  30.  
  31. - Exolent[jNr]: Big plugin optimization
  32.  
  33. =================================================================================*/
  34.  
  35. #include <amxmodx>
  36. #include <zombieplague>
  37.  
  38. /*================================================================================
  39. [Customizations]
  40. =================================================================================*/
  41.  
  42. // Hudmessage tag
  43. new const hud_tag[] = "Jelenlegi mod: "
  44.  
  45. // Name for each Hudmessage Mode
  46. new const mode_names[][] =
  47. {
  48. "Varakozas az uj modra...", // No mode Started
  49. "Normal fertozeses", // Normal Infection, single round
  50. "Nemesis mod", // Nemesis Mode (zombie boss)
  51. "Tulelo mod", // Survivor Mode (human boss)
  52. "Raj mod", // Swarm round (no infections)
  53. "Tobbszoros fertozeses mod", // Multiple Infection (like single round, but, more than 1 zombie)
  54. "Mesterlovesz mod", // Sniper mode
  55. "Assasin mod", // Assasin mod
  56. "Vilagvege mod", // Vilagvege mod
  57. "Pestis mod", // Plague round (nemesis & zombies vs. survivors & humans)
  58. "Ismeretlen mod" // An unofficial mode (edited/created/modified by user)
  59. }
  60.  
  61. // RGB Colors for each Hudmessage Mode
  62. // See here some RGB Colors: http://web.njit.edu/~kevin/rgb.txt.html
  63. new const rgb_hud_colors[sizeof(mode_names)][3] =
  64. {
  65. // R G B
  66. {255, 255, 255}, // No mode Started
  67. {0, 255, 0}, // Normal Infection, single round
  68. {255, 0, 0}, // Nemesis Mode (zombie boss)
  69. {255, 255, 0}, // Assasin mod
  70. {0, 0, 255}, // Survivor Mode (human boss)
  71. {255, 255, 0}, // Swarm round (no infections)
  72. {255, 0, 0}, // Sniper mode
  73. {0, 255, 0}, // Multiple Infection (like single round, but, more than 1 zombie)
  74. {255, 0, 0}, // Plague round (nemesis & zombies vs. survivors & humans)
  75. {255, 0, 255}, // Vilagvege mod
  76. {255, 255, 255} // An unofficial mode (edited/created/modified by user)
  77. }
  78.  
  79. // X Hudmessage Position ( --- )
  80. const Float:HUD_MODE_X = 0.65
  81.  
  82. // Y Hudmessage Position ( ||| )
  83. const Float:HUD_MODE_Y = 0.2
  84.  
  85. // Time at which the Hudmessage is displayed. (when user is puted into the Server)
  86. const Float:START_TIME = 3.0
  87.  
  88. /*================================================================================
  89. Customization ends here! Yes, that's it. Editing anything beyond
  90. here is not officially supported. Proceed at your own risk...
  91. =================================================================================*/
  92.  
  93. // Variables
  94. new g_SyncHud, g_Mode
  95.  
  96. // Cvar pointers
  97. new cvar_enable, cvar_central
  98.  
  99. public plugin_init()
  100. {
  101. // Plugin Info
  102. register_plugin("[ZP] Addon: Display the Current Mode", "0.1.6", "meTaLiCroSS")
  103.  
  104. // Round Start Event
  105. register_event("HLTV", "event_RoundStart", "a", "1=0", "2=0")
  106.  
  107. // Enable Cvar
  108. cvar_enable = register_cvar("zp_display_mode", "1")
  109.  
  110. // Server Cvar
  111. register_cvar("zp_addon_dtcm", "v0.1.6 by meTaLiCroSS", FCVAR_SERVER|FCVAR_SPONLY)
  112.  
  113. // Variables
  114. g_SyncHud = CreateHudSyncObj()
  115.  
  116. // Getting "zp_on" cvar
  117. if(cvar_exists("zp_on"))
  118. cvar_central = get_cvar_pointer("zp_on")
  119.  
  120. // If Zombie Plague is not running (bugfix)
  121. if(!get_pcvar_num(cvar_central))
  122. pause("a")
  123. }
  124.  
  125. public client_putinserver(id)
  126. {
  127. // Setting Hud
  128. set_task(START_TIME, "mode_hud", id, _, _, "b")
  129. }
  130.  
  131. public event_RoundStart()
  132. {
  133. // Update var (no mode started / in delay)
  134. g_Mode = 0
  135. }
  136.  
  137. public mode_hud(id)
  138. {
  139. // If the Cvar isn't enabled
  140. if(!get_pcvar_num(cvar_enable))
  141. return;
  142.  
  143. // Hud Options
  144. 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)
  145.  
  146. // Now the hud appears
  147. ShowSyncHudMsg(id, g_SyncHud, "%s%s", (g_Mode == 0 ? "" : hud_tag), mode_names[g_Mode])
  148. }
  149.  
  150. public zp_round_started(mode, id)
  151. {
  152. // Update var with Mode num
  153. g_Mode = mode
  154.  
  155. // An unofficial mode
  156. if(!(1 <= mode < (sizeof(mode_names) - 1)))
  157. g_Mode = sizeof(mode_names) - 1
  158. }
  159.  
  160. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  161. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
  162. */

Szerző:  small [ 2013.01.26. 11:47 ]
Hozzászólás témája:  Re: Jelenlegi mód kiiró átirva

SMA Forráskód: [ Mindet kijelol ]
  1. /*================================================================================
  2.  
  3. [[ZP] Addon: Display the Current Mode
  4. Copyright (C) 2009 by meTaLiCroSS, Vińa del Mar, Chile
  5.  
  6. This program is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program. If not, see <http://www.gnu.org/licenses/>.
  18.  
  19. In addition, as a special exception, the author gives permission to
  20. link the code of this program with the Half-Life Game Engine ("HL
  21. Engine") and Modified Game Libraries ("MODs") developed by Valve,
  22. L.L.C ("Valve"). You must obey the GNU General Public License in all
  23. respects for all of the code used other than the HL Engine and MODs
  24. from Valve. If you modify this file, you may extend this exception
  25. to your version of the file, but you are not obligated to do so. If
  26. you do not wish to do so, delete this exception statement from your
  27. version.
  28.  
  29. ** Credits:
  30.  
  31. - Exolent[jNr]: Big plugin optimization
  32.  
  33. =================================================================================*/
  34.  
  35. #include <amxmodx>
  36. #include <zombieplague>
  37.  
  38. /*================================================================================
  39. [Customizations]
  40. =================================================================================*/
  41.  
  42. // Hudmessage tag
  43. new const hud_tag[] = "Jelenlegi mod: "
  44.  
  45. // Name for each Hudmessage Mode
  46. new const mode_names[11][] =
  47. {
  48. "Varakozas az uj modra...", // No mode Started
  49. "Normal fertozeses", // Normal Infection, single round
  50. "Nemesis mod", // Nemesis Mode (zombie boss)
  51. "Tulelo mod", // Survivor Mode (human boss)
  52. "Raj mod", // Swarm round (no infections)
  53. "Tobbszoros fertozeses mod", // Multiple Infection (like single round, but, more than 1 zombie)
  54. "Mesterlovesz mod", // Sniper mode
  55. "Assasin mod", // Assasin mod
  56. "Vilagvege mod", // Vilagvege mod
  57. "Pestis mod", // Plague round (nemesis & zombies vs. survivors & humans)
  58. "Ismeretlen mod" // An unofficial mode (edited/created/modified by user)
  59. }
  60.  
  61. // RGB Colors for each Hudmessage Mode
  62. // See here some RGB Colors: http://web.njit.edu/~kevin/rgb.txt.html
  63. new const rgb_hud_colors[sizeof(mode_names)][11] =
  64. {
  65. // R G B
  66. {255, 255, 255}, // No mode Started
  67. {0, 255, 0}, // Normal Infection, single round
  68. {255, 0, 0}, // Nemesis Mode (zombie boss)
  69. {255, 255, 0}, // Assasin mod
  70. {0, 0, 255}, // Survivor Mode (human boss)
  71. {255, 255, 0}, // Swarm round (no infections)
  72. {255, 0, 0}, // Sniper mode
  73. {0, 255, 0}, // Multiple Infection (like single round, but, more than 1 zombie)
  74. {255, 0, 0}, // Plague round (nemesis & zombies vs. survivors & humans)
  75. {255, 0, 255}, // Vilagvege mod
  76. {255, 255, 255} // An unofficial mode (edited/created/modified by user)
  77. }
  78.  
  79. // X Hudmessage Position ( --- )
  80. const Float:HUD_MODE_X = 0.65
  81.  
  82. // Y Hudmessage Position ( ||| )
  83. const Float:HUD_MODE_Y = 0.2
  84.  
  85. // Time at which the Hudmessage is displayed. (when user is puted into the Server)
  86. const Float:START_TIME = 3.0
  87.  
  88. /*================================================================================
  89. Customization ends here! Yes, that's it. Editing anything beyond
  90. here is not officially supported. Proceed at your own risk...
  91. =================================================================================*/
  92.  
  93. // Variables
  94. new g_SyncHud, g_Mode
  95.  
  96. // Cvar pointers
  97. new cvar_enable, cvar_central
  98.  
  99. public plugin_init()
  100. {
  101. // Plugin Info
  102. register_plugin("[ZP] Addon: Display the Current Mode", "0.1.6", "meTaLiCroSS")
  103.  
  104. // Round Start Event
  105. register_event("HLTV", "event_RoundStart", "a", "1=0", "2=0")
  106.  
  107. // Enable Cvar
  108. cvar_enable = register_cvar("zp_display_mode", "1")
  109.  
  110. // Server Cvar
  111. register_cvar("zp_addon_dtcm", "v0.1.6 by meTaLiCroSS", FCVAR_SERVER|FCVAR_SPONLY)
  112.  
  113. // Variables
  114. g_SyncHud = CreateHudSyncObj()
  115.  
  116. // Getting "zp_on" cvar
  117. if(cvar_exists("zp_on"))
  118. cvar_central = get_cvar_pointer("zp_on")
  119.  
  120. // If Zombie Plague is not running (bugfix)
  121. if(!get_pcvar_num(cvar_central))
  122. pause("a")
  123. }
  124.  
  125. public client_putinserver(id)
  126. {
  127. // Setting Hud
  128. set_task(START_TIME, "mode_hud", id, _, _, "b")
  129. }
  130.  
  131. public event_RoundStart()
  132. {
  133. // Update var (no mode started / in delay)
  134. g_Mode = 0
  135. }
  136.  
  137. public mode_hud(id)
  138. {
  139. // If the Cvar isn't enabled
  140. if(!get_pcvar_num(cvar_enable))
  141. return;
  142.  
  143. // Hud Options
  144. 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)
  145.  
  146. // Now the hud appears
  147. ShowSyncHudMsg(id, g_SyncHud, "%s%s", (g_Mode == 0 ? "" : hud_tag), mode_names[g_Mode])
  148. }
  149.  
  150. public zp_round_started(mode, id)
  151. {
  152. // Update var with Mode num
  153. g_Mode = mode
  154.  
  155. // An unofficial mode
  156. if(!(1 <= mode < (sizeof(mode_names) - 1)))
  157. g_Mode = sizeof(mode_names) - 1
  158. }
  159.  
  160. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  161. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
  162. */

Szerző:  Tomos [ 2013.01.26. 11:58 ]
Hozzászólás témája:  Re: Jelenlegi mód kiiró átirva

small írta:
SMA Forráskód: [ Mindet kijelol ]
  1. /*================================================================================
  2.  
  3. [[ZP] Addon: Display the Current Mode
  4. Copyright (C) 2009 by meTaLiCroSS, Vińa del Mar, Chile
  5.  
  6. This program is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program. If not, see <http://www.gnu.org/licenses/>.
  18.  
  19. In addition, as a special exception, the author gives permission to
  20. link the code of this program with the Half-Life Game Engine ("HL
  21. Engine") and Modified Game Libraries ("MODs") developed by Valve,
  22. L.L.C ("Valve"). You must obey the GNU General Public License in all
  23. respects for all of the code used other than the HL Engine and MODs
  24. from Valve. If you modify this file, you may extend this exception
  25. to your version of the file, but you are not obligated to do so. If
  26. you do not wish to do so, delete this exception statement from your
  27. version.
  28.  
  29. ** Credits:
  30.  
  31. - Exolent[jNr]: Big plugin optimization
  32.  
  33. =================================================================================*/
  34.  
  35. #include <amxmodx>
  36. #include <zombieplague>
  37.  
  38. /*================================================================================
  39. [Customizations]
  40. =================================================================================*/
  41.  
  42. // Hudmessage tag
  43. new const hud_tag[] = "Jelenlegi mod: "
  44.  
  45. // Name for each Hudmessage Mode
  46. new const mode_names[11][] =
  47. {
  48. "Varakozas az uj modra...", // No mode Started
  49. "Normal fertozeses", // Normal Infection, single round
  50. "Nemesis mod", // Nemesis Mode (zombie boss)
  51. "Tulelo mod", // Survivor Mode (human boss)
  52. "Raj mod", // Swarm round (no infections)
  53. "Tobbszoros fertozeses mod", // Multiple Infection (like single round, but, more than 1 zombie)
  54. "Mesterlovesz mod", // Sniper mode
  55. "Assasin mod", // Assasin mod
  56. "Vilagvege mod", // Vilagvege mod
  57. "Pestis mod", // Plague round (nemesis & zombies vs. survivors & humans)
  58. "Ismeretlen mod" // An unofficial mode (edited/created/modified by user)
  59. }
  60.  
  61. // RGB Colors for each Hudmessage Mode
  62. // See here some RGB Colors: http://web.njit.edu/~kevin/rgb.txt.html
  63. new const rgb_hud_colors[sizeof(mode_names)][11] =
  64. {
  65. // R G B
  66. {255, 255, 255}, // No mode Started
  67. {0, 255, 0}, // Normal Infection, single round
  68. {255, 0, 0}, // Nemesis Mode (zombie boss)
  69. {255, 255, 0}, // Assasin mod
  70. {0, 0, 255}, // Survivor Mode (human boss)
  71. {255, 255, 0}, // Swarm round (no infections)
  72. {255, 0, 0}, // Sniper mode
  73. {0, 255, 0}, // Multiple Infection (like single round, but, more than 1 zombie)
  74. {255, 0, 0}, // Plague round (nemesis & zombies vs. survivors & humans)
  75. {255, 0, 255}, // Vilagvege mod
  76. {255, 255, 255} // An unofficial mode (edited/created/modified by user)
  77. }
  78.  
  79. // X Hudmessage Position ( --- )
  80. const Float:HUD_MODE_X = 0.65
  81.  
  82. // Y Hudmessage Position ( ||| )
  83. const Float:HUD_MODE_Y = 0.2
  84.  
  85. // Time at which the Hudmessage is displayed. (when user is puted into the Server)
  86. const Float:START_TIME = 3.0
  87.  
  88. /*================================================================================
  89. Customization ends here! Yes, that's it. Editing anything beyond
  90. here is not officially supported. Proceed at your own risk...
  91. =================================================================================*/
  92.  
  93. // Variables
  94. new g_SyncHud, g_Mode
  95.  
  96. // Cvar pointers
  97. new cvar_enable, cvar_central
  98.  
  99. public plugin_init()
  100. {
  101. // Plugin Info
  102. register_plugin("[ZP] Addon: Display the Current Mode", "0.1.6", "meTaLiCroSS")
  103.  
  104. // Round Start Event
  105. register_event("HLTV", "event_RoundStart", "a", "1=0", "2=0")
  106.  
  107. // Enable Cvar
  108. cvar_enable = register_cvar("zp_display_mode", "1")
  109.  
  110. // Server Cvar
  111. register_cvar("zp_addon_dtcm", "v0.1.6 by meTaLiCroSS", FCVAR_SERVER|FCVAR_SPONLY)
  112.  
  113. // Variables
  114. g_SyncHud = CreateHudSyncObj()
  115.  
  116. // Getting "zp_on" cvar
  117. if(cvar_exists("zp_on"))
  118. cvar_central = get_cvar_pointer("zp_on")
  119.  
  120. // If Zombie Plague is not running (bugfix)
  121. if(!get_pcvar_num(cvar_central))
  122. pause("a")
  123. }
  124.  
  125. public client_putinserver(id)
  126. {
  127. // Setting Hud
  128. set_task(START_TIME, "mode_hud", id, _, _, "b")
  129. }
  130.  
  131. public event_RoundStart()
  132. {
  133. // Update var (no mode started / in delay)
  134. g_Mode = 0
  135. }
  136.  
  137. public mode_hud(id)
  138. {
  139. // If the Cvar isn't enabled
  140. if(!get_pcvar_num(cvar_enable))
  141. return;
  142.  
  143. // Hud Options
  144. 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)
  145.  
  146. // Now the hud appears
  147. ShowSyncHudMsg(id, g_SyncHud, "%s%s", (g_Mode == 0 ? "" : hud_tag), mode_names[g_Mode])
  148. }
  149.  
  150. public zp_round_started(mode, id)
  151. {
  152. // Update var with Mode num
  153. g_Mode = mode
  154.  
  155. // An unofficial mode
  156. if(!(1 <= mode < (sizeof(mode_names) - 1)))
  157. g_Mode = sizeof(mode_names) - 1
  158. }
  159.  
  160. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  161. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
  162. */


Ez most akkor jó?

Szerző:  small [ 2013.01.26. 11:59 ]
Hozzászólás témája:  Re: Jelenlegi mód kiiró átirva

Próbáld ki....

Szerző:  Tomos [ 2013.01.26. 12:01 ]
Hozzászólás témája:  Re: Jelenlegi mód kiiró átirva

small írta:
Próbáld ki....

Ok

Szerző:  Tomos [ 2013.01.26. 15:31 ]
Hozzászólás témája:  Re: Jelenlegi mód kiiró átirva

Már majdnem jó de még mindig cseréli a Mesterlövész és az Assisans módot

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/