hlmod.hu
https://hlmod.hu/

Ujraéledés+szinesítés.
https://hlmod.hu/viewtopic.php?f=29&t=19236
Oldal: 1 / 1

Szerző:  levo00 [2015.01.31. 17:32 ]
Hozzászólás témája:  Ujraéledés+szinesítés.

Sziasztok! valaki javítaná hogy éledjen is újra? meg az írás hogy ird be /ujra az meg zöld legyen! :) aki megcsinálja és jo kap egy gombot :)
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <hamsandwich>
  3. #include <cstrike>
  4.  
  5. #define PLUGIN "New Plug-In"
  6. #define VERSION "1.0"
  7. #define AUTHOR "author"
  8.  
  9.  
  10. public plugin_init() {
  11. register_plugin(PLUGIN, VERSION, AUTHOR)
  12. register_clcmd("say /respawn", "ujra")
  13. set_task(180.0, "uzi", 0, _, _, "b")
  14. }
  15. public ujra(id) {
  16. new CsTeams:Team = cs_get_user_team(id)
  17.  
  18. if(is_user_alive(id) || Team == CS_TEAM_SPECTATOR) {
  19. client_print(id, print_chat, "Csak halottak használhatják!")
  20. }
  21. else
  22. {
  23. ExecuteHamB(Ham_CS_RoundRespawn, id)
  24. }
  25. }
  26. public uzi() client_print(0, print_chat, "*|P|eac|E|* Ha halott vagy és ujra szeretnél éledni ird be /ujra")

Szerző:  Hibrid [2015.01.31. 17:34 ]
Hozzászólás témája:  Re: Ujraéledés+szinesítés.

Tessék színes, de nem értem miért nem működik elméletbe működni-e kell neki.
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <hamsandwich>
  3. #include <cstrike>
  4. #include <colorchat>
  5.  
  6. #define PLUGIN "New Plug-In"
  7. #define VERSION "1.0"
  8. #define AUTHOR "author"
  9.  
  10.  
  11. public plugin_init() {
  12. register_plugin(PLUGIN, VERSION, AUTHOR)
  13. register_clcmd("say /respawn", "ujra")
  14. set_task(180.0, "uzi", 0, _, _, "b")
  15. }
  16. public ujra(id) {
  17. new CsTeams:Team = cs_get_user_team(id)
  18.  
  19. if(is_user_alive(id) || Team == CS_TEAM_SPECTATOR) {
  20. client_print(id, print_chat, "Csak halottak használhatják!")
  21. }
  22. else
  23. {
  24. ExecuteHamB(Ham_CS_RoundRespawn, id)
  25. }
  26. }
  27. public uzi() ColorChat(0, GREEN, "*|P|eac|E|* Ha halott vagy és ujra szeretnél éledni ird be /ujra")

Szerző:  excitedboy [2015.01.31. 17:53 ]
Hozzászólás témája:  Re: Ujraéledés+szinesítés.

Elméletben se fog működni, mert nincs kit felélesztenie.
Hibrid írta:
Tessék színes, de nem értem miért nem működik elméletbe működni-e kell neki.




Tessék, a javított változat, anno ez volt bent a szerveremen, tökéletesen működött.

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <hamsandwich>
  3. #include <colorchat>
  4. #include <cstrike>
  5.  
  6. #define RESPAWN_DELAY 2.0
  7.  
  8. new PlayersKiller[33], bool:AllowRespawn, MaxPlayers;
  9.  
  10. public plugin_init()
  11. {
  12. register_plugin("Elimination", "1.2", "hleV");
  13. register_logevent("RoundStart", 2, "1=Round_Start");
  14. register_logevent("RoundEnd", 2, "1=Round_End");
  15. RegisterHam(Ham_Killed, "player", "PlayerKilled", 1);
  16. RegisterHam(Ham_Spawn, "player", "PlayerSpawn", 1);
  17. set_task(180.0, "uzi", 0, _, _, "b")
  18. }
  19.  
  20. public ujra(id) {
  21. new CsTeams:Team = cs_get_user_team(id)
  22.  
  23. if(is_user_alive(id) || Team == CS_TEAM_SPECTATOR) {
  24. client_print(id, print_chat, "Csak halottak használhatják!")
  25. }
  26. else
  27. {
  28. ExecuteHamB(Ham_CS_RoundRespawn, id)
  29. }
  30. }
  31. public plugin_cfg() MaxPlayers = get_maxplayers();
  32. public client_disconnect(Client) PlayersKiller[Client] = 0;
  33. public RoundStart() AllowRespawn = true;
  34. public RoundEnd() AllowRespawn = false;
  35. public uzi() ColorChat(0, RED, "*|P|eac|E|* Ha halott vagy és ujra szeretnél éledni ^x04ird be /ujra")
  36. public PlayerKilled(Victim, Killer)
  37. {
  38. if ((Killer = read_data(1)) == (Victim = read_data(2)))
  39. return;
  40.  
  41. for (new OldVictim = 1; OldVictim < MaxPlayers; OldVictim++)
  42. {
  43. if (!is_user_connected(OldVictim) || is_user_alive(OldVictim))
  44. continue;
  45.  
  46. if (PlayersKiller[OldVictim] == Victim)
  47. set_task(RESPAWN_DELAY, "Respawn", OldVictim);
  48. }
  49.  
  50. PlayersKiller[Victim] = Killer;
  51. }
  52.  
  53. public PlayerSpawn(Client)
  54. if (is_user_alive(Client)) PlayersKiller[Client] = 0;
  55.  
  56. public Respawn(Client)
  57. {
  58. remove_task(Client);
  59.  
  60. if (!AllowRespawn || !is_user_connected(Client) || is_user_alive(Client))
  61. return;
  62.  
  63. ExecuteHamB(Ham_CS_RoundRespawn, Client);
  64. }

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