Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 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 .entreno", "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 FwdKilledPlayerPost( const id ) {
  24. if( !gbRespawn || !is_user_connected( id ) ) return HAM_IGNORED;
  25.  
  26. ExecuteHamB( Ham_CS_RoundRespawn, id );
  27.  
  28. set_task( 3.0, "RespawnPlayer", id );
  29.  
  30. return HAM_IGNORED;
  31. }
  32.  
  33. public RespawnPlayer( const id ) {
  34. if( !is_user_alive( id ) ) ExecuteHamB( Ham_CS_RoundRespawn, id );
  35.  
  36. // set_pdata_int( id, 235, 1, 5 );
  37. set_pdata_int( id, 115, 16000, 5 );
  38.  
  39. cs_set_user_money( id, 16000 );
  40. }
  41.  
  42. public fnStartModeDM( const id ) {
  43. if( !( get_user_flags( id ) & ADMIN_KICK ) ) return PLUGIN_CONTINUE;
  44.  
  45. if( !gbRespawn ) gbRespawn = true;
  46.  
  47. set_hudmessage( 150, 150, 150, -1.0, 0.38, 1, 0.1, 5.0, 0.1, 0.1, 4 );
  48. show_hudmessage( 0, "Warmup Enabled" );
  49.  
  50. server_cmd( "entreno" );
  51. server_exec( );
  52.  
  53. return PLUGIN_HANDLED;
  54. }
  55.  
  56. public fnStartMatch( const id ) {
  57. if( !( get_user_flags( id ) & ADMIN_KICK ) ) return PLUGIN_CONTINUE;
  58.  
  59. if( gbRespawn ) gbRespawn = false;
  60.  
  61. set_hudmessage( 150, 150, 150, -1.0, 0.38, 1, 0.1, 5.0, 0.1, 0.1, 4 );
  62. show_hudmessage( 0, "Match Settings Loaded" );
  63.  
  64. server_cmd( "partido" );
  65. server_exec( );
  66.  
  67. return PLUGIN_HANDLED;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement