Raised This Month: $342 Target: $400
 85%   Almost there!

Extra Damage Mod (Gives weapons extra damage in CS!!!)


Post New Thread Reply   
 
Thread Tools Display Modes
Kaal979
Member
Join Date: Aug 2011
Old 08-27-2012 , 17:05   Re: Extra Damage Mod (Gives weapons extra damage in CS!!!)
Reply With Quote #41

Very good mod idea but bad realisation.
You seriously suppose players to load concole
commands for each weapon over and over again
while its so much easier to simply make a double
damage for all plugin! This would truly improve
the game especially on high difficulties.
__________________
CZ Terror Team "WORGA" Replacement >>
https://onedrive.live.com/?cid=858C2...949A324E%21105
Kaal979 is offline
FreakFrozt
New Member
Join Date: Dec 2012
Old 12-16-2012 , 08:53   Re: Extra Damage Mod (Gives weapons extra damage in CS!!!)
Reply With Quote #42

I still don't know how to use it. Please tell me step by step...
FreakFrozt is offline
Row
BANNED
Join Date: Jun 2013
Location: Romania
Old 07-01-2013 , 04:15   Re: Extra Damage Mod (Gives weapons extra damage in CS!!!)
Reply With Quote #43

Nice
Row is offline
Old 07-08-2013, 11:54
PKGamerX
This message has been deleted by PKGamerX. Reason: Unnecessary.
DaTesTer23
New Member
Join Date: Nov 2016
Old 11-02-2016 , 20:07   Re: Extra Damage Mod (Gives weapons extra damage in CS!!!)
Reply With Quote #44

Guys, I have tested some parts of the plugin and I know something now, the plugin add extra damage but if you use -100 you will remove the extra damage of the gun, but it will don't remove the original damage of the gun.

If you use "sv_restart" the guns will continue with the same extra damage, but if you exit the map and comeback, the weapons will have the reset the extra damage.

First Post...
DaTesTer23 is offline
Ark_Procession
Member
Join Date: Jun 2020
Location: Argentina
Old 08-14-2020 , 14:38   Re: Extra Damage Mod (Gives weapons extra damage in CS!!!)
Reply With Quote #45

Hi! With the help of OciXcrom this version of the mod is able to work with OciXcrom's rank system.
Also, i edited the money cap so you can use it with Arkshine's Unlimited Money!

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

#define PLUGIN	"Extra Damage Mod"
#define VERSION	"0.2"
#define AUTHOR	"v3x"

#define ACCESS_LEVEL	ADMIN_CFG
#define MAXWEAPS 	31

new cstrike;

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	register_concmd("sv_weapondamage", "ConCmd_WeapDmg", ACCESS_LEVEL, ": <weaponid> <damage>");
	register_concmd("amx_weaponlist", "ConCmd_WeapList", 0, ": Lists weapon ids");
	register_event("Damage", "Event_Damage", "b", "2>0");

	cstrike = cstrike_running();
}

new g_nWeapDmg[MAXWEAPS] = { 0, ... };

public Event_Damage( id )
{
	new iWeapID, iHitzone, iAttacker = get_user_attacker(id, iWeapID, iHitzone);

	if(!is_user_connected(id) || !is_user_connected(iAttacker))
		return PLUGIN_CONTINUE;

	new dmgType = read_data(3);

	if(dmgType & DMG_BLAST)
		iWeapID = 4;

	extra_damage(iAttacker, id, g_nWeapDmg[iWeapID], iWeapID);

	return PLUGIN_CONTINUE;
}

public ConCmd_WeapDmg( id, lvl, cid )
{
	if(!cmd_access(id, lvl, cid, 3))
		return PLUGIN_HANDLED;

	new arg1[16], arg2[8];
	read_argv(1, arg1, 15); // Weapon ID
	read_argv(2, arg2, 7);  // Damage amt

	new weapid = str_to_num(arg1);
	new damage = str_to_num(arg2);

	if(weapid > 0 && weapid < MAXWEAPS)
	{
		if(weapid == 2 || weapid == 6 || weapid == 9 || weapid == 25)
		{
			console_print(id, "[XtraDamageMod] Invalid weapon id: %i", weapid);
			server_print("[XtraDamageMod] Invalid weapon id: %i", weapid);
			return PLUGIN_HANDLED;
		}

		g_nWeapDmg[weapid] = damage;
		
		new weapname[33];
		get_weaponname(weapid, weapname, 32);

		replace(weapname, 32, "weap_", "");

		if(damage > 0)
		{
			console_print(id, "[XtraDamageMod] Added %i extra damage for %s", damage, weapname);
		}
		else if(damage <= 0)
		{
			console_print(id, "[XtraDamageMod] Removed extra damage for %s", damage, weapname);
		}
	}

	if(weapid == 0)
	{
		for(new i = 1; i < MAXWEAPS; i++)
			g_nWeapDmg[i] = damage;
	
		if(damage > 0)
		{
			console_print(id, "[XtraDamageMod] Added %i extra damage for all weapons", damage);
		}
		if(damage <= 0)
		{
			console_print(id, "[XtraDamageMod] Removed extra damage for all weapons");
		}
	}

	return PLUGIN_HANDLED;
}

