changed header and version info
added 1.6 weapons (XAD)
This commit is contained in:
parent
a771b2f2d5
commit
9214a349a4
|
@ -1,11 +1,9 @@
|
||||||
/* AMX Mod script.
|
/* AMX Mod X script.
|
||||||
*
|
|
||||||
* (c) 2003, OLO
|
|
||||||
* This file is provided as is (no warranties).
|
|
||||||
*
|
*
|
||||||
* Commands:
|
* (c) 2002-2004, OLO
|
||||||
* amx_restmenu - displays restriction menu
|
* modified by BAILOPAN,Manip,PM,SniperBeamer and XAD
|
||||||
* amx_restrict - displays help for restrict weapons command
|
*
|
||||||
|
* This file is provided as is (no warranties).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Uncomment if you want to have seperate settings for each map
|
// Uncomment if you want to have seperate settings for each map
|
||||||
|
@ -21,7 +19,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
new g_Position[33]
|
new g_Position[33]
|
||||||
new g_allowCheck[33]
|
|
||||||
new g_Modified
|
new g_Modified
|
||||||
new g_blockPos[112]
|
new g_blockPos[112]
|
||||||
new g_saveFile[64]
|
new g_saveFile[64]
|
||||||
|
@ -267,8 +264,9 @@ new g_Aliases[MAXMENUPOS][] = {
|
||||||
"primammo",//Ammo
|
"primammo",//Ammo
|
||||||
"secammo"
|
"secammo"
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined NO_STEAM
|
#if !defined NO_STEAM
|
||||||
new g_moreAliases[MAXMENUPOS][] = {
|
new g_Aliases2[MAXMENUPOS][] = {
|
||||||
"km45",//Pistols
|
"km45",//Pistols
|
||||||
"9x19mm",
|
"9x19mm",
|
||||||
"nighthawk",
|
"nighthawk",
|
||||||
|
@ -286,13 +284,11 @@ new g_moreAliases[MAXMENUPOS][] = {
|
||||||
"ump45",
|
"ump45",
|
||||||
|
|
||||||
"cv47",//Rifles
|
"cv47",//Rifles
|
||||||
//#if !defined NO_STEAM
|
|
||||||
"defender",
|
"defender",
|
||||||
"clarion",
|
"clarion",
|
||||||
//#endif
|
|
||||||
"krieg552",
|
"krieg552",
|
||||||
"m4a1",
|
"m4a1",
|
||||||
"bullup",
|
"bullpup",
|
||||||
"scout",
|
"scout",
|
||||||
"magnum",
|
"magnum",
|
||||||
"d3au1",
|
"d3au1",
|
||||||
|
@ -307,17 +303,22 @@ new g_moreAliases[MAXMENUPOS][] = {
|
||||||
"sgren",
|
"sgren",
|
||||||
"defuser",
|
"defuser",
|
||||||
"nvgs",
|
"nvgs",
|
||||||
//#if !defined NO_STEAM
|
|
||||||
"shield",
|
"shield",
|
||||||
//#endif
|
|
||||||
"primammo",//Ammo
|
"primammo",//Ammo
|
||||||
"secammo"
|
"secammo"
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public plugin_init(){
|
public plugin_init(){
|
||||||
register_plugin("Restrict Weapons","0.9.6","default")
|
register_plugin("Restrict Weapons","0.1","default")
|
||||||
register_clcmd("buyammo1","ammoRest1")
|
register_clcmd("buyammo1","ammoRest1")
|
||||||
register_clcmd("buyammo2","ammoRest2")
|
register_clcmd("buyammo2","ammoRest2")
|
||||||
|
#if !defined NO_STEAM
|
||||||
|
register_clcmd("cl_setautobuy","blockcommand")
|
||||||
|
register_clcmd("cl_autobuy","blockcommand")
|
||||||
|
register_clcmd("cl_setrebuy","blockcommand")
|
||||||
|
register_clcmd("cl_rebuy","blockcommand")
|
||||||
|
#endif
|
||||||
register_clcmd("amx_restmenu","cmdMenu",ADMIN_CFG,"- displays weapons restriction menu")
|
register_clcmd("amx_restmenu","cmdMenu",ADMIN_CFG,"- displays weapons restriction menu")
|
||||||
register_menucmd(register_menuid("#Buy", 1 ),511,"menuBuy")
|
register_menucmd(register_menuid("#Buy", 1 ),511,"menuBuy")
|
||||||
register_menucmd(register_menuid("\yRestrict Weapons"),1023,"actionMenu")
|
register_menucmd(register_menuid("\yRestrict Weapons"),1023,"actionMenu")
|
||||||
|
@ -335,8 +336,6 @@ public plugin_init(){
|
||||||
register_menucmd(-33,511,"menuMachine")
|
register_menucmd(-33,511,"menuMachine")
|
||||||
register_menucmd(-34,511,"menuItem")
|
register_menucmd(-34,511,"menuItem")
|
||||||
register_concmd("amx_restrict","cmdRest",ADMIN_CFG,"- displays help for weapons restriction")
|
register_concmd("amx_restrict","cmdRest",ADMIN_CFG,"- displays help for weapons restriction")
|
||||||
|
|
||||||
register_event("StatusIcon","buyZone","b","2&buy")
|
|
||||||
|
|
||||||
#if defined MAPSETTINGS
|
#if defined MAPSETTINGS
|
||||||
new mapname[32]
|
new mapname[32]
|
||||||
|
@ -348,9 +347,6 @@ public plugin_init(){
|
||||||
loadSettings(g_saveFile)
|
loadSettings(g_saveFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
public buyZone(id)
|
|
||||||
g_allowCheck[ id ] = read_data(1)
|
|
||||||
|
|
||||||
setWeapon( a , action ){
|
setWeapon( a , action ){
|
||||||
new b, m = g_Keys[a][0] * 8
|
new b, m = g_Keys[a][0] * 8
|
||||||
if (g_Keys[a][1] != -1) {
|
if (g_Keys[a][1] != -1) {
|
||||||
|
@ -399,8 +395,7 @@ findAliasId( name[] ){
|
||||||
switchCommand( id, action ){
|
switchCommand( id, action ){
|
||||||
new c = read_argc()
|
new c = read_argc()
|
||||||
if ( c < 3 ){
|
if ( c < 3 ){
|
||||||
for(new a = 0; a < MAXMENUPOS; ++a)
|
setc( g_blockPos, 112, action )
|
||||||
setWeapon( a , action )
|
|
||||||
console_print( id , "Equipment and weapons have been %srestricted" , action ? "" : "un" )
|
console_print( id , "Equipment and weapons have been %srestricted" , action ? "" : "un" )
|
||||||
g_Modified = true
|
g_Modified = true
|
||||||
}
|
}
|
||||||
|
@ -472,8 +467,7 @@ public cmdRest(id,level,cid){
|
||||||
else console_print( id , "Couldn't save configuration (file ^"%s^")" , g_saveFile )
|
else console_print( id , "Couldn't save configuration (file ^"%s^")" , g_saveFile )
|
||||||
}
|
}
|
||||||
else if ( equali( "load" , cmd ) ) {
|
else if ( equali( "load" , cmd ) ) {
|
||||||
for(new a = 0; a < MAXMENUPOS; ++a)
|
setc( g_blockPos, 112, 0 ) // Clear current settings
|
||||||
setWeapon( a , 0 ) // Clear current settings
|
|
||||||
new arg1[64]
|
new arg1[64]
|
||||||
if ( read_argv(2, arg1 , 63 ) ) build_path( arg1 , 63, "$basedir/%s", arg1 )
|
if ( read_argv(2, arg1 , 63 ) ) build_path( arg1 , 63, "$basedir/%s", arg1 )
|
||||||
else copy( arg1, 63, g_saveFile )
|
else copy( arg1, 63, g_saveFile )
|
||||||
|
@ -543,12 +537,14 @@ public actionMenu(id,key){
|
||||||
|
|
||||||
#if !defined NO_STEAM
|
#if !defined NO_STEAM
|
||||||
public client_command( id ){
|
public client_command( id ){
|
||||||
if ( g_AliasBlockNum && g_allowCheck[ id ] ) {
|
if ( g_AliasBlockNum ) {
|
||||||
new arg[16]
|
new arg[13]
|
||||||
read_argv( 0, arg , 15 )
|
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
|
new a = 0
|
||||||
do {
|
do {
|
||||||
if ( equal( g_Aliases[g_AliasBlock[ a ]] , arg ) || equal( g_moreAliases[g_AliasBlock[ a ]] , arg ) ) {
|
if ( equal( g_Aliases[g_AliasBlock[ a ]] , arg ) ||
|
||||||
|
equal( g_Aliases2[g_AliasBlock[ a ]] , arg ) ) {
|
||||||
client_print(id,print_center,g_Restricted )
|
client_print(id,print_center,g_Restricted )
|
||||||
return PLUGIN_HANDLED
|
return PLUGIN_HANDLED
|
||||||
}
|
}
|
||||||
|
@ -558,6 +554,13 @@ public client_command( id ){
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined NO_STEAM
|
||||||
|
public blockcommand(id) {
|
||||||
|
client_print(id,print_center, g_Restricted )
|
||||||
|
return PLUGIN_HANDLED
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
public cmdMenu(id,level,cid){
|
public cmdMenu(id,level,cid){
|
||||||
if (cmd_access(id,level,cid,1))
|
if (cmd_access(id,level,cid,1))
|
||||||
displayMenu(id, g_Position[id] = 0 )
|
displayMenu(id, g_Position[id] = 0 )
|
||||||
|
@ -610,4 +613,4 @@ loadSettings(filename[]){
|
||||||
setWeapon( a , 1 )
|
setWeapon( a , 1 )
|
||||||
}
|
}
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user