Advertisement
Akc3n7

Warmup Round

Feb 10th, 2023 (edited)
515
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.56 KB | None | 0 0
  1. #include < amxmodx >
  2. #include < fun >
  3. #include < cstrike >
  4. #include < hamsandwich >
  5.  
  6. #define PLUGIN   "Warmup Round"
  7. #define VERSION  "1.0"
  8. #define AUTHOR   "A k c 3 n 7"
  9.  
  10. new bool:warmup;
  11. new count_down = 50;
  12.  
  13. public plugin_init( ) {
  14.    
  15.     register_plugin( PLUGIN, VERSION, AUTHOR );
  16.     RegisterHam( Ham_Spawn, "player", "PlayerPostSpawn", 1 );  
  17.     RegisterHam( Ham_Touch, "armoury_entity", "FwdHamPlayerPickup" );
  18.    
  19.     RegisterHam(Ham_Killed, "player", "fw_PlayerKilled_Post", 1)
  20.    
  21.     set_task( 1.0,     "countdown", 00, _, _, "b" );
  22.     warmup = true;
  23. }
  24.  
  25. public Respawn( id ) {
  26.    
  27.     if( !warmup ) return;
  28.    
  29.     if (!is_user_alive( id ) && cs_get_user_team( id ) != CS_TEAM_SPECTATOR)
  30.         ExecuteHamB(Ham_CS_RoundRespawn, id);
  31. }
  32.  
  33. public fw_PlayerKilled_Post( id ) {
  34.    
  35.     set_task(1.0, "Respawn", id, _, _,"b")
  36. }
  37.  
  38. public PlayerPostSpawn( id ) {
  39.    
  40.     if(! is_user_alive( id ) || !warmup )
  41.         return;
  42.    
  43.     strip_user_weapons( id ),  give_item( id, "weapon_knife"), give_item( id, "weapon_ak47" );
  44.     cs_set_user_bpammo( id, CSW_AK47, 90 );
  45.    
  46. }
  47.  
  48. public FwdHamPlayerPickup(iEntity, id)
  49. {
  50.     if( !is_user_alive( id ) )
  51.         return HAM_HANDLED;
  52.    
  53.     return warmup ? HAM_SUPERCEDE : HAM_IGNORED;
  54. }
  55.  
  56. public countdown( ) {
  57.    
  58.     set_hudmessage(random_num(57, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.86, 2, 1.1, 1.1, 0.0, 0.0)
  59.     show_hudmessage( 0, "Runda de Incalzire: %d secunde ramase", count_down );
  60.     count_down--;
  61.    
  62.     if( count_down <= 0 )
  63.     {
  64.         if( task_exists( 00 ) )
  65.             remove_task( 00 );
  66.        
  67.         warmup = false;
  68.         server_cmd( "sv_restart 1" );
  69.         return;
  70.     }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement