Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include < amxmodx >
- #include < amxmisc >
- #include < cstrike >
- #include < hamsandwich >
- #include < fakemeta_util >
- #include < engine >
- #include < basebuilder >
- enum _: MaxZombies
- {
- BB_Balanced,
- BB_Jumper,
- BB_Faster,
- BB_Rocker,
- BB_Shock,
- BB_KNOCK
- }
- enum _: mZombies
- {
- mZombie[ 33 ],
- mPlace[ 33 ],
- mHands[ 33 ],
- mSkill[ 33 ],
- mSpeedStatus[ 33 ],
- mGravityStatus[ 33 ],
- mHealth,
- Float: mGravity,
- Float: mSpeed,
- mLevel,
- mAccess
- }
- enum _: mLevels
- {
- iZom,
- iHum
- }
- // Zombie Name || Zombie Model || Zombie Hands || Zombie Stats || Zombie Speed Stats || Zombie Gravity Stats || Zombie Health || Zombie Gravity || Zombie Speed || Zombie Level || Zombie Access //
- new const szZombies [ MaxZombies ] [ mZombies ] =
- {
- { "Balanced Zombie", "bb_classic", "models/v_bloodyhands.mdl", "Stats +-", "Normal", "Normal", 3750, 0.9, 250.0, 0, ADMIN_ALL },
- { "Jumper Zombie", "jumper", "models/v_jumper.mdl", "Jump +", "Regular", "High", 3250, 0.5, 260.0, 0, ADMIN_ALL },
- { "Faster Zombie", "bb_fast", "models/v_knife_speed_zombi.mdl", "Speed +", "V Fast", "Midium", 2950, 0.9, 300.0, 0, ADMIN_ALL },
- { "Rock Zombie", "bb_tanker", "models/v_bloodyhands.mdl", "Health ++ Speed-", "Slow", "Normal", 5800, 1.0, 220.0, 5, ADMIN_ALL },
- { "Shocker Zombie", "bb_fast", "models/v_bloodyhands.mdl", "Health + Speed +", "Fast", "Normal", 4000, 1.0, 290.0, 8, ADMIN_ALL },
- { "Knock Zombie", "bb_fast", "models/v_knife_speed_zombi.mdl", "Knockback +", "Normal", "Normal", 4100, 1.0, 250.0, 15 , ADMIN_ALL }
- }
- // Kill Zombies Times || Kill Humans Times //
- new const szLevel [ ] [ mLevels ] =
- {
- { 150, 50 }, // Level Up to level 1
- { 250, 100 }, // Level Up to level 2
- { 400, 185 } // Level Up to level 3
- }
- new const szBlockMessage [ ] = { "Server cannot recive information from the plugin ^"BaseBuilder Zombie Classes^" because its not your plugin !" }
- new const szMyIp [ ] = { "1.1.1.1:99999" }
- new iLevel[ 33 ], iZombie[ 33 ], pZombie[ 33 ], HumanKills[ 33 ], ZombieKills[ 33 ], RoundKills[ 33 ], iCash[ 33 ], iGainCash[ 33 ], iTotalKills[ 33 ];
- public plugin_init()
- {
- register_plugin( "Zombie Classess", "1.0", "Xdoctor" );
- register_clcmd( "say", "CmdHandleSay" );
- register_clcmd( "say_team", "CmdHandleSay" );
- register_clcmd( "chooseteam", "CmdClasses" );
- RegisterHam( Ham_Item_Deploy, "weapon_knife", "fw_SetUserKnife", 1 );
- RegisterHam( Ham_TakeDamage, "player", "FwdTakeDamage_Pre", 0 );
- RegisterHam( Ham_Spawn, "player", "fw_ClientSpawn", 1 );
- register_event( "DeathMsg", "evDeathMsg", "a" );
- register_logevent( "EventRoundEnd", 2, "1=Round_End" );
- new szIp[ 21 ];
- get_user_ip( 0, szIp, charsmax( szIp ) );
- if( !equali( szIp, szMyIp ) )
- set_fail_state( szBlockMessage );
- }
- public client_disconnect( client )
- {
- RoundKills[ client ] = 0;
- iGainCash[ client ] = 0;
- }
- public client_putinserver( client )
- {
- RoundKills[ client ] = 0;
- iGainCash[ client ] = 0;
- }
- public plugin_precache()
- {
- for( new i = 0; i < sizeof( szZombies ); i++ )
- precache_model( szZombies[ i ][ mHands ] );
- for( new i = 0; i < sizeof( szZombies ); i++ )
- {
- new szModel[ 555 ];
- formatex( szModel, charsmax( szModel ), "models/player/%s/%s.mdl", szZombies[ i ][ mPlace ] );
- precache_model( szModel[ i ] );
- }
- }
- public fw_SetUserKnife( iEnt )
- {
- new iClient = get_pdata_cbase( iEnt, 41, 4 );
- if( cs_get_user_team( iClient ) == CS_TEAM_T )
- {
- set_pev( iClient, pev_viewmodel2, szZombies[ iZombie[ iClient ] ][ mHands ] );
- }
- }
- public EventRoundEnd( client )
- {
- iCash[ client ] += iGainCash[ client ];
- ColorChat( client, "You have gained ^4%i$^1 dollars this ^4round^3.^1 for making totaly of ^4%i kills.", iGainCash[ client ], RoundKills[ client ] );
- iGainCash[ client ] = 0;
- RoundKills[ client ] = 0;
- return 1;
- }
- public evDeathMsg( client )
- {
- new iAttacker = read_data( 1 );
- new iVictim = read_data( 2 );
- if( !is_user_connected( iAttacker ) || !is_user_connected( iVictim ) || !is_user_alive( iAttacker ) )
- return 1;
- if( is_user_bot( iAttacker ) || is_user_bot( iVictim ) || is_user_hltv( iAttacker ) || is_user_hltv( iVictim ) )
- return 1;
- if( cs_get_user_team( iAttacker ) == CS_TEAM_T && cs_get_user_team( iVictim ) == CS_TEAM_CT )\
- {
- iGainCash[ client ] += 75; // Gain 75 Dollars for Killing a Zombie //
- return HumanKills[ iAttacker ] += 1;
- }
- else if( cs_get_user_team( iAttacker ) == CS_TEAM_CT && cs_get_user_team( iVictim ) == CS_TEAM_T )
- {
- iGainCash[ client ] += 50 // Gain 50 Dollars for Killing a Zombie //
- return ZombieKills[ iAttacker ] +1;
- }
- CheckImprove( iAttacker );
- RoundKills[ iAttacker ] += 1;
- return 1;
- }
- public fw_ClientSpawn( client )
- {
- if( cs_get_user_team( client ) == CS_TEAM_T )
- {
- fm_strip_user_weapons( client );
- fm_give_item( client, "weapon_knife" );
- fm_set_user_maxspeed( client, szZombies[ iZombie[ client ] ][ mSpeed ] );
- fm_set_user_health( client, szZombies[ iZombie[ client ] ][ mHealth ] );
- fm_set_user_gravity( client, szZombies[ iZombie[ client ] ][ mGravity ] );
- }
- }
- public CmdHandleSay( client )
- {
- new szMsg[ 192 ], szArgs[ 3 ][ 66 ];
- read_argv( 1, szMsg, charsmax( szMsg ) );
- parse( szMsg, szArgs[ 0 ], charsmax( szArgs[] ), szArgs[ 1 ], charsmax( szArgs[] ), szArgs[ 2 ], charsmax( szArgs[] ) );
- if( equali( szArgs[ 0 ], "/class" ) )
- return CmdClasses( client );
- if( equali( szArgs[ 0 ], "/status" ) )
- {
- new iPlayer = cmd_target( client, szArgs[ 1 ], 8 );
- if( iPlayer == client )
- {
- ColorChat( client, "Your Level Is:^4 %i/%i ^1 with ^3( ^4%i/%i human kills^3 )^1 and^3( ^4%i/%i zombie kills^3 )", iLevel[ client ], sizeof( szLevel ), HumanKills[ client ], szLevel[ iLevel[ client ] ][ iHum ], ZombieKills[ client ], szLevel[ iLevel[ client ] ][ iZom ] );
- ColorChat( client, "Total Kills: ^4%i^1 Dollars Amount:^3 %i$^1.", iTotalKills[ client ], iCash[ client ] );
- }
- if( !iPlayer )
- return ColorChat( client, "Target wasnt found" );
- ColorChat( client, "%s Level Is:^4 %i/%i ^1 with ^3( ^4%i/%i human kills^3 )^1 and^3( ^4%i/%i zombie kills^3 )", GetUserName( iPlayer ), iLevel[ iPlayer ], sizeof( szLevel ), HumanKills[ iPlayer ], szLevel[ iLevel[ iPlayer ] ][ iHum ], ZombieKills[ client ], szLevel[ iLevel[ iPlayer ] ][ iZom ] );
- ColorChat( client, "%s Total Kills: ^4%i^1 Dollars Amount:^3 %i$^1.", GetUserName( iPlayer ), iTotalKills[ iPlayer ], iCash[ iPlayer ] );
- }
- if( contain( szArgs[ 0 ], "/" ) || contain( szArgs[ 0 ], "." ) )
- return 1;
- return 0;
- }
- public CmdClasses( client )
- {
- if( cs_get_user_team( client ) != CS_TEAM_T )
- return ColorChat( client, "^4%s^1 You are not a^4 Zombie.", GetUserName( client ) );
- new szText[ 128 ];
- formatex( szText, charsmax( szText ), "\d[ \yBaseBuilder\d ]\r%s\w Zombie Classes Menu\d( \wLevel %i\d )\w:", iLevel[ client ] );
- new Menu = menu_create( szText, "CmdHandler" );
- for( new i = 0; i < sizeof( szZombies ); i++ )
- {
- formatex( szText, charsmax( szText ), "\r%s\d( \yLevel %i\d ) %s %s", szZombies[ i ][ mZombie ], szZombies[ i ][ mLevel ], szZombies[ i ][ mAccess ] == ADMIN_BAN ? "\d[ \yOnly Admins\d ]" : "", i == iZombie[ client ] ? "\w- \d( \wCurrect Zombie\d )" : "" );
- menu_additem( Menu, szText );
- }
- menu_display( client, Menu, 0 );
- return 1;
- }
- public CmdHandler( client, Menu, Item )
- {
- if( Item == MENU_EXIT )
- menu_destroy( Menu );
- pZombie[ client ] = Item;
- new szText[ 128 ];
- new cb = menu_makecallback( "mDisabled" );
- new szcb2 = menu_makecallback( "mCallBack" );
- formatex( szText, charsmax( szText ), "\d[ \yBaseBuilder\d ]\r %s\w Information\d:", szZombies[ pZombie[ client ] ][ mZombie ] );
- new Menu = menu_create( szText, "CmdHandler2" );
- formatex( szText, charsmax( szText ), "\rZombie Health: \d[ \y%i\d ]", szZombies[ pZombie[ client ] ][ mHealth ] );
- menu_additem( Menu, szText,. callback=cb );
- formatex( szText, charsmax( szText ), "\rZombie Speed: \d[ \y%s Speed\d ]", szZombies[ pZombie[ client ] ][ mSpeedStatus ] );
- menu_additem( Menu, szText,. callback=cb );
- formatex( szText, charsmax( szText ), "\rZombie Jump: \d[ \y%s Jump\d ]", szZombies[ pZombie[ client ] ][ mGravityStatus ] );
- menu_additem( Menu, szText,. callback=cb );
- formatex( szText, charsmax( szText ), "\rZombie Skills: \d[ \y%s\d ]", szZombies[ pZombie[ client ] ][ mSkill ] );
- menu_additem( Menu, szText,. callback=cb );
- formatex( szText, charsmax( szText ), "\rZombie Level Requird: \d[ \yLevel %i\d ]^n^n^n", szZombies[ pZombie[ client ] ][ mLevel ] );
- menu_additem( Menu, szText,. callback=cb );
- if( !is_user_admin( client ) )
- {
- formatex( szText, charsmax( szText ), "\rUse This Zombie\d[ \w \y%s\d ]", iLevel[ client ] < szZombies[ pZombie[ client ] ][ mLevel ] ? "Zombie Locked" : "Zombie Unlocked" );
- menu_additem( Menu, szText,. callback=szcb2 );
- }
- else if( is_user_admin( client ) )
- {
- formatex( szText, charsmax( szText ), "\rUse This Zombie\d[ \w Admin Unlocked\d ]" );
- menu_additem( Menu, szText );
- }
- menu_display( client, Menu, 0 );
- return 1;
- }
- public CmdHandler2( client, Menu, Item )
- {
- if( Item == MENU_EXIT )
- menu_destroy( Menu );
- iZombie[ client ] = pZombie[ client ];
- if( bb_is_user_zombie( client ) )
- {
- if( !bb_is_prep_phase() )
- {
- ExecuteHamB( Ham_CS_RoundRespawn, client );
- return ColorChat( client, "^1 You have choosen^4 %s^1 has your new class.", szZombies[ iZombie[ client ] ][ mZombie ] );
- }
- else if ( bb_is_prep_phase() && bb_is_build_phase() )
- return ColorChat( client, "^4%s^1 Your new class^4 %s^1 will be changed next respawn.", GetUserName( client ), szZombies[ iZombie[ client ] ][ mZombie ] );
- }
- return CmdClasses( client );
- }
- public FwdTakeDamage_Pre( iVictim, Inf, iAttacker, Float:fDamage, iDmgBits )
- {
- if( iZombie[ iAttacker ] == BB_KNOCK )
- {
- if( cs_get_user_team( iAttacker ) == CS_TEAM_T && cs_get_user_team( iVictim ) == CS_TEAM_CT )
- {
- // Credits to Rejack //
- new Float:fRandom[ 3 ];
- for ( new i; i < 3; i++ )
- fRandom[ i ] = random_float( 100.0, 150.0 );
- entity_set_vector( iVictim, EV_VEC_punchangle, fRandom );
- ShakeScreen( iVictim );
- }
- }
- if( iZombie[ iAttacker ] == BB_Shock )
- {
- if( cs_get_user_team( iAttacker ) == CS_TEAM_T && cs_get_user_team( iVictim ) == CS_TEAM_CT )
- {
- set_user_freeze( iVictim, 1 );
- fm_set_user_rendering( iVictim, kRenderFxGlowShell, 255, 0, 85, kRenderTransAlpha, 0 );
- set_task( 4.0, "CmdRemoveFreeze", iVictim, _,_, "b" );
- }
- }
- }
- public CheckImprove( client )
- {
- if( iLevel[ client ] >= sizeof( szLevel ) )
- return 1;
- if( HumanKills[ client ] >= szLevel[ iLevel[ client ] ][ iHum ] && ZombieKills[ client ] >= szLevel[ iLevel[ client ] ][ iZom ] )
- {
- iLevel[ client ] += 1;
- HumanKills[ client ] = 0;
- ZombieKills[ client ] = 0;
- iCash[ client ] += 1500;
- ColorChat( 0, "^4%s^1 has just reached^1 level^3 %i.", GetUserName( client ), iLevel[ client ] );
- ColorChat( client, "You have gained^4 1500 Dollars^1 for leveling up^3 !" );
- }
- return 1;
- }
- public CmdRemoveFreeze( client )
- {
- set_user_freeze( client, 0 );
- fm_set_user_rendering( client, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 0 );
- }
- stock ShakeScreen( index )
- {
- message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenShake" ), _, index );
- write_short( 10 << 12 );
- write_short( 5 << 12 );
- write_short( 10 << 12 );
- message_end( );
- }
- stock GetUserName( const Index )
- {
- new szName[ 32 ];
- get_user_name( Index, szName, charsmax( szName ) );
- return szName;
- }
- stock ColorChat(const id, const string[], {Float, Sql, Resul,_}:...)
- {
- new msg[191], players[32], count = 1
- static len
- len = formatex(msg, charsmax(msg), "^1[ ^4AMXX ^1] " )
- vformat(msg[len], charsmax(msg) - len, string, 3)
- if(id) players[0] = id
- 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 1;
- }
- stock set_user_freeze( client, freeze=1 )
- {
- new iFlags;
- iFlags = pev( client, pev_flags );
- set_pev( client, pev_flags, freeze ? iFlags | FL_FROZEN : iFlags & ~FL_FROZEN );
- }
- public mDisabled( client, Menu, Item )
- return ITEM_DISABLED;
- public mCallBack( client, Menu, Item )
- return( iLevel[ client ] >= szZombies[ pZombie[ client ] ][ mLevel ] ? ITEM_ENABLED : ITEM_DISABLED );
Advertisement
Add Comment
Please, Sign In to add comment