Raised This Month: $51 Target: $400
 12% 

[CSGO] GivePlayerItem weapon_c4


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Avo
Senior Member
Join Date: Apr 2012
Old 09-06-2013 , 18: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
 



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 11:37.


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