Host_Error: UserMsg: Not Present on Client 255
#1
Hola , estoy en mi servidor y cuando escribo "timeleft" en el say me sale esto:

Host_Error: UserMsg: Not Present on Client 255

Alguien sabe por qué ? Sólo pasa cuando escribo timeleft , thetime no.
Y tampoco si lo tengo bindeado, "bind i timeleft" sale correctamente , pero a la hora de escribir , te kickea..

Timeleft:

Código PHP:
/* AMX Mod X
*   TimeLeft Plugin
*
* by the AMX Mod X Development Team
*  originally developed by OLO
*
* This file is part of AMX Mod X.
*
*
*  This program is free software; you can redistribute it and/or modify it
*  under the terms of the GNU General Public License as published by the
*  Free Software Foundation; either version 2 of the License, or (at
*  your option) any later version.
*
*  This program is distributed in the hope that it will be useful, but
*  WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
*  General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software Foundation,
*  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*  In addition, as a special exception, the author gives permission to
*  link the code of this program with the Half-Life Game Engine ("HL
*  Engine") and Modified Game Libraries ("MODs") developed by Valve,
*  L.L.C ("Valve"). You must obey the GNU General Public License in all
*  respects for all of the code used other than the HL Engine and MODs
*  from Valve. If you modify this file, you may extend this exception
*  to your version of the file, but you are not obligated to do so. If
*  you do not wish to do so, delete this exception statement from your
*  version.
*/

#include <amxmodx>

new g_TimeSet[32][2]
new 
g_LastTime
new g_CountDown
new g_Switch

new const szPrefix [ ] = "!g[BREAKING GAMING]!y";

public 
plugin_init()
{
    
register_plugin("TimeLeft"AMXX_VERSION_STR"AMXX Dev Team")
    
register_dictionary("timeleft.txt")
    
register_cvar("amx_time_voice""1")
    
register_srvcmd("amx_time_display""setDisplaying")
    
register_cvar("amx_timeleft""00:00"FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
    
register_clcmd("say timeleft""sayTimeLeft"0"- displays timeleft")
    
register_clcmd("say thetime""sayTheTime"0"- displays current time")
    
    
set_task(0.8"timeRemain"8648458""0"b")
}

public 
sayTheTime(id)
{
    if (
get_cvar_num("amx_time_voice"))
    {
        new 
mhours[6], mmins[6], whours[32], wmins[32], wpm[6]
        
        
get_time("%H"mhours5)
        
get_time("%M"mmins5)
        
        new 
mins str_to_num(mmins)
        new 
hrs str_to_num(mhours)
        
        if (
mins)
            
num_to_word(minswmins31)
        else
            
wmins[0] = 0
        
        
if (hrs 12)
            
wpm "am "
        
else
        {
            if (
hrs 12hrs -= 12
            wpm 
"pm "
        
}

        if (
hrs
            
num_to_word(hrswhours31)
        else
            
whours "twelve "
        
        
client_cmd(id"spk ^"fvox/time_is_now %s_period %s%s^""whourswminswpm)
    }
    
    new 
ctime[64]
    
    
get_time("%m/%d/%Y - %H:%M:%S"ctime63)
    
    new 
Dia 17 ]; get_time "%A"Diacharsmax Dia ) );
    
    
replace_all(Diacharsmax(Dia), "Monday""Lunes")
    
replace_all(Diacharsmax(Dia), "Tuesday""Martes")
    
replace_all(Diacharsmax(Dia), "Wednesday""Miercoles")
    
replace_all(Diacharsmax(Dia), "Thursday""Jueves")
    
replace_all(Diacharsmax(Dia), "Friday""Viernes")
    
replace_all(Diacharsmax(Dia), "Saturday""Viernes")
    
replace_all(Diacharsmax(Dia), "Sunday""Domingo")
        
    
    
SayPrint 0"%s La fecha es !g%s !t| !yDia: !g%s"szPrefixctimeDia );
    
//client_print(0, print_chat, "%L:   %s", LANG_PLAYER, "THE_TIME", ctime)
    
    
return PLUGIN_CONTINUE
}

public 
sayTimeLeft(id)
{
    if (
get_cvar_float("mp_timelimit"))
    {
        new 
get_timeleft()
        
        if (
get_cvar_num("amx_time_voice"))
        {
            new 
svoice[128]
            
setTimeVoice(svoice1270a)
            
client_cmd(id"%s"svoice)
        }
        
SayPrint 0"%s Tiempo en finalizar el mapa: !g%d:%02d"szPrefix, ( 60 ), ( 60 ) );
        
//client_print(0, print_chat, "%L:  %d:%02d", LANG_PLAYER, "TIME_LEFT", (a / 60), (a % 60))
    
}
    else
        
SayPrint 0"%s No hay tiempo en finalizar el mapa"szPrefix );
        
//client_print(0, print_chat, "%L", LANG_PLAYER, "NO_T_LIMIT")
    
    
return PLUGIN_CONTINUE
}

setTimeText(text[], lentmlfid)
{
    new 
secs tmlf 60
    
new mins tmlf 60
    
    
if (secs == 0)
        
format(textlen"%d %L"minsid, (mins 1) ? "MINUTES" "MINUTE")
    else if (
mins == 0)
        
format(textlen"%d %L"secsid, (secs 1) ? "SECONDS" "SECOND")
    else
        
format(textlen"%d %L %d %L"minsid, (mins 1) ? "MINUTES" "MINUTE"secsid, (secs 1) ? "SECONDS" "SECOND")
}

