Advertisement
crywolfy

show_hp

Oct 8th, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.07 KB | None | 0 0
  1.     /*
  2.         (C) 2013 BY MoS CryWolf =))
  3.     */
  4.    
  5.     #include < amxmodx >
  6.    
  7.     #pragma semicolon 1
  8.    
  9.     // Plugin information
  10.     new const
  11.         PLUGIN_NAME    [ ] = "Show HP + VIP",
  12.         PLUGIN_VERSION [ ] = "0.2",
  13.         PLUGIN_AUTHOR  [ ] = "CryWolf";
  14.    
  15.     new g_MsgSync, g_MaxPlayers, g_pcvarShow;
  16.    
  17. public plugin_init ( )
  18. {
  19.     register_plugin ( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
  20.    
  21.     set_task ( 3.0, "showhp", 0, _, _, "b", _ );
  22.    
  23.     // extras
  24.     g_MaxPlayers = get_maxplayers ( );
  25.     g_MsgSync    = CreateHudSyncObj ( );
  26.    
  27.     // CvarS:
  28.     g_pcvarShow = register_cvar ( "amx_show_health", "1" );
  29. }
  30.  
  31. public showhp ( )
  32. {
  33.     new id;
  34.    
  35.     for ( id = 1; id < g_MaxPlayers; id++ )
  36.     {
  37.         if ( !is_user_alive ( id ) || !get_pcvar_num ( g_pcvarShow ) )
  38.             continue;
  39.        
  40.         set_hudmessage ( 127, 212, 255, 0.0, 0.90, 0, 6.0, 2.8 );
  41.        
  42.         if ( get_user_flags ( id ) == read_flags ( "o" ) ) {
  43.             ShowSyncHudMsg ( id, g_MsgSync, "Health: %i | VIP+GM: Da", get_user_health ( id ) );
  44.         }
  45.         else {
  46.             ShowSyncHudMsg ( id, g_MsgSync, "Health: %i | VIP+GM: Nu", get_user_health ( id ) );
  47.         }
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement