Raised This Month: $ Target: $400
 0% 

Perm mute


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
naXe
BANNED
Join Date: May 2009
Location: Poland/Kwidzyn
Old 02-15-2012 , 15:03   Perm mute
Reply With Quote #1

Welcome.
However, I have a problem. After entering in console perm_mute nick still pops up:
Usage: <nick>

I gave yourself a perm mute, but not enrolled in a file
Can be improved?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <engine>

new ma_mute[33]
new 
plik_vault


public plugin_init(){
        
plik_vault=nvault_open("mute_list")
        
register_clcmd("perm_mute","dawanie_mute",ADMIN_IMMUNITY,"<nick>")

}
public 
client_connect(id){
        
wczytaj_mute(id)
        if(
ma_mute[id]>0){
        
set_speak(idSPEAK_MUTED)
}
}
public 
client_disconnect(id){
        
zapisz_mute(id)
        
ma_mute[id]=0
}
public 
plugin_end(){
        
nvault_close(plik_vault)
}

public 
dawanie_mute(id,level,cid){
        if(!
cmd_access(id,level,cid,3)) return PLUGIN_HANDLED
        
        
new arg1[32]

        
        
read_argv(1,arg1,31)

        
        new 
player=cmd_target(id,arg1,CMDTARGET_ALLOW_SELF)

        
        if (!
player)
        {
                
console_print(id"Gracz %s nie zostal odnaleziony.",arg1)
                return 
PLUGIN_HANDLED
        
}else
        {

                
ma_mute[id]=1
                set_speak
(idSPEAK_MUTED)

                
client_print(id,print_chat,"*** Zostales wyciszony na zawsze ***"
        }
        return 
PLUGIN_HANDLED
}
public 
wczytaj_mute(id)
{
    new 
name[35]
    
get_user_name(id,name,34)
    new 
vaultkey[64],vaultdata[256]
    
format(vaultkey,63,"%s-mute",name)
    
format(vaultdata,255,"%d#",ma_mute[id])
    
nvault_get(plik_vault,vaultkey,vaultdata,255
 
    
replace_all(vaultdata255"#"" ")
        
    new 
fragitemp[33],deadstemp[33]
    
parse(vaultdata,fragitemp,32,deadstemp,32
     
    return 
PLUGIN_CONTINUE
}  

public 
zapisz_mute(id){
    if(
ma_mute[id] > 0){
    new 
name[35]
    
get_user_name(id,name,34)
    new 
vaultkey[64],vaultdata[256
    
format(vaultkey,63,"%s-mute",name
    
format(vaultdata,255,"%d#",ma_mute[id]) 
    
nvault_set(plik_vault,vaultkey,vaultdata
   }
    return 
PLUGIN_CONTINUE

naXe is offline
Send a message via AIM to naXe
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-15-2012 , 15:04   Re: Perm mute
Reply With Quote #2

Quote:
Originally Posted by naXe View Post
PHP Code:
        if(!cmd_access(id,level,cid,3)) return PLUGIN_HANDLED 
Why did you use 3 there?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
naXe
BANNED
Join Date: May 2009
Location: Poland/Kwidzyn
Old 02-15-2012 , 15:11   Re: Perm mute
Reply With Quote #3

I do not know xP

I've got to give 2?

Last edited by naXe; 02-15-2012 at 15:17.
naXe is offline
Send a message via AIM to naXe
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-15-2012 , 15:18   Re: Perm mute
Reply With Quote #4

Don't just guess. What do you think that number represents?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 09:51.


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