Raised This Month: $ Target: $400
 0% 

Native: set_speak PROBLEM... [SOLVED]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Bello
BANNED
Join Date: Jun 2010
Old 06-15-2010 , 00:33   Native: set_speak PROBLEM... [SOLVED]
Reply With Quote #1

Hi friends i have this code:

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

new const plugin_author[] = "Bello"
new const plugin_name[] = "MUTE PLAYER"
new const plugin_version[] = "1.0"

#define MUTED 2

new const Muted[MUTED][] = {
    
"[no comm]",
    
" [no comm]"
}

new Array:
Muteados
new Direccion[46]

new 
bool:MsgMutedChat

public plugin_init() {
    
register_plugin(plugin_nameplugin_versionplugin_author)
    
register_concmd(".mute""cmdMute"ADMIN_RCON"<name>")
    
register_concmd(".unmute""cmdUnmute"ADMIN_RCON"<name>")
    
    new 
sConfig[32]
    
get_configsdir(sConfigsizeof(sConfig)-1)
    
formatex(Direccionsizeof(Direccion)-1"%s/mute.ini"sConfig)

    
register_clcmd("say","handle_say")
    
register_clcmd("say_team","handle_say")

    
register_message(get_user_msgid("SayText"), "MessageNameChange")

    
Muteados ArrayCreate(321)
    
    
Cargar_ini()
}

public 
client_putinserver(id) {
    if(!
file_exists(Direccion)) return
    
    new 
ID[28], sName[32]
    
get_user_authid(idIDsizeof(ID)-1)
    
get_user_name(idsNamesizeof(sName)-1)
    
    new 
lines file_size(Direccion,1)
    new 
file[1024], len
    
    
for(new i=0i<=linesi++) {
        
read_file(Direccionfile1023len)
        
        if(
equal(IDfile)) {
            
set_speak(id1)
            
            if(!(
contain(sNameMuted[0]) != -1)) {
                
add(sNamesizeof(sName)-1Muted[1])
                
set_user_info(id"name"sName)
                
MsgMutedChat true
                
break
            }
        }
    }
}

public 
cmdMute(idlevelcid) {
    if(!
cmd_access(idlevelcid2)) return 1
    
    
new Argv[32]
    
read_argv(1Argvsizeof(Argv)-1)
    
    new 
player cmd_target(idArgv3)
    
    new 
ID[28], sName[32]
    
get_user_authid(playerIDsizeof(ID)-1)
    
get_user_name(playersNamesizeof(sName)-1)
    
    new 
lines file_size(Direccion,1)
    new 
file[1024], len
    
    
for(new i=0i<=linesi++) {
        
read_file(Direccionfile1023len)
        
        if(
equal(IDfile)) {
            
console_print(id"El SteamID: %s, ya esta en la lista"ID)
            return 
1
        
}
    }

    
MsgMutedChat true
    set_speak
(player1)    

    new 
NAME[32]
    
get_user_name(playerNAMEsizeof(NAME)-1)
    
client_print(0print_chat"[ESVE Pug] %s ha sido muteado."NAME)
    
    
write_file(DireccionID)
    
console_print(id"Usuario muteado: %s^nSe ha agregado el SteamID: %s"sNameID)
    
    if(!(
contain(sNameMuted[0]) != -1)) {
        
add(sNamesizeof(sName)-1Muted[1])
        
set_user_info(player"name"sName)
    }
    return 
1
}

public 
cmdUnmute(idlevelcid) {
    if(!
cmd_access(idlevelcid2)) return 
    
    
new Argv[32]
    
read_argv(1Argvsizeof(Argv)-1)
    
    new 
player cmd_target(idArgv3)
    
    new 
ID[28], sName[32]
    
get_user_authid(playerIDsizeof(ID)-1)
    
get_user_name(playersNamesizeof(sName)-1)

    
MsgMutedChat true

    
new NAME[32]
    
get_user_name(playerNAMEsizeof(NAME)-1)
    
client_print(0print_chat"[ESVE Pug] %s ha sido desmuteado."NAME)
    
    new 
lines file_size(Direccion1)
    new 
file[1024], len
    
    
for(new i=0i<=linesi++) {
        
read_file(Direccionfile1023len)
        
        if(
equal(IDfile)) {
            
set_speak(player0)
            
write_file(Direccion""i)
            
console_print(id"Cliente: %s ha sido desmuteado^nSteamID: %s, ha sido removido"sNameID)
            
            if(
contain(sNameMuted[0]) != -1) {
                
replace_all(sNamesizeof(sName)-1Muted[1], "")
                
set_user_info(player"name"sName)
                break
            }
        }
    }
    return 
1
}    
    
public 
Cargar_ini() {
    if(!
file_exists(Direccion)) return
    
    new 
linea[128], file fopen(Direccion"rt")
        
    while(
file && !feof(file)) {
        
fgets(filelinea127)
        
replace(linea127"^n""")
            
        if((
linea[0] == '/' && linea[1] == '/') || linea[0] == ';' || strlen(linea) < 1) continue
        
ArrayPushString(Muteadoslinea)
    }

    if(
filefclose(file)
}

public 
handle_say(id) {
    new 
ID[28]
    
get_user_authid(idIDsizeof(ID)-1)
    
    new 
lines file_size(Direccion1)
    new 
file[1024], len
    
    
for(new i=0i<=linesi++) {
        
read_file(Direccionfile1023len)
        
        if(
equal(IDfile)) {
            
client_print(idprint_chat"")
            return 
PLUGIN_HANDLED_MAIN
            
}
    }
    return 
PLUGIN_CONTINUE
}

public 
client_infochanged(id) {
    static 
sName[32], NewName[32], ID[28]
    
get_user_name(idsNamesizeof(sName)-1)
    
get_user_info(id"name"NewNamesizeof(NewName)-1)
    
get_user_authid(idIDsizeof(ID)-1)
    
    if(!
equali(sNameNewName)) {
        new 
lines file_size(Direccion,1)
        new 
file[1024], len
    
        
for(new i=0i<=linesi++) {
            
read_file(Direccionfile1023len)
        
            if(
equal(IDfile)) {
                
set_speak(id1)
            
                if(!(
contain(NewNameMuted[0]) != -1)) {
                    
add(NewNamesizeof(sName)-1Muted[1])
                    
set_user_info(id"name"NewName)
                    break
                }
            }
        }
    }
}

public 
MessageNameChange(msg_idmsg_destreceiver) {
    if(
MsgMutedChat) {
        new 
szInfo[64]
        
get_msg_arg_string(2szInfo63)

        if(!
equali(szInfo"#Cstrike_Name_Change")) return 0

        MsgMutedChat 
false
        
return 1
    
}
    return 
0

The problem is this:

Code:
L 06/14/2010 - 23:57:39: Start of error session.
L 06/14/2010 - 23:57:39: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20100614.log")
L 06/14/2010 - 23:57:39: [ENGINE] Invalid player 1
L 06/14/2010 - 23:57:39: [AMXX] Displaying debug trace (plugin "yap_mute.amxx")
L 06/14/2010 - 23:57:39: [AMXX] Run time error 10: native error (native "set_speak")
L 06/14/2010 - 23:57:39: [AMXX]    [0] yap_mute.sma::client_infochanged (line 198)
I have not able to fix this problem, as could fix it?
Bello is offline
 


Thread Tools
Display Modes

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 14:51.


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