Raised This Month: $ Target: $400
 0% 

Back Weapons v1.87


Post New Thread Reply   
 
Thread Tools Display Modes
cs1.6
Senior Member
Join Date: Dec 2006
Old 04-19-2008 , 17:26   Re: Back Weapons v1.85
Reply With Quote #261

Offtopic:

Quote:
Originally Posted by coca-cola View Post
i think thats not a bug with the model, so much as the plugin setting the wrong submodel, unless i accidently compiled the ak model as an awp (which I didnt)
yes it's the new plugin version.
Thx, if someone could give me version 1.80.

Last edited by cs1.6; 04-19-2008 at 20:40. Reason: edit
cs1.6 is offline
`666
AlliedModders Donor
Join Date: Jan 2006
Old 04-19-2008 , 21:15   Re: Back Weapons v1.85
Reply With Quote #262

when u throw grenade and then u get auto switched back to main weapon but have one on ur back as well - on cz
`666 is offline
mr_spock
Junior Member
Join Date: Apr 2008
Old 04-19-2008 , 21:15   Re: Back Weapons v1.85
Reply With Quote #263

I've been testing the plugin and i have the same issue that is posted on post #253
Sometimes i see that the players have the rifle on the back and in the hand, if you change the weapon a few times the one in the back will dissapear.
Im not using bots i've been testing it on a Condition Zero server with players.

Last edited by mr_spock; 04-19-2008 at 21:19.
mr_spock is offline
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 04-19-2008 , 22:30   Re: Back Weapons v1.86
Reply With Quote #264

The problem is that the function it was hooked on wasnt catching when weapons are dropped. This should be fixed in v1.86. However, there is a bug when weapons are stripped. Im still trying to find a way to catch when it happens.
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.

Last edited by Cheap_Suit; 04-20-2008 at 00:02.
Cheap_Suit is offline
AirEterno
Junior Member
Join Date: Apr 2008
Old 04-20-2008 , 01:19   Re: Back Weapons v1.86
Reply With Quote #265

Hello, I need some help

I can't download the plugin:

Plugin failed to compile! Please try contacting the author.
Welcome to the AMX Mod X 1.76-300 Compiler.Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team/home/groups/alliedmodders/forums/files/9/4/1/25785.attach(3) : fatal error 100: cannot read from file: "hamsandwich"Compilation aborted.1 Error.Help me please
AirEterno is offline
Send a message via Skype™ to AirEterno
KWo
AMX Mod X Beta Tester
Join Date: Jul 2004
Location: Poland
Old 04-20-2008 , 01:29   Re: Back Weapons v1.86
Reply With Quote #266

Quote:
Originally Posted by Cheap_Suit View Post
The problem is that the function it was hooked on wasnt catching when weapons are dropped. This should be fixed in v1.86. However, there is a bug when weapons are stripped. Im still trying to find a way to catch when it happens.
OK - now I know what might be the reason You have troubles with bots... The function which catches the weapon drop event doesn't work at all on bots. You cannot use it with bots. We had the same problem with CSDM - the bot was droping the weapon, and the weapon instead disapearing was laying on the ground. In the effect - the amount of laying weapons was increasing (the amount of entities) and the server was starting to lag as hell... I have found the method to solve this - with SetModel function.
Code:
in plugin_init()
register_forward(FM_SetModel, "forward_set_model")

later
public forward_set_model(ent, const model[]) 
{
	if (!csdm_active())
		return FMRES_IGNORED

	if (!pev_valid(ent) || !equali(model, g_wbox_model) && !equali(model, g_shield_model))
		return FMRES_IGNORED

	new id = pev(ent, pev_owner)

	if (!(1 <= id <= g_max_clients))
		return FMRES_IGNORED

	new args[2]
	args[0] = ent
	args[1] = id
	set_task(0.2, "delay_find_weapon", ent, args, 2) // You need this delay - believe me...

	return FMRES_IGNORED
}

public delay_find_weapon(args[])
{
	new ent = args[0]
	new id = args[1]

	new class[32]

	if (!pev_valid(ent))
		return

	if (!is_user_connected(id))
		return

	pev(ent, pev_classname, class, sizeof class - 1)

	if (equali(class, "weaponbox"))
		run_drop_wbox(id, ent)
	else if (equali(class, "weapon_shield"))
		run_drop_wbox(id, -1)

}

