Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- #include < amxmisc >
- #include < cstrike >
- #include < fakemeta >
- #include < fakemeta_util >
- #include < hamsandwich >
- #include < dhudmessage >
- #include < nvault >
- /* Defines */
- #define MaxScouts 20
- /* Variables */
- new hnr_count, Shockwave, Laserbeam, Lightning, White, Trail, g_Vault;
- new g_FlashMsg, Zbim;
- new g_FwIndex, gMaxPlayers, g_GunsEvents_Bitsum;
- /* Booleans */
- new bool:IsInfected[ 33 ], bool:hnr_game, bool:BlockZoom;
- new bool:g_Sounds[ 33 ], bool:g_Beacon[ 33 ], bool:g_Laser[ 33 ], bool:AntiFrost[ 33 ], bool:AntiFlash[ 33 ];
- /* Floats */
- new Float:hnr_timer, Float:hnr_last[ 33 ];
- /* Cvars */
- /* Models and Levels */
- new const laser_spr[ ] = "sprites/laserbeam.spr";
- new const shock_spr[ ] = "sprites/shockwave.spr";
- new const light_spr[ ] = "sprites/lgtning.spr";
- new const white_spr[ ] = "sprites/white.spr";
- new const smoke_spr[ ] = "sprites/smoke.spr";
- new const v_He[ ] = "models/Galactic/HNR/Grenades/v_hegrenade.mdl";
- new const v_Flash[ ] = "models/Galactic/HNR/Grenades/v_flashbang.mdl";
- new const v_Smoke[ ] = "models/Galactic/HNR/Grenades/v_smokegrenade.mdl";
- /*new v_Scout[ MaxScouts ][ ] =
- {
- "models/Galactic/HitNRun/Scouts/v_newscout1.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout2.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout3.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout4.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout5.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout6.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout7.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout8.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout9.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout10.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout11.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout12.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout13.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout14.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout15.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout16.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout17.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout18.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout19.mdl",
- "models/Galactic/HitNRun/Scouts/v_newscout20.mdl"
- }*/
- new scout[ ] = "models/Galactic/HitNRun/Scouts/v_scout3.mdl";
- new g_Levels[ 20 ] =
- {
- 35, 100, 200, 350, 500,
- 700, 950, 1200, 1500, 1800,
- 2150, 2500, 3000, 3550, 4150,
- 4700, 5300, 6000, 6900, 8000
- };
- new g_Scout[ 33 ];
- /* Info */
- new Info[ ][ ] =
- {
- "Hit And Run",
- "v0.4.3b",
- "Rejack"
- };
- /* Shop */
- new g_GrenadesClass[ ][ ] = { "weapon_hegrenade", "weapon_flashbang", "weapon_smokegrenade" };
- new g_GrenadesCost[ ] = { 100, 650, 750 };
- new g_GrenadesLvls[ ] = { 6, 3, 4 }
- new g_WeaponsClass[ ][ ] = { "weapon_m4a1", "weapon_ak47", "weapon_galil", "weapon_famas", "weapon_mp5navy" };
- new g_WeaponsCSW[ ] = { CSW_M4A1, CSW_AK47, CSW_GALIL, CSW_FAMAS, CSW_MP5NAVY };
- new g_WeaponsCost[ ] = { 3500, 3500, 3200, 3000, 2350 };
- new g_WeaponsLvls[ ] = { 15, 15, 13, 12, 11 }
- new g_AmmoAmount[ ] = { 10, 20, 30 };
- new g_AmmoCost[ ] = { 300, 600, 900 };
- new g_PowersCost[ ] = { 1500, 2250 };
- new g_PowersLvls[ ] = { 8, 12 };
- /* Event Vote */
- new g_EventsNames[ ][ ] = { "Knife Only", "Pistols Only", "No Zoom", "No Grenades", "Invisible Infected" }
- new VoteMenu, Voting, Votes[ 4 ], g_Num, g_Random, vCount, bool:g_Vote, bool:Voted[ 33 ];
- new NR, Event;
- new Round, bool:Invis;
- /* Arrays ( Clients ) */
- new Level[ 33 ], Exp[ 33 ], Cash[ 33 ], Wins[ 33 ], Lose[ 33 ], Shots[ 33 ], Hits[ 33 ], Hits2[ 33 ], Choose[ 33 ], Grenades[ 33 ];
- /* Frostnades */
- #define TASK_EXPLODE(%1) ( 799 + %1 )
- #define UNTASK_EXPLODE(%1) ( %1 - 799)
- #define TASK_UNFREEZE(%1) ( 899 + %1 )
- #define UNTASK_UNFREEZE(%1) ( %1 - 899 )
- new bool: g_bFreezed[ 33 ], g_iBeaconSprite;
- enum _:FrostSounds
- {
- Explode,
- Hit,
- Unfreeze
- }
- new const szFrostSoundsPath[ FrostSounds ][ ] = {
- "warcraft3/frostnova.wav",
- "warcraft3/impalehit.wav",
- "warcraft3/impalelaunch1.wav"
- }
- public plugin_init()
- {
- register_plugin( Info[ 0 ], Info[ 1 ], Info[ 2 ] );
- register_clcmd( "say", "CmdSay" );
- register_clcmd( "jointeam", "CmdMenu" );
- register_clcmd( "chooseteam", "CmdMenu" );
- /* Events */
- register_logevent( "evRoundStart", 2, "1=Round_Start" );
- register_event( "DeathMsg", "evDeathMsg", "a" );
- register_event("ScreenFade","evFlash","be","4=255","5=255","6=255","7>199")
- register_event("CurWeapon", "evCurWeapon", "be", "1=1")
- g_FlashMsg = get_user_msgid( "ScreenFade" )
- register_event( "ResetHUD", "evResetHud", "b" );
- register_event( "HideWeapon", "evHideWeapon", "b" );
- /* Forwards */
- RegisterHam( Ham_Spawn, "player", "FwdSpawn", 1 );
- RegisterHam( Ham_TakeDamage, "player", "FwdTakeDamage", 0 );
- RegisterHam( Ham_TakeDamage, "player", "FwdBlockDamage", 0 );
- RegisterHam( Ham_Weapon_SecondaryAttack, "weapon_scout", "FwdZoom" );
- /* Blocks */
- register_forward( FM_ClientKill, "BlockKill" );
- /* Messages */
- register_message( get_user_msgid( "SendAudio" ), "MsgAudio" );
- register_message( get_user_msgid( "TextMsg" ), "MsgText" );
- /* Frostnades */
- register_forward( FM_SetModel, "Fwd_SetModel_Pre" );
- g_Vault = nvault_open("s");
- register_forward( FM_PlaybackEvent, "fwShot" );
- unregister_forward( FM_PrecacheEvent, g_FwIndex, 1 );
- gMaxPlayers = global_get( glb_maxClients );
- set_task( 75.0, "AdMessage1", _,_,_, "b" );
- set_task( 90.0, "AdMessage2", _,_,_, "b" );
- }
- public AdMessage1( )
- {
- ColorPrint( 0, "^1This server is running^4 %s^3 %s^1 by^4 %s", Info[ 0 ], Info[ 1 ], Info[ 2 ] );
- ColorPrint( 0, "^1This plugin is for^4 Sale^1! Want to^4 Buy^1 it?^3 Contact Skype:^4 Yan1255" );
- }
- public AdMessage2( )
- ColorPrint( 0, "^1Want to buy^4 Admin^1? Type^4 /^3Buy^1 or^4 Contact Skype:^3 Yan1255", Info[ 0 ], Info[ 1 ], Info[ 2 ] );
- public plugin_end( )
- nvault_close( g_Vault );
- public plugin_cfg( )
- {
- set_cvar_num( "mp_autoteambalance", 0 );
- set_cvar_num( "mp_limitteams", 0 );
- set_cvar_num( "mp_freezetime", 0 );
- set_cvar_num( "mp_roundtime", 9 );
- set_cvar_num( "sv_airaccelerate", 100 );
- set_cvar_string( "humans_join_team", "any" );
- register_message( get_user_msgid( "StatusIcon" ), "Message_StatusIcon" );
- }
- public plugin_precache()
- {
- Shockwave = precache_model( shock_spr );
- Laserbeam = precache_model ( laser_spr )
- Lightning = precache_model ( light_spr )
- White = precache_model ( white_spr )
- Trail = precache_model ( smoke_spr )
- Zbim = precache_model( "sprites/zbeam2.spr" );
- precache_model( v_He );
- precache_model( v_Flash );
- precache_model( v_Smoke );
- precache_model( "models/Galactic/HNR/Scouts/v_scout3.mdl" );
- precache_model( "models/player/alien3/alien3.mdl" );
- /*for ( new i = 0; i < MaxScouts; i++ )
- precache_model( v_Scout[ i ] );*/
- g_FwIndex = register_forward( FM_PrecacheEvent, "fwPrecache", 1 );
- for( new i = 0 ; i < FrostSounds ; i ++ )
- precache_sound( szFrostSoundsPath[ i ] );
- g_iBeaconSprite = precache_model( "sprites/shockwave.spr" );
- }
- public GetRandomInfected( )
- {
- new Players[ 32 ], PNum;
- get_players( Players, PNum, "aceh", "TERRORIST" );
- new iPlayer = Players[ random( PNum ) ];
- if ( IsInfected[ iPlayer ] ) return GetRandomInfected( );
- IsInfected[ iPlayer ] = true;
- fm_set_user_rendering( iPlayer, kRenderFxGlowShell, 0, 255, 255, kRenderNormal, 16 );
- if ( Invis )
- fm_set_user_rendering( iPlayer, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0 );
- cs_set_user_model( iPlayer, "alien3" );
- ShakeScreen( iPlayer );
- Choose[ iPlayer ] += 1;
- return PLUGIN_HANDLED;
- }
- /* Forwards */
- public FwdTakeDamage( victim, inflictor, attacker, Float:damage, damage_bits )
- {
- if ( IsInfected[ attacker ] && !IsInfected[ victim ] && hnr_game )
- {
- IsInfected[ victim ] = true;
- IsInfected[ attacker ] = false;
- fm_set_user_rendering( attacker );
- fm_set_user_rendering( victim, kRenderFxGlowShell, 0, 255, 255, kRenderNormal, 16 );
- if ( Invis )
- fm_set_user_rendering( victim, kRenderFxGlowShell, 0, 255, 255, kRenderTransAlpha, 0 );
- ShakeScreen( victim );
- cs_set_user_model( victim, "alien3" );
- cs_reset_user_model( attacker );
- hnr_last[ victim ] = hnr_timer;
- Hits2[ attacker ] += 1;
- Hits[ victim ] += 1;
- /*static szName[ 32 ];get_user_name( attacker, szName, charsmax( szName ) );
- static szName2[ 32 ];get_user_name( victim, szName2, charsmax( szName2 ) );
- ColorPrint( 0, "^4%s^3 attacked^4 %s", szName, szName2 );*/
- }
- }
- public FwdBlockDamage( victim, inflictor, attacker, Float:damage, damage_bits )
- return HAM_SUPERCEDE;
- public FwdSpawn( client )
- {
- fm_strip_user_weapons( client );
- AntiFlash[ client ] = false;
- AntiFrost[ client ] = false;
- if ( hnr_game ) return user_kill( client );
- if ( is_user_alive( client ) )
- {
- fm_strip_user_weapons( client );
- fm_give_item( client, "weapon_knife" );
- fm_give_item( client, "weapon_scout" );
- fm_give_item( client, "weapon_hegrenade" );
- fm_give_item( client, "weapon_flashbang" );
- fm_give_item( client, "weapon_flashbang" );
- fm_give_item( client, "weapon_smokegrenade" );
- cs_set_user_bpammo( client, CSW_SCOUT, Level[ client ] );
- }
- set_task( 1.0, "FwdRemoveBeam", client );
- IsInfected[ client ] = false;
- cs_reset_user_model( client );
- fm_set_user_rendering( client );
- return PLUGIN_HANDLED;
- }
- public FwdRemoveBeam( client )
- remove_task( client );
- public grenade_throw( client, GrenadeID, WeaponID )
- {
- new r, g, b;
- static szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- Grenades[ client ] += 1;
- switch( WeaponID )
- {
- case CSW_HEGRENADE:
- {
- r = 255;
- g = 0;
- b = 0;
- ColorPrint( 0, "^4%s^3 threw an^4 Explosive Grenade^3!", szName );
- }
- case CSW_FLASHBANG:
- {
- r = random( 255 );
- g = random( 255 );
- b = random( 255 );
- ColorPrint( 0, "^4%s^3 threw a^4 Flashbang^3!", szName );
- }
- case CSW_SMOKEGRENADE:
- {
- r = 0;
- g = 255
- b = 255;
- ColorPrint( 0, "^4%s^3 threw a^4 Frostnade^3!", szName );
- }
- }
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
- write_byte(TE_BEAMFOLLOW)
- write_short( GrenadeID )
- write_short( Trail )
- write_byte(10)
- write_byte(5)
- write_byte(r)
- write_byte(g)
- write_byte(b)
- write_byte(255)
- message_end()
- }
- public FwdZoom( ) return BlockZoom ? HAM_SUPERCEDE : HAM_IGNORED;
- /* Events */
- public evCurWeapon( client )
- {
- new Clip, Ammo, Weapon = get_user_weapon( client, Clip, Ammo );
- if ( Weapon == CSW_SCOUT )
- set_pev( client, pev_viewmodel2, scout );
- //set_pev( client, pev_viewmodel2, v_Scout[ Level[ client ] - 1 ] );
- if ( Weapon == CSW_HEGRENADE )
- set_pev( client, pev_viewmodel2, v_He );
- if ( Weapon == CSW_FLASHBANG )
- set_pev( client, pev_viewmodel2, v_Flash );
- if ( Weapon == CSW_SMOKEGRENADE )
- set_pev( client, pev_viewmodel2, v_Smoke );
- return PLUGIN_CONTINUE;
- }
- public evRoundStart()
- {
- Round += 1;
- BlockZoom = false
- g_Vote = false;
- Voting = 0;
- remove_task( 115 );
- Event = false;
- Invis = false;
- switch ( Round )
- {
- case 6:
- {
- evNR( );
- }
- case 7:
- {
- switch ( NR )
- {
- case 1:
- {
- for ( new i; i<get_maxplayers( ); i++ )
- {
- if ( !is_user_alive( i ) || !is_user_connected( i ) ) continue;
- fm_strip_user_weapons( i );
- fm_give_item( i, "weapon_knife" );
- }
- }
- case 2:
- {
- for ( new i; i<get_maxplayers( ); i++ )
- {
- if ( !is_user_alive( i ) || !is_user_connected( i ) ) continue;
- fm_strip_user_weapons( i );
- fm_give_item( i, "weapon_glock18" );
- cs_set_user_bpammo( i, CSW_GLOCK18, 40 );
- }
- }
- case 3: BlockZoom = true;
- case 4: Invis = true;
- case 5:
- {
- for ( new i; i<get_maxplayers( ); i++ )
- {
- if ( !is_user_alive( i ) || !is_user_connected( i ) ) continue;
- fm_strip_user_weapons( i );
- fm_give_item( i, "weapon_knife" );
- fm_give_item( i, "weapon_scout" );
- cs_set_user_bpammo( i, CSW_SCOUT, Level[ i ] );
- }
- }
- }
- Round = 0;
- Event = true;
- }
- }
- hnr_game = false;
- remove_task( 110 );
- remove_task( 111 );
- remove_task( 112 );
- remove_task( 113 );
- remove_task( 114 );
- new Players[ 32 ], PNum;
- get_players( Players, PNum, "aceh", "TERRORIST" );
- if ( PNum < 2 )
- {
- //set_cvar_num( "sv_restart", 4 );
- return ColorPrint( 0, "The game will not start if there are less than^4 2 Players^1!" );
- }
- hnr_count = 5;
- set_task( 2.0, "evCountdown", 110 );
- return PLUGIN_HANDLED;
- }
- public evCountdown( )
- {
- if ( hnr_count <= 0 )
- {
- new Players[ 32 ], PNum;
- get_players( Players, PNum, "aceh", "TERRORIST" );
- if ( PNum < 2 )
- {
- //set_cvar_num( "sv_restart", 4 );
- return ColorPrint( 0, "The game will not start if there are less than^4 2 Players^1!" );
- }
- if ( PNum > 25 )
- GetRandomInfected( );
- if ( PNum > 18 )
- GetRandomInfected( );
- GetRandomInfected( );
- hnr_game = true;
- hnr_timer = 20.0;
- evTimer( );
- return PLUGIN_HANDLED;
- }
- set_hudmessage( 255, 130, 0, -1.0, 0.35, 0, 0.0, 1.0, 0.1, 0.1 );
- show_hudmessage( 0, "The game will start in %d Seconds!", hnr_count );
- new Vox[ 32 ]; num_to_word( hnr_count, Vox, charsmax( Vox ) );
- client_cmd( 0, "spk ^"vox/%s^"", Vox, (hnr_count>1)?"s":"" );
- hnr_count -= 1;
- set_task( 1.0, "evCountdown", 110 );
- return PLUGIN_HANDLED;
- }
- public evTimer( )
- {
- if ( hnr_timer <= 0.0 )
- {
- new Players[ 32 ], PNum;
- get_players( Players, PNum, "aceh", "TERRORIST" );
- if ( PNum > 25 )
- set_task( 5.0, "GetRandomInfected", 113 );
- if ( PNum > 18 )
- set_task( 5.0, "GetRandomInfected", 112 );
- if ( PNum > 1 )
- set_task( 5.0, "GetRandomInfected", 111 );
- else return PLUGIN_HANDLED;
- set_task( 5.0, "evTimer", 114 );
- for ( new z; z<get_maxplayers( ); z++ )
- hnr_last[ z ] = 0.0;
- hnr_timer = 20.0;
- for ( new i; i<PNum; i++ )
- {
- new iPlayer = Players[ i ];
- if ( IsInfected[ iPlayer ] )
- user_kill( iPlayer );
- }
- return PLUGIN_HANDLED;
- }
- new szInfected[ 512 ], szInfect[ 64 ], InfectedPlayers[ 32 ], InfectedNum;
- get_players( InfectedPlayers, InfectedNum, "aceh", "TERRORIST" );
- for ( new i; i<InfectedNum; i++ )
- {
- new iPlayer = InfectedPlayers[ i ];
- if ( IsInfected[ iPlayer ] )
- {
- new szName[ 32 ];
- get_user_name( iPlayer, szName, 31 );
- formatex( szInfect, charsmax( szInfect ), "^n%s is Infected! [ Hit: %.1f ]", szName, hnr_last[ iPlayer ] );
- add( szInfected, charsmax( szInfected ), szInfect );
- }
- }
- //set_hudmessage( 0, 255, 255, -0.75, -0.35, 1, 0.1, 0.1, 0.1, 0.1 );
- set_hudmessage( 0, 255, 255, -1.0, -0.35, 1, 0.1, 0.1, 0.1, 0.1 );
- show_hudmessage( 0, "%.1f Seconds Left!%s", hnr_timer, szInfected );
- hnr_timer -= 0.1;
- set_task( 0.1, "evTimer", 114 );
- return PLUGIN_HANDLED;
- }
- public evDeathMsg( )
- {
- new victim = read_data( 2 );
- /*if ( hnr_timer > 0.0 )
- {
- if ( IsInfected[ victim ] )
- GetRandomInfected( );
- }*/
- IsInfected[ victim ] = false;
- if ( !hnr_game ) return PLUGIN_HANDLED;
- Lose[ victim ] += 1;
- new Players[ 32 ], PNum;
- get_players( Players, PNum, "aceh", "TERRORIST" );
- if ( PNum == 1 )
- {
- for ( new i; i<PNum; i++ )
- {
- new iPlayer = Players[ i ];
- hnr_game = false;
- remove_task( 110 );
- remove_task( 111 );
- remove_task( 112 );
- remove_task( 113 );
- remove_task( 114 );
- BlockZoom = false
- new szName[ 32 ];get_user_name( iPlayer, szName, charsmax( szName ) );
- Wins[ iPlayer ] += 1;
- if ( !g_Beacon[ iPlayer ] )
- set_task( 0.1, "WinnerBeam", iPlayer, _,_, "b" );
- new sPlayers[ 32 ], SNum;
- get_players( sPlayers, SNum );
- /*for ( new i; i<SNum; i++ )
- {
- new g_Player = sPlayers[ i ];
- if ( !g_Sounds[ g_Player ] )
- client_cmd( i, "Music" );
- }*/
- set_dhudmessage( 255, 0, 0, -1.0, 0.45, 1, 6.0, 6.0, 0.3, 0.3, true );
- show_dhudmessage( 0, "%s is the winner!", szName );
- set_task( 5.0, "RRound", 114 );
- hnr_game = false;
- new tPlayers[ 32 ], TNum;
- get_players( tPlayers, TNum, "ceh", "TERRORIST" );
- Exp[ iPlayer ] += TNum;
- Cash[ iPlayer ] += TNum * 50
- ColorPrint( 0, "^4%s^1 won this round! And he recieved^4 %d Cash^1 and^3 %d Exp^1!", szName, TNum * 50,TNum );
- CmdCheckLevel( iPlayer );
- }
- }
- if ( PNum == 2 )
- {
- switch ( random_num( 1, 10 ) )
- {
- case 9,10:
- {
- ColorPrint( 0, "^4Special Finals! No Zoom - Activated" );
- BlockZoom = true;
- }
- }
- }
- return PLUGIN_HANDLED;
- }
- public evFlash( client )
- {
- if ( AntiFlash[ client ] )
- {
- message_begin( MSG_ONE, g_FlashMsg, {0,0,0}, client );
- write_short( 1 );
- write_short( 1 );
- write_short( 1 );
- write_byte( 0 );
- write_byte( 0 );
- write_byte( 0 );
- write_byte(255 );
- message_end( );
- return PLUGIN_HANDLED;
- }
- new r = random( 255 );
- new g = random( 255 );
- new b = random( 255 );
- message_begin( MSG_ONE,g_FlashMsg,{0,0,0},client )
- write_short( read_data( 1 ) ) // Duration
- write_short( read_data( 2 ) ) // Hold time
- write_short( read_data( 3 ) ) // Fade type
- write_byte ( r ) // Red
- write_byte ( g ) // Green
- write_byte ( b ) // Blue
- write_byte ( read_data( 7 ) ) // Alpha
- message_end()
- return PLUGIN_HANDLED
- }
- public evResetHud( client )
- {
- set_pdata_int( client, 362, 0 );
- set_pdata_int( client, 361, 1<<3 );
- }
- public evHideWeapon( id )
- {
- new iFlags = read_data( 1 );
- new HudFlags;
- for ( new i = 0; i <= 7; i++ )
- {
- HudFlags |= 1<<i;
- }
- if( 1<<3 && (iFlags & 1<<3 != 1<<3) )
- {
- set_pdata_int(id, 362, 0);
- set_pdata_int(id, 361, iFlags|1<<3);
- }
- if( iFlags & HudFlags && !(1<<3 & 1<<7) && is_user_alive(id) )
- set_pdata_cbase(id, 374, FM_NULLENT);
- }
- /* Others */
- public RRound( ) set_cvar_num( "sv_restart", 1 );
- public WinnerBeam( client )
- {
- new iOrigin[ 3 ]
- get_user_origin( client , iOrigin, 1 );
- /*new bOrigin[ 3 ];
- get_user_origin( client , bOrigin, 3 );
- Laser( iOrigin, bOrigin );*/
- message_begin(MSG_PVS, SVC_TEMPENTITY, iOrigin)
- write_byte(TE_BEAMCYLINDER);
- write_coord(iOrigin[0]);
- write_coord(iOrigin[1]);
- write_coord(iOrigin[2]);
- write_coord(iOrigin[0]);
- write_coord(iOrigin[1]);
- write_coord(iOrigin[2] + 600);
- write_short( White );
- write_byte(0);
- write_byte(0);
- write_byte(20);
- write_byte(160);
- write_byte(0);
- write_byte ( random_num( 0, 255 ) ); // Red
- write_byte ( random_num( 0, 255 ) ); // Green
- write_byte ( random_num( 0, 255 ) ); // Blue
- write_byte(100);
- write_byte(0);
- message_end();
- set_task( 0.2, "WinnerBeam2", client );
- }
- public WinnerBeam2( client )
- {
- new RGB[ 3 ];
- RGB[ 0 ] = random( 250 );
- RGB[ 1 ] = random( 250 );
- RGB[ 2 ] = random( 250 );
- static Origin[ 3 ];
- get_user_origin( client, Origin );
- message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
- write_byte( TE_BEAMTORUS );
- write_coord( Origin[ 0 ] );
- write_coord( Origin[ 1 ] );
- write_coord( Origin[ 2 ] );
- write_coord( Origin[ 0 ] );
- write_coord( Origin[ 1 ] );
- write_coord( Origin[ 2 ] + 600 );
- write_short( Zbim );
- write_byte( 0 );
- write_byte( 1 );
- write_byte( 7 );
- write_byte( 80 );
- write_byte( 1 );
- write_byte( RGB[ 0 ] );
- write_byte( RGB[ 1 ] );
- write_byte( RGB[ 2 ] );
- write_byte( 75 );
- write_byte( 0 );
- message_end( );
- }
- /* Block */
- public BlockJointeam( client )
- return (CS_TEAM_T <= cs_get_user_team( client ) <= CS_TEAM_CT) ? PLUGIN_HANDLED : PLUGIN_CONTINUE;
- public Message_StatusIcon( iMsgId, iMsgDest, id )
- {
- static szIcon[ 8 ];
- get_msg_arg_string( 2, szIcon, charsmax( szIcon ) );
- if( equal(szIcon, "buyzone") )
- {
- if( get_msg_arg_int( 1 ) )
- {
- set_pdata_int( id, 235, get_pdata_int(id, 235) & ~(1<<0) );
- return PLUGIN_HANDLED;
- }
- }
- return PLUGIN_CONTINUE;
- }
- public BlockKill( client ) return FMRES_SUPERCEDE;
- /* Client Side */
- public client_putinserver( client )
- {
- CmdLoad( client );
- IsInfected[ client ] = false;
- new Players[ 32 ], PNum;
- get_players( Players, PNum, "ceh", "TERRORIST" );
- if ( PNum < 2 ) set_cvar_num( "sv_restart", 2 );
- }
- public client_disconnect( client )
- {
- CmdSave( client );
- if ( IsInfected[ client ] )
- GetRandomInfected( );
- FwdRemoveBeam( client );
- IsInfected[ client ] = false;
- }
- public CmdSay( client )
- {
- new szMsg[ 192 ], Arg[ 38 ], Arg2[ 38 ], Arg3[ 32 ];
- read_argv( 1, szMsg, charsmax( szMsg ) );
- parse( szMsg, Arg, charsmax( Arg ), Arg2, charsmax( Arg2 ) , Arg3, charsmax( Arg3 ) );
- if ( equal( szMsg, "/menu" ) ) return CmdMenu( client );
- if ( equal( szMsg, "/buy" ) || equal( szMsg, "/buyadmin" ) ) return CmdBuy( client );
- if ( equal( szMsg, "/shop" ) ) return CmdShop( client );
- if ( equal( szMsg, "!rr" ) )
- {
- if ( get_user_flags( client ) & ADMIN_KICK )
- hnr_game = false;
- }
- if( equal( Arg, "/stat" ) || equal( Arg, "/stats" ) )
- {
- new g_Player = cmd_target( client, Arg2, 8 );
- static szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- static szName2[ 32 ];get_user_name( g_Player, szName2, charsmax( szName2 ) );
- if ( equali( szMsg, "/stat" ) || equali( szMsg, "/stats" ) )
- {
- ColorPrint( client, "^4-----------^3%s Stats^4-----------", szName );
- ColorPrint( client, "^4[^1 Wins:^3 %d times ^4|^1 Loses:^3 %d times ^4|^1 Chosen:^3 %d times ^4|^1 Hits on You:^3 %d times ^4]", Wins[ client ], Lose[ client ], Choose[ client ], Hits[ client ] );
- ColorPrint( client, "^4[^1 Hits on Players:^3 %d times ^4|^1 Shots:^3 %d ^4|^1 Grenades Thrown:^3 %d ^4]", Hits2[ client ], Shots[ client ], Grenades[ client ] );
- return ColorPrint( client, "^4-----------^3HNR Stats %s by ^1%s^4-----------", Info[ 1 ], Info[ 2 ] );
- }
- if( !g_Player ) return ColorPrint( client, "^4%s^3 was not found!", Arg2 );
- ColorPrint( client, "^4-----------^3%s Stats^4----------", szName2 );
- ColorPrint( client, "^4[^1 Wins:^3 %d times ^4|^1 Loses:^3 %d times ^4|^1 Chosen:^3 %d times ^4|^1 Hits on You:^3 %d times ^4]", Wins[ g_Player ], Lose[ g_Player ], Choose[ g_Player ], Hits[ g_Player ] );
- ColorPrint( client, "^4[^1 Hits on Players:^3 %d times ^4|^1 Shots:^3 %d ^4|^1 Grenades Thrown:^3 %d ^4]", Hits2[ g_Player ], Shots[ g_Player ], Grenades[ g_Player ] );
- return ColorPrint( client, "^4-----------^3HNR Stats %s by ^1%s^4-----------", Info[ 1 ], Info[ 2 ] );
- }
- if( equal( Arg, "/cash" ) )
- {
- new g_Player = cmd_target( client, Arg2, 8 );
- static szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- static szName2[ 32 ];get_user_name( g_Player, szName2, charsmax( szName2 ) );
- if ( equali( szMsg, "/cash" ) ) return ColorPrint( client, "^4%s^3 have^4 %d Cash^3.", szName, Cash[ client ] );
- if( !g_Player ) return ColorPrint( client, "^4%s^3 was not found!", Arg2 );
- return ColorPrint( client, "^4%s^3 have^4 %d Cash^3.", szName2, Cash[ g_Player ] );
- }
- if ( equal( Arg, "/gamble" ) )
- {
- if ( equali( szMsg, "/gamble" ) || !is_str_num( Arg2 ) ) return ColorPrint( client, "Syntax: /^4gamble^1 <^4amount^1>" );
- new g_Amount = str_to_num( Arg2 );
- if ( g_Amount > Cash[ client ] ) return ColorPrint( client, "You don't have this amount of cash." );
- if ( g_Amount < 1 ) return ColorPrint( client, "The minimum amount to gamble on is^4 1 Cash^3." );
- if ( g_Amount > 10000 ) return ColorPrint( client, "The maxmimum amount to gamble on is^4 10000 Cash^3." );
- if ( g_Amount + Cash[ client ] > 100000 ) return ColorPrint( client, "You've reached the maximum amount of cash." );
- static szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- switch ( random_num( 1, 100 ) )
- {
- case 1..45:
- {
- ColorPrint( 0, "^4%s^1 gambled on^3 %d Cash^1 and^4 Won^1!", szName, g_Amount );
- Cash[ client ] += g_Amount;
- }
- case 46..100:
- {
- ColorPrint( 0, "^4%s^1 gambled on^3 %d Cash^1 and^4 Lost^1!", szName, g_Amount );
- Cash[ client ] -= g_Amount;
- }
- }
- CmdSave( client );
- }
- if ( equal( Arg, "/send" ) || equal( Arg, "/transfer" ) )
- {
- new g_Player = cmd_target( client, Arg2, 8 );
- if ( equali( szMsg, "/send" ) || equali( szMsg, "/transfer" ) ) return ColorPrint( client, "Syntax: /^4send^1 <^4name^1> <^4amount^1>" );
- if ( !g_Player ) return ColorPrint( client, "^4%s^3 was not found!", Arg2 );
- if ( client == g_Player ) return ColorPrint( client, "You canno't transfer cash to yourself." );
- if ( !is_str_num( Arg3 ) ) return ColorPrint( client, "You must type^4 valid^3 numbers only." );
- new g_Amount = str_to_num( Arg3 );
- if ( g_Amount < 1 ) return ColorPrint( client, "The minimum amount to transfer is^4 1 Cash^3." );
- if ( g_Amount + Cash[ g_Player ] > 100000 ) return ColorPrint( client, "If you transfer your cash to this player he will have more than the^4 Max Cash^3." );
- if ( Cash[ client ] < g_Amount ) return ColorPrint( client, "You don't have this amount of cash." );
- static szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- static szName2[ 32 ];get_user_name( g_Player, szName2, charsmax( szName2 ) );
- Cash[ client ] -= g_Amount;
- Cash[ g_Player ] += g_Amount;
- CmdSave( client );
- CmdSave( g_Player );
- return ColorPrint( client, "^4%s^1 transfered^3 %d Cash^1 to^4 %s^1.", szName, g_Amount, szName2 );
- }
- if( equal( Arg, "/exp" ) || equal( Arg, "/xp" ) )
- {
- new g_Player = cmd_target( client, Arg2, 8 );
- static szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- static szName2[ 32 ];get_user_name( g_Player, szName2, charsmax( szName2 ) );
- if ( equali( szMsg, "/exp" ) || equali( szMsg, "/xp" ) ) return ColorPrint( client, "^4%s^3 have^4 %d Exp^3.", szName, Exp[ client ] );
- if( !g_Player ) return ColorPrint( client, "^4%s^3 was not found!", Arg2 );
- return ColorPrint( client, "^4%s^3 have^4 %d Exp^3.", szName2, Exp[ g_Player ] );
- }
- if( equal( Arg, "/level" ) || equal( Arg, "/lvl" ) )
- {
- new g_Player = cmd_target( client, Arg2, 8 );
- static szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- static szName2[ 32 ];get_user_name( g_Player, szName2, charsmax( szName2 ) );
- if ( equali( szMsg, "/level" ) || equali( szMsg, "/lvl" ) ) return ColorPrint( client, "^4%s's^3 Level is^4 %d^3.", szName, Level[ client ] );
- if( !g_Player ) return ColorPrint( client, "^4%s^3 was not found!", Arg2 );
- return ColorPrint( client, "^4%s's^3 Level is^4 %d^3.", szName2, Level[ g_Player ] );
- }
- if( equal( Arg, "/next" ) )
- {
- new g_Player = cmd_target( client, Arg2, 8 );
- static szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- static szName2[ 32 ];get_user_name( g_Player, szName2, charsmax( szName2 ) );
- if ( equali( szMsg, "/next" ) ) return ColorPrint( client, "^4%s^3 is missing^4 %d Exp^3 to levelup to^4 Level %d", szName, g_Levels[ Level[ client ] ] - Exp[ client ], Level[ client ] + 1 );
- if( !g_Player ) return ColorPrint( client, "^4%s^3 was not found!", Arg2 );
- return ColorPrint( client, "^4%s^3 is missing^4 %d Exp^3 to levelup to^4 Level %d", szName2, g_Levels[ Level[ g_Player ] ] - Exp[ g_Player ], Level[ g_Player ] + 1 );
- }
- if( equal( Arg, "/setlevel" ) || equal( Arg, "/slevel" ) || equal( Arg, "/slvl" ) || equal( Arg, "/setlvl" ) )
- {
- if ( !(get_user_flags( client ) & ADMIN_IMMUNITY ) ) return ColorPrint( client, "Only^4 Owners^3 can use this command." );
- new g_Player = cmd_target( client, Arg2, 8 );
- static szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- static szName2[ 32 ];get_user_name( g_Player, szName2, charsmax( szName2 ) );
- if ( equali( szMsg, "/setlevel" ) || equali( szMsg, "/slevel" ) || equali( szMsg, "/slvl" ) || equali( szMsg, "/setlvl" ) ) return ColorPrint( client, "Syntax: /^4setlevel^1 <^4name^1> <^4amount^1>" );
- if( !g_Player ) return ColorPrint( client, "^4%s^3 was not found!", Arg2 );
- if( !is_str_num( Arg3 ) ) return ColorPrint( client, "You must type^4 valid numbers^3!" );
- new g_Amount = str_to_num( Arg3 );
- if ( g_Amount > 50 ) return ColorPrint( client, "The maximum level is^4 50^3." );
- Level[ g_Player ] = g_Amount;
- Exp[ g_Player ] = g_Levels[ Level[ g_Player ] - 1 ];
- ColorPrint( client, "You set^4 %s's^3 level to^4 %d^3.", szName2, g_Amount );
- ColorPrint( g_Player, "^1Owner:^4 %s^3 set your level to^4 %d^3.", szName, g_Amount );
- CmdSave( g_Player );
- return PLUGIN_HANDLED;
- }
- if( equal( Arg, "/setcash" ) || equal( Arg, "/scash" ) || equal( Arg, "/setc" ) )
- {
- if ( !(get_user_flags( client ) & ADMIN_IMMUNITY ) ) return ColorPrint( client, "Only^4 Owners^3 can use this command." );
- new g_Player = cmd_target( client, Arg2, 8 );
- static szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- static szName2[ 32 ];get_user_name( g_Player, szName2, charsmax( szName2 ) );
- if ( equali( szMsg, "/setcash" ) || equali( szMsg, "/scash" ) || equali( szMsg, "/setc" ) ) return ColorPrint( client, "Syntax: /^4setcash^1 <^4name^1> <^4amount^1>" );
- if( !g_Player ) return ColorPrint( client, "^4%s^3 was not found!", Arg2 );
- if( !is_str_num( Arg3 ) ) return ColorPrint( client, "You must type^4 valid numbers^3!" );
- new g_Amount = str_to_num( Arg3 );
- if ( g_Amount > 100000 ) return ColorPrint( client, "The maximum cash is^4 100000 Cash^3." );
- Cash[ client ] = g_Amount;
- ColorPrint( client, "You set^4 %s's^3 cash to^4 %d^3.", szName2, g_Amount );
- ColorPrint( g_Player, "^1Owner:^4 %s^3 set your cash to^4 %d^3.", szName, g_Amount );
- CmdSave( g_Player );
- return PLUGIN_HANDLED;
- }
- if( equal( Arg, "/addcash" ) || equal( Arg, "/acash" ) )
- {
- if ( !(get_user_flags( client ) & ADMIN_IMMUNITY ) ) return ColorPrint( client, "Only^4 Owners^3 can use this command." );
- new g_Player = cmd_target( client, Arg2, 8 );
- static szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- static szName2[ 32 ];get_user_name( g_Player, szName2, charsmax( szName2 ) );
- if ( equali( szMsg, "/addcash" ) || equali( szMsg, "/acash" ) ) return ColorPrint( client, "Syntax: /^4addcash^1 <^4name^1> <^4amount^1>" );
- if( !g_Player ) return ColorPrint( client, "^4%s^3 was not found!", Arg2 );
- if( !is_str_num( Arg3 ) ) return ColorPrint( client, "You must type^4 valid numbers^3!" );
- new g_Amount = str_to_num( Arg3 );
- if ( Cash[ client ] + g_Amount > 100000 ) return ColorPrint( client, "The maximum cash is^4 100000^3." );
- Cash[ client ] += g_Amount;
- ColorPrint( client, "You gave^4 %d Cash^3 to^4 %d^3.", g_Amount, szName2 );
- ColorPrint( g_Player, "^1Owner:^4 %s^3 gave you^4 %d Cash^3.", szName, g_Amount );
- CmdSave( g_Player );
- return PLUGIN_HANDLED;
- }
- if( equal( Arg, "/removecash" ) || equal( Arg, "/rcash" ) )
- {
- if ( !(get_user_flags( client ) & ADMIN_IMMUNITY ) ) return ColorPrint( client, "Only^4 Owners^3 can use this command." );
- new g_Player = cmd_target( client, Arg2, 8 );
- static szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- static szName2[ 32 ];get_user_name( g_Player, szName2, charsmax( szName2 ) );
- if ( equali( szMsg, "/addcash" ) || equali( szMsg, "/acash" ) ) return ColorPrint( client, "Syntax: /^4addcash^1 <^4name^1> <^4amount^1>" );
- if( !g_Player ) return ColorPrint( client, "^4%s^3 was not found!", Arg2 );
- if( !is_str_num( Arg3 ) ) return ColorPrint( client, "You must type^4 valid numbers^3!" );
- new g_Amount = str_to_num( Arg3 );
- if ( Cash[ client ] + g_Amount > 100000 ) return ColorPrint( client, "The maximum cash is^4 100000^3." );
- Cash[ client ] += g_Amount;
- if ( Cash[ client ] < 0 || Cash[ client ] > 100000 ) Cash[ client ] = 0;
- ColorPrint( client, "You removed^4 %d Cash^3 from^4 %d^3.", g_Amount, szName2 );
- ColorPrint( g_Player, "^1Owner:^4 %s^3 removed ^4 %d Cash^3 from you.", szName, g_Amount );
- CmdSave( g_Player );
- return PLUGIN_HANDLED;
- }
- if ( equal( szMsg, "/admin" ) || equal( szMsg, "/admins" ) )
- {
- new Owner[ 5 ], oCounter = 0;
- new Manager[ 16 ], mCounter = 0;
- new SuperAdmin[ 16 ], saCounter = 0;
- new Admins[ 16 ], aCounter = 0;
- new VIP[ 16 ], vCounter = 0;
- new szPlayers[ 32 ], pCounter, player;
- get_players( szPlayers, pCounter, "ch" );
- for ( new i=0 ; i < pCounter ; i++ )
- {
- player = szPlayers[ i ];
- if ( access( player, ADMIN_IMMUNITY ) )
- {
- Owner[ oCounter ] = player;
- oCounter++;
- continue;
- }
- if ( access( player, ADMIN_RESERVATION ) )
- {
- Manager[ mCounter ] = player;
- mCounter++;
- continue;
- }
- if ( access( player, ADMIN_BAN ) )
- {
- SuperAdmin[ mCounter ] = player;
- saCounter++;
- continue;
- }
- if ( access( player, ADMIN_KICK ) )
- {
- Admins[ aCounter ] = player;
- aCounter++;
- continue;
- }
- if ( access( player, ADMIN_SLAY ) )
- {
- VIP[ vCounter ] = player;
- vCounter++;
- continue;
- }
- }
- if (oCounter == 0) ColorPrint( client, "No ^3Owners^1 Online.");
- else
- {
- new szMsg[ 256 ], iPlayer;
- for (new z=0 ; z<oCounter ; z++)
- {
- iPlayer = Owner[ z ];
- add( szMsg, charsmax( szMsg ), GetName( iPlayer ) );
- if (z != oCounter-1) add( szMsg, charsmax( szMsg ), "^1,^4 ");
- }
- ColorPrint( client, "Online ^3Owners^1: ^4%s", szMsg );
- }
- if (mCounter == 0) ColorPrint( client,"No ^3Managers^1 Online.");
- else
- {
- new szMsg[ 256 ], iPlayer;
- for ( new z=0 ; z < mCounter ; z++ )
- {
- iPlayer = Manager[ z ];
- add( szMsg, charsmax( szMsg ), GetName( iPlayer ) );
- if (z != mCounter-1) add( szMsg, charsmax( szMsg ), "^1,^4 ");
- }
- ColorPrint( client, "Online ^3Managers^1: ^4%s", szMsg );
- }
- if ( saCounter == 0 ) ColorPrint( client, "No ^3Super-Admins^1 Online." );
- else
- {
- new szMsg[ 256 ], iPlayer;
- for ( new z=0 ; z < saCounter ; z++ )
- {
- iPlayer = SuperAdmin[ z ];
- add( szMsg, charsmax( szMsg ), GetName( iPlayer ) );
- if (z != saCounter-1) add( szMsg, charsmax( szMsg ), "^1,^4 " );
- }
- ColorPrint( client, "Online ^3Super-Admins^1: ^4%s", szMsg );
- }
- if ( aCounter == 0 ) ColorPrint( client, "No ^3Admins^1 Online." );
- else
- {
- new szMsg[ 256 ], iPlayer;
- for ( new z=0 ; z < aCounter ; z++ )
- {
- iPlayer = Admins[ z ];
- add( szMsg, charsmax( szMsg ), GetName( iPlayer ) );
- if (z != aCounter-1) add( szMsg, charsmax( szMsg ), "^1,^4 " );
- }
- ColorPrint( client, "Online ^3Admins^1: ^4%s", szMsg );
- }
- if (vCounter == 0) ColorPrint( client, "No ^3VIPs^1 Online." );
- else
- {
- new szMsg[ 256 ], iPlayer;
- for (new z = 0 ; z < vCounter ; z++ )
- {
- iPlayer = VIP[ z ];
- add( szMsg, charsmax( szMsg ), GetName( iPlayer ) );
- if (z != vCounter-1) add( szMsg, charsmax( szMsg ), "^1,^4 ");
- }
- ColorPrint( client, "Online ^3VIPs^1: ^4%s", szMsg );
- }
- return PLUGIN_HANDLED;
- }
- return PLUGIN_CONTINUE;
- }
- /* Shop */
- public CmdShop( client )
- {
- new szItem[ 128 ];
- formatex( szItem, charsmax( szItem ), "HNR Shop Menu \d%s\y by\r %s^n\yYou have\r %d\y cash", Info[ 1 ], Info[ 2 ], Cash[ client ] );
- new Menu = menu_create( szItem, "SubShop" );
- menu_additem( Menu, "\rGrenades \yShop", "0" );
- menu_additem( Menu, "\rWeapons \yShop", "1" );
- menu_additem( Menu, "\rAmmo \yShop", "2" );
- menu_additem( Menu, "\rPowers \yShop", "3" );
- return menu_display( client, Menu );
- }
- public SubShop( client, Menu, Item )
- {
- if ( Item == MENU_EXIT || Event ) return menu_destroy( Menu );
- new szItem[ 128 ];
- switch ( Item )
- {
- case 0:
- {
- formatex( szItem, charsmax( szItem ), "HNR Grenades Shop \d%s\y by\r %s^n\yYou have\r %d\y cash", Info[ 1 ], Info[ 2 ], Cash[ client ] );
- new Menu = menu_create( szItem, "SubGrenades" );
- menu_additem( Menu, "\yExplosive\r [\w 1000\d Cash \r]\d Level 6 Needed", "0" );
- menu_additem( Menu, "\yFlashbang\r [\w 600\d Cash \r]\d Level 3 Needed", "1" );
- menu_additem( Menu, "\yFrostnade\r [\w 750\d Cash \r]\d Level 4 Needed", "2" );
- return menu_display( client, Menu );
- }
- case 1:
- {
- formatex( szItem, charsmax( szItem ), "HNR Weapons Shop \d%s\y by\r %s^n\yYou have\r %d\y cash", Info[ 1 ], Info[ 2 ], Cash[ client ] );
- new Menu = menu_create( szItem, "SubWeapons" );
- menu_additem( Menu, "\yM4A1\r [\w 3500\d Cash \r]\d Level 15 Needed", "0" );
- menu_additem( Menu, "\yAk47\r [\w 3500\d Cash \r]\d Level 15 Needed", "1" );
- menu_additem( Menu, "\yGalil\r [\w 3200\d Cash \r]\d Level 13 Needed", "2" );
- menu_additem( Menu, "\yFamas\r [\w 3000\d Cash \r]\d Level 12 Needed", "3" );
- menu_additem( Menu, "\yMp5\r [\w 2350\d Cash \r]\d Level 11 Needed", "4" );
- return menu_display( client, Menu );
- }
- case 2:
- {
- formatex( szItem, charsmax( szItem ), "HNR Ammo Shop \d%s\y by\r %s^n\yYou have\r %d\y cash", Info[ 1 ], Info[ 2 ], Cash[ client ] );
- new Menu = menu_create( szItem, "SubAmmo" );
- menu_additem( Menu, "\y+10 Extra Bullets\r [\w 300\d Cash \r]", "0" );
- menu_additem( Menu, "\y+20 Extra Bullets\r [\w 600\d Cash \r]", "1" );
- menu_additem( Menu, "\y+30 Extra Bullets\r [\w 900\d Cash \r]", "2" );
- return menu_display( client, Menu );
- }
- case 3:
- {
- formatex( szItem, charsmax( szItem ), "HNR Powers Shop \d%s\y by\r %s^n\yYou have\r %d\y cash", Info[ 1 ], Info[ 2 ], Cash[ client ] );
- new Menu = menu_create( szItem, "SubPowers" );
- menu_additem( Menu, "\yAnti-Flash\r [\w 1500\d Cash \r]\d Level 8 Needed", "0" );
- menu_additem( Menu, "\yAnti-Frost\r [\w 2250\d Cash \r]\d Level 12 Needed", "1" );
- return menu_display( client, Menu );
- }
- }
- return menu_destroy( Menu );
- }
- public SubGrenades( client, Menu, Item )
- {
- if ( Item == MENU_EXIT || Event ) return menu_destroy( Menu );
- if ( !is_user_alive( client ) ) return ColorPrint( client, "You need to be^4 Alive^3 to purchase this." );
- if ( Cash[ client ] < g_GrenadesCost[ Item ] ) return ColorPrint( client, "Your missing^4 %d^3 cash to purchase this.", g_GrenadesCost[ Item ] - Cash[ client ] );
- if ( Level[ client ] < g_GrenadesLvls[ Item ] ) return ColorPrint( client, "You need to be^4 Level %d^3 to purchase this.", g_GrenadesLvls[ Item ] );
- fm_give_item( client, g_GrenadesClass[ Item ] );
- Cash[ client ] -= g_GrenadesCost[ Item ];
- return menu_destroy( Menu );
- }
- public SubWeapons( client, Menu, Item )
- {
- if ( Item == MENU_EXIT || Event ) return menu_destroy( Menu );
- if ( !is_user_alive( client ) ) return ColorPrint( client, "You need to be^4 Alive^1 to purchase this." );
- if ( Cash[ client ] < g_WeaponsCost[ Item ] ) return ColorPrint( client, "Your missing^4 %d^3 cash to purchase this.", g_WeaponsCost[ Item ] - Cash[ client ] );
- if ( Level[ client ] < g_WeaponsLvls[ Item ] ) return ColorPrint( client, "You need to be^4 Level %d^3 to purchase this.", g_WeaponsLvls[ Item ] );
- if ( user_has_weapon( client, g_WeaponsCSW[ Item ] ) ) return ColorPrint( client, "You already own this item." );
- fm_give_item( client, g_WeaponsClass[ Item ] );
- Cash[ client ] -= g_WeaponsCost[ Item ];
- return menu_destroy( Menu );
- }
- public SubAmmo( client, Menu, Item )
- {
- if ( Item == MENU_EXIT || Event ) return menu_destroy( Menu );
- if ( !is_user_alive( client ) ) return ColorPrint( client, "You need to be^4 Alive^1 to purchase this." );
- if ( Cash[ client ] < g_AmmoCost[ Item ] ) return ColorPrint( client, "Your missing^4 %d^3 cash to purchase this.", g_AmmoCost[ Item ] - Cash[ client ] );
- new Clip, Ammo, Weapon = get_user_weapon( client, Clip, Ammo );
- if ( Weapon == CSW_KNIFE || Weapon == CSW_C4 ) return ColorPrint( client, "You canno't purchase ammo for this weapon." );
- cs_set_user_bpammo( client, Weapon, cs_get_user_bpammo( client, Weapon ) + g_AmmoAmount[ Item ] );
- Cash[ client ] -= g_AmmoCost[ Item ];
- return menu_destroy( Menu );
- }
- public SubPowers( client, Menu, Item )
- {
- if ( Item == MENU_EXIT || Event ) return menu_destroy( Menu );
- if ( !is_user_alive( client ) ) return ColorPrint( client, "You need to be^4 Alive^1 to purchase this." );
- if ( Cash[ client ] < g_PowersCost[ Item ] ) return ColorPrint( client, "Your missing^4 %d^3 cash to purchase this.", g_PowersCost[ Item ] - Cash[ client ] );
- if ( Level[ client ] < g_PowersLvls[ Item ] ) return ColorPrint( client, "You need to be^4 Level %d^3 to purchase this.", g_PowersLvls[ Item ] );
- switch ( Item )
- {
- case 0:
- {
- if ( AntiFlash[ client ] ) return ColorPrint( client, "You already own this power." );
- AntiFlash[ client ] = true;
- }
- case 1:
- {
- if ( AntiFrost[ client ] ) return ColorPrint( client, "You already own this power" );
- AntiFrost[ client ] = true;
- }
- }
- Cash[ client ] -= g_PowersCost[ Item ];
- return menu_destroy( Menu );
- }
- /* Levels */
- public CmdLevelUp( client )
- {
- new iOrigin[ 3 ];get_user_origin( client, iOrigin );
- message_begin(MSG_PVS, SVC_TEMPENTITY, iOrigin)
- write_byte(TE_EXPLOSION2) // TE_
- write_coord( iOrigin[0] ) // X
- write_coord( iOrigin[1] ) // Y
- write_coord( iOrigin[2] ) // Z
- write_byte(188) // start color
- write_byte(10) // num colors
- message_end()
- }
- public CmdCheckLevel( client )
- {
- while ( Exp[ client ] >= g_Levels[ Level[ client ] ] )
- {
- Level[ client ] += 1;
- static szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- ColorPrint( client, "^4%s^3 just leveled up to^4 Level %d^3.", szName, Level[ client ] );
- CmdFlashScreen( client );
- CmdSave( client );
- CmdLevelUp( client );
- break;
- }
- }
- public CmdFlashScreen( client )
- {
- message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, client);
- write_short(1<<10);
- write_short(1<<10);
- write_short(0);
- write_byte(0);
- write_byte(255);
- write_byte(215);
- write_byte(100);
- message_end( );
- }
- public CmdSave( client )
- {
- static szAuthid[ 35 ];get_user_authid( client, szAuthid, charsmax( szAuthid ) );
- static szAddress[ 35 ];get_user_ip( client, szAddress, charsmax( szAddress ) );
- new VaultKey[ 64 ], VaultData[ 256 ];
- if ( equali( "STEAM_ID_LAN", szAuthid ) )
- formatex( VaultKey, charsmax( VaultKey ), "%s-HNRLevels", szAddress );
- else formatex( VaultKey, charsmax( VaultKey ), "%s-HNRLevels", szAuthid );
- formatex( VaultData, charsmax( VaultData ), "%d#%d#%d#%d#%d#%d#%d#%d#%d#%d#%d#",
- Exp[ client ], Level[ client ], Cash[ client ],Wins[ client ], Lose[ client ],
- Shots[ client ], Hits[ client ], Hits2[ client ], Choose[ client ], Grenades[ client ], g_Scout[ client ] );
- nvault_set( g_Vault, VaultKey, VaultData );
- }
- public CmdLoad( client )
- {
- static szAuthid[ 35 ];get_user_authid( client, szAuthid, charsmax( szAuthid ) );
- static szAddress[ 35 ];get_user_ip( client, szAddress, charsmax( szAddress ) );
- new VaultKey[ 64 ], VaultData[ 256 ];
- if ( equali( "STEAM_ID_LAN", szAuthid ) )
- formatex( VaultKey, charsmax( VaultKey ), "%s-HNRLevels", szAddress );
- else formatex( VaultKey, charsmax( VaultKey ), "%s-HNRLevels", szAuthid );
- formatex( VaultData, charsmax( VaultData ), "%d#%d#%d#%d#%d#%d#%d#%d#%d#%d#%d#",
- Exp[ client ], Level[ client ], Cash[ client ],Wins[ client ], Lose[ client ],
- Shots[ client ], Hits[ client ], Hits2[ client ], Choose[ client ], Grenades[ client ], g_Scout[ client ] );
- nvault_get( g_Vault, VaultKey, VaultData, charsmax( VaultData ) );
- replace_all( VaultData, charsmax( VaultData ), "#", " ");
- new SetExp[ 32 ], SetLevel[ 32 ], SetCash[ 32 ], SetWins[ 32 ], SetLose[ 32 ], SetShots[ 32 ],
- SetHits[ 32 ], SetHits2[ 32 ], SetChoose[ 32 ], SetGrenades[ 32 ];
- parse( VaultData, SetExp, 31, SetLevel, 31, SetCash, 31, SetWins, 31, SetLose, 31, SetShots, 31,
- SetHits, 31, SetHits2, 31, SetChoose, 31, SetGrenades, 31 );
- Exp[ client ] = str_to_num( SetExp );
- Level[ client ] = str_to_num( SetLevel );
- Cash[ client ] = str_to_num( SetCash );
- Wins[ client ] = str_to_num( SetWins );
- Lose[ client ] = str_to_num( SetLose );
- Shots[ client ] = str_to_num( SetShots );
- Hits[ client ] = str_to_num( SetHits );
- Hits2[ client ] = str_to_num( SetHits2 );
- Choose[ client ] = str_to_num( SetChoose );
- Grenades[ client ] = str_to_num( SetGrenades );
- }
- /* Main Menu */
- public CmdMenu( client )
- {
- new szItem[ 128 ];
- formatex( szItem, charsmax( szItem ), "HNR Main Menu \d%s\y by\r %s", Info[ 1 ], Info[ 2 ] );
- new Menu = menu_create( szItem, "SubMenu" );
- formatex( szItem, charsmax( szItem ), "\ySounds\w:\r %s", g_Sounds[ client ]?"Disabled":"Enabled" );
- menu_additem( Menu, szItem, "0" );
- formatex( szItem, charsmax( szItem ), "\yLaser Shot\w:\r %s", g_Laser[ client ]?"Disabled":"Enabled" );
- menu_additem( Menu, szItem, "1" );
- formatex( szItem, charsmax( szItem ), "\yBeacon\w:\r %s^n", g_Beacon[ client ]?"Disabled":"Enabled" );
- menu_additem( Menu, szItem, "2" );
- menu_additem( Menu, "\rPlayers \dMenus^n", "3" );
- menu_additem( Menu, "\yOpen\r Shop", "4" );
- return menu_display( client, Menu );
- }
- public SubMenu( client, Menu, Item )
- {
- if ( Item == MENU_EXIT ) return menu_destroy( Menu );
- switch ( Item )
- {
- case 0: g_Sounds[ client ] = !g_Sounds[ client ];
- case 1: g_Laser[ client ] = !g_Laser[ client ];
- case 2: g_Beacon[ client ] = !g_Beacon[ client ];
- case 3: return CmdPlayers( client );
- case 4: return CmdShop( client );
- }
- CmdMenu( client );
- return menu_destroy( Menu );
- }
- public CmdPlayers( client )
- {
- new szItem[ 128 ];
- formatex( szItem, charsmax( szItem ), "HNR Players Menu\d %s\y by\r %s", Info[ 1 ], Info[ 2 ] );
- new Menu = menu_create( szItem, "SubPlayers" );
- new Players[ 32 ], PNum, szTempid[ 32 ];
- get_players( Players, PNum, "ch" );
- for ( new i; i<PNum; i++ )
- {
- new iPlayer = Players[ i ];
- new szName[ 32 ];get_user_name( iPlayer, szName, charsmax( szName ) );
- num_to_str( iPlayer, szTempid, charsmax( szTempid ) );
- formatex( szItem, charsmax( szItem ), "\y%s\r [\w Lvl %d \d|\w %d Exp \d|\w %d Cash \r]", szName, Level[ iPlayer ], Exp[ iPlayer ], Cash[ iPlayer ] );
- menu_additem( Menu, szItem, szTempid );
- }
- return menu_display( client, Menu );
- }
- public SubPlayers( client, Menu, Item )
- {
- if ( Item == MENU_EXIT ) return menu_destroy( Menu );
- CmdPlayers( client );
- return menu_destroy( Menu );
- }
- /* Buy Menu */
- new gMonth[ 33 ], gAccess[ 33 ];
- new const g_Access[ ][ ] =
- {
- "VIP", "Admin", "Super-Admin", "Manager"
- };
- new const g_Cost[ ] =
- {
- 20, 40, 50, 60
- };
- public CmdBuy( client )
- {
- new szItem[ 128 ];
- formatex( szItem, charsmax( szItem ), "HNR Players Menu\d %s\y by\r %s", Info[ 1 ], Info[ 2 ] );
- new Menu = menu_create( szItem, "SubBuy" );
- formatex( szItem, charsmax( szItem ), "I want to buy\r %s Access", g_Access[ gAccess[ client ] ] );
- menu_additem( Menu, szItem, "0" );
- formatex( szItem, charsmax( szItem ), "I want the\r %s Access\w for\r %d Months", g_Access[ gAccess[ client ] ], gMonth[ client ] );
- menu_additem( Menu, szItem, "1" );
- formatex( szItem, charsmax( szItem ), "It will cost\r %d Shekels^n^n\yContact Skype:\r Yan1255", g_Cost[ gAccess[ client ] ] * gMonth[ client ] );
- menu_additem( Menu, szItem, "2" );
- return menu_display( client, Menu );
- }
- public SubBuy( client, Menu, Item )
- {
- if ( Item == MENU_EXIT ) return menu_destroy( Menu );
- switch ( Item )
- {
- case 0:
- {
- if ( gAccess[ client ] == 3 )
- {
- gAccess[ client ] = 0;
- return CmdBuy( client );
- }
- gAccess[ client ] += 1;
- }
- case 1:
- {
- if ( gMonth[ client ] == 12 )
- {
- gMonth[ client ] = 0;
- return CmdBuy( client );
- }
- gMonth[ client ] += 1;
- }
- }
- CmdBuy( client );
- return menu_destroy( Menu );
- }
- /* Messages */
- public MsgAudio( )
- {
- new szString[ 32 ];
- get_msg_arg_string( 2, szString, charsmax( szString ) )
- if ( equali( szString, "%!MRAD_FIREINHOLE" ) )
- return PLUGIN_HANDLED;
- return PLUGIN_CONTINUE;
- }
- public MsgText()
- {
- new szString[ 32 ];
- if ( str_to_num( szString ) > 0 )
- {
- get_msg_arg_string( 3, szString, charsmax( szString ) );
- if ( equali( szString, "#Game_radio" ) )
- {
- get_msg_arg_string( 5, szString, charsmax( szString ) );
- if ( equali( szString, "#Fire_in_the_hole" ) )
- return PLUGIN_HANDLED;
- }
- }
- return PLUGIN_CONTINUE;
- }
- /* Laser Shot */
- new const g_GunsEvents[ ][ ] = { "events/scout.sc" };
- public fwPrecache( type, const name[ ] )
- {
- for ( new i = 0; i < sizeof g_GunsEvents; ++i )
- {
- if ( equal( g_GunsEvents[ i ], name ) )
- {
- g_GunsEvents_Bitsum |= ( 1<<get_orig_retval( ) );
- return FMRES_HANDLED;
- }
- }
- return FMRES_IGNORED;
- }
- public fwShot( flags, shooter, eventid )
- {
- Shots[ shooter ] += 1;
- if ( !( g_GunsEvents_Bitsum & ( 1<<eventid ) ) || !(1 <= shooter <= gMaxPlayers ) || g_Laser[ shooter ] )
- return FMRES_IGNORED;
- new iOrigin[ 3 ], bOrigin[ 3 ];
- get_user_origin( shooter , iOrigin, 1 );
- get_user_origin( shooter , bOrigin, 3 );
- Laser( iOrigin, bOrigin );
- return FMRES_HANDLED;
- }
- /* FrostNade */
- public Fwd_SetModel_Pre( iEnt, const Model[] )
- {
- new iOwner = pev( iEnt, pev_owner );
- if( !pev_valid( iEnt ) || !equal( Model, "models/w_smokegrenade.mdl" ) || !is_user_connected( iOwner ) )
- return;
- set_pev( iEnt, pev_nextthink, get_gametime( ) + 5.0 );
- set_task( 1.5, "fnExplodeNade", TASK_EXPLODE( iEnt ) );
- }
- public fnExplodeNade( Task_ID )
- {
- new iEnt = UNTASK_EXPLODE( Task_ID );
- if( !pev_valid( iEnt ) )
- return;
- new iOwner = pev( iEnt, pev_owner ), Float: g_flOrigin[ 3 ], g_iOrigin[ 3 ], Float: g_flPlayerOrigin[ 3 ];
- pev( iEnt, pev_origin, g_flOrigin );
- g_iOrigin[ 0 ] = floatround( g_flOrigin[ 0 ] );
- g_iOrigin[ 1 ] = floatround( g_flOrigin[ 1 ] );
- g_iOrigin[ 2 ] = floatround( g_flOrigin[ 2 ] );
- CmdExplodeBeacon( g_iOrigin )
- engfunc( EngFunc_EmitSound, iEnt, CHAN_WEAPON, szFrostSoundsPath[ Explode ], 1.0, ATTN_NORM, 0, PITCH_NORM );
- for( new i = 1 ; i < get_maxplayers( ) ; i ++ )
- {
- if( !is_user_connected( i ) || !is_user_alive( i ) || i == iOwner || g_bFreezed[ i ] || AntiFrost[ i ] )
- continue;
- pev( i, pev_origin, g_flPlayerOrigin );
- if( get_distance_f( g_flPlayerOrigin, g_flOrigin ) > 240.0 )
- continue;
- g_bFreezed[ i ] = true;
- set_task( 2.5, "Fwd_Unfreeze", TASK_UNFREEZE( i ) );
- new Float: g_flGlowColor[ 3 ];
- g_flGlowColor[ 0 ] = 0.0;
- g_flGlowColor[ 1 ] = 80.0;
- g_flGlowColor[ 2 ] = 200.0;
- set_pev( i, pev_renderfx, kRenderFxGlowShell );
- set_pev( i, pev_rendercolor, g_flGlowColor );
- set_pev( i, pev_rendermode, kRenderNormal );
- set_pev( i, pev_renderamt, 80.0 );
- set_pev( i, pev_flags, pev( i, pev_flags ) | FL_FROZEN );
- engfunc( EngFunc_EmitSound, i, CHAN_WEAPON, szFrostSoundsPath[ Hit ], 1.0, ATTN_NORM, 0, PITCH_NORM)
- message_begin( MSG_ONE, get_user_msgid("ScreenFade"), _, i);
- write_short( ~0 );
- write_short( ~0 );
- write_short( 0x0004 );
- write_byte( 0 );
- write_byte( 255 );
- write_byte( 255 );
- write_byte( 100 );
- message_end( );
- set_pev( i, pev_flags, pev( i, pev_flags ) | FL_FROZEN );
- }
- engfunc( EngFunc_RemoveEntity , iEnt )
- }
- public Fwd_Unfreeze( Task_ID )
- {
- new client = UNTASK_UNFREEZE( Task_ID );
- new Float: g_flGlowColor[ 3 ];
- g_flGlowColor[ 0 ] = 250.0;
- g_flGlowColor[ 1 ] = 250.0;
- g_flGlowColor[ 2 ] = 250.0;
- if ( Invis && IsInfected[ client ] )
- fm_set_user_rendering( client, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0 );
- else {
- set_pev( client, pev_renderfx, kRenderFxNone );
- set_pev( client, pev_rendercolor, g_flGlowColor );
- set_pev( client, pev_rendermode, kRenderNormal );
- set_pev( client, pev_renderamt, 16.0 );
- }
- message_begin( MSG_ONE, get_user_msgid("ScreenFade"), _, client);
- write_short( 0 );
- write_short( 0 );
- write_short( 0 );
- write_byte( 0 );
- write_byte( 0 );
- write_byte( 0 );
- write_byte( 0 );
- message_end( );
- g_bFreezed[ client ] = false;
- set_pev( client, pev_flags, pev( client, pev_flags ) & ~FL_FROZEN );
- engfunc( EngFunc_EmitSound, client, CHAN_WEAPON, szFrostSoundsPath[ Unfreeze ], 1.0, ATTN_NORM, 0, PITCH_NORM)
- }
- public CmdExplodeBeacon( const g_iOrigin[3] )
- {
- message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
- write_byte( TE_BEAMCYLINDER );
- write_coord( g_iOrigin[0] );
- write_coord( g_iOrigin[1] );
- write_coord( g_iOrigin[2] );
- write_coord( g_iOrigin[0] );
- write_coord( g_iOrigin[1] );
- write_coord( g_iOrigin[2] + 360);
- write_short( g_iBeaconSprite );
- write_byte( 0 );
- write_byte( 0 );
- write_byte( 8 );
- write_byte( 60 );
- write_byte( 0 );
- write_byte( 0 );
- write_byte( 255 );
- write_byte( 255 );
- write_byte( 200 );
- write_byte( 3 );
- message_end();
- }
- /* Events */
- public evNR( )
- {
- g_Random = random_num( 3, 4 );
- g_Num = g_Random;
- Voting = 0;
- vCount = 15;
- Votes[ 0 ] = Votes[ 1 ] = Votes[ 2 ] = Votes[ 3 ] = 0;
- g_Vote = true;
- CmdVote( );
- set_task( 1.0, "CmdVote", 115, _,_, "a", 15 );
- return PLUGIN_HANDLED;
- }
- public CmdVote( )
- {
- if ( !g_Vote ) return PLUGIN_HANDLED;
- new szItem[ 128 ];
- formatex( szItem, charsmax( szItem ), "HNR Vote Menu\d %s\y by\r %s^n\yVote for the event you want for\r Next Round\y!", Info[ 1 ], Info[ 2 ] );
- VoteMenu = menu_create( szItem, "SubVote" );
- if ( Voting == 0 )
- {
- menu_additem( VoteMenu, "Knife Only - \r[\d 0% \r]\w - \r[\d 0 Votes \r]", "0" );
- menu_additem( VoteMenu, "Pistols Only - \r[\d 0% \r]\w - \r[\d 0 Votes \r]", "1" );
- menu_additem( VoteMenu, "No Zoom - \r[\d 0% \r]\w - \r[\d 0 Votes \r]", "2" );
- formatex( szItem, charsmax( szItem ), "%s - \r[\d 0% \r]\w - \r[\d 0 Votes \r]\w -^n^n\r%d\w Seconds Left to vote!", g_EventsNames[ g_Num ], vCount );
- menu_additem( VoteMenu, szItem, "3" );
- }
- else
- {
- formatex( szItem, charsmax( szItem ), "Knife Only - \r[\d %d%% \r]\w - \r[\d %d Votes \r]", Votes[ 0 ] * 100 / Voting, Votes[ 0 ] );
- menu_additem( VoteMenu, szItem, "0" );
- formatex( szItem, charsmax( szItem ), "Pistols Only - \r[\d %d%% \r]\w - \r[\d %d Votes \r]", Votes[ 1 ] * 100 / Voting, Votes[ 1 ] );
- menu_additem( VoteMenu, szItem, "1" );
- formatex( szItem, charsmax( szItem ), "No Zoom - \r[\d %d%% \r]\w - \r[\d %d Votes \r]", Votes[ 2 ] * 100 / Voting, Votes[ 2 ] );
- menu_additem( VoteMenu, szItem, "2" );
- formatex( szItem, charsmax( szItem ), "%s - \r[\d %d%% \r]\w - \r[\d %d Votes \r]\w -^n^n\r%d\w Seconds Left to vote!", g_EventsNames[ g_Num ], Votes[ 3 ] * 100 / Voting, Votes[ 3 ], vCount );
- menu_additem( VoteMenu, szItem, "3" );
- }
- vCount -= 1;
- new Players[ 32 ], PNum;
- get_players( Players, PNum, "ch" );
- for ( new i; i<PNum; i++ )
- {
- new iPlayer = Players[ i ];
- CloseMenu( iPlayer );
- if ( vCount <= 0 )
- {
- CmdEndVote( );
- Voted[ iPlayer ] = false;
- return PLUGIN_HANDLED;
- }
- menu_setprop( VoteMenu, MPROP_EXIT, MEXIT_NEVER );
- menu_display( iPlayer, VoteMenu );
- }
- return PLUGIN_HANDLED;
- }
- public SubVote( client, Menu, Item )
- {
- if ( Voted[ client ] || !g_Vote ) return PLUGIN_HANDLED;
- Votes[ Item ] += 1;
- Voted[ client ] = true;
- Voting += 1;
- static szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- switch ( Item )
- {
- case 3: return ColorPrint( 0, "^4%s^1 voted for^3 %s^1!", g_EventsNames[ g_Num ] );
- default: return ColorPrint( 0, "^4%s^1 voted for^3 %s^1!", g_EventsNames[ Item ] );
- }
- return PLUGIN_HANDLED;
- }
- public CloseMenu( client ) show_menu( client, 0, "^n", 1 );
- public CmdEndVote( )
- {
- if ( !g_Vote ) return PLUGIN_HANDLED;
- if ( Votes[ 0 ] > Votes[ 1 ] || Votes[ 0 ] > Votes[ 2 ] || Votes[ 0 ] > Votes[ 3 ] )
- {
- NR = 1;
- ColorPrint( 0, "^4Knife Only^1 will be the^3 Next Round^4 Event^1!" );
- }
- else if ( Votes[ 1 ] > Votes[ 0 ] || Votes[ 1 ] > Votes[ 2 ] || Votes[ 1 ] > Votes[ 3 ] )
- {
- NR = 2;
- ColorPrint( 0, "^4Pistols Only^1 will be the^3 Next Round^4 Event^1!" );
- }
- else if ( Votes[ 2 ] > Votes[ 0 ] || Votes[ 2 ] > Votes[ 1 ] || Votes[ 2 ] > Votes[ 3 ] )
- {
- NR = 3;
- ColorPrint( 0, "^4No Zoomy^1 will be the^3 Next Round^4 Event^1!" );
- }
- else if ( Votes[ 3 ] > Votes[ 0 ] || Votes[ 3 ] > Votes[ 1 ] || Votes[ 3 ] > Votes[ 2 ] )
- {
- NR = g_Num;
- ColorPrint( 0, "^4%s^1 will be the^3 Next Round^4 Event^1!", g_EventsNames[ g_Num ] );
- }
- else
- {
- evNR( );
- ColorPrint( 0, "The votes are tied!^4 Revote^3 Starting^1!" );
- }
- return PLUGIN_HANDLED;
- }
- /* Stocks */
- stock ColorPrint( const client, const string[], any:... )
- {
- new msg[ 191 ], players[ 32 ], count = 1;
- static len; len = formatex( msg, charsmax( msg ), "^3[^4 HitAndRun ^3] " );
- vformat( msg[ len ], charsmax( msg ) - len, string, 3 );
- if( client ) players[ 0 ] = client;
- else get_players( players,count,"ch" );
- for ( new i = 0; i < count; i++ )
- {
- if( is_user_connected( players[ i ] ) )
- {
- message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] );
- write_byte( players[ i ] );
- write_string( msg );
- message_end( );
- }
- }
- return PLUGIN_HANDLED;
- }
- stock Laser( iOrigin[3] , bOrigin[3] )
- {
- message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
- write_byte(0);
- write_coord(iOrigin[0]); // X
- write_coord(iOrigin[1]); // Y
- write_coord(iOrigin[2]); // Z
- write_coord(bOrigin[0]); // X Axis
- write_coord(bOrigin[1]); // Y Axis
- write_coord(bOrigin[2]); // Z Axis
- switch ( random_num( 1, 3) ) // Sprite
- {
- case 1: write_short( Shockwave );
- case 2: write_short( Laserbeam );
- case 3: write_short( Lightning );
- case 4: write_short( White );
- }
- write_byte(1); // STart Frame
- write_byte(5); // Frame Rate
- write_byte(7); // Life
- write_byte(30); // Width
- write_byte(10); // Noise
- write_byte ( random_num( 0, 255 ) ); // Red
- write_byte ( random_num( 0, 255 ) ); // Green
- write_byte ( random_num( 0, 255 ) ); // Blue
- write_byte(255); // Alpha
- write_byte(0); // Speed
- message_end();
- }
- stock ShakeScreen( client )
- {
- message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenShake" ), _, client );
- write_short( 10 << 12 );
- write_short( 5 << 12 );
- write_short( 10 << 12 );
- message_end( );
- }
- stock GetName( const client )
- {
- static Name[ 128 ];
- get_user_name( client, Name, charsmax( Name ) );
- return Name;
- }
Advertisement
Add Comment
Please, Sign In to add comment