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

Restrict Item


Post New Thread Reply   
 
Thread Tools Display Modes
tkaway69
Senior Member
Join Date: Dec 2004
Location: Millbrook Alabama
Old 10-19-2007 , 14:53   Re: Restrict Item
Reply With Quote #141

Any chance you might give out that readme. I am trying to restrict awps to one per team. I havent figured it out yet. I was also thinking it would be nice if when there is a weapon restricted that it would announce this ever so often. Such as "The Awp has been limited to one per team".
__________________

Last edited by tkaway69; 10-19-2007 at 18:05.
tkaway69 is offline
Send a message via AIM to tkaway69 Send a message via MSN to tkaway69 Send a message via Yahoo to tkaway69
Extreme_One
Veteran Member
Join Date: Nov 2006
Old 10-19-2007 , 16:20   Re: Restrict Item
Reply With Quote #142

I'm also a little confused by the configuration options for this plugin.

I want 2 awps per team and 1 autosniper per team for all maps except as_ maps which need to be restricted to 0 awps and 0 autosnipers.

How would I achieve this?
__________________
Extreme_One is offline
bgmate
Junior Member
Join Date: Sep 2007
Old 10-21-2007 , 04:55   Re: Restrict Item
Reply With Quote #143

Here's the OLD (1.1.4.0) readme file:


Counter Strike:Source Restrict Item Script

This script will set item restrictions on your server
depending on the settings you give it. This script is
just like the original one for AMX Mod X ported for
Sourcemod.

First and forth most, thanks to the original authors who
wrote the script first. I could have not have done this
script without their original code as a guide.

Use at your OWN risk! Please submit your changes of this
script to Shane. Known issues/Submit bug reports at:

http://bugs.alliedmods.net/?project=9&do=index

Thanks.

Name of Author: Shane A. Froebel
Credits: #sourcemod on irc.gamesurge.com
Website: http://bugssite.org
E-mail: [email protected]

Credit to who helped create this plugin...
* BAILOPAN - Sourcemod/Help/Issue List And SVN Hosting
* FlyingMongoose - Help with the "Buy"/Suggestions
* Olly - Native Support
* teame06 - KeyVars Functions
* theY4Kman - GUI I/O/Testing Guy
* Knagg0 - Hacks
KEY:

* Anyone can run this command
& Only admins with the ADMFLAG_CONFIG can run it.
# Only admins with the ADMFLAG_RCON can run it.
+ Either ADMFLAG_CONFIG or ADMFLAG_RCON can run it.

@ Not implemented yet.

USAGE:
sm_restrict: Brings up the Restrict Settings menu directly. (&)
sm_unrestrict: Brings you right to the unrestrict menu, by-passing the main menu. (&)

sm_restrict status: Show current status of restrictions script (*)
sm_restrict on: Enable restrictions (#)
sm_restrict off: Disable restrictions (#)
sm_restrict help: Show the usage menu in CS:S itself (*/@)
sm_restrict list: Show restrictions and limits (*)
-- add "player <name>" to see an indiviual's restrictions
-- running in console shows all players restrictions if player is not specified
-- only shows in console

sm_restrict view <global|map|team|player> [ <t|ct> | <playername|userid> ]: View the default restrictions for <global|map|team|player>'s from the server defaults (*/@)
sm_restrict save <global|map|team|player> [ <t|ct> | <playername|userid> ]: Save current restrictions for <global|map|team|player>'s as server defaults (#)
sm_restrict restore <global|map|team|player> [ <t|ct> | <playername|userid> ]: Restore <global|map|team|player>'s defaults. If non-exist, it will clear the current restrictions for thie group. (#)

sm_restrict limit [ global | map | team <t|ct> ] NUMBER <item index|item alias>: Set the number of this item can be used. This is checked second after basic restrictions. (+)
sm_restrict limit [ global | map | team <t|ct> ] <save|restore|view>: Save - Saves the gorup (#)
Retotre -- restore saved defaults (#)
View -- Shows you defaults. (*/@)
VAILD LIST OF ITEMS:

These are the vaild names allowed to be used. Unless recompiled, the knife and C4 are alawys able to be used.

glock
usp
p228
deagle
elite
fiveseven
m3
xm1014
galil
ak47
scout
sg552
awp
g3sg1
famas
m4a1
aug
sg550
mac10
tmp
mp5navy
ump45
p90
m249
priammo
secammo
vest
vesthelm
flashbang
hegrenade
smokegrenade
defuser
nvgs

MAJOR COMMANDS:

sm_(un)restrict all: (un)Restrict all items. Use of Knife and C4 only. (+)
sm_(un)restrict weapon(s): (un)Restrict all weapons. Use of Knife and C4 only plus equipment. (+)
sm_(un)restrict equip(ment): (un)Restrict all equipment. Use of Weapons only. (+)

sm_(un)restrict group <pistols|shotguns|nonfifles|rifles>: Use of Weapons only. (+)

E.g.: sm_restrict group pistols = Use of pistols only. (Will restrict everything else minus equipment and knife)
sm_unrestrict group pistols = Restore the use of just the pistols. (Will now allow you to buy anything AND restore the default settings for this group)

SINGLE ITEM (UN)RESTRICT COMMAND:

Append to this section can be either "global", "team", "map", or "player".
These values will not carry over to the next map.

COMMAND:

sm_(un)restrict item [ global | map | team <t|ct> ] <item index|item alias>: (un)Restrict item. (+)


HOW TO RESTRICT AN ITEM FROM COMMAND LINE:

All weapon restrictions can be set on global or teams or players or map
by perpending the "item" identifier. These are the examples.

1. "global"
-- if either "team", "map", "player" is not added, it is a global map restriction by default.
2. "team <t|ct>"
-- team will do both teams.
3. "map [ team <t|ct> | player <playername|userid> ]".
-- adding "team" will set this map team specific map restriction (You can not save these yet or have them loaded by default)
-- adding "player" will set player specific map restriction (You can not save these yet or have them loaded by default)
4. "player <playername|userid>"

"<item name|item alias>" must be one of the valid names that this script uses to match
up-against the real thing. In theory, you can can force every single person with the knife.

E.g.: sm_restrict item team ct awp = Disables buying/use of the AWP for the CT's
sm_restrict item team awp = Disabled buying/use fo the AWP for both teams.
sm_restrict item player TooT awp = Disables buying/use of the AWP for [EcG-B] TooT
sm_restrict item global awp m4a1 deagle = Disabled buying/use of the AWP, M4A1 and the DEAGLE for everyone.

The hierarchy of this script is as follows: Global --> Map --> Team --> Player. Here is an example.

So buy default your server makes the awp, g3sg1, and sg550 global. So now the map "de_westwood" loads, but the "scout", "sg552", and "aug"
are cheap because it allows them to zoom in on this map. So there is a "de_westwood" section that has "scout", "sg552", and "aug" as a restrict items.
So if you tried to buy any of these items on this map, you would get a nice error message. However, the next round is "de_losttemple", you be able to now
buy "scout", "sg552", and "aug", but still not the "awp", "g3sg1", and "sg550".

HOW TO RESTRICT AN ITEM VIA LIMIT FROM COMMAND LINE:

If you have an item set to a limit, that item will be able to be bought. However, if an item is set to restricted, the item can not be bought and this is by-passed.
For safty messure, if you try to limit something, and it is currenly restricted, it will tell you, however if if a limited item is set to 0, it gets
placed in the restricted group depending on the option. Also if a restriction is set, the value would stay vaild for the map until a new map is changed. This is in place so it
can switch between restricted and limited at ease. E.g: You set the m4a1 to limited 3 per global. All of a sudden it's map or global restricted (not team because these are
different types of checks) the item is not allowed to be used. However now the item comes out of restriction and it's back to 3 global.
It must not be in the "global", "team", or "map" settings for this to work. hierarchy is the same format of: Global --> Map --> Team.
AWP limited 2 times in the global setting will override the AWP limited 4 times to the T team. If there are saved settings, they will be loaded each time the server starts a new map.


E.g.: sm_restrict limit global 2 awp = 2 AWP for the entire map
sm_restrict limit team t 4 awp = 4 AWP for the entire T team.
sm_restrict limit team 2 awp = 2 AWP for both teams.
sm_restrict limit global 0 awp = Makes the AWP a restricted item
sm_restrict limit global -1 awp = Makes the AWP an unrestricted item
sm_restrict limit global save = Saves the current global limits
sm_restrict limit team t = Save the current T team limits
sm_restrict limit map = Save the current map limits
sm_restrict limit team = Save both teams limits
bgmate is offline
tkaway69
Senior Member
Join Date: Dec 2004
Location: Millbrook Alabama
Old 10-22-2007 , 11:50   Re: Restrict Item
Reply With Quote #144

We are using sourcemod_version "1.0.0.1644", sm_restrict_version "1.1.5.0"
Any Idea what i am doing wrong?
If I exec autoexec.cfg through rcon I get.
Code:
<04>[RESTRICT]<01> Item (awp<0D>) is not vaild.
         <04>[RESTRICT]<01> Item (awp<0D>) is not vaild.
         <04>[RESTRICT]<01> Item (sg550<0D>) is not vaild.
         <04>[RESTRICT]<01> Item (g3sg1<0D>) is not vaild.
I have this in my autoexec.cfg.
Code:
sm_restrict limit team t 1 awp
sm_restrict limit team ct 1 awp
sm_restrict limit team t 1 sg550
sm_restrict limit team ct 1 g3sg1
sm_restrict list gives this.
Code:
10:44:35 sm_restrict list
10:44:36 ------------------------[ Restrict Status ]------------------------
         Item Name                         Type                             Status
         Nothing restricted.
         -------------[ Current Restrict Status for: KOC-BOT | Adrian ]------------
         Nothing restricted.
         -------------[ Current Restrict Status for: KOC-BOT | Victor ]------------
         Nothing restricted.
After reading for a bit, the previous post about this with the quick fix of adding dummy to the restrict code seems to be working. I now have this in my autoexec.cfg

Code:
sm_restrict limit team 1 awp sg550 g3sg1 dummy
restrict_list now gives this,
Code:
12:04:25 sm_restrict list
12:04:25 ------------------------[ Restrict Status ]------------------------
         Item Name                         Type                             Status
         1. Magnum Sniper Rifle               Team T's                         Limited (0/1)
         2. D3/AU-1 Semi-Auto Sniper Rifle     Team T's                         Limited (0/1)
         3. Krieg 550 Commando                Team T's                         Limited (0/1)
         4. Magnum Sniper Rifle               Team CT's                        Limited (0/1)
         5. D3/AU-1 Semi-Auto Sniper Rifle     Team CT's                        Limited (0/1)
         6. Krieg 550 Commando                Team CT's                        Limited (0/1)
         -------------[ Current Restrict Status for: KOC-BOT | Adrian ]------------
         Nothing restricted.
         -------------[ Current Restrict Status for: KOC-BOT | Victor ]------------
         Nothing restricted.
The plugin is working but I am getting these errors in my logs. Errors are not wanted.
Code:
L 10/22/2007 - 16:03:39: [SM] Plugin encountered error 15: Array index is out of bounds
L 10/22/2007 - 16:03:39: [SM] Displaying call stack trace for plugin "restrict.smx":
L 10/22/2007 - 16:03:39: [SM]   [0]  Line 620, restrict/restrict.privatefunctions.sp::AddLimitCount()
L 10/22/2007 - 16:03:39: [SM]   [1]  Line 260, restrict/restrict.publicfunctions.sp::Restrict_Weapon_Limit_Count()
L 10/22/2007 - 16:03:39: [SM]   [2]  Line 55, restrict/restrict.hooks.sp::Event_RoundEnd()
L 10/22/2007 - 16:07:09: Error log file session closed.
__________________

Last edited by tkaway69; 10-22-2007 at 20:10.
tkaway69 is offline
Send a message via AIM to tkaway69 Send a message via MSN to tkaway69 Send a message via Yahoo to tkaway69
Fanatiker
Junior Member
Join Date: Mar 2004
Old 10-27-2007 , 13:24   Re: Restrict Item
Reply With Quote #145

stupid but simple question : where is the readme???
i can't find any readme file in the zip archive and neither i can't find a file README_RESTRICT.txt

2nd question: i skimmed the 14 pages of this thread and came to the conclusion that it might be possible to restrict awp to 2 per team and exclude some players of this restriction.

(of course) i'm admin on my sever and i don't want to be affected by the restriction limits.
__________________
Please push up my karma!
Fanatiker is offline
MoggieX
Veteran Member
Join Date: Aug 2007
Location: n00bville
Old 10-27-2007 , 21:47   Re: Restrict Item
Reply With Quote #146

Quote:
Originally Posted by tkaway69 View Post
The plugin is working but I am getting these errors in my logs. Errors are not wanted.
Code:
L 10/22/2007 - 16:03:39: [SM] Plugin encountered error 15: Array index is out of bounds
L 10/22/2007 - 16:03:39: [SM] Displaying call stack trace for plugin "restrict.smx":
L 10/22/2007 - 16:03:39: [SM]   [0]  Line 620, restrict/restrict.privatefunctions.sp::AddLimitCount()
L 10/22/2007 - 16:03:39: [SM]   [1]  Line 260, restrict/restrict.publicfunctions.sp::Restrict_Weapon_Limit_Count()
L 10/22/2007 - 16:03:39: [SM]   [2]  Line 55, restrict/restrict.hooks.sp::Event_RoundEnd()
L 10/22/2007 - 16:07:09: Error log file session closed.
I've got the same thing with version 1648:

Code:
L 10/28/2007 - 01:24:52: [SM] Plugin encountered error 15: Array index is out of bounds
L 10/28/2007 - 01:24:52: [SM] Displaying call stack trace for plugin "restrict.smx":
L 10/28/2007 - 01:24:52: [SM]   [0]  Line 603, restrict/restrict.privatefunctions.sp::CheckVaildLimitItem()
L 10/28/2007 - 01:24:52: [SM]   [1]  Line 581, restrict/restrict.privatefunctions.sp::CheckVaildLimitItem()
L 10/28/2007 - 01:24:52: [SM]   [2]  Line 668, restrict/restrict.recommand.sp::Command_Restrict()
Creating a bug report for it now.

---
Edit created: http://bugs.alliedmods.net/index.php...s&task_id=1094


Matt
__________________

Last edited by MoggieX; 10-27-2007 at 21:54.
MoggieX is offline
Send a message via Skype™ to MoggieX
^BuGs^
Senior Member
Join Date: May 2007
Old 10-28-2007 , 01:44   Re: Restrict Item
Reply With Quote #147

This is a plaguing bug. I have to write and create a custom SMX file so I can debug this data. Be sure to follow that but report for the special SMX file, so I can figure this out.
__________________
Sourcemod Plugin Author and Plugin Approver
"The correct way is MAXPLAYERS + 1"
I will not take bugs/new idea reports over the forums. Please use the issue list.
^BuGs^ is offline
bgmate
Junior Member
Join Date: Sep 2007
Old 10-28-2007 , 05:41   Re: Restrict Item
Reply With Quote #148

Quote:
Originally Posted by Fanatiker View Post
stupid but simple question : where is the readme???
i can't find any readme file in the zip archive and neither i can't find a file README_RESTRICT.txt
The readme was missing in one of the later or latest releases. I pasted the info from the readme file in post #143. So read there.

Godluck
/BG

Last edited by bgmate; 10-28-2007 at 05:44.
bgmate is offline
Frenzzy
SourceMod Donor
Join Date: Jan 2007
Location: Russia
Old 10-28-2007 , 06:28   Re: Restrict Item
Reply With Quote #149

Please, add other languages support.
Frenzzy is offline
Send a message via ICQ to Frenzzy Send a message via MSN to Frenzzy Send a message via Skype™ to Frenzzy
MoggieX
Veteran Member
Join Date: Aug 2007
Location: n00bville
Old 10-28-2007 , 09:21   Re: Restrict Item
Reply With Quote #150

Quote:
Originally Posted by ^BuGs^ View Post
This is a plaguing bug. I have to write and create a custom SMX file so I can debug this data. Be sure to follow that but report for the special SMX file, so I can figure this out.
Yea I tried to follow your code through last night, it appears to be failing and spilling this out when 'sm_restict on' is used.

The only bit I see that could interfere is the MAX_ITEMS (restrict.recommand.sp) that are being set at 35 (restict.inc), although there is a hell of a lot more than that in the server at that time.

Or if this number is reflective of the max players, then we have 54 on during the day and 35 would cause an issue and would explain why it worked first off when there were few players on and fails when the server is rammed.

Just a thought...

BTW: Anyone reading this, don;t be put off by this, the plugin essentially wiorks (very well), just that 'sm_restrict all' doesn't provide the desired outcome at the moment :-)

Matt
__________________

Last edited by MoggieX; 10-28-2007 at 09:23.
MoggieX is offline
Send a message via Skype™ to MoggieX
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 03:33.


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