Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define USE_RULES // This plugin uses special rules
- // Includes
- #include < amxmodx >
- #include < cstrike >
- #include < fakemeta_util >
- #include < lastrequest >
- // Defines
- #define LR_MODE LR_SPECIAL_BATTLES // To decide to which category this plugin match
- #define TASKID_DELAY 11111 // Don't touch
- // Enums
- enum _:BATTLE_IDS
- {
- TAKE_AWAY_THE_BOMB,
- GUN_TOSS,
- KILL_THE_NOCLIP_MAN,
- STRIP_DUEL,
- SURVIVAL_DUEL,
- SPRAY_DUEL,
- INVISIBLE_DUEL
- };
- // Strings
- new const szBattles[ BATTLE_IDS ][ ] =
- {
- "Take Away The Bomb",
- "Gun Toss",
- "Kill The Noclip Man",
- "Strip Battles",
- "Survival Battles",
- "Spray Battles",
- "Invisible Battles"
- };
- // Others
- new g_iBattleIDs[ BATTLE_IDS ];
- new g_mGameID = -1;
- new g_iVictim
- new g_iPlayer;
- public plugin_init()
- {
- register_plugin( "LR: Basic Custome Wars", "1.0", "Rejack" );
- register_forward( FM_SetModel,"FwdSetModel" );
- static i;
- for ( i = 0; i < BATTLE_IDS; i++ ) // Register lrs
- {
- g_iBattleIDs[ i ] = register_special_lr( szBattles[ i ], true/*, true, "cmdOpenRulesMenu"*/ );
- if ( g_iBattleIDs[ i ] == -1 )
- log_amx( "[LR:Basic Special Wars] ERROR: Failed to register special lr (i=%i) : %s", i, szBattles[ i ] );
- }
- }
- public FwdLrStarted( const client, const victim, const g_iCategory, const iGameID, const g_iDelay )
- {
- if ( g_iCategory != LR_MODE ) // Not this category
- return 1;
- static i;
- for ( i = 0; i < BATTLE_IDS; i++ ) // Look to see if the game Id mathces this plugin
- {
- if ( g_iBattleIDs[ i ] == iGameID )
- {
- g_mGameID = i;
- }
- }
- if ( g_mGameID == -1 ) // If didn't match move on
- return 1;
- g_iVictim = victim;
- g_iPlayer = client;
- set_task( float( g_iDelay ), "taskStartBattle", TASKID_DELAY );
- return 1;
- }
- public FwdLrEnded( const winner )
- {
- g_mGameID = -1;
- }
- public FwdSetModel( ent )
- {
- if ( !pev_valid( ent ) )
- return 1;
- if ( g_mGameID != GUN_TOSS && g_mGameID != TAKE_AWAY_THE_BOMB )
- return 1;
- static client;
- client = pev( ent, pev_owner );
- if ( !is_user_connected( client ) )
- return 1;
- switch ( get_user_team( client ) )
- {
- case 1: // Terrorists
- fm_set_rendering( ent, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 16 );
- case 2: // Counter-Terrorists
- fm_set_rendering( ent, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 16 );
- }
- return 1;
- }
- public taskStartBattle( )
- {
- switch ( g_mGameID )
- {
- case TAKE_AWAY_THE_BOMB:
- {
- // Prisoner Settings
- fm_give_item( g_iPlayer, "weapon_deagle" );
- fm_give_item( g_iPlayer, "weapon_c4" );
- cs_set_user_bpammo( g_iPlayer, CSW_DEAGLE, 9999 );
- // Guard Settings
- fm_give_item( g_iVictim, "weapon_deagle" );
- fm_give_item( g_iVictim, "weapon_c4" );
- cs_set_user_bpammo( g_iVictim, CSW_DEAGLE, 9999 );
- }
- case GUN_TOSS:
- {
- // Prisoner Settings
- fm_give_item( g_iPlayer, "weapon_deagle" );
- fm_give_item( g_iPlayer, "weapon_knife" );
- cs_set_user_bpammo( g_iPlayer, CSW_DEAGLE, 0 );
- cs_set_weapon_ammo( fm_find_ent_by_owner( -1, "weapon_deagle", g_iPlayer ), 0 );
- // Guard Settings
- fm_give_item( g_iVictim, "weapon_deagle" );
- fm_give_item( g_iVictim, "weapon_knife" );
- cs_set_user_bpammo( g_iVictim, CSW_DEAGLE, 0 );
- cs_set_weapon_ammo( fm_find_ent_by_owner( -1, "weapon_deagle", g_iVictim ), 0 );
- }
- case KILL_THE_NOCLIP_MAN:
- {
- // Prisoner Settings
- fm_give_item( g_iPlayer, "weapon_deagle" );
- fm_give_item( g_iPlayer, "weapon_m4a1" );
- cs_set_user_bpammo( g_iPlayer, CSW_DEAGLE, 9999 );
- cs_set_user_bpammo( g_iPlayer, CSW_M4A1, 9999 );
- // Guard Settings
- fm_set_user_noclip( g_iVictim, 1 );
- fm_give_item( g_iVictim, "weapon_knife" );
- }
- case STRIP_DUEL:
- {
- // Prisoner Settings
- fm_give_item( g_iPlayer, "weapon_knife" );
- // Guard Settings
- }
- case SURVIVAL_DUEL:
- {
- // Prisoner Settings
- fm_give_item( g_iPlayer, "weapon_m4a1" );
- cs_set_user_bpammo( g_iPlayer, CSW_M4A1, 9999 );
- // Guard Settings
- fm_set_user_health( g_iVictim, 5000 );
- fm_give_item( g_iVictim, "weapon_knife" );
- }
- case SPRAY_DUEL:
- {
- // Prisoner Settings
- fm_give_item( g_iPlayer, "weapon_knife" );
- // Guard Settings
- fm_give_item( g_iVictim, "weapon_knife" );
- }
- case INVISIBLE_DUEL:
- {
- // Prisoner Settings
- fm_give_item( g_iPlayer, "weapon_m4a1" );
- cs_set_user_bpammo( g_iPlayer, CSW_M4A1, 9999 );
- fm_set_user_rendering( g_iPlayer, kRenderFxNone, 20, 20, 20, kRenderTransAlpha , 1 );
- // Guard Settings
- fm_give_item( g_iVictim, "weapon_m4a1" );
- cs_set_user_bpammo( g_iVictim, CSW_M4A1, 9999 );
- fm_set_user_rendering( g_iVictim, kRenderFxNone, 20, 20, 20, kRenderTransAlpha, 1 );
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement