Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <cstrike>
- #include <hamsandwich>
- #include <cstrike_pdatas>
- #define PLUGIN "Freeammo"
- #define VERSION "1.0"
- enum _:AmmoIds
- {
- __ammo_none = 0,
- __ammo_338magnum = 1, // 30
- __ammo_762nato, // 90
- __ammo_556natobox, // 200
- __ammo_556nato, // 90
- __ammo_buckshot, // 32
- __ammo_45acp, // 100
- __ammo_57mm, // 100
- __ammo_50ae, // 35
- __ammo_357sig, // 52
- __ammo_9mm, // 120
- __ammo_flashbang, // 2
- __ammo_hegrenade, // 1
- __ammo_smokegrenade, // 1
- __ammo_c4 // 1
- }
- new const g_iMaxBpAmmo[AmmoIds] = {
- 0,
- 30,
- 90,
- 200,
- 90,
- 32,
- 100,
- 100,
- 35,
- 52,
- 120,
- 2,
- 1,
- 1,
- 1
- }
- new const g_iMaxClip[CSW_P90+1] = {
- -1, 13, -1, 10, 1, 7, 1, 30, 30, 1, 30,
- 20, 25, 30, 35, 25, 12, 20, 10, 30, 100,
- 8 , 30, 30, 20, 2, 7, 30, 30, -1, 50}
- public plugin_init()
- {
- register_plugin( PLUGIN, VERSION, "ConnorMcLeod" )
- RegisterHam(Ham_Spawn, "player", "OnCBasePlayer_Spawn_Post", true)
- register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0")
- }
- public Event_HLTV_New_Round()
- {
- new players[ 32 ], num, id, iWeapon, slot
- get_players(players, num, "a")
- for(--num; num>=0; num--)
- {
- id = players[ num ]
- for(slot = 1; slot<= 2; slot++ )
- {
- iWeapon = get_pdata_cbase(id, m_rgpPlayerItems_CBasePlayer[slot])
- while( iWeapon > 0 )
- {
- cs_set_weapon_ammo(iWeapon, g_iMaxClip[ cs_get_weapon_id(iWeapon) ])
- iWeapon = get_pdata_cbase(iWeapon, m_pNext, XO_CBASEPLAYERITEM)
- }
- }
- }
- }
- public OnCBasePlayer_Spawn_Post( id )
- {
- if( !is_user_alive(id) ) return;
- for(new i=__ammo_338magnum; i<=__ammo_9mm; i++)
- {
- set_pdata_int(id, m_rgAmmo_CBasePlayer[i], g_iMaxBpAmmo[i])
- }
- }
Add Comment
Please, Sign In to add comment