hlmod.hu
https://hlmod.hu/

respawn
https://hlmod.hu/viewtopic.php?f=29&t=8123
Oldal: 1 / 1

Szerző:  Joke [2013.04.14. 19:22 ]
Hozzászólás témája:  respawn

Sziasztok..

Egy olyan /respawn kellene ,hogy ha meghal egy player 3mp múlva újra éled ha nem éled /respawn ,csak ct -kap USP-t a terrorista csak kést kap...köszönöm...

Szerző:  HuBaBuBa [2013.04.15. 10:02 ]
Hozzászólás témája:  Re: respawn

SMA Forráskód: [ Mindet kijelol ]
  1. /* AMXX Mod script.
  2. *
  3. * (c) Copyright 2004, developed by Geesu
  4. * This file is provided as is (no warranties).
  5. *
  6. * Changelog
  7. * 1.1:
  8. * Added /respawn command to spawn a player if they're dead
  9. * Added a public cvar
  10. * 1.0:
  11. * Pistols are now given to players when they respawn
  12. * sv_checkpistols cvar added, if this is set to 0, then players will always spawn with a pistol, otherwise they will only spawn with a pistol when it is not scoutzknivez and not a ka map
  13. * sv_respawn cvar added, set this to 0 to disable the plugin
  14. */
  15.  
  16. new const VERSION[] = "1.1"
  17.  
  18. #include <amxmodx>
  19. #include <fun>
  20. #include <cstrike>
  21.  
  22. #define DISABLE_CS 0
  23.  
  24. // team ids
  25. #define UNASSIGNED 0
  26. #define TS 1
  27. #define CTS 2
  28. #define AUTO_TEAM 5
  29.  
  30.  
  31. public plugin_init(){
  32.  
  33. register_plugin("Respawn Forever", VERSION, "Pimp Daddy (OoTOAoO)")
  34.  
  35. register_event("DeathMsg","on_Death","a")
  36.  
  37.  
  38. register_cvar("sv_respawn", "1")
  39. register_cvar("respawn_forever_version", VERSION, FCVAR_SERVER)
  40.  
  41. register_clcmd("say","on_Chat")
  42. register_clcmd("say_team","on_Chat")
  43. }
  44.  
  45. public on_Chat(id)
  46. {
  47. if ( !get_cvar_num("sv_respawn") )
  48. {
  49. client_print(id, print_chat, "* Respawn plugin disabled")
  50. return PLUGIN_CONTINUE
  51. }
  52.  
  53. new szSaid[32]
  54. read_args(szSaid, 31)
  55.  
  56. if (equali(szSaid,"^"/respawn^"") || equali(szSaid,"^"respawn^""))
  57. {
  58. spawn_func(id)
  59. }
  60. return PLUGIN_CONTINUE;
  61. }
  62.  
  63.  
  64. public spawn_func(id)
  65. {
  66. new parm[1]
  67. parm[0]=id
  68.  
  69. /* Spawn the player twice to avoid the HL engine bug */
  70. set_task(3.0,"player_spawn",72,parm,1)
  71. set_task(3.1,"player_spawn",72,parm,1)
  72.  
  73. /* Then give them a suit and a knife */
  74. set_task(3.2,"player_giveitems",72,parm,1)
  75. }
  76.  
  77. public on_Death()
  78. {
  79. if ( !get_cvar_num("sv_respawn") )
  80. return PLUGIN_CONTINUE
  81.  
  82. new victim_id = read_data(2)
  83.  
  84. spawn_func( victim_id )
  85.  
  86. return PLUGIN_CONTINUE
  87. }
  88.  
  89. public player_giveitems(parm[1])
  90. {
  91. new id = parm[0]
  92.  
  93. give_item(id, "item_suit")
  94. give_item(id, "weapon_knife")
  95.  
  96.  
  97. /* Give a CT his/her pistol */
  98. if ( get_user_team(id)==CTS )
  99. {
  100. give_item(id,"weapon_usp")
  101. give_item(id,"ammo_45acp")
  102. give_item(id,"ammo_45acp")
  103. }
  104.  
  105. return PLUGIN_CONTINUE
  106. }
  107.  
  108. public player_spawn(parm[1])
  109. {
  110. spawn(parm[0])
  111. }

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