Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Includes
- #include < amxmodx >
- #include < cstrike >
- #include < fakemeta_util >
- #include < lastrequest >
- // Defines
- #define LR_MODE LR_CUSTOME_BATTLES // To decide to which category this plugin match
- #define TASKID_DELAY 11111 // Don't touch
- // Enums
- enum _:BATTLE_IDS
- {
- KNIFE,
- M4A1,
- AK47,
- AWP,
- SCOUT,
- USP,
- GLOCK,
- DEAGLE,
- ELITE,
- M3,
- XM1014,
- M249,
- GALIL,
- AUG,
- FAMAS,
- MP5,
- UZI,
- P90
- };
- enum _:BATTLE_DATA
- {
- BATTLE_NAME[ 32 ],
- BATTLE_WEAPON_CLASS[ 32 ],
- BATTLE_WEAPON_ID
- };
- // Strings
- new const szBattles[ BATTLE_IDS ][ BATTLE_DATA ] =
- {
- { "Knife Battles", "weapon_knife", CSW_KNIFE },
- { "M4A1 Battles", "weapon_m4a1", CSW_M4A1 },
- { "AK47 Battles", "weapon_ak47", CSW_AK47 },
- { "AWP Battles", "weapon_awp", CSW_AWP },
- { "SCOUT Battles", "weapon_scout", CSW_SCOUT },
- { "USP Battles", "weapon_usp", CSW_USP },
- { "Glock Battles", "weapon_glock18", CSW_GLOCK18 },
- { "Deagle Battles", "weapon_deagle", CSW_DEAGLE },
- { "Dual-Elite Battles", "weapon_elite", CSW_ELITE },
- { "M3 Battles", "weapon_m3", CSW_M3 },
- { "XM1014 Battles", "weapon_xm1014", CSW_XM1014 },
- { "M249 Battles", "weapon_m249", CSW_M249 },
- { "Galil Battles", "weapon_galil", CSW_GALIL },
- { "AUG Battles", "weapon_aug", CSW_AUG },
- { "Famas Battles", "weapon_famas", CSW_FAMAS },
- { "MP5 Battles", "weapon_mp5navy", CSW_MP5NAVY },
- { "Uzi Battles", "weapon_mac10", CSW_MAC10 },
- { "P90 Battles", "weapon_p90", CSW_P90 }
- };
- // 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" );
- static i, szBuffer[ 32 ];
- for ( i = 0; i < BATTLE_IDS; i++ ) // Register lrs
- {
- formatex( szBuffer, charsmax( szBuffer ), szBattles[ i ][ BATTLE_NAME ] );
- g_iBattleIDs[ i ] = register_custome_lr( szBuffer, true );
- }
- }
- 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( )
- {
- g_mGameID = -1;
- g_iVictim = 0;
- g_iPlayer = 0;
- if ( task_exists( TASKID_DELAY ) )
- remove_task( TASKID_DELAY );
- return 1;
- }
- public taskStartBattle( )
- {
- fm_give_item( g_iVictim, szBattles[ g_mGameID ][ BATTLE_WEAPON_CLASS ] );
- fm_give_item( g_iPlayer, szBattles[ g_mGameID ][ BATTLE_WEAPON_CLASS ] );
- if ( szBattles[ g_mGameID ][ BATTLE_WEAPON_ID ] != CSW_KNIFE )
- {
- cs_set_user_bpammo( g_iVictim, szBattles[ g_mGameID ][ BATTLE_WEAPON_ID ], 9999 );
- cs_set_user_bpammo( g_iPlayer, szBattles[ g_mGameID ][ BATTLE_WEAPON_ID ], 9999 );
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment