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

[CSS/CS:GO] Weapon Restrict


Post New Thread Reply   
 
Thread Tools Display Modes
Corneus
SourceMod Donor
Join Date: Feb 2012
Location: iFrame
Old 07-29-2012 , 13:56   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1111

Thanks TnTSCS i already compiled it and i try if it works
Corneus is offline
Corneus
SourceMod Donor
Join Date: Feb 2012
Location: iFrame
Old 07-29-2012 , 14:09   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1112

Great Job !!!, but the first code You`ve posted is working too TnTSCS
Anyway, Thanks Dr!fter for great plugin and TnTSCS for great help

P.S.
Dr!fter You have reason to do next release
Corneus is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 07-29-2012 , 15:14   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1113

Quote:
Originally Posted by TnTSCS View Post
Here... use this one, it works with Weapon Restrict for sure - I even tested it - even with admin immunity on, this plugin will block the specified weapons... Again, I already added the weapons you want:

You need the .inc files to compile... let me know if you need me to compile
PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <restrict>
#include <css_weapons>

/**
 * Called when CanBuyWeapon is fired. 
 * 
 * @param    client        Client index
 * @param    team        Team index
 * @param    id            Weapon id that is being attempted to be bought
 * @param    result        default result
 * 
 * Return Plugin_Continue to ignore Plugin_Changed if result was changed Plugin_Handled and higher to block.
 */
public Action:Restrict_OnCanBuyWeapon(clientteamWeaponID:id, &CanBuyResult:result)
{
    if (
id == WEAPON_G3SG1 || id == WEAPON_SG550)
    {
        return 
Plugin_Handled;
    }
    
    return 
Plugin_Continue;

...:: TnT Edit ::...



If you use the other one, remove the PrintToChat that shows the name of the weapon... that was for debugging... I've fixed it in the post
as a note if you change result to CanBuy_BlockDontDisplay and return Plugin_Changed it will play the sound for restricted weapons and also block the buy.
Dr!fter is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 07-29-2012 , 19:05   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1114

You mean:
CanBuy_BlockDontDisplay, //block buy and notifications

I saw that, but thought it would block the notification, which I didn't want...

so, something like:
PHP Code:
public Action:Restrict_OnCanBuyWeapon(clientteamWeaponID:id, &CanBuyResult:result)
{
    if (
id == WEAPON_G3SG1 || id == WEAPON_SG550)
    {
        
CanBuy_BlockDontDisplay true;
        
        return 
Plugin_Changed;
    }
    
    return 
Plugin_Continue;

__________________
View my Plugins | Donate
TnTSCS is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 07-29-2012 , 19:42   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1115

Quote:
Originally Posted by TnTSCS View Post
You mean:
CanBuy_BlockDontDisplay, //block buy and notifications

I saw that, but thought it would block the notification, which I didn't want...

so, something like:
PHP Code:
public Action:Restrict_OnCanBuyWeapon(clientteamWeaponID:id, &CanBuyResult:result)
{
    if (
id == WEAPON_G3SG1 || id == WEAPON_SG550)
    {
        
CanBuy_BlockDontDisplay true;
        
        return 
Plugin_Changed;
    }
    
    return 
Plugin_Continue;

It blocks the text notification. You can use the other block CanBuy_Block if you want to show the text and play the sound. I cant remember why I added the DontDisplay one but im sure there was a reason and like this.

PHP Code:
public Action:Restrict_OnCanBuyWeapon(clientteamWeaponID:id, &CanBuyResult:result)
{
    if (
id == WEAPON_G3SG1 || id == WEAPON_SG550)
    {
        
result CanBuy_Block;
        
        return 
Plugin_Changed;
    }
    
    return 
Plugin_Continue;

result originally stores the value and is passed by reference so you can override it.

Edit: I remember why I have the DontDisplay one. When it displays the text it shows the amounts, so in some cases the amount will be unrestricted but you restricted it (This was added for per player bans).

Last edited by Dr!fter; 07-29-2012 at 19:47.
Dr!fter is offline
PeaceKeeper Gaming
New Member
Join Date: Feb 2012
Old 08-08-2012 , 08:21   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1116

Would it be possible to make a per player restriction that worked along the lines of

sm_restrict flashbang @aim

purpose being to restrict server griefers from being able to harm gameplay. Seems like making them leave of their own volition is better than banning.
PeaceKeeper Gaming is offline
GunSpeed
Member
Join Date: Oct 2010
Old 08-08-2012 , 11:12   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1117

Any certain admin flag command to get full access? Currently only "Z" Root admin get access to it, others just force drop bomb command. Not sure if something wrong or if its normal! Just checked the first page only.

Last edited by GunSpeed; 08-08-2012 at 11:12.
GunSpeed is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 08-10-2012 , 12:36   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1118

Quote:
Originally Posted by PeaceKeeper Gaming View Post
Would it be possible to make a per player restriction that worked along the lines of

sm_restrict flashbang @aim

purpose being to restrict server griefers from being able to harm gameplay. Seems like making them leave of their own volition is better than banning.
It is in the works but I don't have time to finish it.

Quote:
Originally Posted by GunSpeed View Post
Any certain admin flag command to get full access? Currently only "Z" Root admin get access to it, others just force drop bomb command. Not sure if something wrong or if its normal! Just checked the first page only.
It tells you what flags for each command in the first post.
Dr!fter is offline
GU@RD!ON
Junior Member
Join Date: Jul 2010
Location: Germany
Old 08-11-2012 , 05:32   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1119

Are you going to port this to CS:GO? I've been using your plugin on several CS:S server and don't want to miss it in CS:GO! Thanks for any replies Cheers
__________________

GU@RD!ON is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-11-2012 , 07:15   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1120

Quote:
Originally Posted by GU@RD!ON View Post
Are you going to port this to CS:GO? I've been using your plugin on several CS:S server and don't want to miss it in CS:GO! Thanks for any replies Cheers
read posts...
https://forums.alliedmods.net/showth...55#post1741555
__________________
Do not Private Message @me
Bacardi 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 09:53.


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