Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //* Includes */
- #include < amxmodx >
- #include < cstrike >
- #include < fakemeta_util >
- #include < fakemeta >
- #include < hamsandwich >
- #include < csx >
- #include < engine >
- #include < dhudmessage >
- #include < amxmisc >
- #include < fun >
- /* Natives */
- native get_user_cash( const index );
- native set_user_cash( const index, cash );
- native remove_sgdrill( const index );
- native give_sgdrill( const index );
- native set_glow();
- native remove_glow();
- native is_running_vote( const index );
- native give_pumpkin__( const index );
- native remove_pumpkin__( const index );
- native get_cannon( const index );
- native remove_cannon( const index );
- /* Defines */
- #define TASKID_VOTE 1500
- #define TASKID_TIMER 1501
- #define TASKID_MESSAGE 1502
- #define TASKID_CLIENTMSG 1503
- #define g_mCountdownTask2 1615
- #define MAX_AMMO 75
- #define RELOAD_TIME 10.0
- #define TIME_LEFT 40
- /* Enums */
- #define MAX_PLAYERS 32
- #define Keysasd (1<<0) // Keys: 1
- native remove_speargun( index );
- native give_speargun( index );
- enum _:g_mDaysData{
- DAY_FREE,
- DAY_NIGHT,
- DAY_SHARK,
- DAY_WAR,
- DAY_PWAR,
- DAY_KNIFE,
- DAY_BOX,
- DAY_GUNGAME,
- DAY_TUG,
- DAY_DEAGLE,
- DAY_PDEAGLE,
- DAY_PSHOT,
- DAY_HEG,
- DAY_PHEG,
- DAY_SNIPERS,
- DAY_DODGEBALL,
- DAY_LASER,
- DAY_ZOMBIE,
- DAY_AWP,
- DAY_SHOTGUN,
- DAY_DM,
- DAY_SPEARGUN,
- DAY_TACTICAL,
- DAY_PUMPKIN,
- DAY_CANNON,
- DAY_SGDRILL,
- DAY_1HPBOXDAY,
- DAY_HEADSHOT
- };
- new const szPrefix[ ] = "Top Jailbreak";
- new const iWeaponEntName[][] = {
- "weapon_knife",
- "weapon_hegrenade",
- "weapon_smokegrenade",
- "weapon_flashbang",
- "weapon_deagle",
- "weapon_m4a1",
- "weapon_ak47",
- "weapon_awp",
- "weapon_m249",
- "weapon_shield",
- "weapon_famas",
- "weapon_elite"
- };
- new const iWeaponNum[] = {
- CSW_KNIFE,
- CSW_HEGRENADE,
- CSW_SMOKEGRENADE,
- CSW_FLASHBANG,
- CSW_DEAGLE,
- CSW_M4A1,
- CSW_AK47,
- CSW_AWP,
- CSW_M249,
- CSW_KNIFE,
- CSW_FAMAS,
- CSW_ELITE
- };
- new const iGunEntName[][] = {
- "weapon_glock18",
- "weapon_usp",
- "weapon_deagle",
- "weapon_elite",
- "weapon_mac10",
- "weapon_m3",
- "weapon_xm1014",
- "weapon_mp5navy",
- "weapon_awp",
- "weapon_scout",
- "weapon_m4a1",
- "weapon_ak47",
- "weapon_m249",
- "weapon_knife",
- "weapon_hegrenade"
- };
- new const iGunNum[] = {
- CSW_GLOCK18,
- CSW_USP,
- CSW_DEAGLE,
- CSW_ELITE,
- CSW_MAC10,
- CSW_M3,
- CSW_XM1014,
- CSW_MP5NAVY,
- CSW_AWP,
- CSW_SCOUT,
- CSW_M4A1,
- CSW_AK47,
- CSW_M249,
- CSW_KNIFE,
- CSW_HEGRENADE
- };
- /* Array's & String's */
- new szViewer[ ][ ] ={
- "Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Special Day"
- };
- new szDays[ g_mDaysData ][ ] ={
- "Freeday",
- "NightCrawler Day",
- "Shark Day",
- "War Day",
- "Prisoners War Day",
- "Knife Day",
- "Box Day",
- "Gun Game Day",
- "Tug Day",
- "Deagle Day",
- "Power Deagle Day",
- "Power ShotGun Day",
- "Grenades Day",
- "Power Grenades Day",
- "Snipers Day",
- "Dodgeball Day",
- "Laser Day",
- "Zombie Day",
- "Awp Day",
- "ShotGun Day",
- "DeadMatch Day",
- "SpearGun Day",
- "Tactical Knifes Throwing Day",
- "Pumpkin Grenade Day",
- "Cannon Day",
- "Sgdrill Day",
- "1 Hp Box Day",
- "HeadShot Day"
- };
- new g_mModels[ ][ ] ={
- "models/AMXX/JB/LR/p_dodgeball.mdl",
- "models/AMXX/JB/LR/v_dodgeball.mdl",
- "models/AMXX/JB/LR/w_dodgeball.mdl"
- };
- new g_iModels[ ][ ] ={
- "models/AMXX/JB/Days/v_laser.mdl",
- "models/AMXX/JB/Days/p_laser.mdl"
- };
- new g_iSounds[ ][ ] ={
- "AMXX/JB/Days/laser_fire.wav",
- "AMXX/JB/Days/laser_hit.wav"
- };
- new g_iZombie[ ] = "models/AMXX/JB/Days/v_zombieday.mdl";
- new g_iVote[ ] = "AMXX/JB/Days/specialday.mp3";
- new g_mSound[ ] = "weapons/g_bounce.wav";
- new g_mSprite[ ] = "sprites/AMXX/flame.spr";
- new szMap[ 32 ], szItem[ 256 ], szAttacker[ 33 ][ 128 ];
- new GunLevel[33],XpLevel[33];
- new CountDie[33]
- /* Variables */
- new iDay = -1, iRound, g_iMaxPlayers, iTaskid, dVoteMenu, dOption[ 4 ], dVotes[ 4 ], dCount, dVoters, g_iMinutes = 5, g_iSeconds = 0;
- new g_mTrail, g_mBlood, g_mDay;
- /* Integers & Floats */
- new Float: g_iOrigin[ 32 ][ 3 ], Float: fnAttack[ 33 ], Float: fnTime[ 33 ], g_mAmmo[ 33 ], Float: g_fCount;
- new g_iTimer[ 33 ], Float: fnAttackTime[ 33 ], g_iDays[ 33 ];
- /* Booleans */
- new bool: bVoted[ 33 ], bool: bVote, bool: bAttacker, bool: bTimeleft;
- new bool:iGunGame;
- new bool:TofesetDay,TofesetT[32]
- new iBallsThrown[ MAX_PLAYERS + 1 ];
- native give_tactical( index );
- native remove_tactical( index );
- public plugin_init()
- {
- register_plugin( "JailBreak Days", "1.0", "Built by Rejack || Edit by @.TheBomB`" );
- /* Client Commands */
- register_clcmd( "say /days", "CmdDays" );
- register_clcmd( "say /fd", "CmdStartFreeday" );
- register_clcmd( "drop", "CmdDrop" );
- /* Events */
- register_event( "CurWeapon", "evCurWeapon", "b" );
- register_event( "DeathMsg", "evDeathMsg", "a" );
- /* Log Events */
- register_logevent( "evRoundStart", 2, "1=Round_Start" );
- /* Messages */
- register_message( get_user_msgid( "SendAudio" ), "MsgAudio" );
- register_message( get_user_msgid( "TextMsg" ), "MsgText" );
- /* Touch */
- register_touch( "*", "player", "PlayerInteract" );
- register_touch( "grenade", "*", "BallInteract" );
- /* Forwards */
- register_forward( FM_Touch, "FwdTouch" );
- register_forward( FM_SetModel, "FwdSetModel", 0 );
- register_forward( FM_EmitSound, "FwdEmitSound", 0 );
- register_forward( FM_PlayerPreThink, "FwdPreThink" );
- /* Ham Forwards */
- RegisterHam( Ham_TakeDamage, "player", "FwdTakeDamage", true );
- RegisterHam( Ham_Use, "func_button", "FwdUseButton" );
- RegisterHam( Ham_Touch, "armoury_entity", "FwdHamPlayerPickup" );
- RegisterHam( Ham_Touch, "weaponbox", "FwdHamPlayerPickup" );
- RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_deagle", "FwdWeaponPrimaryAttack" );
- RegisterHam( Ham_Killed, "player", "FwdHamPlayerKiller", 1)
- /* Think */
- register_think( "grenade", "FwdThinkGrenade" );
- /* Others */
- get_mapname( szMap, charsmax( szMap ) );
- g_iMaxPlayers = get_maxplayers();
- }
- public plugin_natives(){
- register_library( "DaysLibrary" );
- register_native( "is_day", "_is_day" );
- register_native( "is_running_vote", "_running_vote" );
- register_native( "get_ruuning_day", "_get_day" );
- register_native( "get_round", "_get_round" );
- register_native( "get_running_day_speargun", "_speargun" );
- register_native( "get_running_day_throwing_knifes","_throwing" );
- register_native( "get_running_day_pumpkin", "_pumpkin" );
- register_native( "get_running_day_cannon", "_cannon" );
- register_native( "get_running_day_sgdrill", "_sgdrill" );
- }
- public _pumpkin( plugin, params )
- return g_mDay == DAY_PUMPKIN ? true : false;
- public _speargun( plugin, params )
- return g_mDay == DAY_SPEARGUN ? true : false;
- public _throwing( plugin, params )
- return g_mDay == DAY_TACTICAL ? true : false;
- public _cannon( plugin, params )
- return g_mDay == DAY_CANNON ? true : false;
- public _sgdrill( plugin, params )
- return g_mDay == DAY_SGDRILL ? true : false;
- public _is_day( plugin, params )
- {
- if ( g_mDay == -1 )
- return false;
- return true;
- }
- public _running_vote( plugin, params )
- return ( bVote && dCount > 0 ) ? true : false;
- public _get_day( plugin, params )
- return g_mDay;
- public _get_round( plugin, params )
- return iDay;
- public plugin_precache(){
- new file[32]
- if( !file_exists( file ) )
- log_amx( "kovez lo kayam %s", file );
- else
- precache_model( file );
- for ( new i; i < sizeof g_mModels; i++ )
- precache_model( g_mModels[ i ] );
- for ( new i; i < sizeof g_iModels; i++ ){
- precache_model( g_iModels[ i ] );
- precache_sound( g_iSounds[ i ] );
- }
- precache_model( g_iZombie );
- precache_model( "models/player/JailBreakZM/JailBreakZM.mdl" );
- precache_sound( g_mSound );
- precache_sound( g_iVote );
- g_mTrail = precache_model( g_mSprite );
- g_mBlood = precache_model( "sprites/blood.spr" );
- }
- public CmdStartFreeday( const client )
- {
- if ( get_user_flags( client ) & ADMIN_KICK || is_user_alive( client ) && cs_get_user_team( client ) == CS_TEAM_CT )
- {
- if ( g_mDay > -1 )
- return ColorPrint( client, "^3Error: ^1A Day Has Already ^3Started^4." );
- if ( bVote )
- return ColorPrint( client, "^3Error: ^1You Currently Canno't Start a Day^4.." );
- CmdStartDay( 0 );
- return ColorPrint( 0, "^1%s: ^3%s ^1Started a ^3Freeday ^4!", (get_user_flags( client ) & ADMIN_KICK) ? "ADMIN " : "", szName( client ) );
- }
- return ColorPrint( client, "You have no access to this." );
- }
- public CmdDays( client )
- {
- if ( !( get_user_flags( client ) & ADMIN_KICK ) )
- return ColorPrint( client, "^3Error: ^1You Don't Have Access To This Command^4." );
- if ( g_mDay > -1 )
- return ColorPrint( client, "^3Error: ^1A Day Has Already ^3Started^4." );
- if ( bVote )
- return ColorPrint( client, "^3Error: ^1You Currently Canno't Start a Day^4." );
- formatex( szItem, charsmax( szItem ), "\r[\w%s\r] \wDays \yMenu\d:", szPrefix );
- new Menu = menu_create( szItem, "SubDays" );
- menu_additem( Menu, "Start Special Day^n" );
- formatex( szItem, charsmax( szItem ), "Selected Day\d: \r%s", szDays[ g_iDays[ client ] ] );
- menu_additem( Menu, szItem );
- menu_additem( Menu, "Start \yDays" );
- menu_display( client, Menu );
- return 1;
- }
- public SubDays( client, Menu, Item )
- {
- if ( !( get_user_flags( client ) & ADMIN_KICK ) )
- return ColorPrint( client, "^3Error: ^1You Don't Have Access To This Command^4." );
- if ( g_mDay > -1 )
- return ColorPrint( client, "^3Error: ^1Day Has Already ^3Started^4." );
- if ( bVote )
- return ColorPrint( client, "^3Error: ^1You Currently Canno't Start a Day^4." );
- if ( Item == MENU_EXIT )
- {
- menu_destroy( Menu );
- return 1;
- }
- switch ( Item )
- {
- case 0:
- {
- CmdReceiveVotes();
- return ColorPrint( 0, "ADMIN: ^3%s ^1Has Started Special Day^4 !", szName( client ) );
- }
- case 1:
- return CmdChooseDays( client );
- case 2:
- {
- CmdStartDay( g_iDays[ client ] );
- return ColorPrint( 0, "ADMIN: ^3%s ^1Has Started ^4%s", szName( client ), szDays[ g_iDays[ client ] ] );
- }
- }
- menu_destroy( Menu );
- return 1;
- }
- public CmdChooseDays( client )
- {
- if ( !( get_user_flags( client ) & ADMIN_KICK ) )
- return ColorPrint( client, "^3Error: ^1You Don't Have Access To This Command^4." );
- if ( g_mDay > -1 )
- return ColorPrint( client, "^3Error: ^1Day Has Already ^3Started^4." );
- if ( bVote )
- return ColorPrint( client, "^3Error: ^1You Currently Canno't Start a Day^4." );
- formatex( szItem, charsmax( szItem ), "\r[\w%s\r] \wSelect a Day^n\wPage\d:\r", szPrefix );
- new Menu = menu_create( szItem, "SubChooseDays" );
- for ( new i; i < sizeof szDays; i++ )
- menu_additem( Menu, szDays[ i ] );
- menu_setprop( Menu, MPROP_EXITNAME, "Back" );
- menu_display( client, Menu );
- return 1;
- }
- public SubChooseDays( client, Menu, Item )
- {
- if ( !( get_user_flags( client ) & ADMIN_KICK ) )
- return ColorPrint( client, "^3Error: ^1You Don't Have Access To This Command^4." );
- if ( g_mDay > -1 )
- return ColorPrint( client, "^3Error: ^1Day Has Already ^3Started^4." );
- if ( bVote )
- return ColorPrint( client, "^3Error: ^1You Currently Canno't Start a Day^4." );
- if ( Item == MENU_EXIT )
- {
- menu_destroy( Menu );
- CmdDays( client );
- return 1;
- }
- g_iDays[ client ] = Item;
- return CmdDays( client );
- }
- /* Vote Days */
- public CmdReceiveVotes()
- {
- GiveItem(0, "weapon_knife" );
- if ( bVote )
- return 1;
- for ( new i; i < sizeof dOption; i++ )
- dOption[ i ] = random( g_mDaysData );
- for ( new i; i < sizeof dOption; i++ )
- {
- if ( IsItemExists( dOption[ i ], i ) )
- return CmdReceiveVotes();
- }
- for ( new i = 1; i < g_iMaxPlayers; i++ )
- {
- if ( !is_user_connected( i ) )
- continue;
- bVoted[ i ] = false;
- }
- dCount = 18;
- arrayset( dVotes, 0, sizeof dVotes );
- dVoters = 0;
- bVote = true;
- client_cmd( 0, "mp3 play ^"sound/%s^"", g_iVote );
- CmdVoteMenu();
- return 1;
- }
- public CmdVoteMenu()
- {
- if ( !bVote )
- return 1;
- if ( dCount < 1 )
- {
- CmdEndVote();
- return 1;
- }
- static Players[ 32 ], iNum/*, iPer*/;
- get_players( Players, iNum, "ch" );
- for ( new i; i < iNum; i++ )
- formatex( szItem, charsmax( szItem ), "\r[\w%s\r] \wSelect a Special Day!^n^n\wStatus\d: %s\d.",szPrefix, (bVoted[ Players[ i ] ]) ? "\rVoted" : "\yVote", dCount );
- dVoteMenu = menu_create( szItem, "SubVoteMenu" );
- for ( new i; i < 4; i++ )
- {
- /*
- if ( dVotes[ i ] == 0 )
- iPer = 0;
- else
- iPer = (100/dVoters) * dVotes[ i ];
- formatex( szItem, charsmax( szItem ), "%s\d - [\y %i Votes \d]", szDays[ dOption[ i ] ], dVotes[ i ] );*/
- formatex( szItem, charsmax( szItem ), "\wDay\w [\y %s\w ] \d- \wVotes \w[\r %i\w ]", szDays[ dOption[ i ] ], dVotes[ i ]);
- menu_additem( dVoteMenu, szItem );
- }
- formatex( szItem, charsmax( szItem ), "^n\wTime Left\d: \y%i \wSeconds", dCount );
- menu_addtext( dVoteMenu, szItem );
- menu_setprop( dVoteMenu, 6, -1 );
- menu_setprop( dVoteMenu, MPROP_EXIT, MEXIT_NEVER );
- for ( new i; i < iNum; i++ )
- menu_display( Players[ i ], dVoteMenu );
- dCount--;
- set_task( 1.0, "CmdVoteMenu", TASKID_VOTE );
- return 1;
- }
- public SubVoteMenu( client, Menu, Item )
- {
- if ( Item == MENU_EXIT || !bVote || bVoted[ client ] )
- return 1;
- dVotes[ Item ]++;
- dVoters++;
- bVoted[ client ] = true;
- return ColorPrint( 0, "^3%s ^1Has Voted For ^4%s^3.", szName( client ), szDays[ dOption[ Item ] ] );
- }
- public CmdEndVote()
- {
- for ( new i = 1; i < g_iMaxPlayers; i++ )
- {
- if ( !is_user_connected( i ) )
- continue;
- show_menu( i, 0, "^n", 1 );
- }
- static iVoted;
- if ( dVotes[ 0 ] > dVotes[ 1 ] && dVotes[ 0 ] > dVotes[ 2 ] && dVotes[ 0 ] > dVotes[ 3 ] )
- iVoted = 0;
- else if ( dVotes[ 1 ] > dVotes[ 0 ] && dVotes[ 1 ] > dVotes[ 2 ] && dVotes[ 1 ] > dVotes[ 3 ] )
- iVoted = 1;
- else if ( dVotes[ 2 ] > dVotes[ 0 ] && dVotes[ 2 ] > dVotes[ 1 ] && dVotes[ 2 ] > dVotes[ 3 ] )
- iVoted = 2;
- else if ( dVotes[ 3 ] > dVotes[ 0 ] && dVotes[ 3 ] > dVotes[ 1 ] && dVotes[ 3 ] > dVotes[ 2 ] )
- iVoted = 3;
- else iVoted = random( 4 );
- ColorPrint( 0, "The Day Has Been Choosed Is^4: ^3%s ^1With ^4%i ^1Votes ^3 !", szDays[ dOption[ iVoted ] ], dVotes[ iVoted ] );
- menu_destroy( dVoteMenu );
- CmdStartDay( dOption[ iVoted ] );
- return 1;
- }
- /* Functions */
- public CmdFadeScreen( taskid )
- {
- taskid = taskid - 1000;
- if ( (taskid/2) == 15 /*Seconds*/ )
- return 1;
- for ( new i; i < g_iMaxPlayers; i++ )
- {
- if ( !is_user_connected( i ) )
- continue;
- set_user_fade( i, 0.5, random( 255 ), random( 255 ), random( 255 ), 150 ); /* Random Color */
- }
- taskid++;
- iTaskid = taskid + 1000;
- set_task( 0.5, "CmdFadeScreen", iTaskid );
- return 1;
- }
- public CmdCreateCountdown()
- {
- if ( g_fCount <= 0 )
- {
- return 1;
- }
- return 1;
- }
- /* Blocks */
- public CmdDrop( client )
- {
- if ( g_mDay == -1 || g_mDay == DAY_FREE )
- return 0;
- return 1;
- }
- public FwdHamPlayerPickup( ent, client )
- {
- if ( !is_user_connected( client ) )
- return 1;
- if ( g_mDay == -1 || g_mDay == DAY_FREE )
- return 1;
- return 4;
- }
- public FwdUseButton()
- {
- if ( g_mDay == -1 || g_mDay == DAY_FREE )
- return 1;
- return 4;
- }
- /* Events */
- public client_disconnect( client )
- {
- if ( g_mDay == -1 )
- return 1;
- set_task( 0.5, "taskCheckDays" );
- return 1;
- }
- public taskCheckDays(id)
- {
- if ( g_mDay == -1 )
- return 1;
- if( g_mDay == DAY_SPEARGUN )
- {
- for( new i = 1; i < 33 ;i++ )
- remove_speargun( i );
- }
- if ( TeamCount( "CT", "aceh" ) == 0 )
- {
- ColorPrint( 0, "^3%s ^1Stopped Due To a Lack Of ^4Online ^3Guards^4.", szDays[ g_mDay ] );
- StopDaysOnline();
- }
- if ( TeamCount( "TERRORIST", "aceh" ) < 1 )
- {
- ColorPrint( 0, "^3%s ^1Stopped Due To a Lack Of ^4Online ^3Prisoner^4.", szDays[ g_mDay ] );
- StopDaysOnline();
- }
- if ( TeamCount( "TERRORIST", "aceh" ) == 1 && TeamCount( "CT", "aceh" ) > 0 )
- {
- ColorPrint( 0, "^3%s ^1Stopped Due To a Lack Of ^4Online ^3Prisoner^4.", szDays[ g_mDay ] );
- static Players[ 32 ], iNum, client;
- get_players( Players, iNum, "aceh", "TERRORIST" );
- for(new i=1;i<33;i++) { if(is_user_connected(i)) { client_cmd( i, "say /music" ); } }
- ColorPrint( 0, "^3%s ^1Has Won The Day And Recived^4 1,000 ^1Cash ^3!", szName( client ), szDays[ g_mDay ] );
- set_user_cash( client, get_user_cash( client ) + 1000 );
- StopDaysOnline();
- }
- return 1;
- }
- public TimerFrozen(taskid)
- {
- new id = taskid - 9999;
- if( CountDie[ id ] == 0 )
- {
- set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN))
- user_kill(id)
- remove_task(taskid)
- }
- else
- {
- set_hudmessage( id, 85, 255, -1.0, 0.10, 1, 6.0, 1.1 );
- show_hudmessage(id, "Freeze time will end and kill you in : %i", CountDie[ id ] )
- CountDie[ id ] -- ;
- }
- }
- public evRoundStart()
- {
- StopDaysOnline();
- TofesetDay = false
- if( iDay >= sizeof( szViewer ) -1 )
- iDay = -1;
- iDay++; iRound++;
- if ( iDay == -1 )
- return 0;
- set_hudmessage( random( 255 ), random( 255 ), random( 255 ), -1.0, 0.65, 2, 3.0, 5.0 );
- show_hudmessage( 0, "( AMXX # JailBreak )^nToday is %s!^nMaps playing at %s^nOnline Players: %i Player%s", szViewer[ iDay ], szMap, TeamCount( "", "ch" ), (TeamCount("","ch") > 1) ? "s" : "" );
- if ( iDay == 6 && TeamCount( "CT", "aceh" ) > 0 && TeamCount( "TERRORIST", "aceh" ) > 1 )
- CmdReceiveVotes();
- return 0;
- }
- public evCurWeapon( client )
- {
- if ( !is_user_alive( client ) || !is_user_connected( client ) )
- return 0;
- if ( g_mDay == DAY_DODGEBALL && get_user_weapon( client ) == CSW_HEGRENADE )
- {
- entity_set_string( client, EV_SZ_viewmodel, g_mModels[ 1 ] );
- entity_set_string( client, EV_SZ_weaponmodel, g_mModels[ 0 ] );
- }
- if ( g_mDay == DAY_LASER && get_user_weapon( client ) == CSW_DEAGLE )
- {
- entity_set_string( client, EV_SZ_viewmodel, g_iModels[ 0 ] );
- entity_set_string( client, EV_SZ_weaponmodel, g_iModels[ 1 ] );
- }
- if ( g_mDay == DAY_ZOMBIE && get_user_weapon( client ) == CSW_KNIFE && cs_get_user_team( client ) == CS_TEAM_CT )
- entity_set_string( client, EV_SZ_viewmodel, g_iZombie );
- return 0;
- }
- public evDeathMsg()
- {
- if ( g_mDay == -1 )
- return 0;
- new iAttacker = read_data( 1 );
- new iVictim = read_data( 2 );
- if( g_mDay == DAY_SPEARGUN && iAttacker != iVictim )
- remove_speargun( iVictim );
- if ( TeamCount( "TERRORIST", "aceh" ) < 2 )
- {
- if ( TeamCount( "TERRORIST", "aceh" ) == 1 )
- {
- static Players[ 32 ], iNum, client, iPlayer;
- get_players( Players, iNum, "ach" );
- for ( new i; i < iNum; i++ )
- {
- iPlayer = Players[ i ];
- fm_strip_user_weapons( iPlayer );
- fm_set_user_health( iPlayer, 100 );
- fm_set_user_godmode( iPlayer, 0 );
- fm_set_user_rendering( iPlayer, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 16 );
- if ( cs_get_user_team( iPlayer ) == CS_TEAM_T )
- client = Players[ i ];
- else if ( cs_get_user_team( iPlayer ) == CS_TEAM_CT )
- {
- fm_give_item( iPlayer, "weapon_knife" );
- }
- }
- ColorPrint( 0, "^3%s ^1Has Won The Day And Recived^4 1,000 ^1Cash ^3!", szName( client ), szDays[ g_mDay ] );
- set_user_cash( client, get_user_cash( client ) + 1000 );
- }
- StopDaysOnline();
- }
- return 0;
- }
- stock StopDaysOnline()
- {
- set_cvar_num( "mp_friendlyfire", 0 );
- set_user_hitzones(0, 0, 255)
- if( g_mDay == DAY_LASER )
- {
- for( new i = 1; i < 33 ;i++ )
- {
- if( is_user_connected( i ) )
- remove_speargun( i );
- }
- }
- if( g_mDay == DAY_SPEARGUN )
- {
- for( new i = 1; i < 33 ;i++ )
- {
- if( is_user_connected( i ) )
- remove_speargun( i );
- }
- }
- if( g_mDay == DAY_CANNON )
- {
- for( new i = 1; i < 33 ;i++ )
- {
- if( is_user_connected( i ) )
- remove_cannon( i );
- }
- }
- if( g_mDay == DAY_PUMPKIN )
- {
- for( new i = 1; i < 33 ;i++ )
- {
- if( is_user_connected( i ) )
- remove_pumpkin__( i );
- }
- }
- if( g_mDay == DAY_SGDRILL )
- {
- for( new i = 1; i < 33 ;i++ )
- {
- if( is_user_connected( i ) )
- remove_sgdrill( i );
- }
- }
- /* Stop Vote */
- dCount = 0;
- arrayset( dVotes, 0, sizeof dVotes );
- client_cmd( 0, "mp3 stop" );
- /* Remove Tasks */
- remove_task( TASKID_VOTE );
- remove_task( TASKID_TIMER );
- remove_task( TASKID_MESSAGE );
- remove_task( TASKID_CLIENTMSG );
- if ( task_exists( iTaskid ) )
- remove_task( iTaskid );
- /* Reset Booleans */
- bVote = false;
- bAttacker = false;
- bTimeleft = false;
- TofesetDay = false;
- /* Remove Dodgeball */
- new ent;
- while( ( ent = fm_find_ent_by_class( ent, "grenade" ) ) != 0 )
- fm_remove_entity( ent );
- /* Variables */
- g_mDay = -1;
- g_fCount = 0.0;
- /* Set Cvars */
- set_cvar_num( "sv_airaccelerate", 100 );
- set_cvar_num( "mp_friendlyfire", 0 );
- set_cvar_num( "bh_enabled", 1 );
- /* Clear Settings */
- set_lights( "#OFF" );
- CreateFog( 0, .clear = true );
- remove_glow();
- static Players[ 32 ], iNum, iPlayer;
- get_players( Players, iNum, "ach" );
- for ( new i; i < iNum; i++ )
- {
- iPlayer = Players[ i ];
- fm_strip_user_weapons( iPlayer );
- fm_give_item( iPlayer, "weapon_knife" );
- fm_set_user_godmode( iPlayer, 0 );
- cs_reset_user_model( iPlayer );
- fm_set_user_rendering( iPlayer );
- if ( cs_get_user_team( iPlayer ) == CS_TEAM_CT )
- {
- fm_give_item( iPlayer, "weapon_m4a1" );
- fm_give_item( iPlayer, "weapon_deagle" );
- cs_set_user_bpammo( iPlayer, CSW_M4A1, 9999 );
- cs_set_user_bpammo( iPlayer, CSW_DEAGLE, 9999 );
- }
- }
- /* Reset Menus */
- get_players( Players, iNum, "ch" );
- for ( new i; i < iNum; i++ )
- show_menu( Players[ i ], 0, "^n", 1 );
- return 1;
- }
- public FwdHamPlayerKiller( client, attacker, victim )
- {
- if( g_mDay == DAY_DM && cs_get_user_team( client ) == CS_TEAM_T )
- {
- set_task( 0.1 ,"Respawn", client)
- fm_strip_user_weapons(client);
- set_hudmessage( random ( 255 ), random( 255 ), random( 255 ), -1.0, 0.30, 0, 0.0, 1.1, 0.0, 0.0, -1)
- show_hudmessage( client, "You will respawn in 5 seconds")
- }
- if(iGunGame && cs_get_user_team(client) == CS_TEAM_T)
- {
- set_task( 1.0, "Respawn", client );
- fm_strip_user_weapons(client);
- }
- if(g_mDay == DAY_GUNGAME && cs_get_user_team(client) == CS_TEAM_T)
- {
- set_task( 1.0, "Respawn", client );
- fm_strip_user_weapons(client);
- }
- new CsTeams: iTeam[ 2 ];
- iTeam[ 0 ] = cs_get_user_team( attacker );
- iTeam[ 1 ] = cs_get_user_team( victim );
- if(iGunGame)
- {
- if ( iTeam[ 0 ] == iTeam[ 1 ] || iTeam[ 0 ] != CS_TEAM_T || iTeam[ 1 ] != CS_TEAM_CT )
- {
- XpLevel[ attacker ]++;
- if( 2 <= XpLevel[ attacker ] )
- {
- GunLevel[ attacker ]++;
- XpLevel[ attacker ] = 0;
- if( GunLevel[ attacker ] >= 15 )
- {
- static szName[ 32 ];
- get_user_name( attacker, szName, 32 );
- ColorPrint(0,"^3%s ^1is the winner on the ^4gungame ^1day and recived^4 1500 cash",szName);
- set_user_cash( attacker, get_user_cash( attacker ) + 1500 )
- new players[ 32 ], Tnum;
- get_players( players, Tnum, "ae", "TERRORIST" );
- for( new i = 0; i < Tnum; i++ )
- {
- if( is_user_alive( players[ i ] ) && players[ i ] != attacker)
- {
- user_silentkill( players[ i ] );
- user_silentkill( players[ i ] );
- user_silentkill( players[ i ] );
- }
- }
- return 0;
- }
- fm_strip_user_weapons(attacker)
- give_item_stock(attacker, iGunEntName[GunLevel[attacker]])
- cs_set_user_bpammo(attacker, iGunNum[GunLevel[attacker]], 9999 )
- ColorPrint(attacker,"You are level ^3: ^4(^1 %i ^3/^1 15 ^4) ^1Your Kills ^3: ^4(^1 %i ^3/^1 2 ^4)",GunLevel[ attacker ],XpLevel[ attacker ]);
- }
- ColorPrint(attacker,"You are level ^3: ^4(^1 %i ^3/^1 15 ^4) ^1Your Kills ^3: ^4(^1 %i ^3/^1 2 ^4)",GunLevel[ attacker ],XpLevel[ attacker ]);
- }
- set_task(0.5, "Respawn", victim)
- fm_strip_user_weapons(client);
- }
- if(g_mDay == DAY_GUNGAME)
- {
- if ( iTeam[ 0 ] == iTeam[ 1 ] || iTeam[ 0 ] != CS_TEAM_T || iTeam[ 1 ] != CS_TEAM_CT )
- {
- XpLevel[ attacker ]++;
- if( 2 <= XpLevel[ attacker ] )
- {
- GunLevel[ attacker ]++;
- XpLevel[ attacker ] = 0;
- if( GunLevel[ attacker ] >= 15 )
- {
- static szName[ 32 ];
- get_user_name( attacker, szName, 32 );
- ColorPrint(0,"^3%s ^1is the winner on the ^4gungame ^1day and recived^4 1500 cash",szName);
- set_user_cash( attacker, get_user_cash( attacker ) + 1500 )
- new players[ 32 ], Tnum;
- get_players( players, Tnum, "ae", "TERRORIST" );
- for( new i = 0; i < Tnum; i++ )
- {
- if( is_user_alive( players[ i ] ) && players[ i ] != attacker)
- {
- user_silentkill( players[ i ] );
- user_silentkill( players[ i ] );
- user_silentkill( players[ i ] );
- }
- }
- return 0;
- }
- fm_strip_user_weapons(attacker)
- give_item_stock(attacker, iGunEntName[GunLevel[attacker]])
- cs_set_user_bpammo(attacker, iGunNum[GunLevel[attacker]], 9999 )
- ColorPrint(attacker,"You are level ^3: ^4(^1 %i ^3/^1 15 ^4) ^1Your Kills ^3: ^4(^1 %i ^3/^1 2 ^4)",GunLevel[ attacker ],XpLevel[ attacker ]);
- }
- ColorPrint(attacker,"You are level ^3: ^4(^1 %i ^3/^1 15 ^4) ^1Your Kills ^3: ^4(^1 %i ^3/^1 2 ^4)",GunLevel[ attacker ],XpLevel[ attacker ]);
- }
- }
- return PLUGIN_CONTINUE;
- }
- public Respawn( client )
- {
- fm_strip_user_weapons(client);
- fm_strip_user_weapons(client);
- fm_strip_user_weapons(client);
- ExecuteHamB(Ham_CS_RoundRespawn, client)
- //fm_set_user_health( client, 100);
- fm_strip_user_weapons( client );
- fm_give_item( client, "weapon_m4a1" );
- fm_give_item( client, "weapon_deagle");
- cs_set_user_bpammo( client, CSW_M4A1, 999);
- cs_set_user_bpammo( client, CSW_DEAGLE, 999);
- set_glow();
- OpenCells();
- if( iGunGame )
- {
- fm_strip_user_weapons(client);
- fm_strip_user_weapons(client);
- fm_strip_user_weapons(client);
- fm_strip_user_weapons(client);
- ExecuteHamB(Ham_CS_RoundRespawn, client);
- set_health( client , 100 , false)
- fm_strip_user_weapons(client);
- give_item_stock(client, iGunEntName[GunLevel[client]])
- cs_set_user_bpammo(client, iGunNum[GunLevel[client]], 9999 )
- }
- if( g_mDay == DAY_GUNGAME )
- {
- fm_strip_user_weapons(client);
- fm_strip_user_weapons(client);
- fm_strip_user_weapons(client);
- fm_strip_user_weapons(client);
- ExecuteHamB(Ham_CS_RoundRespawn, client);
- set_health( client , 100 , false)
- fm_strip_user_weapons(client);
- give_item_stock(client, iGunEntName[GunLevel[client]])
- cs_set_user_bpammo(client, iGunNum[GunLevel[client]], 9999 )
- }
- return PLUGIN_CONTINUE;
- }
- public CmdStartTimer( )
- {
- if( g_mDay == DAY_DM)
- {
- if( g_iMinutes == 0 && g_iSeconds <= 0 )
- {
- set_cvar_num("sv_restartround", 1)
- remove_task()
- return PLUGIN_HANDLED;
- }
- if( g_iSeconds == 0 )
- {
- g_iMinutes--;
- g_iSeconds = 59;
- }
- new szText[256];
- formatex(szText, 255, "%i:%s%i", g_iMinutes, g_iSeconds < 10 ? "0" : "", g_iSeconds );
- set_dhudmessage( 0, 85, 255, -1.0, 0.0, 0, 6.0, 0.9, 0.1, 0.1 );
- show_dhudmessage( 0, "Time left %s, DeathMatch day.", szText )
- g_iSeconds--
- set_task( 1.0, "CmdStartTimer");
- return PLUGIN_CONTINUE;
- }
- return PLUGIN_CONTINUE;
- }
- /* Forwards */
- public FwdTakeDamage( victim, inf, attacker, Float:damage, damagebits )
- {
- if( !is_user_alive( victim ) || !is_user_alive( attacker ) )
- return HAM_IGNORED;
- new temp[ 2 ], weapon = get_user_weapon( attacker, temp[ 0 ], temp[ 1 ] );
- if( weapon == CSW_KNIFE && g_mDay == DAY_TUG )
- {
- new CsTeams:att_team = cs_get_user_team( attacker );
- new CsTeams:vic_team = cs_get_user_team( victim );
- if( att_team == CS_TEAM_CT && vic_team == CS_TEAM_T && !task_exists( victim + 9999 ) )
- {
- set_pev(victim, pev_flags, (pev(victim, pev_flags) | FL_FROZEN));
- set_user_health( victim, get_user_health( victim ) + 50 );
- CountDie[ victim ] = 15
- TofesetT[ victim ] = true
- //fm_set_user_godmode( victim, 1 )
- set_task(1.0, "TimerFrozen", victim + 9999,_,_, "b")
- fm_set_user_rendering(victim, kRenderFxGlowShell, 0, 120, 255, kRenderNormal, 16)
- return 1;
- }
- if( att_team == CS_TEAM_T && vic_team == CS_TEAM_T && task_exists( victim + 9999 ) )
- {
- set_pev(victim, pev_flags, (pev(victim, pev_flags) & ~FL_FROZEN))
- CountDie[ victim ] = false
- TofesetT[ victim ] = false
- set_user_rendering(victim, kRenderFxNone, 0, 0, 0, kRenderNormal, 16);
- ColorPrint(attacker, "Yo oo ooyo oo oo")
- set_user_health( victim, get_user_health( victim ) + 50 );
- fm_set_user_godmode( victim, 0 )
- remove_task(victim + 9999)
- return 1;
- }
- return HAM_SUPERCEDE;
- }
- if ( !is_user_connected( victim ) || !is_user_alive( victim ) || !is_user_connected( attacker ) || !is_user_alive( attacker ) )
- return 1;
- if ( g_mDay == -1 )
- return 1;
- static CsTeams: iTeam[ 2 ], g_mWeapon;
- iTeam[ 0 ] = cs_get_user_team( victim );
- iTeam[ 1 ] = cs_get_user_team( attacker );
- g_mWeapon = get_user_weapon( attacker );
- if ( bAttacker )
- formatex( szAttacker[ victim ], charsmax( szAttacker[] ), szName( attacker ) );
- if ( bTimeleft )
- {
- g_iTimer[ attacker ] = TIME_LEFT;
- fnAttackTime[ attacker ] = get_gametime();
- }
- if ( iTeam[ 0 ] == CS_TEAM_T && iTeam[ 0 ] == iTeam[ 1 ] )
- {
- if ( g_mWeapon == CSW_DEAGLE && g_mDay == DAY_PDEAGLE || damagebits & (1<<24) && g_mDay == DAY_PSHOT )
- {
- new Float:iOrigin[ 3 ], Float:Vec[ 3 ];
- get_velocity( victim, iOrigin, 1500.0, Vec );
- Vec[ 2 ] = 300.0;
- set_pev( victim, pev_velocity, Vec );
- }
- }
- if ( iTeam[ 0 ] == CS_TEAM_T && iTeam[ 0 ] == iTeam[ 1 ] )
- {
- if ( g_mWeapon == CSW_M3 && g_mDay == DAY_PSHOT || damagebits & (1<<24) && g_mDay == DAY_PSHOT )
- {
- new Float:iOrigin[ 3 ], Float:Vec[ 3 ];
- get_velocity( victim, iOrigin, 1500.0, Vec );
- Vec[ 2 ] = 300.0;
- set_pev( victim, pev_velocity, Vec );
- }
- }
- return 1;
- }
- public FwdWeaponPrimaryAttack( client )
- {
- if ( g_mDay == DAY_LASER )
- return 4;
- return 0;
- }
- public FwdPreThink( client )
- {
- if ( !is_user_connected( client ) || !is_user_alive( client ) || g_mDay == -1 )
- return 1;
- new button = fm_get_user_button( client );
- if ( cs_get_user_team( client ) == CS_TEAM_CT )
- {
- if ( g_mDay == DAY_NIGHT )
- {
- if ( button & IN_JUMP || button & IN_USE )
- {
- static Float:iOrigin[ 3 ];
- pev( client, pev_origin, iOrigin );
- if ( get_distance_f( iOrigin, g_iOrigin[ client ] ) > 10.0 )
- return 1;
- if ( fm_get_entity_flags( client ) & FL_ONGROUND )
- return 1;
- if ( button & IN_FORWARD )
- {
- static Float:iVelocity[ 3 ];
- velocity_by_aim( client, 270, iVelocity );
- fm_set_user_velocity( client, iVelocity );
- }
- else if ( button & IN_BACK )
- {
- static Float:iVelocity[ 3 ];
- velocity_by_aim( client, -270, iVelocity );
- fm_set_user_velocity( client, iVelocity );
- }
- }
- }
- if ( g_mDay == DAY_ZOMBIE )
- {
- CreateAura( client );
- }
- }
- else if ( cs_get_user_team( client ) == CS_TEAM_T )
- {
- if ( bTimeleft && fnAttackTime[ client ] + 1.0 < get_gametime() )
- {
- if ( g_iTimer[ client ] > 0 )
- g_iTimer[ client ]--;
- else user_slap( client, 15, 0 );
- fnAttackTime[ client ] = get_gametime();
- }
- if ( g_mDay == DAY_LASER && button & IN_ATTACK )
- {
- if ( get_user_weapon( client ) != CSW_DEAGLE )
- return 1;
- if ( fnAttack[ client ] + 0.1 > get_gametime() )
- return 1;
- if ( !g_mAmmo[ client ] && fnTime[ client ] + RELOAD_TIME > get_gametime() )
- return 1;
- fnAttack[ client ] = get_gametime();
- g_mAmmo[ client ]--;
- if ( !g_mAmmo[ client ] )
- fnTime[ client ] = get_gametime();
- emit_sound( client, CHAN_WEAPON, g_iSounds[ 0 ], VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
- static iOrigin[ 3 ], bOrigin[ 3 ], Targets[ 2 ];
- get_user_origin( client , iOrigin, 1 );
- get_user_origin( client , bOrigin, 3 );
- CreateLaser( iOrigin, bOrigin )
- CreateShake( client );
- get_user_aiming( client, Targets[ 0 ], Targets[ 1 ] );
- if ( is_user_connected( Targets[ 0 ] ) && cs_get_user_team( Targets[ 0 ] ) != CS_TEAM_CT )
- {
- CreateFadeScreen( Targets[ 0 ] );
- CreateBlood( Targets[ 0 ], 20 );
- emit_sound( client, CHAN_WEAPON, g_iSounds[ 1 ], VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
- if ( bAttacker )
- formatex( szAttacker[ Targets[ 0 ] ], charsmax( szAttacker[] ), szName( client ) );
- if ( bTimeleft )
- {
- g_iTimer[ client ] = TIME_LEFT
- fnAttackTime[ client ] = get_gametime();
- }
- if ( get_user_health( Targets[ 0 ] ) - 15 <= 0 )
- {
- fm_set_user_health( client, get_user_health( client ) + 25 );
- ColorPrint( client, "You Gained^4 25 ^1Health For Killing ^3%s ^4!", szName( Targets[ 0 ] ) );
- user_silentkill( Targets[ 0 ] );
- make_deathmsg( client, Targets[ 0 ], 0, "weapon_deagle" );
- }
- else
- fm_set_user_health( Targets[ 0 ], get_user_health( Targets[ 0 ] ) - 15 );
- }
- }
- }
- return 1;
- }
- public FwdTouch( client, world )
- {
- if ( g_mDay != DAY_NIGHT || !is_user_alive( client ) || cs_get_user_team( client ) != CS_TEAM_CT )
- return 1;
- new szClass[ 32 ];
- pev( world, pev_classname, szClass, charsmax( szClass ) );
- if ( equal( szClass, "worldspawn" ) || equal( szClass, "func_wall" ) || equal( szClass, "func_breakable" ) )
- pev( client, pev_origin, g_iOrigin[ client ] )
- return 1;
- }
- public FwdSetModel( ent, szModel[ ] )
- {
- if ( g_mDay == DAY_DODGEBALL )
- {
- if ( equali( szModel, "models/w_hegrenade.mdl" ) )
- {
- entity_set_model( ent, g_mModels[ 2 ] );
- return 4;
- }
- }
- return 1;
- }
- public FwdEmitSound( ent, channel, sample[], Float:volume, Float:atten, flags, pitch )
- {
- if ( g_mDay == DAY_DODGEBALL )
- {
- if( containi( sample, "he_bounce" ) != -1 )
- {
- if ( pev( ent, pev_fuser1 ) + 0.3 < get_gametime( ) )
- {
- set_pev( ent, pev_fuser1, get_gametime() );
- emit_sound( ent, CHAN_ITEM, g_mSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
- }
- return 4;
- }
- }
- return 1;
- }
- public FwdThinkGrenade( ent )
- {
- if ( g_mDay == DAY_DODGEBALL )
- {
- new szModel[ 64 ];
- pev( ent, pev_model, szModel, charsmax( szModel ) );
- if ( !equali( szModel, g_mModels[ 2 ] ) )
- return 0;
- return 1;
- }
- return 0;
- }
- /* Natives */
- /* Message */
- public MsgAudio()
- {
- new szString[ 32 ];
- get_msg_arg_string( 2, szString, charsmax( szString ) );
- if ( equal( szString, "%!MRAD_FIREINHOLE" ) )
- return 1;
- return 0;
- }
- public MsgText()
- {
- new szString[ 32 ];
- get_msg_arg_string( 2, szString, charsmax( szString ) );
- if ( equali( szString, "#Weapon_Cannot_Be_Dropped" ) )
- return 1;
- if ( get_msg_args() == 3 && get_msg_argtype( 2 ) == ARG_STRING )
- {
- if ( equali( szString, "#Game_teammate_attack" ) )
- return 1;
- }
- 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 1;
- }
- }
- return 0;
- }
- stock OpenCells(){
- new ent = -1
- while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
- dllfunc( DLLFunc_Use, ent, 0 );
- while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
- dllfunc( DLLFunc_Use, ent, 0 );
- }
- stock set_health( client , Health , bool: Kaful)
- {
- if(Kaful)
- {
- new players[32], pnum
- get_players(players, pnum, "ae", "TERRORIST");
- new iHealth = (Health * pnum);
- fm_set_user_health( client, iHealth )
- }
- else
- fm_set_user_health( client, Health )
- }
- /* Start Days */
- public CmdStartDay( index )
- {
- g_mDay = index;
- /* Open Cages */
- new ent = -1
- while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
- dllfunc( DLLFunc_Use, ent, 0 );
- while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
- dllfunc( DLLFunc_Use, ent, 0 );
- /* Main Day Start */
- static Players[ 32 ], iNum, client;
- get_players( Players, iNum, "ach" );
- /* Set Variables */
- g_fCount = -1.0;
- /* Reset Booleans */
- bAttacker = bTimeleft = false;
- if ( index != DAY_FREE )
- set_cvar_num( "bh_enabled", 0 );
- for ( new i; i < iNum ;i++ )
- {
- client = Players[ i ];
- fm_set_user_godmode( client, 0 );
- fnAttackTime[ client ] = get_gametime();
- g_iTimer[ client ] = TIME_LEFT;
- }
- switch ( index )
- {
- case DAY_FREE:
- {
- g_fCount = 60.0;
- for ( new i; i < iNum; i++ )
- {
- static wrandom;
- client = Players[ i ];
- fm_strip_user_weapons( client );
- fm_give_item( client, "weapon_knife" );
- fm_set_user_health( client, 100 );
- wrandom = random( 2 );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- {
- GiveItem( client, wrandom ? "weapon_m4a1" : "weapon_ak47", wrandom ? CSW_M4A1 : CSW_AK47, 9999 );
- GiveItem(client, "weapon_deagle", CSW_DEAGLE, 9999);
- }
- case CS_TEAM_T:
- fm_set_user_rendering( client, kRenderFxGlowShell, random( 255 ), random( 255 ), random( 255 ), kRenderNormal, 85 );
- }
- }
- }
- case DAY_SPEARGUN:
- {
- set_glow();
- set_cvar_num( "mp_friendlyfire", 1 );
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- {
- fm_set_user_godmode( client, 1 );
- }
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 1500 );
- give_speargun( client );
- }
- }
- }
- }
- case DAY_CANNON:
- {
- set_glow();
- set_cvar_num( "mp_friendlyfire", 1 );
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- {
- fm_set_user_godmode( client, 1 );
- }
- case CS_TEAM_T:
- {
- get_cannon( client )
- fm_set_user_health( client, 1500 );
- }
- }
- }
- }
- case DAY_1HPBOXDAY:
- {
- set_glow();
- bTimeleft = true;
- bAttacker = true;
- set_cvar_num( "mp_friendlyfire", 1 );
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- fm_set_user_godmode( client, 1 );
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 1 );
- fm_give_item( client, "weapon_knife" );
- }
- }
- }
- }
- case DAY_TACTICAL:
- {
- set_glow();
- set_cvar_num( "mp_friendlyfire", 1 );
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:fm_set_user_godmode( client, 1 );
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 1500 );
- give_tactical( client );
- }
- }
- }
- }
- case DAY_PUMPKIN:
- {
- set_glow();
- set_cvar_num( "mp_friendlyfire", 1 );
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:fm_set_user_godmode( client, 1 );
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 1500 );
- give_pumpkin__( client );
- }
- }
- }
- }
- case DAY_SGDRILL:
- {
- set_glow();
- set_cvar_num( "mp_friendlyfire", 1 );
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:fm_set_user_godmode( client, 1 );
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 1500 );
- give_sgdrill( client );
- }
- }
- }
- }
- case DAY_NIGHT:
- {
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- {
- fm_set_user_health( client, 450 );
- fm_give_item( client, "weapon_knife" );
- fm_set_user_rendering( client, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0 );
- }
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 100 );
- GiveItem( client, "weapon_m4a1", CSW_M4A1, 9999 );
- if(get_user_flags( client ) & ADMIN_LEVEL_H )
- {
- GiveItem( client, "weapon_m249", CSW_M249, 9999 );
- }
- }
- }
- }
- }
- case DAY_SHARK:
- {
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- {
- fm_set_user_health( client, 1000 );
- fm_give_item( client, "weapon_knife" );
- fm_set_user_noclip( client, 1 );
- }
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 100 );
- GiveItem( client, "weapon_m4a1", CSW_M4A1, 9999 );
- if(get_user_flags( client ) & ADMIN_LEVEL_H )
- {
- GiveItem( client, "weapon_m249", CSW_M249, 9999 );
- }
- }
- }
- }
- }
- case DAY_WAR:
- {
- bTimeleft = true;
- static wrandom;
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- wrandom = random( 2 );
- GiveItem( client, wrandom ? "weapon_m4a1" : "weapon_ak47", wrandom ? CSW_M4A1 : CSW_AK47, 9999 );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- fm_set_user_health( client, 2500 );
- case CS_TEAM_T:
- fm_set_user_health( client, 150 );
- }
- }
- }
- case DAY_HEADSHOT:
- {
- set_glow();
- bTimeleft = true;
- bAttacker = true;
- set_cvar_num( "mp_friendlyfire", 1 );
- set_user_hitzones(0, 0, 2)
- static wrandom;
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- wrandom = random( 2 );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- fm_set_user_godmode( client, 1 );
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 750 );
- GiveItem( client, wrandom ? "weapon_m4a1" : "weapon_ak47", wrandom ? CSW_M4A1 : CSW_AK47, 9999 );
- }
- }
- }
- }
- case DAY_PWAR:
- {
- set_glow();
- bTimeleft = true;
- bAttacker = true;
- set_cvar_num( "mp_friendlyfire", 1 );
- static wrandom;
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- wrandom = random( 2 );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- fm_set_user_godmode( client, 1 );
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 750 );
- GiveItem( client, wrandom ? "weapon_m4a1" : "weapon_ak47", wrandom ? CSW_M4A1 : CSW_AK47, 9999 );
- }
- }
- }
- }
- case DAY_KNIFE:
- {
- bTimeleft = true;
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- fm_give_item( client, "weapon_knife" );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- fm_set_user_health( client, 4000 );
- case CS_TEAM_T:
- fm_set_user_health( client, 100 );
- }
- }
- }
- case DAY_BOX:
- {
- set_glow();
- bTimeleft = true;
- bAttacker = true;
- set_cvar_num( "mp_friendlyfire", 1 );
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- fm_set_user_godmode( client, 1 );
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 500 );
- fm_give_item( client, "weapon_knife" );
- }
- }
- }
- }
- case DAY_TUG:
- {
- set_glow();
- TofesetDay = true
- bTimeleft = true;
- bAttacker = true;
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- {
- set_pev(client, pev_flags, (pev(i, pev_flags) | FL_FROZEN));
- set_task(21.0, "RemoveFreeze", client)
- fm_set_user_godmode(client, 1)
- fm_strip_user_weapons(client)
- iGive(client , 0 )
- }
- case CS_TEAM_T:
- {
- set_health( client , 10000 , false)
- fm_strip_user_weapons(client)
- fm_set_user_godmode(client, 0)
- iGive(client , 0 )
- }
- }
- }
- }
- case DAY_GUNGAME:
- {
- set_glow();
- bTimeleft = true;
- bAttacker = true;
- set_cvar_num( "mp_friendlyfire", 1 );
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- {
- fm_set_user_godmode( client, 1 );
- fm_strip_user_weapons(client);
- }
- case CS_TEAM_T:
- {
- set_health( client , 100 , false)
- fm_strip_user_weapons(client);
- fm_give_item( client, "weapon_glock18" )
- cs_set_user_bpammo( client, CSW_GLOCK18, 9999 )
- GunLevel[client] = 0;
- XpLevel[client] = 0;
- }
- }
- }
- }
- case DAY_DEAGLE:
- {
- bTimeleft = true;
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- GiveItem( client, "weapon_deagle", CSW_DEAGLE, 9999 );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- fm_set_user_health( client, 2000 );
- case CS_TEAM_T:
- fm_set_user_health( client, 150 );
- }
- }
- }
- case DAY_PDEAGLE:
- {
- set_glow();
- bTimeleft = true;
- bAttacker = true;
- set_cvar_num( "mp_friendlyfire", 1 );
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- fm_set_user_godmode( client, 1 );
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 500 );
- GiveItem( client, "weapon_deagle", CSW_DEAGLE, 9999 );
- }
- }
- }
- }
- case DAY_PSHOT:
- {
- set_glow();
- bTimeleft = true;
- bAttacker = true;
- set_cvar_num( "mp_friendlyfire", 1 );
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- fm_set_user_godmode( client, 1 );
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 500 );
- GiveItem( client, "weapon_m3", CSW_M3, 9999 );
- }
- }
- }
- }
- case DAY_HEG:
- {
- bTimeleft = true;
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- GiveItem( client, "weapon_hegrenade", CSW_HEGRENADE, 9999 );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- fm_set_user_health( client, 2000 );
- case CS_TEAM_T:
- fm_set_user_health( client, 150 );
- }
- }
- }
- case DAY_PHEG:
- {
- set_glow();
- bTimeleft = true;
- bAttacker = true;
- set_cvar_num( "mp_friendlyfire", 1 );
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- fm_set_user_godmode( client, 1 );
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 500 );
- GiveItem( client, "weapon_hegrenade", CSW_HEGRENADE, 9999 );
- }
- }
- }
- }
- case DAY_SNIPERS:
- {
- bTimeleft = true;
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- {
- fm_set_user_health( client, 4500 );
- GiveItem( client, "weapon_awp", CSW_AWP, 9999 );
- }
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 200 );
- GiveItem( client, "weapon_scout", CSW_SCOUT, 9999 );
- if(get_user_flags( client ) & ADMIN_LEVEL_H )
- {
- GiveItem( client, "weapon_awp", CSW_AWP, 9999 );
- }
- }
- }
- }
- }
- case DAY_DODGEBALL:
- {
- set_glow();
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- {
- fm_set_user_godmode( client, 1 );
- }
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 100 );
- GiveItem( client, "weapon_hegrenade", CSW_HEGRENADE, 9999 );
- }
- }
- }
- }
- case DAY_LASER:
- {
- set_glow();
- bTimeleft = true;
- bAttacker = true;
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- g_mAmmo[ client ] = MAX_AMMO;
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- fm_set_user_godmode( client, 1 );
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 500 );
- fm_give_item( client, "weapon_deagle" );
- cs_set_weapon_ammo( fm_find_ent_by_owner( 1, "weapon_deagle", client ), 0 );
- }
- }
- }
- }
- case DAY_ZOMBIE:
- {
- bTimeleft = true;
- g_fCount = 45.0;
- CreateFog( 0, 127, 127, 127, 0.004 );
- set_lights( "e" );
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- {
- fm_set_user_godmode( client, 1 );
- cs_set_user_model( client, "JailBreakZM" );
- fm_set_user_rendering( client, kRenderFxGlowShell, 0, 100, 255, kRenderNormal, 35 );
- set_pev( client, pev_flags, pev( client, pev_flags ) | FL_FROZEN );
- }
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 100 );
- }
- }
- }
- }
- case DAY_AWP:
- {
- set_glow();
- bTimeleft = true;
- bAttacker = true;
- set_cvar_num( "mp_friendlyfire", 1 );
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- fm_set_user_godmode( client, 1 );
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 700 );
- fm_give_item( client, "weapon_awp" );
- cs_set_user_bpammo( client, CSW_AWP, 9999 );
- }
- }
- }
- }
- case DAY_SHOTGUN:
- {
- set_glow();
- bTimeleft = true;
- bAttacker = true;
- set_cvar_num( "mp_friendlyfire", 1 );
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- fm_set_user_godmode( client, 1 );
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 700 );
- fm_give_item( client, "weapon_m3" );
- GiveItem( client, "weapon_m3", CSW_M3, 9999 );
- }
- }
- }
- }
- case DAY_DM:
- {
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- fm_strip_user_weapons( client );
- set_cvar_num( "mp_friendlyfire", 1 );
- switch ( cs_get_user_team( client ) )
- {
- case CS_TEAM_CT:
- {
- fm_set_user_health( client, 100 );
- fm_set_user_godmode( client, 1 );
- }
- case CS_TEAM_T:
- {
- fm_set_user_health( client, 100 );
- fm_give_item( client, "weapon_m4a1" );
- cs_set_user_bpammo( client, CSW_M4A1, 999);
- fm_give_item( client, "weapon_ak47" );
- cs_set_user_bpammo( client, CSW_AK47, 999);
- fm_give_item( client, "weapon_deagle");
- cs_set_user_bpammo( client, CSW_DEAGLE, 999);
- }
- }
- }
- g_iSeconds = 0, g_iMinutes = 3;
- CmdStartTimer( );
- }
- }
- bTimeleft = false;
- if ( g_fCount > 0 )
- set_task( 1.0, "taskStartTime", TASKID_TIMER );
- else
- {
- CmdShowMsg();
- CmdClientMsg();
- }
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- client_cmd( client, "say /music" );
- }
- }
- public RemoveFreeze(id)
- set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN))
- public taskStartTime()
- {
- set_hudmessage(0, 127, 255, -1.0, 0.15, 0, 6.0, 12.0)
- show_hudmessage(0, "%s Start^nTime Left %.1f", szDays[ g_mDay ], g_fCount)
- g_fCount -= 0.1;
- if ( g_fCount <= 0.0 )
- {
- switch ( g_mDay )
- {
- case DAY_ZOMBIE:
- {
- for ( new i = 1; i < g_iMaxPlayers; i++ )
- {
- if ( !is_user_connected( i ) || !is_user_alive( i ) )
- continue;
- fm_strip_user_weapons( i );
- if ( cs_get_user_team( i ) == CS_TEAM_CT )
- {
- set_pev( i, pev_flags, pev( i, pev_flags ) & ~FL_FROZEN );
- fm_set_user_health(i, 9500 );
- fm_set_user_godmode( i, 0 );
- fm_give_item( i, "weapon_knife" );
- }
- else if ( cs_get_user_team( i ) == CS_TEAM_T )
- {
- fm_set_user_health( i, 100 );
- GiveItem( i, "weapon_m4a1", CSW_M4A1, 9999 )
- GiveItem( i, "weapon_m4a1", CSW_AK47, 9999 )
- if( get_user_flags( i ) & ADMIN_LEVEL_H )
- {
- GiveItem( i, "weapon_m249", CSW_M249, 9999 )
- }
- }
- }
- }
- }
- set_hudmessage( random( 255 ), random( 255 ), random( 255 ), -1.0, 0.71, 1, 0.0, 5.0, 0.0, 0.0 );
- if ( g_mDay == DAY_ZOMBIE )
- show_hudmessage( 0, "%s Just Started ! ", szDays[ g_mDay ] );
- else if ( g_mDay == DAY_FREE )
- show_hudmessage( 0, "%s Is Now Over !", szDays[ g_mDay ] );
- CmdShowMsg();
- CmdClientMsg();
- }
- else
- {
- if ( task_exists( TASKID_TIMER ) )
- {
- remove_task( TASKID_TIMER );
- set_task( 0.1, "taskStartTime", TASKID_TIMER );
- }
- }
- }
- public CmdShowMsg()
- {
- if ( g_mDay == -1 )
- return 1;
- new iPlayer;
- static szMsg[ 2056 ], szText[ 128 ], Players[ 32 ], iNum;
- if( g_mDay == DAY_FREE || g_mDay == DAY_NIGHT || g_mDay == DAY_SHARK || g_mDay == DAY_WAR || g_mDay == DAY_KNIFE || g_mDay == DAY_DEAGLE || g_mDay == DAY_HEG || g_mDay == DAY_SNIPERS || g_mDay == DAY_ZOMBIE )
- get_players( Players, iNum, "aceh", "CT" );
- else
- get_players( Players, iNum, "aceh", "TERRORIST" );
- formatex( szMsg, charsmax( szMsg ), "%s # JailBreak^n^nCurrent Day - %s^n^n^n", szPrefix, szDays[ g_mDay ] );
- if( g_mDay == DAY_FREE || g_mDay == DAY_NIGHT || g_mDay == DAY_SHARK || g_mDay == DAY_WAR || g_mDay == DAY_KNIFE || g_mDay == DAY_DEAGLE || g_mDay == DAY_HEG || g_mDay == DAY_SNIPERS || g_mDay == DAY_ZOMBIE )
- formatex( szText, charsmax( szText ), "Counter-Terrorists Alives (%i)^n^n^n", TeamCount( "CT", "aceh" ) );
- else
- formatex( szText, charsmax( szText ), "Terrorists Alives (%i)^n^n^n", TeamCount( "TERRORIST", "aceh" ) );
- add( szMsg, charsmax( szMsg ), szText );
- for ( new i; i < iNum; i++ )
- {
- iPlayer = Players[ i ];
- if( g_mDay == DAY_DODGEBALL )
- formatex( szText, charsmax( szText ), "%s | Balls Threw: %i^n", szName( iPlayer ), iBallsThrown[ iPlayer ] );
- else
- formatex( szText, charsmax( szText ), "%s | %i Health^n", szName( Players[ i ] ), get_user_health( Players[ i ] ) );
- if( g_mDay == DAY_GUNGAME )
- formatex( szText, charsmax( szText ), "%s | Level ( %d / 15 ) - Kills ( %d / 2)^n",szName( Players[ i ] ), GunLevel[ iPlayer ],XpLevel[ iPlayer ]);
- add( szMsg, charsmax( szMsg ), szText );
- }
- set_hudmessage( 0, 127, 255, 0.05, 0.1, 0, 0.1, 0.3, 0.1, 0.1, 2 );
- for( new i = 0; i < get_maxplayers(); i++ )
- {
- if( is_user_connected( i ) )
- show_hudmessage( i, szMsg );
- }
- set_task( 0.2, "CmdShowMsg", TASKID_MESSAGE );
- return 1;
- }
- /*public CmdShowMsgDgl()
- {
- new iPlayer;
- if ( g_mDay == -1 )
- return 1;
- static szMsg[ 1024 ], szText[ 128 ], Players[ 32 ], iNum;
- get_players( Players, iNum, "ae", "TERRORIST" );
- formatex( szMsg, charsmax( szMsg ), "%s^nJailBreak Server^n^nCurrent Day - %s^n^n^n", szPrefix, szDays[ g_mDay ] );
- formatex( szText, charsmax( szText ), "Terorist Team: (%i)^n^n", TeamCount( "TERRORIST", "ae" ) );
- add( szMsg, charsmax( szMsg ), szText );
- for ( new i; i < iNum; i++ )
- {
- iPlayer = Players[ i ];
- formatex( szText, charsmax( szText ), "%s - Balls Threw: %i^n", szName( iPlayer ), iBallsThrown[ iPlayer ] );
- add( szMsg, charsmax( szMsg ), szText );
- }
- set_hudmessage( 0, 127, 255, 0.05, 0.1, 0, 0.1, 0.3, 0.1, 0.1, 2 );
- get_players( Players, iNum, "ch" );
- for ( new i; i < iNum; i++ )
- {
- show_hudmessage( Players[ i ], szMsg );
- }
- set_task( 0.2, "CmdShowMsgDgl", TASKID_MESSAGE );
- return 1;
- }*/
- public CmdClientMsg()
- {
- if ( g_mDay == -1 )
- return 1;
- static szMsg[ 1024 ], szText[ 128 ], Players[ 32 ], iNum, client, Float: g_fTime;
- get_players( Players, iNum, "ach" );
- for ( new i; i < iNum; i++ )
- {
- client = Players[ i ];
- szMsg = "Client Information:^n";
- formatex( szText, charsmax( szText ), " Health: %i HP^n", get_user_health( client ) );
- add( szMsg, charsmax( szMsg ), szText );
- if ( cs_get_user_team( client ) == CS_TEAM_T )
- {
- if ( bAttacker )
- {
- formatex( szText, charsmax( szText ), " Last Attacker: %s^n", szAttacker[ client ] );
- add( szMsg, charsmax( szMsg ), szText );
- }
- if ( bTimeleft )
- {
- formatex( szText, charsmax( szText ), " Time left: %i^n", g_iTimer[ client ] );
- add( szMsg, charsmax( szMsg ), szText );
- }
- if ( g_mDay == DAY_LASER )
- {
- if ( g_mAmmo[ client ] == 0 )
- {
- g_fTime = RELOAD_TIME - (get_gametime() - fnTime[ client ]);
- formatex( szText, charsmax( szText ), " Ammo: 0/%i (%.1f)^n", MAX_AMMO, g_fTime );
- if ( g_fTime <= 0.2 )
- g_mAmmo[ client ] = MAX_AMMO;
- }
- else
- formatex( szText, charsmax( szText ), " Ammo: %i/%i^n", g_mAmmo[ client ], MAX_AMMO, RELOAD_TIME - (get_gametime() - fnTime[ client ]) );
- add( szMsg, charsmax( szMsg ), szText );
- }
- }
- set_hudmessage( 0, 127, 255, 0.05, 0.6, 1, 0.1, 0.2, 0.1, 0.1, 1 );
- show_hudmessage( client, szMsg );
- }
- set_task( 0.1, "CmdClientMsg", TASKID_CLIENTMSG );
- return 1;
- }
- /* Dodgeball */
- public grenade_throw( client, gid, wid )
- {
- if ( g_mDay == DAY_DODGEBALL )
- {
- if ( wid == CSW_HEGRENADE )
- {
- iBallsThrown[ client ]++;
- set_pev( gid, pev_euser1, client );
- set_pev( gid, pev_iuser1, 0 );
- set_pev( gid, pev_size, Float:{-6.0,-6.0,-6.0}, Float:{6.0,6.0,6.0} );
- set_pev( gid, pev_friction, 0.6 );
- message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
- write_byte( TE_BEAMFOLLOW );
- write_short( gid );
- write_short( g_mTrail );
- write_byte( 20 );
- write_byte( 5 );
- write_byte( 0 );
- write_byte( random(255) );
- write_byte( random(255) );
- write_byte( random(255) );
- message_end( );
- fm_set_rendering( gid, kRenderFxGlowShell, 255, 170, 127 );
- set_task( 0.1, "CmdStopRolling" ,gid );
- }
- }
- }
- public CmdStopRolling( ent )
- {
- if ( g_mDay == DAY_DODGEBALL )
- {
- if( fm_is_valid_ent( ent ) )
- {
- if( fm_get_entity_flags( ent ) & FL_ONGROUND )
- {
- set_pev( ent, pev_velocity, Float:{0.0,0.0,0.0} );
- set_pev( ent, pev_gravity, 1.0 );
- fm_remove_entity( ent );
- }
- else set_task( 0.1, "CmdStopRolling", ent );
- }
- }
- }
- public PlayerInteract( ent, client )
- {
- if ( g_mDay == DAY_DODGEBALL )
- {
- if ( !is_valid_ent( ent ) )
- return 0;
- new szClassname[ 32 ], szModel[ 32 ];
- entity_get_string( ent, EV_SZ_classname, szClassname, charsmax( szClassname ) );
- entity_get_string( ent, EV_SZ_model, szModel, charsmax( szModel ) );
- if ( equali( szClassname, "armoury_entity" ) )
- {
- if ( equali( szModel, g_mModels[ 2 ] ) )
- {
- if ( user_has_dodgeball( client ) <= 0 )
- {
- fm_give_item( client, "weapon_hegrenade" );
- remove_entity( ent );
- }
- }
- return 1;
- }
- if( equali ( szClassname, "grenade") )
- CmdHitByBall( client, ent );
- }
- return 0;
- }
- public BallInteract( ball, ent )
- {
- if ( g_mDay == DAY_DODGEBALL )
- {
- if ( ent == 0 )
- {
- entity_set_int( ball, EV_INT_iuser1, 1 );
- set_rendering( ball );
- }
- else
- {
- new szClassname[ 32] ;
- entity_get_string( ent, EV_SZ_classname, szClassname, charsmax( szClassname ) );
- if ( equali ( szClassname, "func_", 5 ) )
- {
- entity_set_int( ball, EV_INT_iuser1, 1 );
- set_rendering( ball );
- }
- }
- }
- }
- public CmdHitByBall( client, ball )
- {
- if ( g_mDay == DAY_DODGEBALL )
- {
- if ( cs_get_user_team( client ) != CS_TEAM_T ) return 1;
- if( pev( ball, pev_iuser1 ) == 1 )
- {
- if( user_has_dodgeball( client ) <= 0 )
- fm_remove_entity( ball );
- return 1;
- }
- new Owner = pev( ball, pev_euser1 );
- if( Owner == client )
- {
- fm_remove_entity( ball );
- return 1;
- }
- new Float:iOrigin[ 3 ], Float:vec[ 3 ], Float:bOrigin[ 3 ], Float:Maxs[ 3 ];
- pev( ball, pev_origin, iOrigin );
- get_velocity( client, iOrigin, 5120.0, vec );
- vec[ 2 ] = 512.0;
- set_pev( client, pev_velocity, vec );
- fm_set_user_godmode( client, 1 );
- set_task( 0.1, "CmdKill" ,client );
- fm_remove_entity( ball );
- pev( client, pev_maxs, Maxs );
- pev( client, pev_origin, bOrigin );
- bOrigin[ 2 ] += Maxs[ 2 ];
- set_pev( ball, pev_iuser1, 1 );
- }
- return PLUGIN_CONTINUE;
- }
- public CmdKill( client )
- {
- if ( g_mDay == DAY_DODGEBALL )
- user_silentkill( client );
- }
- /* Stocks */
- stock ColorPrint( const index, const string[], any:... )
- {
- new szMsg[ 191 ], Players[ 32 ], PNum = 1;
- static iLen; iLen = formatex( szMsg, charsmax( szMsg ), "^4[^1%s^4]^1 ", szPrefix );
- vformat( szMsg[ iLen ], charsmax( szMsg ) - iLen, string, 3 );
- if ( index )
- Players[ 0 ] = index;
- else
- get_players( Players, PNum, "ch" );
- for ( new i; i < PNum; i++ )
- {
- if( is_user_connected( Players[ i ] ) )
- {
- message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, Players[ i ] );
- write_byte( Players[ i ] );
- write_string( szMsg );
- message_end( );
- }
- }
- return 1;
- }
- stock TeamCount( szTeam[ 12 ], szFlags[] )
- {
- static Players[ 32 ], iNum;
- get_players( Players, iNum, szFlags, szTeam )
- return iNum;
- }
- stock set_user_fade( const index, Float:fDuration = 1.0, r = 255, g = 255, b = 255, a = 255 )
- {
- message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), {0, 0, 0}, index );
- write_short(floatround( 4096.0 * fDuration, floatround_round) );
- write_short(floatround( 4096.0 * fDuration, floatround_round) );
- write_short( 4096 );
- write_byte( r );
- write_byte( g );
- write_byte( b );
- write_byte( a );
- message_end();
- }
- stock give_item_stock( client, const item[] )
- {
- if ( !equal( item, "weapon_", 7 ) )
- return 0;
- new ent = fm_create_entity( item );
- if ( !pev_valid( ent ) )
- return 0;
- new Float:origin[3];
- pev( client, pev_origin, origin );
- set_pev( ent, pev_origin, origin );
- set_pev( ent, pev_spawnflags, pev( ent, pev_spawnflags ) | SF_NORESPAWN );
- dllfunc( DLLFunc_Spawn, ent );
- new save = pev( ent, pev_solid );
- dllfunc( DLLFunc_Touch, ent, client );
- if ( pev( ent, pev_solid ) != save )
- return ent;
- engfunc( EngFunc_RemoveEntity, ent );
- return -1;
- }
- stock set_user_freeze( client, freeze=1 )
- {
- new iFlags;
- iFlags = pev( client, pev_flags );
- if( freeze ) fm_give_item(client,"weapon_knife");
- set_pev( client, pev_flags, freeze ? iFlags | FL_FROZEN : iFlags & ~FL_FROZEN );
- }
- stock iGive( client , iWep, bool: iWep2_B = false , iWep2 = 0 , bool: iWep3_B = false , iWep3 = 0 )
- {
- fm_strip_user_weapons(client)
- give_item_stock(client, iWeaponEntName[iWep])
- if(iWep && iWep != 9)
- cs_set_user_bpammo(client, iWeaponNum[iWep], 9999 )
- if(!iWep2_B)
- return 0;
- give_item_stock(client, iWeaponEntName[iWep2])
- if(iWep2 && iWep2 != 9)
- cs_set_user_bpammo(client, iWeaponNum[iWep2], 9999 )
- if(!iWep3_B)
- return 0;
- give_item_stock(client, iWeaponEntName[iWep3])
- if(iWep3 && iWep3 != 9)
- cs_set_user_bpammo(client, iWeaponNum[iWep3], 9999 )
- return 0;
- }
- stock bool: IsItemExists( const iItem, Item )
- {
- for ( new i; i < sizeof dOption; i++ )
- {
- if ( i == Item || dOption[ i ] != iItem )
- continue;
- return true;
- }
- return false;
- }
- stock GiveItem( const index, Class[], Index = 0, Ammo = 0 )
- {
- fm_give_item( index, Class );
- if ( equali( Class, "weapon_knife" ) )
- return 1;
- cs_set_user_bpammo( index, Index, Ammo );
- return 1;
- }
- stock get_velocity( ent, Float:fOrigin[ 3 ], Float:fSpeed, Float:fVelocity[ 3 ] )
- {
- new Float:fEntOrigin[3];
- pev( ent, pev_origin, fEntOrigin );
- new Float:fDistance[3];
- fDistance[0] = fEntOrigin[0] - fOrigin[0];
- fDistance[1] = fEntOrigin[1] - fOrigin[1];
- fDistance[2] = fEntOrigin[2] - fOrigin[2];
- new Float:fTime = ( vector_distance( fEntOrigin,fOrigin ) / fSpeed );
- fVelocity[0] = fDistance[0] / fTime;
- fVelocity[1] = fDistance[1] / fTime;
- fVelocity[2] = fDistance[2] / fTime;
- return (fVelocity[0] && fVelocity[1] && fVelocity[2]);
- }
- stock user_has_dodgeball( const index )
- {
- new Clip, Ammo;
- get_user_ammo( index, CSW_HEGRENADE, Clip, Ammo );
- return Ammo;
- }
- stock SetLights( szLights[] )
- {
- engfunc( EngFunc_LightStyle, 0, szLights );
- }
- stock szName( const index )
- {
- static mName[ 32 ];
- get_user_name( index, mName, charsmax( mName ) );
- return mName;
- }
- stock CreateLaser( 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
- write_short( g_mTrail ); // Sprite
- write_byte( 1 ); // Start Frame
- write_byte( 5 ); // Frame Rate
- write_byte( 3 ); // Life
- write_byte( 50 ); // Width
- write_byte( 10 ); // Noise
- write_byte ( random_num( 100, 255 ) ); // Red
- write_byte ( random_num( 100, 255 ) ); // Green
- write_byte ( random_num( 100, 255 ) ); // Blue
- write_byte( 255 ); // Alpha
- write_byte( 0 ); // Speed
- message_end();
- }
- stock CreateShake( const client )
- {
- static duration;
- duration = FixedUnsigned16( 1.0, 1<<12 );
- message_begin( MSG_ONE, get_user_msgid( "ScreenShake" ), {0,0,0}, client );
- write_short( 0xFFFF );
- write_short( duration );
- write_short( 0xFFFF );
- message_end();
- }
- public CreateFadeScreen( const client )
- {
- message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), {0, 0, 0}, client );
- write_short( floatround(4096.0 * 2.0, floatround_round) );
- write_short( floatround(4096.0 * 2.0, floatround_round) );
- write_short( 4096 );
- write_byte( 255 );
- write_byte( 10 );
- write_byte( 10 );
- write_byte( 75 );
- message_end();
- }
- stock CreateBlood( const client, bScale )
- {
- new Float:iOrigin[ 3 ];
- pev( client, pev_origin, iOrigin );
- message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
- write_byte( 115 );
- write_coord( floatround( iOrigin[ 0 ] + random_num( -20, 20 ) ) );
- write_coord( floatround( iOrigin[ 1 ] + random_num( -20, 20 ) ) );
- write_coord( floatround( iOrigin[ 2 ] + random_num( -20, 20 ) ) );
- write_short( g_mBlood );
- write_short( g_mBlood );
- write_byte( 248 );
- write_byte( bScale );
- message_end();
- }
- stock CreateFog( const index = 0, const red = 127, const green = 127, const blue = 127, const Float:density_f = 0.001, bool:clear = false )
- {
- static msgFog;
- if ( msgFog || ( msgFog = get_user_msgid( "Fog" ) ) )
- {
- new density = _:floatclamp( density_f, 0.0001, 0.25 ) * _:!clear;
- message_begin(index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, msgFog, .player = index );
- write_byte( clamp( red, 0, 255 ) );
- write_byte( clamp( green, 0, 255 ) );
- write_byte( clamp( blue , 0, 255 ) );
- write_byte( ( density & 0xFF ) );
- write_byte( ( density >> 8 ) & 0xFF );
- write_byte( ( density >> 16 ) & 0xFF );
- write_byte( ( density >> 24 ) & 0xFF );
- message_end();
- }
- }
- stock CreateAura( const index )
- {
- static iOrigin[ 3 ];
- get_user_origin( index, iOrigin );
- message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin );
- write_byte( TE_DLIGHT );
- write_coord( iOrigin[ 0 ] );
- write_coord( iOrigin[ 1 ] );
- write_coord( iOrigin[ 2 ] );
- write_byte( 15 );
- write_byte( 0 );
- write_byte( 100 );
- write_byte( 255 );
- write_byte( 2 ) ;
- write_byte( 0 );
- message_end();
- }
- stock FixedUnsigned16( Float:flValue, iScale )
- {
- new iOutput;
- iOutput = floatround( flValue * iScale );
- if ( iOutput < 0 )
- iOutput = 0;
- if ( iOutput > 0xFFFF )
- iOutput = 0xFFFF;
- return iOutput;
- }
- public Showasd(id) {
- show_menu(id, Keysasd, "\ybulbukla\rd\wa\d^n", -1, "asd") // Display menu
- }
- public Pressedasd(id, key) {
- /* Menu:
- * bulbuklada
- */
- switch (key) {
- case 0: { // 1
- }
- }
- }
- /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
- *{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1033{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement