hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.03.28. 17:06



Jelenlévő felhasználók

Jelenleg 254 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 253 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: Google [Bot] az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 4 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Surf VIP Fegyver Spawnoláskor
HozzászólásElküldve: 2016.04.12. 14:03 
Offline
Senior Tag
Avatar

Csatlakozott: 2015.06.11. 01:54
Hozzászólások: 220
Megköszönt másnak: 46 alkalommal
Megköszönték neki: 13 alkalommal
Itt azt hogy lehetne megcsinálni hogy kör kezdéskor a VIP kapjon egy M3 shotgunt meg deaglet?

  1. #include < amxmodx >
  2. #include < amxmisc >
  3. #include < fakemeta >
  4. #include < fun >
  5. #include < geoip >
  6. #include < cstrike >
  7. #include < colorchat >
  8. #include < hamsandwich >
  9.  
  10. #define PLUGIN "Simple Surf Vip"
  11. #define VERSION "1.1"
  12.  
  13. #define CN_SOUND    "buttons/bell1.wav"    // Csatlakozó hang
  14. #define DC_SOUND    "fvox/blip.wav"        // Lecsatlakozó hang  
  15.  
  16. #define XO_PLAYER            5
  17. #define m_flFlashedUntil     514
  18. #define m_flFlashedAt        515
  19. #define m_flFlashHoldTime    516
  20. #define m_flFlashDuration    517
  21. #define m_iFlashAlpha        518
  22.  
  23. #define ALPHA_FULLBLINDED    255
  24.  
  25. #define VIP_ACCESS    ADMIN_LEVEL_C
  26.  
  27. #define is_vip(%1)    ( get_user_flags(%1) & VIP_ACCESS )
  28.  
  29. /* Mennyi életet kapjon a VIP, alap beállítás 130 */
  30. #define VIP_HEALTH    ( 130 )
  31.  
  32. new g_pCvarHsBonus, g_pCvarKillBonus
  33. new g_pCvarHpPerHeadShot, g_pCvarHpPerKill
  34.  
  35. public plugin_init( )
  36. {
  37.     register_plugin( PLUGIN, VERSION, "Baws" )
  38.      
  39.     register_cvar( "surfvip_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY );
  40.     set_cvar_string( "surfvip_version", VERSION );
  41.      
  42.     register_message( get_user_msgid( "SayText" ), "VipTag" );
  43.    
  44.     RegisterHam( Ham_Spawn, "player", "Fwd_VipSpawn", true );
  45.     RegisterHam( Ham_Killed, "player", "Fwd_PlayerKilled_Post", 1 );
  46.    
  47.     register_event( "DeathMsg", "eDeathMsg", "a" );
  48.     register_logevent( "eRoundStart", 2, "1=Round_Start" )
  49.      
  50.     g_pCvarHpPerHeadShot = register_cvar( "surfvip_hp_per_hs", "0" ) //Mennyi életet kapjon fejlövésért.
  51.     g_pCvarHpPerKill = register_cvar( "surfvip_hp_per_kill", "0" ) //Mennyi életet kapjon sima ölésért.
  52.     g_pCvarHsBonus = register_cvar( "surfvip_money_per_hs", "0" ) //Mennyi pénzt kapjon fejlövésért.
  53.     g_pCvarKillBonus = register_cvar( "surfvip_money_per_kill", "0" ) //Mennyi pénzt kapjon sima ölésért.
  54.      
  55.     /* VIP ellenőrzés parancsok */
  56.     register_clcmd( "say /vip", "showvips_online" )
  57.     register_clcmd( "say_team /vip", "showvips_online" )
  58.     register_clcmd( "say /vips", "showvips_online" )
  59.     register_clcmd( "say_team /vips", "showvips_online" )
  60.      
  61. }
  62.  
  63. public showvips_online( id )
  64. {
  65.     new iPlayers[ 32 ], iNum, iPlayerId, szName[ 32 ]
  66.     get_players( iPlayers, iNum, "ch" )
  67.      
  68.     new iLen, szMessage[ ( sizeof iPlayers ) * charsmax( szName ) ]
  69.      
  70.     iLen = formatex( szMessage, charsmax( szMessage ), "^x04Online VIP-k: " )
  71.     for( new i; i < iNum; i++ )
  72.     {
  73.         iPlayerId = iPlayers[ i ]
  74.         if( is_vip( iPlayerId ) )
  75.         {
  76.             get_user_name( iPlayerId, szName, 31 )
  77.             iLen += formatex( szMessage[ iLen ], charsmax( szMessage ) - iLen, " %s%s", szName, iLen ? "," : "" )
  78.         }
  79.     }
  80.     ColorChat( id, GREEN, szMessage )
  81. }
  82.  
  83. public client_putinserver( id )
  84. {
  85.     if( !is_user_bot( id ) )
  86.     {
  87.         new szName[ 32 ], szCountry[ 46 ];
  88.         get_user_name( id, szName, 31 );
  89.         szCountry = get_user_country( id );
  90.          
  91.         if( get_user_flags( id ) & VIP_ACCESS )
  92.         {
  93.             ColorChat( 0, GREEN, "^x04* ^x01VIP^x04 %s (%s)^x01 csatlakozott ^x04*", szName, szCountry );
  94.             client_cmd( 0, "spk %s", CN_SOUND )
  95.         }
  96.     }
  97. }
  98.  
  99. public client_disconnect( id )
  100. {
  101.     if( !is_user_bot( id ) )  
  102.     {
  103.         new szName[ 32 ], szCountry[ 46 ];
  104.         get_user_name( id, szName, 31 );
  105.         szCountry = get_user_country( id );
  106.          
  107.         if( get_user_flags( id ) & VIP_ACCESS )
  108.         {
  109.             ColorChat( 0, GREEN, "^x04* ^x01VIP^x04 %s (%s)^x01 lecsatlakozott ^x04*", szName, szCountry );
  110.             client_cmd( 0, "spk %s", DC_SOUND )
  111.         }
  112.     }
  113. }
  114.  
  115. public Fwd_VipSpawn( id )
  116. {
  117.     if( is_user_alive( id ) && get_user_flags( id ) & VIP_ACCESS )
  118.     {
  119.         set_user_health( id, VIP_HEALTH );
  120.     }
  121. }
  122.  
  123. public get_user_country( index )  
  124. {  
  125.     static szIP[ 32 ], szCountry[ 46 ];  
  126.     get_user_ip( index, szIP, 31 );  
  127.     geoip_country( szIP, szCountry );  
  128.  
  129.     if( equal( szCountry, "error" ) )  
  130.     {  
  131.     if( !contain( szIP, "192.168." ) || !contain( szIP, "10. " ) || !contain( szIP, "172." ) || equal( szIP, "127.0.0.1" ) )  
  132.     szCountry = "LAN";  
  133.  
  134.     else if( equal( szIP, "loopback" ) )  
  135.     szCountry = "ListenServer User";
  136.      
  137.     else
  138.     szCountry = "Unknown Country";
  139.     }
  140.     return szCountry;
  141. }
  142.  
  143. public VipTag( msgId, msgDest, msgEnt )
  144. {
  145.     new id = get_msg_arg_int( 1 );
  146.      
  147.     if( is_user_connected( id ) && get_user_flags( id ) & VIP_ACCESS )
  148.     {
  149.         new szTmp[ 256 ],
  150.             szTmp2[ 256 ];
  151.              
  152.         get_msg_arg_string( 2, szTmp, charsmax( szTmp ) );
  153.          
  154.         new szPrefix[ 64 ] = "^x01[ ^x04VIP ^x01]";
  155.          
  156.         if( !equal( szTmp, "#Cstrike_Chat_All" ) )
  157.         {
  158.             add( szTmp2, charsmax( szTmp2 ), szPrefix );
  159.             add( szTmp2, charsmax( szTmp2 ), " " );
  160.             add( szTmp2, charsmax( szTmp2 ), szTmp );
  161.         }
  162.         else
  163.         {
  164.             add( szTmp2, charsmax( szTmp2 ), szPrefix );
  165.             add( szTmp2, charsmax( szTmp2 ), "^x03 %s1^x01 :  %s2" );
  166.         }
  167.         set_msg_arg_string( 2, szTmp2 );
  168.     }
  169.     return PLUGIN_CONTINUE;
  170. }
  171.  
  172. public eRoundStart( )
  173. {
  174.     new players[ 32 ], iCount, iPlayer
  175.     get_players( players, iCount, "ch" )
  176.      
  177.     for( new i; i < iCount; i++ )
  178.     {
  179.         iPlayer = players[ i ]
  180.         if( is_vip( iPlayer ) && is_user_alive( iPlayer ) )
  181.         {
  182.             new Weapons[ 32 ], iNum
  183.             new iWepBitSum = /**/~/**/get_user_weapons( iPlayer, Weapons, iNum )            
  184.         }
  185.     }    
  186. }
  187.  
  188. public eDeathMsg( id )
  189. {
  190.     new hp_added[ 64 ];
  191.     static iHeadShot, iVictim, iKillerId
  192.     iKillerId = read_data( 1 )
  193.     iVictim = read_data( 2 )
  194.     iHeadShot = read_data( 3 )
  195.    
  196.     if ( !is_user_connected( iKillerId ) )
  197.              return PLUGIN_CONTINUE;
  198.          
  199.     if( iVictim == iKillerId )
  200.     {
  201.             return PLUGIN_HANDLED;
  202.     }
  203.     if( is_vip( iKillerId ) )
  204.     {
  205.         if( iHeadShot )
  206.         {
  207.             new nHpHs_add = get_pcvar_num( g_pCvarHpPerHeadShot )
  208.             if( get_user_health( iKillerId ) > 0 )
  209.             set_user_health( iKillerId, get_user_health( iKillerId ) + nHpHs_add )
  210.             if( get_user_health( iKillerId ) )
  211.             {
  212.                 format( hp_added, sizeof( hp_added ), "Szép fejlövés!", nHpHs_add )
  213.                 set_hudmessage( 0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1 )
  214.                 show_hudmessage( iKillerId, hp_added, nHpHs_add )
  215.             }
  216.             if( !get_user_flashed( iKillerId ) )
  217.             {
  218.                 message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), { 0,0,0 }, iKillerId )
  219.                 write_short( 1<<10 )
  220.                 write_short( 1<<10 )
  221.                 write_short( 0x0000 )
  222.                 write_byte( 0 )
  223.                 write_byte( 0 )
  224.                 write_byte( 200 )
  225.                 write_byte( 75 )
  226.                 message_end( )
  227.             }
  228.         }
  229.         else
  230.         {
  231.             new nHp_add = get_pcvar_num( g_pCvarHpPerKill )
  232.             if( get_user_health( iKillerId ) > 0 )
  233.             set_user_health( iKillerId, get_user_health( iKillerId ) + nHp_add )
  234.             if( get_user_health( iKillerId ) )
  235.             {
  236.                 format( hp_added, sizeof( hp_added ), "Szép ölés!", nHp_add )
  237.                 set_hudmessage( 0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1 )
  238.                 show_hudmessage( iKillerId, hp_added, nHp_add )
  239.             }
  240.             if( !get_user_flashed( iKillerId ) )
  241.             {
  242.                 message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), { 0,0,0 }, iKillerId )
  243.                 write_short( 1<<10 )
  244.                 write_short( 1<<10 )
  245.                 write_short( 0x0000 )
  246.                 write_byte( 0 )
  247.                 write_byte( 0 )
  248.                 write_byte( 200 )
  249.                 write_byte( 75 )
  250.                 message_end( )
  251.             }
  252.         }
  253.     }
  254.     return PLUGIN_HANDLED;
  255. }
  256.  
  257. public Fwd_PlayerKilled_Post( id )
  258. {
  259.     new Hitzone, Weapon, Attacker = get_user_attacker( id, Weapon, Hitzone )
  260.     new Players[ 32 ], Aid;
  261.     get_players( Players, Aid )
  262.     if( 0 < Attacker <= Aid && is_user_alive( Attacker ) && Attacker != id && is_vip( Attacker ) )
  263.     {
  264.     cs_set_user_money( Attacker, cs_get_user_money( Attacker ) + get_pcvar_num( g_pCvarKillBonus ) )
  265.     if(  Hitzone == 1 )
  266.     cs_set_user_money( Attacker, cs_get_user_money( Attacker ) + get_pcvar_num( g_pCvarHsBonus ) )
  267.     }
  268. }
  269.  
  270. get_user_flashed( id, &iPercent=0 )
  271. {
  272.     new Float:flFlashedAt = get_pdata_float( id, m_flFlashedAt, XO_PLAYER )
  273.  
  274.     if( !flFlashedAt )
  275.     {
  276.         return 0
  277.     }
  278.  
  279.     new Float:flGameTime = get_gametime( )
  280.     new Float:flTimeLeft = flGameTime - flFlashedAt
  281.     new Float:flFlashDuration = get_pdata_float( id, m_flFlashDuration, XO_PLAYER )
  282.     new Float:flFlashHoldTime = get_pdata_float( id, m_flFlashHoldTime, XO_PLAYER )
  283.     new Float:flTotalTime = flFlashHoldTime + flFlashDuration
  284.  
  285.     if( flTimeLeft > flTotalTime )
  286.     {
  287.         return 0
  288.     }
  289.  
  290.     new iFlashAlpha = get_pdata_int( id, m_iFlashAlpha, XO_PLAYER )
  291.  
  292.     if( iFlashAlpha == ALPHA_FULLBLINDED )
  293.     {
  294.         if( get_pdata_float( id, m_flFlashedUntil, XO_PLAYER) - flGameTime > 0.0 )
  295.         {
  296.             iPercent = 100
  297.         }
  298.         else
  299.         {
  300.             iPercent = 100-floatround( ( ( flGameTime - ( flFlashedAt + flFlashHoldTime ) )*100.0 )/flFlashDuration )
  301.         }
  302.     }
  303.     else
  304.     {
  305.         iPercent = 100-floatround( ( ( flGameTime - flFlashedAt )*100.0 )/flTotalTime )
  306.     }
  307.    
  308.     return iFlashAlpha
  309. }

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Surf VIP Fegyver Spawnoláskor
HozzászólásElküldve: 2016.04.12. 15:20 
Offline
Nagyúr
Avatar

