Advertisement
crywolfy

Give Free HE Grenade

Dec 10th, 2024 (edited)
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.03 KB | Source Code | 0 0
  1. #include < amxmodx >
  2. #include < cstrike >
  3. #include < fun >
  4.  
  5. new g_Delay, g_contor[ 33 ];
  6. new g_Chan1, g_Chan2;
  7.  
  8. public plugin_init( )
  9. {
  10.     register_plugin "Give Free HE Grenade", "1.1", "KronoS # GG" ;
  11.  
  12.     g_Delay = register_cvar( "freehe_delay", "10" );
  13.    
  14.     g_Chan1 = CreateHudSyncObj();
  15.     g_Chan2 = CreateHudSyncObj();
  16. }
  17.  
  18. public client_putinserver( index )
  19. {
  20.     g_contor[ index ] = 0;
  21.     set_task 1.0, "Func_GiveHe", index, _, _, "b" ;
  22. }
  23.  
  24. public Func_GiveHe( index )
  25. {
  26.     if ( !is_user_alive( index ) || cs_get_user_bpammo( index , CSW_HEGRENADE ) > 0 )
  27.         return;
  28.  
  29.     if ( g_contor[ index ] > 0 )
  30.     {
  31.         set_hudmessage 255, 0, 0, -1.0, 0.02, 0, 6.0, 12.0 ;
  32.         ShowSyncHudMsg( index, g_Chan1, "Vei primi un HE gratis in %i secunde...", g_contor[ index ] );
  33.        
  34.         g_contor[ index ]--;
  35.         return;
  36.     }
  37.     else
  38.     {
  39.         set_hudmessage 0, 255, 0, 0.02, 0.48, 0, 1.0, 1.0 ;
  40.         ShowSyncHudMsg( index, g_Chan2, "Ai primit un HE gratis!" );
  41.         g_contor[ index ] = get_pcvar_num( g_Delay );
  42.             give_item index, "weapon_hegrenade" ;
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement