HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /*
  2. [ZP] New Win Messages
  3.  
  4. Plugin by Shidla [SGC] & xPaw & 93()|29!/<
  5.  
  6. Idea & models:
  7. Koshak | ICQ: 283-361-228 (zombie-mod.ru)
  8.  
  9. Credits:
  10. xPaw (Main code... My was worse... But it worked too :))
  11. 93()|29!/< | SkyPE: georgik_braila (Bug fixing)
  12. | Yahoo Messenger: george_stafie
  13. MeRcyLeZZ (For his Zombie Plague)
  14. CHyCMyMpNk | ICQ: 4-888-617 (forum.hlds.us)
  15. Fedcomp | ICQ: 536020 (gm-community.net / forum.hlds.us / amx-x.ru / gscom.org)
  16. PomanoB | ICQ: 147-919 (gm-community.net / forum.hlds.us / amx-x.ru)
  17. DJ_WEST | ICQ: 634-866 (For his amx-x.ru & reallite.cs2.ru)
  18. meTaLiCroSS (For something, what ever... I know him - we steal something: his idea\code\constant\crap\brain\blablabla :))
  19.  
  20.  
  21.  
  22. Shidla [SGC] | 2010 | ICQ: 312-298-513
  23.  
  24. 1.3 [Final Version]
  25.  
  26. http://forums.alliedmods.net/showthread.php?t=128385 // Eng
  27. http://forum.hlds.us/showthread.php?p=84425 // Rus
  28. */
  29.  
  30. #include <amxmodx>
  31. #include <fakemeta>
  32. #include <zombieplague>
  33.  
  34. new Hands[33], MaxPlayers
  35.  
  36. new const MODELS[3][] =
  37. {
  38. "",
  39. "models/zombie_plague/zombie_win.mdl",
  40. "models/zombie_plague/human_win.mdl"
  41. };
  42.  
  43. new const MODELS_FLIP[3][] =
  44. {
  45. "",
  46. "models/zombie_plague/zombie_win-f.mdl",
  47. "models/zombie_plague/human_win-f.mdl"
  48. };
  49.  
  50.  
  51. new g_iModelIndex[3], g_iWinTeam, g_iModelIndexFlip[3];
  52.  
  53. public plugin_init()
  54. {
  55. register_plugin("[ZP] Sub-Plugin: New Win Messages", "1.3", "Shidla, xPaw, 93()|29!/<" );
  56. register_event("HLTV", "EventRoundStart", "a", "1=0", "2=0" );
  57. register_event("CurWeapon", "EventCurWeapon", "be", "1=1");
  58.  
  59. MaxPlayers = get_maxplayers();
  60.  
  61. register_cvar("Shidla", "[ZP] New Win Messages v.1.3", FCVAR_SERVER|FCVAR_SPONLY);
  62. register_cvar("zp_new_win_messages", "[ZP] New Win Messages v.1.3", FCVAR_SERVER|FCVAR_SPONLY);
  63. }
  64.  
  65. public plugin_precache()
  66. {
  67. for (new i = WIN_ZOMBIES; i <= WIN_HUMANS; i++)
  68. {
  69. precache_model(MODELS[i]);
  70. g_iModelIndex[i] = engfunc(EngFunc_AllocString, MODELS[i]);
  71. precache_model(MODELS_FLIP[i]);
  72. g_iModelIndexFlip[i] = engfunc(EngFunc_AllocString, MODELS_FLIP[i]);
  73. }
  74. }
  75.  
  76. public client_connect(id)
  77. {
  78. if(!is_user_bot(id))
  79. query_client_cvar(id , "cl_righthand" , "Hands_CVAR_Value");
  80. }
  81.  
  82. public Hands_CVAR_Value(id, const cvar[], const value[])
  83. {
  84. if(1 <= id <= MaxPlayers) // Bug Fix
  85. Hands[id] = str_to_num(value)
  86. }
  87.  
  88. public client_disconnect(id)
  89. {
  90. Hands[id] = 0
  91. }
  92.  
  93. public zp_round_ended(iTeam)
  94. {
  95. if (iTeam == WIN_NO_ONE)
  96. return;
  97. g_iWinTeam = iTeam;
  98. new iPlayers[32], iNum;
  99. get_players(iPlayers, iNum, "ch");
  100. for (new i; i < iNum; i++)
  101. {
  102. client_cmd(iPlayers[i], "cl_righthand ^"1^"");
  103. zp_set_user_nightvision(iPlayers[i], 1);
  104.  
  105. if (get_user_weapon(iPlayers[i]) != CSW_KNIFE)
  106. set_pev(iPlayers[i], pev_viewmodel, g_iModelIndexFlip[iTeam]);
  107. else
  108. set_pev(iPlayers[i], pev_viewmodel, g_iModelIndex[iTeam]);
  109. }
  110. }
  111.  
  112. public EventRoundStart()
  113. {
  114. g_iWinTeam = WIN_NO_ONE;
  115.  
  116. for (new i = 1; i <= MaxPlayers; i++)
  117. {
  118. if(!is_user_connected(i))
  119. continue; // xPaw fix)))
  120.  
  121. client_cmd(i, "cl_righthand ^"%d^"", Hands[i]);
  122. //client_print(i,print_chat,"[DEBUG] Значение данных '%d'***", Hands[i]);
  123. }
  124. }
  125.  
  126. public EventCurWeapon(const id)
  127. {
  128. if (g_iWinTeam > WIN_NO_ONE)
  129. {
  130. client_cmd(id, "cl_righthand ^"1^"");
  131.  
  132. if (get_user_weapon(id) != CSW_KNIFE)
  133. set_pev(id, pev_viewmodel, g_iModelIndexFlip[g_iWinTeam]);
  134. else
  135. set_pev(id, pev_viewmodel, g_iModelIndex[g_iWinTeam]);
  136. }
  137. }
  138.  
  139. // Yes, baby, its's Russia! xDD
  140. // Thanks for all, who help me)))