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

Solved [L4D2] How to create items but not allow pick-up


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Solar1234
Junior Member
Join Date: Nov 2021
Old 09-24-2023 , 08:10   [L4D2] How to create items but not allow pick-up
Reply With Quote #1

PHP Code:
int melee CreateEntityByName("weapon_melee");
if(
melee != -1)
{
    
DispatchKeyValue(melee"melee_script_name"TAG_MELEE_NAME[MELEE_NO08][1]);
    
TeleportEntity(meleeeposanglvelo);
    
DispatchSpawn(melee);

I generated a knife this way, but how do I stop the player from pressing e on it(Bad English comes from machine translation)

Last edited by Solar1234; 03-18-2024 at 04:12.
Solar1234 is offline
3ipKa
Member
Join Date: Jul 2013
Location: Western Siberia
Old 09-24-2023 , 08:22   Re: [L4D2] How to create items but not allow pick-up
Reply With Quote #2

Hi. Try this

Code:
SDKHook(melee, SDKHook_Use, OnUse);

Action OnUse(int entity, int client)
{
	return Plugin_Handled;
}
3ipKa is offline
Solar1234
Junior Member
Join Date: Nov 2021
Old 09-24-2023 , 08:27   Re: [L4D2] How to create items but not allow pick-up
Reply With Quote #3

Quote:
Originally Posted by 3ipKa View Post
Hi. Try this

Code:
SDKHook(melee, SDKHook_Use, OnUse);

Action OnUse(int entity, int client)
{
	return Plugin_Handled;
}
Let me have a try
Solar1234 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 11:35.


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