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

[CSS/CS:GO] Weapon Restrict


Post New Thread Reply   
 
Thread Tools Display Modes
Tribl
Junior Member
Join Date: Jul 2012
Old 07-26-2012 , 15:24   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1101

Quote:
Originally Posted by Dr!fter View Post
Use the override system to override the sm_knives and sm_pistols. But by default it uses the same flag as restrict and unrestrict so it shouldnt show up.
already tried, works, thx
Quote:
It randomly picks one weapon each warmup so it doesnt give them all.
that explains it

Quote:
Yes remove #define STOCKMENU from weapon_restrict.sp and compile it again.

I'll try that thx
Tribl is offline
Corneus
SourceMod Donor
Join Date: Feb 2012
Location: iFrame
Old 07-29-2012 , 07:28   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1102

I set up admins have immunity for restricted weapons, but i also want to restrict 2 weapons even for admins. =>Admin can buy restricted weapons but not this two: Krieg 550 Commando, D3/AU-1.
How to do that?
Corneus is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 07-29-2012 , 08:17   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1103

Quote:
Originally Posted by Corneus View Post
I set up admins have immunity for restricted weapons, but i also want to restrict 2 weapons even for admins. =>Admin can buy restricted weapons but not this two: Krieg 550 Commando, D3/AU-1.
How to do that?
For now you can't.
Bacardi is offline
Corneus
SourceMod Donor
Join Date: Feb 2012
Location: iFrame
Old 07-29-2012 , 08:41   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1104

Ok. I don`t use this 2 weapons at all, so maybe there is another way to block this weapons for whole server, not in this plugin?
Corneus is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 07-29-2012 , 12:05   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1105

what game?
__________________
View my Plugins | Donate
TnTSCS is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 07-29-2012 , 12:26   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1106

if CS:S:

Just put the names of the guns you want to restrict in the global string... I already put the two you want. I haven't tested it alongside this weapon restrict plugin, so I'm not 100% it will work.

PHP Code:

#pragma semicolon 1

#include <sourcemod>
#include <cstrike>

new String:BlockedWeapons[][] = 
    {
        
"sg550",
        
"g3sg1"
    
};

public 
Action:CS_OnBuyCommand(client, const String:weapon[])
{
    for (new 
0sizeof(BlockedWeapons); i++)
    {
        if (
StrEqual(weaponBlockedWeapons[i], false))
        {
            
PrintToChat(client"You are not allowed to purchase that weapon");
            return 
Plugin_Handled;
        }
    }
    
    return 
Plugin_Continue;

...:: TnT Edit ::...
removed PrintToChat(client, "Weapon Name is [%s]", weapon);
__________________
View my Plugins | Donate

Last edited by TnTSCS; 07-29-2012 at 13:35.
TnTSCS is offline
Corneus
SourceMod Donor
Join Date: Feb 2012
Location: iFrame
Old 07-29-2012 , 12:33   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1107

Quote:
Originally Posted by TnTSCS View Post
if CS:S:

Just put the names of the guns you want to restrict in the global string... I already put the two you want. I haven't tested it alongside this weapon restrict plugin, so I'm not 100% it will work.
Yes TnTSCS, it is for CSS.
Thanks, i will compile this into smx and I will check if it works.
Corneus is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 07-29-2012 , 12:37   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1108

Quote:
Originally Posted by TnTSCS View Post
if CS:S:

Just put the names of the guns you want to restrict in the global string... I already put the two you want. I haven't tested it alongside this weapon restrict plugin, so I'm not 100% it will work.

PHP Code:

#pragma semicolon 1

#include <sourcemod>
#include <cstrike>

new String:BlockedWeapons[][] = 
    {
        
"sg550",
        
"g3sg1"
    
};

public 
Action:CS_OnBuyCommand(client, const String:weapon[])
{
    
PrintToChat(client"Weapon Name is [%s]"weapon);
    
    for (new 
0sizeof(BlockedWeapons); i++)
    {
        if (
StrEqual(weaponBlockedWeapons[i], false))
        {
            
PrintToChat(client"You are not allowed to purchase that weapon");
            return 
Plugin_Handled;
        }
    }
    
    return 
Plugin_Continue;

Use the natives/forwards that weapon restrict gives you

Last edited by Dr!fter; 07-29-2012 at 12:38.
Dr!fter is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 07-29-2012 , 13:06   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1109

oh, I forgot about those... new version forthcoming
__________________
View my Plugins | Donate
TnTSCS is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 07-29-2012 , 13:31   Re: [CSS] Weapon Restrict (3.0 is here!)
Reply With Quote #1110

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

Quote:
Originally Posted by Corneus View Post
Yes TnTSCS, it is for CSS.
Thanks, i will compile this into smx and I will check if it works.
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
__________________
View my Plugins | Donate

Last edited by TnTSCS; 07-29-2012 at 13:35.
TnTSCS 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 18:51.


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