// Doesn't work well for clients..
public ConCmd_WeapList( id )
{
	new arg[8];
	read_argv(1, arg, 7);

	new szWeapMsg[256], nLen, iPage = str_to_num(arg);

	nLen = format(szWeapMsg, 255, "[ExtraDamageMod] Weapon ID list %s", (iPage==2) ? "(con.):" : ":");

	if(iPage == 0 || iPage == 1)
	{
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- P228: %i", CSW_P228);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- Scout: %i", CSW_SCOUT);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- HE Grenade: %i", CSW_HEGRENADE);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- XM1014 (autoshotgun): %i", CSW_XM1014);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- Mac10: %i", CSW_MAC10);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- Aug: %i", CSW_AUG);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- Elites: %i", CSW_ELITE);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- Fiveseven: %i", CSW_FIVESEVEN);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- UMP45: %i", CSW_UMP45);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- SG550: %i", CSW_SG550);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- Galil: %i", CSW_GALIL);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- Famas: %i", CSW_FAMAS);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- USP: %i", CSW_USP);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n^nType 'amx_weaponlist 2' for more");
	}
	else if(iPage == 2)
	{
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- Glock18: %i", CSW_GLOCK18);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- AWP: %i", CSW_AWP);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- MP5NAVY: %i", CSW_MP5NAVY);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- M249 (Para): %i", CSW_M249);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- M3 (Pump): %i", CSW_M3);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- M4A1: %i", CSW_M4A1);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- TMP: %i", CSW_TMP);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- G3SG1: %i", CSW_G3SG1);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- Deagle: %i", CSW_DEAGLE);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- SG552: %i", CSW_SG552);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- AK47: %i", CSW_AK47);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- Knife: %i", CSW_KNIFE);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n- P90: %i", CSW_P90);
		nLen += format(szWeapMsg[nLen], (255-nLen), "^n^nType 'amx_weaponlist 1' to go back");
	}

	if(is_user_connected(id))
		console_print(id, szWeapMsg);
	else
		server_print(szWeapMsg);

	return PLUGIN_HANDLED;
}

public extra_damage(attacker, victim, damage, weap)
{
	if(!cstrike || !is_user_connected(attacker) || !is_user_connected(victim))
		return;
	if(damage <= 0 || get_user_health(victim) <= 0 || get_user_godmode(victim))
		return;

	new FFon = get_cvar_num("mp_friendlyfire");

	new index, body, distance = 99999;
	get_user_aiming(attacker, index, body, distance);

	new weaponname[33];
	get_weaponname(weap, weaponname, 32);

	replace(weaponname, 32, "weapon_", "");

	new team[2];
	team[0] = get_user_team(attacker);
	team[1] = get_user_team(victim);

	if(FFon && team[0] == team[1])
	{
		new name[32];
		get_user_name(attacker, name, 31);
		client_print(0, print_chat, "%s attacked a teammate", name);
	}

	if(get_user_health(victim) > damage)
	{
		fakedamage(victim, weaponname, float(damage), (weap == 4) ? DMG_BLAST : DMG_BULLET); 

		new origin[3];
		get_user_origin(victim, origin);

		message_begin(MSG_ONE, get_user_msgid("Damage"), {0,0,0}, victim);
		write_byte(0);		// dmg_save
		write_byte(damage);	// dmg_take
		write_long(0);		// visibleDamageBits
		write_coord(origin[0]);	// damageOrigin.x
		write_coord(origin[1]);	// damageOrigin.y
		write_coord(origin[2]);	// damageOrigin.z
		message_end();
	}
	else
	{
		log_kill(attacker, victim, weaponname, (body == HIT_HEAD) ? 1 : 0);
	}
}

stock log_kill(killer, victim, weapon[],headshot) 
{
	new weapname[64];

	if(containi(weapon, "nade") != -1)
		format(weapname, 63, "grenade");
	else
	{
		format(weapname, 63, "%s", weapon);
		replace(weapname, 63, "weapon_", "");
	}

	user_silentkill(victim)
	set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT)
	static msgid = 0
if (!msgid)
{
    msgid = get_user_msgid("DeathMsg")
}
emessage_begin(MSG_ALL, msgid, {0,0,0}, 0)
ewrite_byte(killer)
ewrite_byte(victim)

static mod_name[32]

if (!mod_name[0])
{
    get_modname(mod_name, 31)
}
if (equal(mod_name, "cstrike") || equal(mod_name, "czero") || equal(mod_name, "csv15") || equal(mod_name, "cs13"))
    ewrite_byte(headshot)
ewrite_string(weapname)
emessage_end()

	if(get_user_team(killer) != get_user_team(victim))
	{
		set_user_frags(killer, get_user_frags(killer) + 1);

		new money = cs_get_user_money(killer) + 300;

		if(money >= 2147483583)
		{
			cs_set_user_money(killer, 2147483583);
		}
		else
		{
			cs_set_user_money(killer, cs_get_user_money(killer) + 300, 1);
		}
	}
	if(get_user_team(killer)==get_user_team(victim))
		set_user_frags(killer, get_user_frags(killer) - 1);
	
	message_begin(MSG_BROADCAST, get_user_msgid("ScoreInfo"));
	write_byte(killer);
	write_short(get_user_frags(killer));
	write_short(cs_get_user_deaths(killer));
	write_short(0);
	write_short(1);
	message_end(); 
	
	new kname[32], vname[32], kauthid[32], vauthid[32], kteam[10], vteam[10];

	get_user_name(killer, kname, 31);
	get_user_team(killer, kteam, 9);
	get_user_authid(killer, kauthid, 31);

	get_user_name(victim, vname, 31);
	get_user_team(victim, vteam, 9);
	get_user_authid(victim, vauthid, 31);

	log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^"", 
	kname, get_user_userid(killer), kauthid, kteam, 
 	vname, get_user_userid(victim), vauthid, vteam, weapname);

 	return PLUGIN_CONTINUE;
}
Ark_Procession is offline
Reply


Thread Tools
Display Modes

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 21:15.


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