Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.92 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 .modedm",      "fnStartModeDM" );
  13.     register_clcmd( "say_team .modedm",     "fnStartModeDM" );
  14.    
  15.     register_clcmd( "say .start",       "fnStartMatch" );
  16.     register_clcmd( "say .ready",       "fnStartMatch" );
  17.     register_clcmd( "say_team .start",  "fnStartMatch" );
  18.     register_clcmd( "say_team .start",  "fnStartMatch" );
  19.    
  20.     gbRespawn = false;
  21. }
  22.  
  23. public client_putinserver( id ) set_task( 3.0, "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( 3.0, "RespawnCheck", id );
  29.     else set_task( 3.0, "RespawnPlayer", id );
  30. }
  31.  
  32. public FwdKilledPlayerPost( const id ) {
  33.     if( !gbRespawn || !is_user_connected( id ) ) return HAM_IGNORED;
  34.    
  35.     set_task( 3.0, "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, 115, 16000, 5 );
  45. }
  46.  
  47. public fnStartModeDM( const id ) {
  48.     if( !( get_user_flags( id ) & ADMIN_KICK ) ) return PLUGIN_CONTINUE;
  49.    
  50.     if( !gbRespawn ) gbRespawn = true;
  51.    
  52.     set_hudmessage( 150, 150, 150, -1.0, 0.38, 1, 0.1, 5.0, 0.1, 0.1, 4 );
  53.     show_hudmessage( 0, "Started Deathmatch mode" );
  54.    
  55.     server_cmd( "entreno" );
  56.     server_exec( );
  57.    
  58.     return PLUGIN_HANDLED;
  59. }
  60.  
  61. public fnStartMatch( const id ) {
  62.     if( !( get_user_flags( id ) & ADMIN_KICK ) ) return PLUGIN_CONTINUE;
  63.    
  64.     if( gbRespawn ) gbRespawn = false;
  65.    
  66.     set_hudmessage( 150, 150, 150, -1.0, 0.38, 1, 0.1, 5.0, 0.1, 0.1, 4 );
  67.     show_hudmessage( 0, "Started Match mode" );
  68.    
  69.     server_cmd( "partido" );
  70.     server_exec( );
  71.    
  72.     return PLUGIN_HANDLED;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement