Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <fakemeta_util>
- #include <cstrike>
- #define OFFSET_CLIPAMMO 51 //+ EXTRA_OFFSET_WEAPONS
- #define EXTRAOFFSET_WEAPONS 4 // weapon offsets are obviously only 4 steps higher on Linux!
- new szCurWeapon,WeaponsMaxClips[] ={
- -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
- },PLUGIN[][]={"Free AMMOS Round", "1.0", "Seroff"};
- public plugin_init(){
- register_plugin(PLUGIN[0],PLUGIN[1],PLUGIN[2]);
- szCurWeapon = get_user_msgid("CurWeapon");
- register_event("ResetHUD", "szAmmo", "be");
- }
- new Weapon[]={
- CSW_P228,
- CSW_ELITE,
- CSW_FIVESEVEN,
- CSW_USP,
- CSW_GLOCK18,
- CSW_DEAGLE,
- CSW_SCOUT,
- CSW_XM1014,
- CSW_MAC10,
- CSW_AUG,
- CSW_UMP45,
- CSW_SG550,
- CSW_GALIL,
- CSW_AK47,
- CSW_AWP,
- CSW_MP5NAVY,
- CSW_M249,
- CSW_M3,
- CSW_M4A1,
- CSW_TMP,
- CSW_G3SG1,
- CSW_SG552,
- CSW_P90
- }
- new WeaponAmmo[]={
- 52,
- 120,
- 100,
- 100,
- 120,
- 35,
- 90,
- 32,
- 100,
- 90,
- 100,
- 90,
- 90,
- 90,
- 30,
- 120,
- 200,
- 32,
- 90,
- 120,
- 90,
- 90,
- 100
- }
- public szAmmo(id){
- set_task(0.1, "refill_ammo",id);
- set_task(0.1, "sz_getammo",id);
- }
- public sz_getammo(id){
- for(new i;i<sizeof(Weapon);i++){
- if(user_has_weapon(id,Weapon[i])) cs_set_user_bpammo(id, Weapon[i], WeaponAmmo[i]);
- }
- }
- public refill_ammo(id){
- for(new i;i<sizeof(Weapon);i++){
- if(user_has_weapon(id,Weapon[i])){
- new ent = fm_get_user_weapon_entity(id, Weapon[i]);
- if(pev_valid(ent)){
- set_pdata_int(ent, OFFSET_CLIPAMMO, WeaponsMaxClips[Weapon[i]], EXTRAOFFSET_WEAPONS);
- message_begin(MSG_ONE, szCurWeapon, _, id);
- write_byte(1);
- write_byte(Weapon[i]);
- write_byte(WeaponsMaxClips[Weapon[i]]);
- message_end();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment