Raised This Month: $ Target: $400
 0% 

retrict buying weapons in 35hp_2 map.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Metanabol
Member
Join Date: Feb 2009
Old 03-08-2009 , 07:44   retrict buying weapons in 35hp_2 map.
Reply With Quote #1

Hello, i made little script to fix bug then 35hp_2 or most_wanted map starts, there player can buy weapon in first round (then server starts)
but i get error then i try this to complile
PHP Code:
#include <amxmodx>
 #include <amxmisc>
 #include <cstrike>
 
new g_round 0
 
new bool:g_check false;
 new 
g_bug[][] =
 {
         
"35hp",
         
"ka_",
         
"most_"
 
}
 public 
plugin_init()
 {
     
register_plugin("MAP bug fix","1.0","Metanabol")
     
register_clcmd("p228","HandleCmd")
     
register_clcmd("hegrenade","HandleCmd")    
     
register_clcmd("smokegrenade","HandleCmd")
     
register_clcmd("elite","HandleCmd")
     
register_clcmd("fiveseven","HandleCmd")
     
register_clcmd("usp","HandleCmd")
     
register_clcmd("glock18","HandleCmd")
     
register_clcmd("deagle","HandleCmd")
     
register_logevent("logevent_Round_Start"2"1=Round_Start");
     new 
MapName[64];
 
         
get_mapname(MapName63);
  
         for (new 
Map 0Map sizeof(g_bug); Map++)
                 if (
containi(MapNameg_bug[Map]) != -1)
         {
             
g_check true;
     }
 }
 public 
logevent_Round_Start()
 {
     
g_round++
 }
 public 
HandleCmd(id){
     if(
g_round && g_check) {
              
client_print(0print_chat"[KPZ] Player tried to buy weapon.")
               return 
PLUGIN_HANDLED
    
}
 } 
Metanabol is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 03-08-2009 , 08:17   Re: retrict buying weapons in 35hp_2 map.
Reply With Quote #2

Code:
#include <amxmodx> #include <hamsandwich> #include <cstrike>   new g_MapNames[][] = {         "35hp"         "ka_",         "most_" };   public plugin_init() {         new MapName[32];         get_mapname(MapName, 31);           for (new Map = 0; Map < sizeof(g_MapNames); Map++)                 if (containi(MapName, g_MapNames[Map]) != -1)                 {                         RegisterHam(Ham_Spawn, "player", "Spawn_Player_Post", 1);                           break;                 } }   public Spawn_Player_Post(Client)         if (is_user_alive(Client))                 cs_set_user_money(Client, 0, 0);
__________________
hleV is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 03-08-2009 , 12:33   Re: retrict buying weapons in 35hp_2 map.
Reply With Quote #3

test this

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Remove Buy"
#define VERSION "1.0"
#define AUTHOR "Starsailor"

new const buyweapons[][] = {
    
    
"usp""glock""deagle""p228""elites",
    
"fn57""m3""xm1014""mp5""tmp""p90",
    
"mac10""ump45""ak47""galil""famas",
    
"sg552""m4a1""aug""scout""awp""g3sg1",
    
"sg550""m249""vest""vesthelm""flash",
    
"hegren""sgren""defuser""nvgs""shield",
    
"primammo""secammo""km45""9x19mm""nighthawk",
    
"228compact""fiveseven""12gauge""autoshotgun",
    
"mp""c90""cv47""defender""clarion""krieg552",
    
"bullpup""magnum""d3au1""krieg550"
}

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_command(id){
    new 
Mapname[64]
    
    
get_mapname(Mapname63)
    new 
arg[13];
    
read_argv(0arg12
    
    if(
equali(Mapname,"35hp_2")) {
        for( new 
0sizeof(buyweapons); i++ )
        {
            if( 
equali(buyweapons[i], arg0) )
            {
                return 
PLUGIN_HANDLED
            
}
        }
        
    }
    
    
    return 
PLUGIN_CONTINUE

__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-08-2009 , 13:17   Re: retrict buying weapons in 35hp_2 map.
Reply With Quote #4

Instead of checking map on every client_command it would be a LOT better if you checked it once and set a variable or even better paused the plugin totally.

Code:
#include <amxmodx>   #define PLUGIN "Remove Buy" #define VERSION "1.0" #define AUTHOR "Supremacy"   new const buyweapons[][] = {  "usp", "glock", "deagle", "p228", "elites",  "fn57", "m3", "xm1014", "mp5", "tmp", "p90",  "mac10", "ump45", "ak47", "galil", "famas",  "sg552", "m4a1", "aug", "scout", "awp", "g3sg1",  "sg550", "m249", "vest", "vesthelm", "flash",  "hegren", "sgren", "defuser", "nvgs", "shield",  "primammo", "secammo", "km45", "9x19mm", "nighthawk",  "228compact", "fiveseven", "12gauge", "autoshotgun",  "mp", "c90", "cv47", "defender", "clarion", "krieg552",  "bullpup", "magnum", "d3au1", "krieg550" }   public plugin_init() {    register_plugin(PLUGIN, VERSION, AUTHOR);    new mapname[64];  get_mapname(mapname, 63);    if ( ! equali(mapname, "35hp_2") )   pause("a"); }   public client_command(id) {    new arg[13];  read_argv(0, arg, 12);    for( new i = 0; i < sizeof(buyweapons); i++ ) {   if( equali(buyweapons[i], arg, 0) ) // 0? That's idiotic.    return PLUGIN_HANDLED;  }    return PLUGIN_CONTINUE; }


EDIT... Ripper? Seriously, your code sucked, i fixed it. Don't be a baby about it.
The great thing about Pawn is I can do whatever I want to your code.

Last edited by [ --<-@ ] Black Rose; 03-09-2009 at 15:42.
[ --<-@ ] Black Rose is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-08-2009 , 13:26   Re: retrict buying weapons in 35hp_2 map.
Reply With Quote #5

Just put sv_restart 1 in amxx.cfg and nobody will be able to buy.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Metanabol
Member
Join Date: Feb 2009
Old 03-08-2009 , 15:27   Re: retrict buying weapons in 35hp_2 map.
Reply With Quote #6

Very thanks everyone. I see a lot of ways to choose... i prefer hleV's choise, because it's very simple and usable
Metanabol is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-08-2009 , 15:29   Re: retrict buying weapons in 35hp_2 map.
Reply With Quote #7

Quote:
Originally Posted by Metanabol View Post
Very thanks everyone. I see a lot of ways to choose... i prefer hleV's choise, because it's very simple and usable
BUZZ! Wrong. The easiest would be Connors and then mine.
[ --<-@ ] Black Rose 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 08:59.


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