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

how to restrict deagle on awp maps


Post New Thread Reply   
 
Thread Tools Display Modes
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 01-28-2015 , 17:00   Re: how to restrict deagle on awp maps
Reply With Quote #11

GetPlayerWeaponSlot will always either return a valid edict or -1. The IsValidEdict call would be (negligible, but still) a waste in this case.
bl4nk 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 #12

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
LambdaLambda
AlliedModders Donor
Join Date: Oct 2010
Location: London
Old 01-28-2015 , 18:07   Re: how to restrict deagle on awp maps
Reply With Quote #13

That's not what term of "restriction" means. And yes, it is important in this case, you can restrict weapon to certain group of people, you can limit it etc.
LambdaLambda 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 #14

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
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 17:49.


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