Csatlakozott: 2014.08.24. 18:28
Hozzászólások: 584
Megköszönt másnak: 122 alkalommal
Megköszönték neki: 120 alkalommal
Ham_Spawn-ba:
  1. strip_user_weapons(id)
  2. give_item(id, "weapon_knife")
  3. give_item(id, "weapon_m3")
  4. give_item(id, "weapon_deagle")
  5. cs_set_user_bpammo(id, CSW_M3, 32)
  6. cs_set_user_bpammo(id, CSW_DEAGLE, 35)

Bocs, ha a töltény beállítást elírtam, fejből nem vágom a dolgokat. :P

Ők köszönték meg LyleChriss nek ezt a hozzászólást: AlphaHun (2016.04.12. 16:07)
  Népszerűség: 2.27%


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Surf VIP Fegyver Spawnoláskor
HozzászólásElküldve: 2016.04.12. 15:23 
Offline
Senior Tag

Csatlakozott: 2016.01.17. 07:11
Hozzászólások: 296
Megköszönt másnak: 60 alkalommal
Megköszönték neki: 11 alkalommal
így :P
  1. #include < amxmodx >
  2. #include < amxmisc >
  3. #include < fakemeta >
  4. #include < fun >
  5. #include < geoip >
  6. #include < cstrike >
  7. #include < colorchat >
  8. #include < hamsandwich >
  9.  
  10. #define PLUGIN "Simple Surf Vip"
  11. #define VERSION "1.1"
  12.  
  13. #define CN_SOUND    "buttons/bell1.wav"    // Csatlakozó hang
  14. #define DC_SOUND    "fvox/blip.wav"        // Lecsatlakozó hang  
  15.  
  16. #define XO_PLAYER            5
  17. #define m_flFlashedUntil     514
  18. #define m_flFlashedAt        515
  19. #define m_flFlashHoldTime    516
  20. #define m_flFlashDuration    517
  21. #define m_iFlashAlpha        518
  22.  
  23. #define ALPHA_FULLBLINDED    255
  24.  
  25. #define VIP_ACCESS    ADMIN_LEVEL_C
  26.  
  27. #define is_vip(%1)    ( get_user_flags(%1) & VIP_ACCESS )
  28.  
  29. /* Mennyi életet kapjon a VIP, alap beállítás 130 */
  30. #define VIP_HEALTH    ( 130 )
  31.  
  32. new g_pCvarHsBonus, g_pCvarKillBonus
  33. new g_pCvarHpPerHeadShot, g_pCvarHpPerKill
  34.  
  35. public plugin_init( )
  36. {
  37.     register_plugin( PLUGIN, VERSION, "Baws" )
  38.      
  39.     register_cvar( "surfvip_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY );
  40.     set_cvar_string( "surfvip_version", VERSION );
  41.      
  42.     register_message( get_user_msgid( "SayText" ), "VipTag" );
  43.    
  44.     RegisterHam( Ham_Spawn, "player", "Fwd_VipSpawn", true );
  45.     RegisterHam( Ham_Killed, "player", "Fwd_PlayerKilled_Post", 1 );
  46.    
  47.     register_event( "DeathMsg", "eDeathMsg", "a" );
  48.     register_logevent( "eRoundStart", 2, "1=Round_Start" )
  49.      
  50.     g_pCvarHpPerHeadShot = register_cvar( "surfvip_hp_per_hs", "0" ) //Mennyi életet kapjon fejlövésért.
  51.     g_pCvarHpPerKill = register_cvar( "surfvip_hp_per_kill", "0" ) //Mennyi életet kapjon sima ölésért.
  52.     g_pCvarHsBonus = register_cvar( "surfvip_money_per_hs", "0" ) //Mennyi pénzt kapjon fejlövésért.
  53.     g_pCvarKillBonus = register_cvar( "surfvip_money_per_kill", "0" ) //Mennyi pénzt kapjon sima ölésért.
  54.      
  55.     /* VIP ellenőrzés parancsok */
  56.     register_clcmd( "say /vip", "showvips_online" )
  57.     register_clcmd( "say_team /vip", "showvips_online" )
  58.     register_clcmd( "say /vips", "showvips_online" )
  59.     register_clcmd( "say_team /vips", "showvips_online" )
  60.      
  61. }
  62.  
  63. public showvips_online( id )
  64. {
  65.     new iPlayers[ 32 ], iNum, iPlayerId, szName[ 32 ]
  66.     get_players( iPlayers, iNum, "ch" )
  67.      
  68.     new iLen, szMessage[ ( sizeof iPlayers ) * charsmax( szName ) ]
  69.      
  70.     iLen = formatex( szMessage, charsmax( szMessage ), "^x04Online VIP-k: " )
  71.     for( new i; i < iNum; i++ )
  72.     {
  73.         iPlayerId = iPlayers[ i ]
  74.         if( is_vip( iPlayerId ) )
  75.         {
  76.             get_user_name( iPlayerId, szName, 31 )
  77.             iLen += formatex( szMessage[ iLen ], charsmax( szMessage ) - iLen, " %s%s", szName, iLen ? "," : "" )
  78.         }
  79.     }
  80.     ColorChat( id, GREEN, szMessage )
  81. }
  82.  
  83. public client_putinserver( id )
  84. {
  85.     if( !is_user_bot( id ) )
  86.     {
  87.         new szName[ 32 ], szCountry[ 46 ];
  88.         get_user_name( id, szName, 31 );
  89.         szCountry = get_user_country( id );
  90.          
  91.         if( get_user_flags( id ) & VIP_ACCESS )
  92.         {
  93.             ColorChat( 0, GREEN, "^x04* ^x01VIP^x04 %s (%s)^x01 csatlakozott ^x04*", szName, szCountry );
  94.             client_cmd( 0, "spk %s", CN_SOUND )
  95.         }
  96.     }
  97. }
  98.  
  99. public client_disconnect( id )
  100. {
  101.     if( !is_user_bot( id ) )  
  102.     {
  103.         new szName[ 32 ], szCountry[ 46 ];
  104.         get_user_name( id, szName, 31 );
  105.         szCountry = get_user_country( id );
  106.          
  107.         if( get_user_flags( id ) & VIP_ACCESS )
  108.         {
  109.             ColorChat( 0, GREEN, "^x04* ^x01VIP^x04 %s (%s)^x01 lecsatlakozott ^x04*", szName, szCountry );
  110.             client_cmd( 0, "spk %s", DC_SOUND )
  111.         }
  112.     }
  113. }
  114.  
  115. public Fwd_VipSpawn( id )
  116. {
  117.     if( is_user_alive( id ) && get_user_flags( id ) & VIP_ACCESS )
  118.     {
  119.         give_item(id, "weapon_m3")
  120.     cs_set_user_bpammo(id, CSW_M3, 35)
  121.         set_user_health( id, VIP_HEALTH );
  122.     }
  123. }
  124.  
  125. public get_user_country( index )  
  126. {  
  127.     static szIP[ 32 ], szCountry[ 46 ];  
  128.     get_user_ip( index, szIP, 31 );  
  129.     geoip_country( szIP, szCountry );  
  130.  
  131.     if( equal( szCountry, "error" ) )  
  132.     {  
  133.     if( !contain( szIP, "192.168." ) || !contain( szIP, "10. " ) || !contain( szIP, "172." ) || equal( szIP, "127.0.0.1" ) )  
  134.     szCountry = "LAN";  
  135.  
  136.     else if( equal( szIP, "loopback" ) )  
  137.     szCountry = "ListenServer User";
  138.      
  139.     else
  140.     szCountry = "Unknown Country";
  141.     }
  142.     return szCountry;
  143. }
  144.  
  145. public VipTag( msgId, msgDest, msgEnt )
  146. {
  147.     new id = get_msg_arg_int( 1 );
  148.      
  149.     if( is_user_connected( id ) && get_user_flags( id ) & VIP_ACCESS )
  150.     {
  151.         new szTmp[ 256 ],
  152.             szTmp2[ 256 ];
  153.              
  154.         get_msg_arg_string( 2, szTmp, charsmax( szTmp ) );
  155.          
  156.         new szPrefix[ 64 ] = "^x01[ ^x04VIP ^x01]";
  157.          
  158.         if( !equal( szTmp, "#Cstrike_Chat_All" ) )
  159.         {
  160.             add( szTmp2, charsmax( szTmp2 ), szPrefix );
  161.             add( szTmp2, charsmax( szTmp2 ), " " );
  162.             add( szTmp2, charsmax( szTmp2 ), szTmp );
  163.         }
  164.         else
  165.         {
  166.             add( szTmp2, charsmax( szTmp2 ), szPrefix );
  167.             add( szTmp2, charsmax( szTmp2 ), "^x03 %s1^x01 :  %s2" );
  168.         }
  169.         set_msg_arg_string( 2, szTmp2 );
  170.     }
  171.     return PLUGIN_CONTINUE;
  172. }
  173.  
  174. public eRoundStart( )
  175. {
  176.     new players[ 32 ], iCount, iPlayer
  177.     get_players( players, iCount, "ch" )
  178.      
  179.     for( new i; i < iCount; i++ )
  180.     {
  181.         iPlayer = players[ i ]
  182.         if( is_vip( iPlayer ) && is_user_alive( iPlayer ) )
  183.         {
  184.             new Weapons[ 32 ], iNum
  185.             new iWepBitSum = /**/~/**/get_user_weapons( iPlayer, Weapons, iNum )            
  186.         }
  187.     }    
  188. }
  189.  
  190. public eDeathMsg( id )
  191. {
  192.     new hp_added[ 64 ];
  193.     static iHeadShot, iVictim, iKillerId
  194.     iKillerId = read_data( 1 )
  195.     iVictim = read_data( 2 )
  196.     iHeadShot = read_data( 3 )
  197.    
  198.     if ( !is_user_connected( iKillerId ) )
  199.              return PLUGIN_CONTINUE;
  200.          
  201.     if( iVictim == iKillerId )
  202.     {
  203.             return PLUGIN_HANDLED;
  204.     }
  205.     if( is_vip( iKillerId ) )
  206.     {
  207.         if( iHeadShot )
  208.         {
  209.             new nHpHs_add = get_pcvar_num( g_pCvarHpPerHeadShot )
  210.             if( get_user_health( iKillerId ) > 0 )
  211.             set_user_health( iKillerId, get_user_health( iKillerId ) + nHpHs_add )
  212.             if( get_user_health( iKillerId ) )
  213.             {
  214.                 format( hp_added, sizeof( hp_added ), "Szép fejlövés!", nHpHs_add )
  215.                 set_hudmessage( 0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1 )
  216.                 show_hudmessage( iKillerId, hp_added, nHpHs_add )
  217.             }
  218.             if( !get_user_flashed( iKillerId ) )
  219.             {
  220.                 message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), { 0,0,0 }, iKillerId )
  221.                 write_short( 1<<10 )
  222.                 write_short( 1<<10 )
  223.                 write_short( 0x0000 )
  224.                 write_byte( 0 )
  225.                 write_byte( 0 )
  226.                 write_byte( 200 )
  227.                 write_byte( 75 )
  228.                 message_end( )
  229.             }
  230.         }
  231.         else
  232.         {
  233.             new nHp_add = get_pcvar_num( g_pCvarHpPerKill )
  234.             if( get_user_health( iKillerId ) > 0 )
  235.             set_user_health( iKillerId, get_user_health( iKillerId ) + nHp_add )
  236.             if( get_user_health( iKillerId ) )
  237.             {
  238.                 format( hp_added, sizeof( hp_added ), "Szép ölés!", nHp_add )
  239.                 set_hudmessage( 0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1 )
  240.                 show_hudmessage( iKillerId, hp_added, nHp_add )
  241.             }
  242.             if( !get_user_flashed( iKillerId ) )
  243.             {
  244.                 message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), { 0,0,0 }, iKillerId )
  245.                 write_short( 1<<10 )
  246.                 write_short( 1<<10 )
  247.                 write_short( 0x0000 )
  248.                 write_byte( 0 )
  249.                 write_byte( 0 )
  250.                 write_byte( 200 )
  251.                 write_byte( 75 )
  252.                 message_end( )
  253.             }
  254.         }
  255.     }
  256.     return PLUGIN_HANDLED;
  257. }
  258.  
  259. public Fwd_PlayerKilled_Post( id )
  260. {
  261.     new Hitzone, Weapon, Attacker = get_user_attacker( id, Weapon, Hitzone )
  262.     new Players[ 32 ], Aid;
  263.     get_players( Players, Aid )
  264.     if( 0 < Attacker <= Aid && is_user_alive( Attacker ) && Attacker != id && is_vip( Attacker ) )
  265.     {
  266.     cs_set_user_money( Attacker, cs_get_user_money( Attacker ) + get_pcvar_num( g_pCvarKillBonus ) )
  267.     if(  Hitzone == 1 )
  268.     cs_set_user_money( Attacker, cs_get_user_money( Attacker ) + get_pcvar_num( g_pCvarHsBonus ) )
  269.     }
  270. }
  271.  
  272. get_user_flashed( id, &iPercent=0 )
  273. {
  274.     new Float:flFlashedAt = get_pdata_float( id, m_flFlashedAt, XO_PLAYER )
  275.  
  276.     if( !flFlashedAt )
  277.     {
  278.         return 0
  279.     }
  280.  
  281.     new Float:flGameTime = get_gametime( )
  282.     new Float:flTimeLeft = flGameTime - flFlashedAt
  283.     new Float:flFlashDuration = get_pdata_float( id, m_flFlashDuration, XO_PLAYER )
  284.     new Float:flFlashHoldTime = get_pdata_float( id, m_flFlashHoldTime, XO_PLAYER )
  285.     new Float:flTotalTime = flFlashHoldTime + flFlashDuration
  286.  
  287.     if( flTimeLeft > flTotalTime )
  288.     {
  289.         return 0
  290.     }
  291.  
  292.     new iFlashAlpha = get_pdata_int( id, m_iFlashAlpha, XO_PLAYER )
  293.  
  294.     if( iFlashAlpha == ALPHA_FULLBLINDED )
  295.     {
  296.         if( get_pdata_float( id, m_flFlashedUntil, XO_PLAYER) - flGameTime > 0.0 )
  297.         {
  298.             iPercent = 100
  299.         }
  300.         else
  301.         {
  302.             iPercent = 100-floatround( ( ( flGameTime - ( flFlashedAt + flFlashHoldTime ) )*100.0 )/flFlashDuration )
  303.         }
  304.     }
  305.     else
  306.     {
  307.         iPercent = 100-floatround( ( ( flGameTime - flFlashedAt )*100.0 )/flTotalTime )
  308.     }
  309.    
  310.     return iFlashAlpha
  311. }

_________________
Global Offensive: (50%)

Ők köszönték meg SZILARD nek ezt a hozzászólást: AlphaHun (2016.04.12. 16:07)
  Népszerűség: 2.27%


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Surf VIP Fegyver Spawnoláskor
HozzászólásElküldve: 2016.04.12. 16:08 
Offline
Senior Tag
Avatar

Csatlakozott: 2015.06.11. 01:54
Hozzászólások: 220
Megköszönt másnak: 46 alkalommal
Megköszönték neki: 13 alkalommal
Köszi srácok! :good:

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 4 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 22 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole