Rejack

Jailbreak - Last Request (Custome Wars)

Sep 26th, 2020 (edited)
1,690
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.07 KB | None | 0 0
  1. // Includes
  2.  
  3. #include < amxmodx >
  4. #include < cstrike >
  5. #include < fakemeta_util >
  6. #include < lastrequest >
  7.  
  8. // Defines
  9.  
  10. #define LR_MODE LR_CUSTOME_BATTLES      // To decide to which category this plugin match
  11.  
  12. #define TASKID_DELAY    11111   // Don't touch
  13.  
  14. // Enums
  15.  
  16. enum _:BATTLE_IDS
  17. {
  18.     KNIFE,
  19.     M4A1,
  20.     AK47,
  21.     AWP,
  22.     SCOUT,
  23.     USP,
  24.     GLOCK,
  25.     DEAGLE,
  26.     ELITE,
  27.     M3,
  28.     XM1014,
  29.     M249,
  30.     GALIL,
  31.     AUG,
  32.     FAMAS,
  33.     MP5,
  34.     UZI,
  35.     P90
  36. };
  37.  
  38. enum _:BATTLE_DATA
  39. {
  40.     BATTLE_NAME[ 32 ],
  41.     BATTLE_WEAPON_CLASS[ 32 ],
  42.     BATTLE_WEAPON_ID
  43. };
  44.  
  45. // Strings
  46.  
  47. new const szBattles[ BATTLE_IDS ][ BATTLE_DATA ] =
  48. {
  49.     { "Knife Battles""weapon_knife",     CSW_KNIFE },
  50.    
  51.     { "M4A1 Battles",   "weapon_m4a1",      CSW_M4A1 },
  52.     { "AK47 Battles",   "weapon_ak47",      CSW_AK47 },
  53.     { "AWP Battles",    "weapon_awp",       CSW_AWP },
  54.     { "SCOUT Battles""weapon_scout",     CSW_SCOUT },
  55.    
  56.     { "USP Battles",    "weapon_usp",       CSW_USP },
  57.     { "Glock Battles""weapon_glock18",   CSW_GLOCK18 },
  58.     { "Deagle Battles", "weapon_deagle",    CSW_DEAGLE },
  59.     { "Dual-Elite Battles", "weapon_elite",     CSW_ELITE },
  60.    
  61.     { "M3 Battles",     "weapon_m3",        CSW_M3 },
  62.     { "XM1014 Battles", "weapon_xm1014",    CSW_XM1014 },
  63.    
  64.     { "M249 Battles",   "weapon_m249",      CSW_M249 },
  65.    
  66.     { "Galil Battles""weapon_galil",     CSW_GALIL },
  67.     { "AUG Battles",    "weapon_aug",       CSW_AUG },
  68.     { "Famas Battles""weapon_famas",     CSW_FAMAS },
  69.    
  70.     { "MP5 Battles",    "weapon_mp5navy",   CSW_MP5NAVY },
  71.     { "Uzi Battles",    "weapon_mac10",     CSW_MAC10 },
  72.     { "P90 Battles",    "weapon_p90",       CSW_P90 }
  73.    
  74. };
  75.  
  76. // Others
  77.  
  78. new g_iBattleIDs[ BATTLE_IDS ];
  79.  
  80. new g_mGameID   = -1;
  81.  
  82. new g_iVictim
  83. new g_iPlayer;
  84.  
  85. public plugin_init()
  86. {
  87.     register_plugin( "LR: Basic Custome Wars", "1.0", "Rejack" );
  88.    
  89.     static i, szBuffer[ 32 ];
  90.    
  91.     for ( i = 0; i < BATTLE_IDS; i++ )  // Register lrs
  92.     {
  93.         formatex( szBuffer, charsmax( szBuffer ), szBattles[ i ][ BATTLE_NAME ] );
  94.        
  95.         g_iBattleIDs[ i ]   = register_custome_lr( szBuffer, true );
  96.     }
  97. }
  98.  
  99. public FwdLrStarted( const client, const victim, const g_iCategory, const iGameID, const g_iDelay )
  100. {
  101.     if ( g_iCategory != LR_MODE )   // Not this category
  102.         return 1;
  103.    
  104.     static i;
  105.    
  106.     for ( i = 0; i < BATTLE_IDS; i++ )      // Look to see if the game Id mathces this plugin
  107.     {
  108.         if ( g_iBattleIDs[ i ] == iGameID )
  109.         {
  110.             g_mGameID   = i;
  111.         }
  112.     }
  113.    
  114.     if ( g_mGameID == -1 )  // If didn't match move on
  115.         return 1;
  116.    
  117.     g_iVictim   = victim;
  118.     g_iPlayer   = client;
  119.    
  120.     set_task( float( g_iDelay ), "taskStartBattle", TASKID_DELAY );
  121.    
  122.     return 1;
  123. }
  124.  
  125. public FwdLrEnded( )
  126. {
  127.     g_mGameID   = -1;
  128.    
  129.     g_iVictim   = 0;
  130.     g_iPlayer   = 0;
  131.    
  132.     if ( task_exists( TASKID_DELAY ) )
  133.         remove_task( TASKID_DELAY );
  134.    
  135.     return 1;
  136. }
  137.  
  138. public taskStartBattle( )
  139. {
  140.     fm_give_item( g_iVictim, szBattles[ g_mGameID ][ BATTLE_WEAPON_CLASS ] );
  141.    
  142.     fm_give_item( g_iPlayer, szBattles[ g_mGameID ][ BATTLE_WEAPON_CLASS ] );
  143.    
  144.     if ( szBattles[ g_mGameID ][ BATTLE_WEAPON_ID ] != CSW_KNIFE )
  145.     {
  146.         cs_set_user_bpammo( g_iVictim, szBattles[ g_mGameID ][ BATTLE_WEAPON_ID ], 9999 );
  147.        
  148.         cs_set_user_bpammo( g_iPlayer, szBattles[ g_mGameID ][ BATTLE_WEAPON_ID ], 9999 );
  149.     }
  150.    
  151.     return 1;
  152. }
  153.  
Add Comment
Please, Sign In to add comment