AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   now allow to buy awp (https://forums.alliedmods.net/showthread.php?t=126375)

reinert 05-08-2010 18:12

now allow to buy awp
 
Hey, can someone give me a code that blocks players buying awp.

i got a code that blocks picking up, and now i need to block buying...

BTW: Picking up code:
PHP Code:

public fwd_touch(entid)
{
    new 
model[33]
    
entity_get_string(entEV_SZ_modelmodel32)
    
pev(entpev_modelmodel31)
    if(
equali(model"models/w_awp.mdl")||equali(model"models/w_g3sg1.mdl")||equali(model"models/w_sg550.mdl")) 
    if(
PlayerCon[id] && PlayerAwp[id]) return FMRES_SUPERCEDE
    
return FMRES_IGNORED



SaM.ThE.MaN 05-09-2010 02:30

Re: now allow to buy awp
 
there is a plugins, that who ever tries to buy an awp gets kicked from the server, how ever i dont know the name of it

Aykay 05-09-2010 02:38

Re: now allow to buy awp
 
You do realize that this plugin comes with amxx when you install it?
Its actually on the second page of the amxmodmenu.
Just uncomment it from the plugins.ini - the plugin is called restmenu.amxx

reinert 05-09-2010 04:09

Re: now allow to buy awp
 
ah, i wanted to make that if player is admin then he can buy if not, then just block buying.

EDIT: already found code. that works almost fine, just it won't show any message

PHP Code:

register_menucmd(-31,(1<<4),"via_me" )                                    
    
register_menucmd(-31,(1<<5),"via_me" )                                    
    
register_menucmd(register_menuid("BuyRifle",1),(1<<4),"via_me" )          
    
register_menucmd(register_menuid("BuyRifle",1),(1<<5),"via_me" )          
    
register_clcmd("awp","menu_awp"
    
register_clcmd("magnum","menu_awp")
    
register_clcmd("g3sg1","menu_awp")
    
register_clcmd("sg550","menu_awp"

PHP Code:

public via_me(id,key)
{
    new 
team get_user_team(id)

    if ((
team==&& key==5) || (team==&& key==4))
        
menu_awp(idkey)
    if ((
team==&& key==4) || (team==&& key==5))
        
menu_awp(idkey)

    return 
PLUGIN_CONTINUE
}
public 
menu_awp(idkey){
    if(!
PlayerCon[id] || !PlayerAwp[id]){
    
engclient_cmd(id,"menuselect","10")
    
Message_No_Awp(id)
}
}

public 
Message_No_Awp(id){
    const 
HUD_PRINTCENTER    =    4
    
static const szOnlyVIP[] = "you are not user" 

    
message_begin(MSG_ONE_UNRELIABLEgmsgTextMsg, .player=id)
    
write_byteHUD_PRINTCENTER )
    
write_stringszOnlyVIP )
    
message_end()


why message won't appear when i'm buying awp.

SaM.ThE.MaN 05-09-2010 08:45

Re: now allow to buy awp
 
you could make the script simpler

reinert 05-09-2010 09:48

Re: now allow to buy awp
 
like... ?


All times are GMT -4. The time now is 03:39.

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