AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to restrict alias buy commands (https://forums.alliedmods.net/showthread.php?t=126419)

reinert 05-09-2010 05:51

How to restrict alias buy commands
 
Hey, i've restricted awp buying via menu. but i can still buy it with my buy commands such as:

PHP Code:

bind "F4" ";awp; vesthelm; vest" 

how can i restrict it ?

my awp buying via menu code is:

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"

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()




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

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