Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. #include < amxmodx >
  2. #include < fakemeta >
  3. #include < hamsandwich >
  4.  
  5. new bool:gbRespawn;
  6.  
  7. public plugin_init( ) {
  8. register_plugin( "Prematch/Warmup Manager", "0.1", "Cr34t!v3" );
  9.  
  10. RegisterHam( Ham_Killed, "player", "FwdKilledPlayerPost", 1 );
  11.  
  12. register_clcmd( "say .entreno", "fnStartModeDM" );
  13. register_clcmd( "say_team .partido", "fnStartModeDM" );
  14.  
  15. register_clcmd( "say .start", "fnStartMatch" );
  16. register_clcmd( "say .partido", "fnStartMatch" );
  17. register_clcmd( "say_team .start", "fnStartMatch" );
  18. register_clcmd( "say_team .partido", "fnStartMatch" );
  19.  
  20. gbRespawn = false;
  21. }
  22.  
  23. public client_putinserver( id ) set_task( 1.5, "RespawnCheck", id );
  24.  
  25. public RespawnCheck( const id ) {
  26. new iTeam = get_pdata_int( id, 114, 5 )
  27.  
  28. if( iTeam != 1 || iTeam != 2 ) set_task( 1.5, "RespawnCheck", id );
  29. else set_task( 1.5, "RespawnPlayer", id );
  30. }
  31.  
  32. public FwdKilledPlayerPost( const id ) {
  33. if( !gbRespawn || !is_user_connected( id ) ) return HAM_IGNORED;
  34.  
  35. set_task( 1.5, "RespawnPlayer", id );
  36.  
  37. return HAM_IGNORED;
  38. }
  39.  
  40. public RespawnPlayer( const id ) {
  41. ExecuteHamB( Ham_CS_RoundRespawn, id );
  42. if( !is_user_alive( id ) ) ExecuteHamB( Ham_CS_RoundRespawn, id );
  43.  
  44. // set_pdata_int( id, 235, 1, 5 );
  45. set_pdata_int( id, 115, 16000, 5 );
  46. }
  47.  
  48. public fnStartModeDM( const id ) {
  49. if( !( get_user_flags( id ) & ADMIN_KICK ) ) return PLUGIN_CONTINUE;
  50.  
  51. if( !gbRespawn ) gbRespawn = true;
  52.  
  53. set_hudmessage( 150, 150, 150, -1.0, 0.38, 1, 0.1, 5.0, 0.1, 0.1, 4 );
  54. show_hudmessage( 0, "Warmup Enabled" );
  55.  
  56. server_cmd( "entreno" );
  57. server_exec( );
  58.  
  59. return PLUGIN_HANDLED;
  60. }
  61.  
  62. public fnStartMatch( const id ) {
  63. if( !( get_user_flags( id ) & ADMIN_KICK ) ) return PLUGIN_CONTINUE;
  64.  
  65. if( gbRespawn ) gbRespawn = false;
  66.  
  67. set_hudmessage( 150, 150, 150, -1.0, 0.38, 1, 0.1, 5.0, 0.1, 0.1, 4 );
  68. show_hudmessage( 0, "Match Settings Loaded" );
  69.  
  70. server_cmd( "partido" );
  71. server_exec( );
  72.  
  73. return PLUGIN_HANDLED;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement