Admin NoBuy

A Config Script for Counter-Strike 1.6

Greetings! We are one of the oldest mod sites on the Interwebs. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation by sending rj. points.
  • Post: Give rj. your thoughts on this Script.
  • Vote: Help rj. win the Monthly Awards.
  • Rate: Give this Script a rating out of 10.
  • Flag: Alert moderators and warn members of a problem with this Script.
  • Watch: Get notified when this Script is updated.
Mascot

Sound fun?

Sign up

Already a Bananite? Login

253 lines | 7 kb | Raw Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
/* AMX Mod script.
*
* Made by AssKicR with some code from Scarzzurs
*
* This file is provided as is (no warranties).
*
*/
 

#include <amxmodx.inc>
#include <amxmisc.inc>

#if !defined NO_STEAM
#define MAXMENUPOS 34
#else
#define MAXMENUPOS 31
#endif

// VARIABLES
new bool:BuyBlock[33]
new g_Aliases[MAXMENUPOS][] = {
"usp",//Pistols
"glock",
"deagle",
"p228",
"elites",
"fn57",

"m3",//Shotguns
"xm1014",

"mp5",//SMG
"tmp",
"p90",
"mac10",
"ump45",

"ak47",//Rifles
#if !defined NO_STEAM
"galil",
"famas",
#endif
"sg552",
"m4a1",
"aug",
"scout",
"awp",
"g3sg1",
"sg550",

"m249", //Machine Gun

"vest",//Equipment
"vesthelm",
"flash",
"hegren",
"sgren",
"defuser",
"nvgs",
#if !defined NO_STEAM
"shield",
#endif
"primammo",//Ammo
"secammo"
}
#if !defined NO_STEAM
new g_Aliases2[MAXMENUPOS][] = {
"km45",//Pistols
"9x19mm",
"nighthawk",
"228compact",
"elites",
"fiveseven",

"12gauge",//Shotguns
"autoshotgun",

"smg",//SMG
"mp",
"c90",
"mac10",
"ump45",

"cv47",//Rifles
//#if !defined NO_STEAM
"defender",
"clarion",
//#endif
"krieg552",
"m4a1",
"bullup",
"scout",
"magnum",
"d3au1",
"krieg550",

"m249", //Machine Gun

"vest",//Equipment
"vesthelm",
"flash",
"hegren",
"sgren",
"defuser",
"nvgs",
//#if !defined NO_STEAM
"shield",
//#endif
"primammo",//Ammo
"secammo"
}
#endif
//----------------------------------------------------------------------------------------------
public plugin_init() {
        register_plugin("Admin NoBuy","1.0","AssKicR/Scarzzurs")  
        register_clcmd("amx_nobuy","admin_nobuy",ADMIN_SLAY,"<authid, nick, @team or #userid>")  
        register_clcmd("amx_rebuy","admin_rebuy",ADMIN_SLAY,"<authid, nick, @team or #userid>")
        register_clcmd("buy","nobuy")
        register_clcmd("buyequip","nobuy")
        register_clcmd("buyammo1","nobuy")
        register_clcmd("buyammo2","nobuy")
}
//----------------------------------------------------------------------------------------------
public nobuy(id) {
        if (BuyBlock[id]) return PLUGIN_HANDLED
        return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public client_connect(id){
        BuyBlock[id]=false
}
//----------------------------------------------------------------------------------------------
public client_disconnect(id){
        BuyBlock[id]=false
}
//----------------------------------------------------------------------------------------------
#if !defined NO_STEAM
public client_command(id){      //from AssKicr
        if (BuyBlock[id]) {
                new arg[13]
                if (read_argv(0, arg, 12) > 11) /* Longest buy command has 11 chars so if command is longer then don't care */
                        return PLUGIN_CONTINUE
                new a = 0
                do {
                        if (equal(g_Aliases[a], arg) || equal(g_Aliases2[a], arg)) {
                                return PLUGIN_HANDLED
                        }
                } while(++a < MAXMENUPOS)
        }
       
        return PLUGIN_CONTINUE
}
#endif

//----------------------------------------------------------------------------------------------

public admin_nobuy(id,level,cid) {
   if (!cmd_access(id,level,cid,2))
      return PLUGIN_HANDLED
   new arg[32], name2[32]
   get_user_name(id,name2,31)
   read_argv(1,arg,31)

   if ((arg[0]=='@') && (arg[1]=='A') && (arg[2]=='L') && (arg[3]=='L')) {
      new players[32], inum
      get_players(players,inum,"")
       
      for(new a=0;a<inum;++a)
         BuyBlock[players[a]]=true
      switch(get_cvar_num("amx_show_activity"))   {
   case 2:   client_print(0,print_chat,"ADMIN %s: Disable Everyones Buymenu",name2)
   case 1:   client_print(0,print_chat,"ADMIN: Disable Everyones Buymenu")
      }
      console_print(id,"No clients can buy")
   }
   else if (arg[0]=='@'){
      new players[32], inum
      get_players(players,inum,"ae",arg[1])
      if (inum==0){
         console_print(id,"No clients in such team")
         return PLUGIN_HANDLED
      }
      for(new a=0;a<inum;++a)
         BuyBlock[players[a]]=true
      switch(get_cvar_num("amx_show_activity"))   {
   case 2:   client_print(0,print_chat,"ADMIN %s: Disabled the Buymenu off all %s's",name2,arg[1])
   case 1:   client_print(0,print_chat,"ADMIN: Disable the Buymenu off all %s's",arg[1])
      }
      console_print(id,"No clients on %s can buy",arg[1])
   }
   else {
      new player = cmd_target(id,arg,7)
      if (!player) return PLUGIN_HANDLED
      BuyBlock[player]=true
      new name[32]
      get_user_name(player,name,31)
      switch(get_cvar_num("amx_show_activity"))   {
   case 2:   client_print(0,print_chat,"ADMIN %s: Disabled %s's Buymenu",name2,name)
   case 1:   client_print(0,print_chat,"ADMIN: Disabled %s's Buymenu",name)
      }
      console_print(id,"Client ^"%s^" can't buy",name)
   }
   return PLUGIN_HANDLED  
}
//----------------------------------------------------------------------------------------------
public admin_rebuy(id,level,cid) {
   if (!cmd_access(id,level,cid,2))
      return PLUGIN_HANDLED
   new arg[32], name2[32]
   get_user_name(id,name2,31)
   read_argv(1,arg,31)

   if ((arg[0]=='@') && (arg[1]=='A') && (arg[2]=='L') && (arg[3]=='L')) {
      new players[32], inum
      get_players(players,inum,"")
       
      for(new a=0;a<inum;++a)
         BuyBlock[players[a]]=false
      switch(get_cvar_num("amx_show_activity"))   {
   case 2:   client_print(0,print_chat,"ADMIN %s: Enable the Buymenu of all players",name2)
   case 1:   client_print(0,print_chat,"ADMIN: Enable the Buymenu of all players")
      }
      console_print(id,"All clients can buy")
   }
   else if (arg[0]=='@'){
      new players[32], inum
      get_players(players,inum,"ae",arg[1])
      if (inum==0){
         console_print(id,"No clients in such team")
         return PLUGIN_HANDLED
      }
      for(new a=0;a<inum;++a)
         BuyBlock[players[a]]=false
      switch(get_cvar_num("amx_show_activity"))   {
   case 2:   client_print(0,print_chat,"ADMIN %s: Enable the Buymenu of all %s's",name2,arg[1])
   case 1:   client_print(0,print_chat,"ADMIN: Enable the Buymenu of all %s's",arg[1])
      }
      console_print(id,"All clients on %s can buy",arg[1])
   }
   else {
      new player = cmd_target(id,arg,7)
      if (!player) return PLUGIN_HANDLED
      BuyBlock[player]=false
      new name[32]
      get_user_name(player,name,31)
      switch(get_cvar_num("amx_show_activity"))   {
   case 2:   client_print(0,print_chat,"ADMIN %s: Enabled %s's buymenu",name2,name)
   case 1:   client_print(0,print_chat,"ADMIN: Enable %s's buymenu",name)
      }
      console_print(id,"Client ^"%s^" can't buy",name)
   }
   return PLUGIN_HANDLED  
}
//----------------------------------------------------------------------------------------------
A simple plugin to stop specific players from buying  Made by me AssKicR. 
Used some code that Scarzzurs Posted so creds go to him too... Anyways Enjoy This plug 

Posts

None found

Share

Shareable Image:
Share banner
HTML embed code:
BB embed code:
Markdown embed code:

More embeddable images

Bookmark and Share

Credits

Original Authors
AssKicR
AMXX Script/Codes

Submitter

rj. avatar
rj. PAUSE
Member Joined 1y
291 points Ranked 14387th
38 medals 4 legendary 10 rare
  • Submitted 15 Tools Medal icon
  • Submitted 50 Gamefiles Medal icon
  • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
  • Thanked 500 submitters Medal icon
  • 2nd Place - Game Poetry Contest Medal icon
  • Submitted 5 Tools Medal icon

rj.
Redistributor
Are you the owner? Request Ownership
Sign up to access this!
Sign up to access this!
Sign up to access this!
Sign up to access this!

Category

Stats

Posts
0
Views
473
Date Added
5mo
bcp.crwdcntrl.net tracking pixel