Raised This Month: $ Target: $400
 0% 

[AMXX 1.8.1] Changing the amount of ammunition for the weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Daku
Senior Member
Join Date: Nov 2009
Location: Poland / Polska
Old 11-13-2009 , 13:21   Re: [AMXX 1.8.1] Changing the amount of ammunition for the weapons
Reply With Quote #1

I do not know whether this is good but I do such a thing

Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <cstrike>

new MP5_MODEL_NAME[64] = "models/mp5test/v_mp.mdl"

public plugin_init(){
	register_plugin("2MP5& 2X ammo","1.0","Daku")
}

public checkModel(id){ 
	if (!is_user_alive(id)){
		return PLUGIN_CONTINUE
	}
	entity_set_string(id, EV_SZ_viewmodel, MP5_MODEL_NAME)

	new iCurrent
	iCurrent = find_ent_by_class(-1,"weapon_mp5navy")

	while(iCurrent != 0) {
		iCurrent = find_ent_by_class(iCurrent,"weapon_mp5navy")
	}

	return PLUGIN_HANDLED
} 

public checkWeapon(id){ 
	new plrClip, plrAmmo, plrWeap[32]
	new plrWeapId

	plrWeapId = get_user_weapon(id, plrClip, plrAmmo)
	cs_set_user_ammo(19, 60)
        cs_set_user_bpammo(id, CSW_MP5NAVY, 240)

	if (plrWeapId == CSW_MP5NAVY){
		checkModel(id)
		cs_set_weapon_ammo(plrWeapId,60)
	}
	else {
	    // Otherwise just leave this function
		return PLUGIN_CONTINUE
	}

	if (plrClip == 0){
		if(get_cvar_num("amx_dualmp5_unlimitedammo") == 1) {
			// ^ If the user is out of ammo..
			get_weaponname(plrWeapId, plrWeap, 31)
			// Get the name of their weapon (MP5, duh!)
			give_item(id, plrWeap)
			// Give them another MP5 (ammo)
			engclient_cmd(id, plrWeap) 
			engclient_cmd(id, plrWeap)
			engclient_cmd(id, plrWeap)
			// Sending multiple times may help
		}
	}

	return PLUGIN_CONTINUE 
}
compile.exe get an error " error 017: undefinied symbol "cs_set_user_ammo""
and crash


I find
Weapons MaxClip 0.2.0 (07 mar 2009)
http://forums.alliedmods.net/showthread.php?t=82093

BackPack Ammo Features
http://forums.alliedmods.net/showthread.php?t=81183

Last edited by Daku; 11-13-2009 at 13:33.
Daku is offline
Send a message via Skype™ to Daku
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 11-13-2009 , 13:42   Re: [AMXX 1.8.1] Changing the amount of ammunition for the weapons
Reply With Quote #2

Include <cstrike>
__________________
unnyquee is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode