Raised This Month: $158 Target: $400
 39% 

[CSGO] GivePlayerItem weapon_c4


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Avo
Senior Member
Join Date: Apr 2012
Old 09-06-2013 , 19:46   [CSGO] GivePlayerItem weapon_c4
Reply With Quote #1

Hi,

Since an august update (don't know which), my plugin doesn't work anymore. To be precise, it make the server crash on the GivePlayerItem(client, "weapon_c4");
It worked before without any problem, but now I can't find the right fix.

Here is the code :

Code:
public Action:CS_OnCSWeaponDrop(client, weapon)
{
	if (IsClientConnected(client) && IsClientInGame(client) && IsPlayerAlive(client) && IsValidEdict(weapon))
	{
		decl String:sWeapon[64];
		GetEdictClassname(weapon, sWeapon, 64);
		if (StrEqual(sWeapon, "weapon_c4"))
		{
			g_iWeaponC4 = weapon;
			CreateTimer(0.1, TimerDropBomb, client);
		}
	}
	return Plugin_Continue;
}

public Action:TimerDropBomb(Handle:timer, any:client)
{
	if (IsClientConnected(client) && IsClientInGame(client) && IsPlayerAlive(client) && IsValidEdict(g_iWeaponC4))
	{
		AcceptEntityInput(g_iWeaponC4, "kill");
		GivePlayerItem(client, "weapon_c4");
	}
}
I tried moving or removing the AcceptEntityInput, replacing it with a RemoveEdict, anyway those commands pass, it's always the GivePlayerItem which crash. And other bomb plugins (like Bomb Commands or Request Bomb) work the same way (I don't know if they are broken too).


Could someone help me ?
__________________
Avo is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 09-06-2013 , 20:41   Re: [CSGO] GivePlayerItem weapon_c4
Reply With Quote #2

what version do you have on your server for metamod and source mod?
__________________
View my Plugins | Donate
TnTSCS is offline
Avo
Senior Member
Join Date: Apr 2012
Old 09-07-2013 , 06:45   Re: [CSGO] GivePlayerItem weapon_c4
Reply With Quote #3

MetaMod:Source v1.10.0-devV,
SourceMod v1.6.0-dev+3865
__________________
Avo is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 09-07-2013 , 06:52   Re: [CSGO] GivePlayerItem weapon_c4
Reply With Quote #4

Try using the 1.5 snapshot branch instead; 1.6 still has experimental changes. And I'll just leave this here, I was bored.
Spoiler
__________________
thetwistedpanda is offline
Avo
Senior Member
Join Date: Apr 2012
Old 09-07-2013 , 19:15   Re: [CSGO] GivePlayerItem weapon_c4
Reply With Quote #5

Thanks a lot, it's indeed the 1.6 branch which isn't functional anymore on this feature. Works great with 1.5.1.

And thanks for your bored work, I'll definitely use it. ;)
__________________
Avo is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 09-07-2013 , 23:07   Re: [CSGO] GivePlayerItem weapon_c4
Reply With Quote #6

Quote:
Originally Posted by Avo View Post
Thanks a lot, it's indeed the 1.6 branch which isn't functional anymore on this feature. Works great with 1.5.1.
The snapshot of 1.6 you were using is very, very old. Would you please consider testing on the latest one - there are no known issues with it and we really need to know if something is broken.
__________________
asherkin is offline
Avo
Senior Member
Join Date: Apr 2012
Old 09-08-2013 , 06:53   Re: [CSGO] GivePlayerItem weapon_c4
Reply With Quote #7

No problem with SourceMod v1.6.0-dev+4118, I should have look into that first.

However, now that 1.5 is fully operationnal on CSGO, and just FMI, what are main benefits and features, to pass on dev 1.6 ? (and stay up to date of course).

Thanks
__________________
Avo 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 13:24.


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