setTimeVoice(text[], lenflagstmlf)
{
    new 
temp[7][32]
    new 
secs tmlf 60
    
new mins tmlf 60
    
    
for (new 0;7;++a)
        
temp[a][0] = 0

    
if (secs 0)
    {
        
num_to_word(secstemp[4], 31)
        
        if (!(
flags 8)) 
            
temp[5] = "seconds "    /* there is no "second" in default hl */
    
}
    
    if (
mins 59)
    {
        new 
hours mins 60
        
        num_to_word
(hourstemp[0], 31)
        
        if (!(
flags 8))
            
temp[1] = "hours "
        
        
mins mins 60
    
}
    
    if (
mins 0)
    {
        
num_to_word(minstemp[2], 31)
        
        if (!(
flags 8))
            
temp[3] = "minutes "
    
}
    
    if (!(
flags 4))
        
temp[6] = "remaining "
    
    
return format(textlen"spk ^"vox/%s%s%s%s%s%s%s^""temp[0], temp[1], temp[2], temp[3], temp[4], temp[5], temp[6])
}

findDispFormat(time)
{
    for (new 
0g_TimeSet[i][0]; ++i)
    {
        if (
g_TimeSet[i][1] & 16)
        {
            if (
g_TimeSet[i][0] > time)
            {
                if (!
g_Switch)
                {
                    
g_CountDown g_Switch time
                    remove_task
(8648458)
                    
set_task(1.0"timeRemain"34543""0"b")
                }
                
                return 
i
            
}
        }
        else if (
g_TimeSet[i][0] == time)
        {
            return 
i
        
}
    }
    
    return -
1
}

public 
setDisplaying()
{
    new 
arg[32], flags[32], num[32]
    new 
argc read_argc() - 1
    
new 0

    
while (argc && 32)
    {
        
read_argv(1arg31)
        
parse(argflags31num31)
        
        
g_TimeSet[i][0] = str_to_num(num)
        
g_TimeSet[i][1] = read_flags(flags)
        
        
i++
    }
    
g_TimeSet[i][0] = 0
    
    
return PLUGIN_HANDLED
}

public 
timeRemain(param[])
{
    new 
gmtm get_timeleft()
    new 
tmlf g_Switch ? --g_CountDown gmtm
    
new stimel[12]
    
    
format(stimel11"%02d:%02d"gmtm 60gmtm 60)
    
set_cvar_string("amx_timeleft"stimel)
    
    if (
g_Switch && gmtm g_Switch)
    {
        
remove_task(34543)
        
g_Switch 0
        set_task
(0.8"timeRemain"8648458""0"b")
        
        return
    }

    if (
tmlf && g_LastTime != tmlf)
    {
        
g_LastTime tmlf
        
new tm_set findDispFormat(tmlf)
        
        if (
tm_set != -1)
        {
            new 
flags g_TimeSet[tm_set][1]
            new 
arg[128]
            
            if (
flags 1)
            {
                new 
players[32], pnum
                
                get_players
(playerspnum"c")
                
                for (new 
0pnumi++)
                {
                    
setTimeText(arg127tmlfplayers[i])
                    
                    if (
flags 16)
                        
set_hudmessage(255255255, -1.00.8500.01.10.10.5, -1)
                    else
                        
set_hudmessage(255255255, -1.00.8500.03.00.00.5, -1)
                    
                    
show_hudmessage(players[i], "%s"arg)
                }
            }

            if (
flags 2)
            {
                
setTimeVoice(arg127flagstmlf)
                
client_cmd(0"%s"arg)
            }
        }
    }
}

stock SayPrint ( const iIndex, const Text [ ], any:... ) { 
    
    new 
Say 192 ];
    
vformat Saysizeof Say ), Text);
    
    
replace_all Saysizeof Say ), "!y""^1" );
    
replace_all Saysizeof Say ), "!g""^4" );
    
replace_all Saysizeof Say ), "!t""^3" );
    
    
//Acentos
    
replace_all Saysizeof Say ), "á""á" );
    
replace_all Saysizeof Say ), "é""é" );
    
replace_all Saysizeof Say ), "í""Ã*" );
    
replace_all Saysizeof Say ), "ó""ó" );
    
replace_all Saysizeof Say ), "ú""ú" );
    
replace_all Saysizeof Say ), "ñ""ñ" );
    
    
replace_all Saysizeof Say ), "Á""Ã" );
    
replace_all Saysizeof Say ), "É""É" );
    
replace_all Saysizeof Say ), "Í""Í" );
    
replace_all Saysizeof Say ), "Ó""Ó" );
    
replace_all Saysizeof Say ), "Ú""Ú" );
    
replace_all Saysizeof Say ), "Ñ""Ñ" );
    
    
    
    
    
message_begin iIndex MSG_ONE_UNRELIABLE MSG_BROADCASTget_user_msgid "SayText" ), .player iIndex );
    
write_byte iIndex iIndex 33 );
    
write_string Say );
    
message_end (  );
    
    


Fix: amx_time_voice "0" , cuando el player pone timeleft no le sale el audio entonces para evitar alguna caida o algo , lo kickea. O por lo menos eso es lo que comprendí. Así que es eso! Saludos.
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)