Raised This Month: $ Target: $400
 0% 

[SNIPPET][CSGO] Safely remove weapons without crashes


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 10-05-2016 , 09:48   Re: [SNIPPET][CSGO] Safely remove weapons without crashes
Reply With Quote #10

Quote:
Originally Posted by shanapu View Post
Some time ago a read in a thread to use SDKHooks_DropWeapon instead of RemovePlayerItem or CS_DropWeapon. But unfortunately I can't find it or remember the advanced of using SDKHooks instead. Also, I never recognized a crash related to RemovePlayerItem.

PHP Code:
SDKHooks_DropWeapon(clientweaponNULL_VECTORNULL_VECTOR); 
AcceptEntityInput(iWeapon"Kill"); 
Still crash
Code:
#include <sdkhooks>

public OnPluginStart()
{
    RegConsoleCmd("sm_testi", test);
}

public Action:test(client, args)
{
	new glock = GetPlayerWeaponSlot(client, 1);
	new knife = GetPlayerWeaponSlot(client, CS_SLOT_KNIFE);
	
	SDKHooks_DropWeapon(client, glock, NULL_VECTOR, NULL_VECTOR); 
	EquipPlayerWeapon(client, knife);

	return Plugin_Handled;
}
But if we will pick pistol or buy, there will be no crash

Last edited by Indarello; 10-05-2016 at 10:04.
Indarello 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 18:56.


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