run_drop_wbox(id, ent)
{
	new ret
	new model[32]
	ExecuteForward(g_drop_fwd, ret, id, ent, 0)
	
	if (ret == CSDM_DROP_REMOVE)
	{
		csdm_remove_weaponbox(id, ent, 0, 1)
		return 1
	} 
	else if (ret == CSDM_DROP_IGNORE) 
	{
		return 0
	}

	if (g_StayTime > 20 || g_StayTime < 0)
	{
		return 0
	}


	if (ent == -1)
	{
		csdm_remove_weapon(id, "weapon_shield", g_StayTime, 1)
		return 1
	}

	if (ent)
	{
		pev(ent, pev_model, model, 31)
		if (((equali(model,"models/w_usp.mdl")) || (equali(model,"models/w_glock18.mdl")))
				&& (g_StripWeapons))
			csdm_remove_weaponbox(id, ent, 0, 0)
		else if ((equali(model,"models/w_backpack.mdl")) && (g_RemoveBomb))
			csdm_remove_weaponbox(id, ent, 0, 0)
		else
			csdm_remove_weaponbox(id, ent, g_StayTime, 1)
		return 1
	}
	
	return 0
}
and in the csdm module:
Code:
static cell AMX_NATIVE_CALL csdm_remove_weaponbox(AMX *amx, cell *params)
{
	// Check index.
	unsigned int owner = params[1];
	unsigned int ent = params[2];

	if (owner < 1 || owner > (unsigned int)gpGlobals->maxClients)
	{
		MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d", owner);
		return 0;
	} else if (!MF_IsPlayerIngame(owner)) {
		MF_LogError(amx, AMX_ERR_NATIVE, "Player %d is not in game", owner);
		return 0;
	}
	edict_t *searchEnt = INDEXENT(ent);
	if (FNullEnt(searchEnt))
	{
		MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weaponbox %d", ent);
		return 0;
	} else if (strcmp(STRING(searchEnt->v.classname),"weaponbox") != 0) {
		MF_LogError(amx, AMX_ERR_NATIVE, "Not a weaponbox %d", ent);
		return 0;
	}

	edict_t *pEdict = MF_GetPlayerEdict(owner);
	edict_t *pWeapEdict = g_engfuncs.pfnPEntityOfEntIndex(gpGlobals->maxClients + 1);

	for (int i = gpGlobals->maxClients + 1; i < gpGlobals->maxEntities; i++, pWeapEdict++)
	{
		if (pWeapEdict == NULL)
			continue;
		if (pWeapEdict->free)
			continue;
		if ((pWeapEdict->v.flags & FL_FAKECLIENT) || (pWeapEdict->v.flags & FL_CLIENT))
			continue;
		if (pWeapEdict->v.owner == searchEnt)
		{
			if (!params[3] || !params[4])
			{
				if (NotifyForRemove(owner, pWeapEdict, searchEnt))
				{
					REMOVE_ENTITY(pWeapEdict);
					REMOVE_ENTITY(searchEnt);
				}
/*
				else
					ALERT(at_logged, "CSDM - can't remove weapon of %s - notify for remove failed....\n", STRING(pEdict->v.netname));
*/
			} 
			else 
			{
				FindWeapon *p = FindWeapon::NewFindWeapon(pEdict, STRING(pWeapEdict->v.classname), params[3]);
				g_Timer.AddTask(p, 0.1);
				return 1;

				RemoveWeapon::SchedRemoval(params[3], pEdict, searchEnt, pWeapEdict);
			}
			return 1;
		}
	}
	return 0;
}
There is a lot of things You don't need, like removing the weapon after certain time with SchedRemoval, but I believe if You will read carefully this You will get the point...BAILOPAN didn't like my method, by since he haven't have time to better figure it out, this method works perfectly in my CSDM beta. I hope that can help You a bit.
__________________
The Fullpack of podbot mm V3B22 - 24 apr 2012!!! is available here.
The All-In-One 3.2a package - 02 jun 2013 (AMX X 1.8.2 [with ATAC 3.0.1b , CSDM2.1.3c beta, CM OE 0.6.5, podbot mm V3B22c and mm 1.20) is available here.
The newest Beta V3B23a (rel. 28 august 2018!!!) is available here.
KWo is offline
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 04-20-2008 , 01:39   Re: Back Weapons v1.86
Reply With Quote #267

Im able to catch weapon drop through Ham_RemovePlayerItem.
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
cs1.6
Senior Member
Join Date: Dec 2006
Old 04-20-2008 , 01:39   Re: Back Weapons v1.86
Reply With Quote #268

AirEterno

read the text in big red

cool avatar
cs1.6 is offline
coca-cola
BANNED
Join Date: Dec 2007
Location: I got caught by Roach be
Old 04-20-2008 , 01:43   Re: Back Weapons v1.86
Reply With Quote #269

ugh im sorry about those weapon model bugs. If you could get me pictures of all the ones that are still hovering a little away from their bodys, i can fix em up for you.
coca-cola is offline
KWo
AMX Mod X Beta Tester
Join Date: Jul 2004
Location: Poland
Old 04-20-2008 , 01:45   Re: Back Weapons v1.86
Reply With Quote #270

Quote:
Originally Posted by Cheap_Suit View Post
Im able to catch weapon drop through Ham_RemovePlayerItem.
I will re-phrase my sentence - the weapon drop event cannot work with any metamod bots (because metamod is blocking some messages). If Ham_RemovePlayerItem works with metamod bots, then I'm happy. I never tested it (haven't had time). But maybe cs1.6 can test Your newest version and tell us if it works or not with metamod bots.
__________________
The Fullpack of podbot mm V3B22 - 24 apr 2012!!! is available here.
The All-In-One 3.2a package - 02 jun 2013 (AMX X 1.8.2 [with ATAC 3.0.1b , CSDM2.1.3c beta, CM OE 0.6.5, podbot mm V3B22c and mm 1.20) is available here.
The newest Beta V3B23a (rel. 28 august 2018!!!) is available here.
KWo 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 02:06.


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