hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.01. 19:04



Jelenlévő felhasználók

Jelenleg 303 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 302 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: Google [Bot] az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 1 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Ultimate Players/Frags/Death Executer
HozzászólásElküldve: 2013.04.09. 21:53 
Offline
Beavatott
Avatar

Csatlakozott: 2013.03.04. 02:42
Hozzászólások: 69
Megköszönt másnak: 16 alkalommal
Megköszönték neki: 4 alkalommal
Sziasztok!

Valaki el tudná mondani, hogy ez a plugin mit csinál??

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2.  
  3. #define PLUGIN "Ultimate Players/Frags/Death Executer"
  4. #define AUTHOR "DA"
  5. #define VERSION "1.0"
  6.  
  7. #define maxcommands 32
  8.  
  9. new maxplayers[maxcommands], maxfrags[maxcommands], maxdeath[maxcommands];
  10. new playercommands[maxcommands][95], fragcommands[maxcommands][190], deathcommands[maxcommands][190];
  11. new playercounter = 0, fragscounter = 0, deathcounter = 0, playerendcommands[maxcommands][95];
  12. new bool:executealready[maxcommands] = false;
  13.  
  14. public plugin_init()
  15. {
  16. register_plugin(PLUGIN, VERSION, AUTHOR);
  17. register_srvcmd("pfd_players", "check_players");
  18. register_srvcmd("pfd_frags", "check_frags");
  19. register_srvcmd("pfd_death", "check_death");
  20. register_event("DeathMsg", "on_death", "a", "1>0")
  21. }
  22.  
  23. public check_players()
  24. {
  25. if(read_argc() < 4)
  26. {
  27. log_amx("Can't execute pfd_players. Use pfd_players <maxplayers> ^"startcommand^" ^"endcommand^"");
  28. return PLUGIN_HANDLED;
  29. }
  30.  
  31. new args[192], players[2];
  32. read_args(args, 192);
  33. parse(args, players, 2, playercommands[playercounter], 95, playerendcommands[playercounter], 94);
  34. maxplayers[playercounter] = str_to_num(players);
  35. playercounter++;
  36.  
  37. return PLUGIN_CONTINUE;
  38. }
  39.  
  40. public check_frags()
  41. {
  42. if(read_argc() < 4)
  43. {
  44. log_amx("Can't execute pfd_frags. Use pfd_frags <maxfrags> ^"command^"");
  45. return PLUGIN_HANDLED;
  46. }
  47.  
  48. new args[192], frags[4];
  49. read_args(args, 192);
  50. parse(args, frags, 4, fragcommands[fragscounter], 190);
  51. maxfrags[fragscounter] = str_to_num(frags);
  52. fragscounter++;
  53.  
  54. return PLUGIN_CONTINUE;
  55. }
  56.  
  57. public check_death()
  58. {
  59. if(read_argc() < 4)
  60. {
  61. log_amx("Can't execute pfd_death. Use pfd_death <maxdeath> ^"command^"");
  62. return PLUGIN_HANDLED;
  63. }
  64.  
  65. new args[192], death[4];
  66. read_args(args, 192);
  67. parse(args, death, 4, deathcommands[deathcounter], 190);
  68. maxdeath[deathcounter] = str_to_num(death);
  69. deathcounter++;
  70.  
  71. return PLUGIN_CONTINUE;
  72. }
  73.  
  74. public client_putinserver()
  75. {
  76. new players[32], num;
  77. get_players(players, num, "ch");
  78.  
  79. for(new i=0; i < playercounter; i++)
  80. {
  81. if (num>=maxplayers[i])
  82. {
  83. if (!(executealready[i]))
  84. {
  85. server_cmd(playercommands[i]);
  86. executealready[i] = true;
  87. }
  88. }
  89. }
  90. }
  91.  
  92. public client_disconnect()
  93. {
  94. new players[32], num;
  95. get_players(players, num, "ch");
  96. for(new i=0; i < playercounter; i++)
  97. {
  98. if (num < maxplayers[i])
  99. {
  100. if (executealready[i])
  101. {
  102. server_cmd(playerendcommands[i]);
  103. executealready[i] = false;
  104. }
  105. }
  106. }
  107. }
  108.  
  109. public on_death()
  110. {
  111. new Killer = read_data(1);
  112. new Victim = read_data(2);
  113.  
  114. new death = get_user_deaths(Victim);
  115. new Frags = get_user_frags(Killer);
  116.  
  117.  
  118. new i=0;
  119. for(i=0; i < deathcounter; i++)
  120. {
  121. if (maxdeath[i]<=death)
  122. {
  123. server_cmd(deathcommands[i]);
  124. maxdeath[i] = 0;
  125. deathcommands[i] = "";
  126. }
  127. }
  128.  
  129. for(i=0; i < fragscounter; i++)
  130. {
  131. if (maxfrags[i]<=Frags)
  132. {
  133. server_cmd(fragcommands[i]);
  134. maxfrags[i] = 0;
  135. fragcommands[i] = "";
  136. }
  137. }
  138. }

_________________
COD:MW3 szerver hamarosan...
Egyedi mód
: 85%

Kész konfig: 90%
Több kaszt: 100%
Szint limit: 100%


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 1 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 57 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole