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

how to restrict deagle on awp maps


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SanKen
Senior Member
Join Date: Oct 2012
Location: /var/logs
Old 01-25-2015 , 18:14   how to restrict deagle on awp maps
Reply With Quote #1

how to restrict deagle on awp maps.
You may at some simple plugin, I'm just about thrown Deagle from these maps.
__________________
SanKen is offline
LambdaLambda
AlliedModders Donor
Join Date: Oct 2010
Location: London
Old 01-25-2015 , 18:39   Re: how to restrict deagle on awp maps
Reply With Quote #2

-OnPluginStart HookEvent "item_pickup"
-OnMapStart check it's prefix ("awp_"), save bool to the variable
-On item_pickup check the weapon - kill entity if it is ..... (your weapon)
LambdaLambda is offline
SanKen
Senior Member
Join Date: Oct 2012
Location: /var/logs
Old 01-26-2015 , 06:08   Re: how to restrict deagle on awp maps
Reply With Quote #3

-OnPluginStart HookEvent "item_pickup"

But what if this item is already in your inventory after spawn?
__________________
SanKen is offline
LambdaLambda
AlliedModders Donor
Join Date: Oct 2010
Location: London
Old 01-26-2015 , 06:15   Re: how to restrict deagle on awp maps
Reply With Quote #4

exactly. After spawn. You get weapons, which means you pick them up once you get spawned.

Zaufaj, zadziała. ;)

Last edited by LambdaLambda; 01-26-2015 at 06:19.
LambdaLambda is offline
h3bus
AlliedModders Donor
Join Date: Nov 2013
Old 01-26-2015 , 08:00   Re: how to restrict deagle on awp maps
Reply With Quote #5

The complete way would be hooking Spawn event on OnEntityCreated then killing the weapon there.
h3bus is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 01-28-2015 , 17:08   Re: how to restrict deagle on awp maps
Reply With Quote #6

Quote:
Originally Posted by h3bus View Post
The complete way would be hooking Spawn event on OnEntityCreated then killing the weapon there.
Totally agree with you sir!

Simple and efficient way to do it ->

PHP Code:
public int OnEntityCreated(int entity, const char[] classname)
{
    if (
StrEqual(classname"weapon_deagle"))
        
SDKHook(entitySDKHook_SpawnOnDeagleSpawn);
}

public 
Action OnDeagleSpawn(int entity)
{
    return 
Plugin_Handled;

Mathias. is offline
EngHell
Member
Join Date: Jul 2013
Location: Guatemala
Old 01-30-2015 , 11:42   Re: how to restrict deagle on awp maps
Reply With Quote #7

Quote:
Originally Posted by Black-Rabbit View Post
Totally agree with you sir!

Simple and efficient way to do it ->

PHP Code:
public int OnEntityCreated(int entity, const char[] classname)
{
    if (
StrEqual(classname"weapon_deagle"))
        
SDKHook(entitySDKHook_SpawnOnDeagleSpawn);
}

public 
Action OnDeagleSpawn(int entity)
{
    return 
Plugin_Handled;

Imma update my plugin then
EngHell is offline
LambdaLambda
AlliedModders Donor
Join Date: Oct 2010
Location: London
Old 01-26-2015 , 08:22   Re: how to restrict deagle on awp maps
Reply With Quote #8

Pointless.
LambdaLambda is offline
EngHell
Member
Join Date: Jul 2013
Location: Guatemala
Old 01-26-2015 , 17:33   Re: how to restrict deagle on awp maps
Reply With Quote #9

I have done this some weeks ago for my server, may it's not the best way idk, but it works very well ;D
Attached Files
File Type: sp Get Plugin or Get Source (nopistol.sp - 540 views - 1.5 KB)
EngHell is offline
SanKen
Senior Member
Join Date: Oct 2012
Location: /var/logs
Old 01-27-2015 , 05:46   Re: how to restrict deagle on awp maps
Reply With Quote #10

it looks like it works. Thank you.
__________________
SanKen 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 22:23.


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