Raised This Month: $51 Target: $400
 12% 

Host_Error: PF_precache_sound_I: Bad string '


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dalimnassar
Member
Join Date: Aug 2017
Location: Tunisia
Old 09-17-2017 , 12:29   Host_Error: PF_precache_sound_I: Bad string '
Reply With Quote #1

whats wrong :'(
PHP Code:
public plugin_precache()
{
    
precache_sound(sound_sleep)
    
precache_model(Trap_Model)
    
    
precache_sound(TrapTrigger_Sound)
    
precache_sound(PlayerCatched_Sound)
    
precache_sound(PlayerCatched_Sound1)    
    
precache_sound(CantPlantTrap_Sound)
    new 
j
         
for(j=0sizeof sound_idlej++) precache_sound(sound_idle[j])
    for(
j=0sizeof sound_infectj++) precache_sound(sound_infect[j])
    for(
j=0sizeof sound_painj++) precache_sound(sound_pain[j])
    for(
j=0sizeof sound_diej++) precache_sound(sound_die[j])        
    
    
g_TrapPromptSpr precache_model("sprites/zombie_trap_prompt.spr")
    
g_PlayerCatchedSpr precache_model("sprites/zombie_trap_notice.spr")
    
    
g_zclass_heavy zp_register_zombie_class(zclass4_namezclass4_infozclass4_modelzclass4_clawmodelzclass4_healthzclass4_speedzclass4_gravityzclass4_knockback)

dalimnassar is offline
Send a message via Skype™ to dalimnassar
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 09-17-2017 , 12:42   Re: Host_Error: PF_precache_sound_I: Bad string '
Reply With Quote #2

show the strings
__________________
retired chump
DjSoftero is offline
dalimnassar
Member
Join Date: Aug 2017
Location: Tunisia
Old 09-17-2017 , 12:58   Re: Host_Error: PF_precache_sound_I: Bad string '
Reply With Quote #3

PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <xs>
#include <zombieplague>

#define SUPPORT_BOT_TO_USE
#define TASK_SET_TRAP        1234
#define TASK_REMOVE_TRAP        4321

new const zclass4_name[] = { "Heavy Zombie" }    
new const 
zclass4_info[] = { "[Can Make Traps [G]" }    
new const 
zclass4_model[] = {"big_zombie"}        
new const 
zclass4_clawmodel[] = { "zombie_plague/v_knife_heavy_zombi.mdl" }    
const 
zclass4_health 5200        
const zclass4_speed 235        
const Float:zclass4_gravity 0.85        
const Float:zclass4_knockback 0.25        

new g_chance[33]
new 
g_msgScreenFade
const FFADE_IN 0x0000
const FFADE_STAYOUT 0x0004
const UNIT_SECOND = (1<<12)

new 
is_cooldown_time[33] = 0
new is_cooldown[33] = 0

new const Trap_Model[] = { "models/zombie_plague/big_zombie/zombie_trap.mdl" }

new const 
TrapTrigger_Sound[] = { "ultra_energyzm/big/zombi_trapsetup.wav" }
new const 
PlayerCatched_Sound[] = { "ultra_energyzm/big/zombi_trapped.wav" }
new const 
PlayerCatched_Sound1[] = { "ultra_energyzm/big/zombi_trapped_female.wav" }
new const 
CantPlantTrap_Sound[] = { "ultra_energyzm/big/zombie_trap_cant_plant.wav" }
const 
Max_Traps 5    

const OFFSET_flNextPrimaryAttack 46
const OFFSET_flNextSecondaryAttack 47
const OFFSET_flTimeWeaponIdle 48

const OFFSET_LINUX_WEAPONS 

new g_zclass_heavy

new Float:g_revenge_cooldown 30.0

new g_chance_to_cast 25
new cvar_TrapSetTimecvar_TrapAffectTime

new g_maxplayers
new user_has_traps[33]
new 
user_traps_ent[33][Max_Traps]
new 
g_TrapPromptSprg_PlayerCatchedSpr
new g_msgScreenShakeg_msgBarTime
new bool:user_set_trap[33], set_trap_ent[33], Float:set_trap_origin[33][3]
new 
bool:user_be_catched[33], catched_trap_ent[33]

new const 
sound_sleep[] = "ultra_energyzm/big/SleepImpact.wav"
new const sound_infect[] = {"ultra_energyzm/big/infect011.wav","ultra_energyzm/big/infect021.wav","ultra_energyzm/big/infect031.wav"

#define TASK_IDLE_SOUND 4467

#define MIN_IDLE_TIME 20.0
#define MAX_IDLE_TIME 50.0

new const sound_idle[][] = {"ultra_energyzm/big/idle011.wav","ultra_energyzm/big/idle021.wav","ultra_energyzm/big/idle021.wav"}
 
new const 
sound_pain[][] = {"ultra_energyzm/big/pain011.wav","ultra_energyzm/big/pain021.wav"

new const 
sound_die[][] = {"ultra_energyzm/big/die01.wav","ultra_energyzm/big/die02.wav"}

new const 
sound_burn[][] = {"ultra_energyzm/big/burn011.wav","ultra_energyzm/big/burn021.wav","ultra_energyzm/big/burn031.wav"}  

#if defined SUPPORT_BOT_TO_USE
new Float:bot_next_check_time[33]
#endif

public plugin_init()
{
    
register_plugin("[ZP] Class: Big""1.0"":) / Slimes")

    
g_msgScreenFade get_user_msgid("ScreenFade")
    
g_maxplayers get_maxplayers()

    
register_logevent("roundStart"2"1=Round_Start")
    
register_forward(FM_CmdStart"fw_CmdStart")
    
register_forward(FM_StartFrame"fw_StartFrame")
    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink")
    
register_forward(FM_Touch"fw_Touch")
    
register_forward(FM_Think"fw_Think")
    
register_forward(FM_EmitSound"fw_EmitSound")
    
    
register_event("ResetHUD""event_NewSpawn""be")
    
register_event("DeathMsg""event_Death""a")
    
register_event("HLTV""event_RoundStart""a""1=0""2=0")
    
    
RegisterHam(Ham_TakeDamage"player""CPlayer__TakeDamage")
    
    
#if defined SUPPORT_BOT_TO_USE
    
register_event("Damage""event_Damage""be""2>0")
    
#endif
    
    
cvar_TrapSetTime register_cvar("zp_heavy_trap_settime""3.0")
    
cvar_TrapAffectTime register_cvar("zp_heavy_trap_affecttime""10.0")

    
g_msgScreenShake get_user_msgid("ScreenShake")
    
g_msgBarTime get_user_msgid("BarTime")
    
g_maxplayers get_maxplayers()

}

public 
plugin_precache()
{
    
precache_sound(sound_sleep)
    
precache_model(Trap_Model)
    
    
precache_sound(TrapTrigger_Sound)
    
precache_sound(PlayerCatched_Sound)
    
precache_sound(PlayerCatched_Sound1)    
    
precache_sound(CantPlantTrap_Sound)
    new 
j
        
for(j=0sizeof sound_painj++) precache_sound(sound_pain[j]);
        for(
j=0sizeof sound_infectj++) precache_sound(sound_infect[j]);
        for(
j=0sizeof sound_diej++) precache_sound(sound_die[j]);
    for(
j=0sizeof sound_idlej++) precache_sound(sound_idle[j]);
    
    
g_TrapPromptSpr precache_model("sprites/zombie_trap_prompt.spr")
    
g_PlayerCatchedSpr precache_model("sprites/zombie_trap_notice.spr")
    
    
g_zclass_heavy zp_register_zombie_class(zclass4_namezclass4_infozclass4_modelzclass4_clawmodelzclass4_healthzclass4_speedzclass4_gravityzclass4_knockback)
}

public 
client_damage(attacker,victim)
{
    if ((
zp_get_user_zombie_class(victim) == g_zclass_heavy) && zp_get_user_zombie(victim) && !zp_get_user_nemesis(victim) && (is_cooldown[victim] == 0))
    {
        
g_chance[victim] = random_num(0,999)
        if (
g_chance[victim] < g_chance_to_cast)
        {
            
message_begin(MSG_ONEg_msgScreenFade_attacker)
            
write_short(4)
            
write_short(4)
            
write_short(FFADE_STAYOUT)
            
write_byte(0)
            
write_byte(0)
            
write_byte(0)
            
write_byte(255)
            
message_end()
            
            
set_user_health(victimget_user_health(victim) + ( get_user_health(victim) / 10 ) )
            
            
set_task(4.0,"wake_up",attacker)
            
set_task(1.0"ShowHUD"victim__"a",is_cooldown_time[victim])
            
set_task(g_revenge_cooldown,"reset_cooldown",victim)
            
            
emit_sound(attackerCHAN_STREAMsound_sleep1.0ATTN_NORM0PITCH_NORM);
            
            
is_cooldown[victim] = 1
        
}
    }
}

public 
reset_cooldown(id)
{
    if ((
zp_get_user_zombie_class(id) == g_zclass_heavy) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id))
    {
        
is_cooldown[id] = 0
        is_cooldown_time
[id] = floatround(g_revenge_cooldown)
                
ChatColor(id"!g[Heavy] !yYour Ability Is !gReady")  
    }
}

public 
ShowHUD(id)
{
    if(
is_user_alive(id))
    {
        
is_cooldown_time[id] = is_cooldown_time[id] - 1;
                
set_hudmessage(20010000.650.9401.01.10.00.0, -1)
                
show_hudmessage(id"Ability through: %i"is_cooldown_time[id])
    }
    else
    {
        
remove_task(id)
    }
}

public 
wake_up(id)
{
    
message_begin(MSG_ONEg_msgScreenFade_id)
    
write_short(UNIT_SECOND)
    
write_short(0)
    
write_short(FFADE_IN)
    
write_byte(0)
    
write_byte(0)
    
write_byte(0)
    
write_byte(255)
    
message_end()
}

public 
zp_user_infected_post(idinfector)
{
    if (
user_be_catched[id])
    {
        
clear_user_sprite(id)
        
set_pev(idpev_flags, (pev(idpev_flags) & ~FL_FROZEN))
    }
    
    
reset_vars(id)
    
    if (
zp_get_user_zombie_class(id) == g_zclass_heavy && !zp_get_user_nemesis(id))
    {
        
emit_sound(idCHAN_STATICsound_infect[random(sizeof(sound_infect))], VOL_NORMATTN_NORM0PITCH_NORM)
        
is_cooldown[id] = 0
        is_cooldown_time
[id] = floatround(g_revenge_cooldown)

        
user_has_traps[id] = Max_Traps
        ChatColor
(id"!g[Heavy] !yYour Ability !gIs !ySetting UP !g Traps Using !team[R] Button")  
        
ChatColor(id"You Have Only %d Traps To Set"Max_Traps
                
client_cmd(id"bind F1 classic_no")
    }

    
remove_task(id+TASK_IDLE_SOUND)
    
set_task(random_float(MIN_IDLE_TIME,MAX_IDLE_TIME), "TaskIdleSound"id+TASK_IDLE_SOUND)
    
is_cooldown[id] = 0
}

public 
CPlayer__TakeDamage(idiVictimiInflictoriAttackerFloat:flDamagebitsDamage)
{
    if (
zp_get_user_zombie_class(id) == g_zclass_heavy && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && !zp_get_user_survivor(id))
    {
        
emit_sound(idCHAN_STATICsound_pain[random(sizeof(sound_pain))], VOL_NORMATTN_NORM0PITCH_NORM)
    }
}

public 
fw_CmdStart(iduc_handleseed)
{
    if (!
is_user_alive(id))
        return 
FMRES_IGNORED;
    
    if (!
zp_get_user_zombie(id) || zp_get_user_zombie_class(id) != g_zclass_heavy || zp_get_user_nemesis(id))
        return 
FMRES_IGNORED;
    
    
#if defined SUPPORT_BOT_TO_USE
    
if (is_user_bot(id))
    {
        
bot_use_traps(id)
        return 
FMRES_IGNORED;
    }
    
#endif
    
    
static buttonoldbutton
    button 
get_uc(uc_handleUC_Buttons)
    
oldbutton pev(idpev_oldbuttons)
    
    if (!
user_set_trap[id])
    {
        if ((
button IN_RELOAD) && !(oldbutton IN_RELOAD))
        {
            
do_set_trap(id)
        }
    }
    else
    {
        static 
user_flagsFloat:user_origin[3], Float:fdistance
        user_flags 
pev(idpev_flags)
        
pev(idpev_originuser_origin)
        
user_origin[2] -= (user_flags FL_DUCKING) ? 18.0 36.0
        fdistance 
get_distance_f(user_originset_trap_origin[id])
        
        if (!(
button IN_RELOAD) || fdistance 18.0)
        {
            
stop_set_trap(id)
        }
    }
    
    return 
FMRES_HANDLED;
}

public 
fw_StartFrame()
{
    static 
Float:timeFloat:next_check_timeidiclassname[32], Float:origin1[3], Float:origin2[3]
    
    
time get_gametime()
    
    if (
time >= next_check_time)
    {
        for (
id 1id <= g_maxplayersid++)
        {
            if (!
is_user_connected(id) || !is_user_alive(id))
                continue;
            
            if (!
zp_get_user_zombie(id) || zp_get_user_zombie_class(id) != g_zclass_heavy || zp_get_user_nemesis(id))
                continue;
            
            for (
0Max_Trapsi++)
            {
                if (
user_traps_ent[id][i] <= 0)
                    continue;
                
                if (!
pev_valid(user_traps_ent[id][i]))
                {
                    
user_traps_ent[id][i] = 0
                    
continue;
                }
                
                
pev(user_traps_ent[id][i], pev_classnameclassnamecharsmax(classname))
                if (!
equal(classname"ZOMBIE_TRAP_ENT"))
                {
                    
user_traps_ent[id][i] = 0
                    
continue;
                }
                
                if (
pev(user_traps_ent[id][i], pev_iuser3) == 1)
                    continue;
                
                
pev(user_traps_ent[id][i], pev_originorigin1)
                
xs_vec_copy(origin1origin2)
                
origin2[2] += 30.0
                
if (fm_is_point_visible(idorigin11) || fm_is_point_visible(idorigin21))
                {
                    
origin1[2] += 30.0
                    create_user_sprite
(idorigin1g_TrapPromptSpr5)
                }
            }
        }
        
        
next_check_time time 0.1
    
}
    
    return 
FMRES_IGNORED;
}

public 
fw_PlayerPreThink(id)
{
    if (!
is_user_alive(id))
        return 
FMRES_IGNORED;
    
    if (
zp_get_user_zombie(id))
    {
        if (
zp_get_user_zombie_class(id) != g_zclass_heavy || zp_get_user_nemesis(id))
            return 
FMRES_IGNORED;
        
        if (
user_set_trap[id])
        {
            
freeze_user_attack(id)
        }
    }
    else
    {
        if (
user_be_catched[id] && pev_valid(catched_trap_ent[id]))
        {
            static 
classname[32]
            
pev(catched_trap_ent[id], pev_classnameclassnamecharsmax(classname))
            if (!
equal(classname"ZOMBIE_TRAP_ENT"))
                return 
FMRES_IGNORED;
            
            
set_pev(idpev_velocityFloat:{ 0.00.0, -200.0 })
            
set_pev(idpev_maxspeed1.0)
            
            static 
Float:user_origin[3], Float:ent_origin[3], Float:temp_origin[3]
            
pev(idpev_originuser_origin)
            
pev(catched_trap_ent[id], pev_originent_origin)
            
xs_vec_copy(ent_origintemp_origin)
            
temp_origin[2] += 18.0
            
if (get_distance_f(user_origintemp_origin) > 18.0)
            {
                
temp_origin[2] += ((pev(idpev_flags) & FL_DUCKING) ? 0.0 18.0)
                
set_pev(idpev_origintemp_origin)
            }
        }
    }
    
    return 
FMRES_IGNORED;
}

public 
fw_Touch(ptrptd)
{
    if (!
pev_valid(ptr) || !pev_valid(ptd))
        return 
FMRES_IGNORED;
    
    static 
classname[32]
    
pev(ptrpev_classnameclassnamecharsmax(classname))
    if (!
equal(classname"ZOMBIE_TRAP_ENT"))
        return 
FMRES_IGNORED;
    
    if (!(
<= ptd <= g_maxplayers) || !is_user_alive(ptd) || zp_get_user_zombie(ptd))
        return 
FMRES_IGNORED;
    
    if (
pev(ptrpev_iuser2) == 0)
        return 
FMRES_IGNORED;

    if (
pev(ptrpev_iuser3) == && !user_be_catched[ptd])
    {
        
PlaySound(ptdTrapTrigger_Sound)
        new 
rand random_num(1,2)
        switch(
rand)
        {
        case 
1engfunc(EngFunc_EmitSoundptdCHAN_VOICEPlayerCatched_Sound1.0ATTN_NORM0PITCH_NORM)
        case 
2engfunc(EngFunc_EmitSoundptdCHAN_VOICEPlayerCatched_Sound11.0ATTN_NORM0PITCH_NORM)
             }
        
user_screen_shake(ptd425)
        
show_user_sprite(ptdg_PlayerCatchedSpr)
        
        static 
Float:origin[3]
        
pev(ptrpev_originorigin)
        
origin[2] += ((pev(ptdpev_flags) & FL_DUCKING) ? 18.0 36.0)
        
set_pev(ptdpev_originorigin)
        
set_pev(ptdpev_velocityFloat:{ 0.00.00.0 })
                new 
name[32]
                
get_user_name(ptdname31)
                
client_print(ptdprint_center"!g[Ultra!y-!gEnergy] !y You are !gTrapped")
        
        
set_pev(ptrpev_iuser31)
        
set_pev(ptrpev_iuser4ptd)
        
user_be_catched[ptd] = true
        catched_trap_ent
[ptd] = ptr
        fm_set_rendering
(ptrkRenderFxNone0,0,0kRenderNormal255)
        
set_pev(ptrpev_nextthinkget_gametime() + 0.05)
        
        static 
owner
        owner 
pev(ptrpev_iuser1)
        if (
<= owner <= g_maxplayers)
                        
client_print(ownerprint_center"!g[Ultra!y-!gEnergy] !team%s !yis !gTrapped"name)
        
        static 
Float:trap_affect_time
        trap_affect_time 
get_pcvar_float(cvar_TrapAffectTime)
        if (
trap_affect_time 0.0)
        {
            static 
args[1]
            
args[0] = ptr
            set_task
(trap_affect_time"remove_trap"TASK_REMOVE_TRAPargs1)
        }
    }
    
    return 
FMRES_IGNORED;
}

public 
fw_Think(ent)
{
    if (
pev_valid(ent))
    {
        static 
classname[32]
        
pev(entpev_classnameclassnamecharsmax(classname))
        if (
equal(classname"ZOMBIE_TRAP_ENT"))
        {
            if (
pev(entpev_sequence) != 1)
            {
                
set_pev(entpev_sequence1)
                
set_pev(entpev_frame0.0)
            }
            else
            {
                if (
pev(entpev_frame) > 241.0)
                    
set_pev(entpev_frame20.0)
                else
                    
set_pev(entpev_framepev(entpev_frame) + 1.0)
            }
            
            static 
catched_player
            catched_player 
pev(entpev_iuser4)
            if (!
user_be_catched[catched_player] || catched_trap_ent[catched_player] != ent)
            {
                
engfunc(EngFunc_RemoveEntityent)
                return 
FMRES_IGNORED;
            }
            
            
set_pev(entpev_nextthinkget_gametime() + 0.05)
        }
    }
    
    return 
FMRES_IGNORED;
}

freeze_user_attack(id)
{
    new 
weaponweapon_name[32], weapon_ent
    weapon 
get_user_weapon(id)
    
get_weaponname(weaponweapon_namecharsmax(weapon_name))
    
weapon_ent fm_find_ent_by_owner(-1weapon_nameid)
    
    if (
get_weapon_next_pri_attack(weapon_ent) <= 0.1)
        
set_weapon_next_pri_attack(weapon_ent0.5)
    
    if (
get_weapon_next_sec_attack(weapon_ent) <= 0.1)
        
set_weapon_next_sec_attack(weapon_ent0.5)
    
    if (
weapon == CSW_XM1014 || weapon == CSW_M3)
    {
        if (
get_weapon_idle_time(weapon_ent) <= 0.1)
            
set_weapon_idle_time(weapon_ent0.5)
    }
}

do_set_trap(id)
{
    if (!
user_set_trap[id])
    {
        if (
set_a_trap(idset_trap_ent[id], set_trap_origin[id]) == 1)
        {
            
user_set_trap[id] = true
            
            
new Float:velocity[3]
            
pev(idpev_velocityvelocity)
            
velocity[0] = velocity[1] = 0.0
            set_pev
(idpev_velocityvelocity)
            
            new 
Float:set_trap_timetask_time
            set_trap_time 
get_pcvar_float(cvar_TrapSetTime)
            
task_time floatround(set_trap_timefloatround_floor) + (floatfract(set_trap_time) >= 0.5 0)
            
set_task(set_trap_time"trap_complete", (id TASK_SET_TRAP))
            
show_user_taskbar(idtask_time)
            
                        
client_print(idprint_center"!g[Heavy] !teamInstallation !yof the !gtrap !yis in !gprogress!")
            return 
1;
        }
    }
    
    return 
0;
}

stop_set_trap(id)
{
    if (
user_set_trap[id])
    {
        
client_print(idprint_center"")
        
        if (
pev_valid(set_trap_ent[id]))
            
engfunc(EngFunc_RemoveEntityset_trap_ent[id])
        
        
user_set_trap[id] = false
        set_trap_ent
[id] = 0
        remove_task
(id TASK_SET_TRAP)
        
show_user_taskbar(id0)
    }
}

set_a_trap(id, &trap_entityFloat:trap_origin[3])
{
    if (
user_has_traps[id] <= 0)
    {
        
engfunc(EngFunc_EmitSoundidCHAN_ITEMCantPlantTrap_Sound1.0ATTN_NORM0PITCH_NORM)
                
client_print(idprint_center"!g[Heavy] !y No More !gTraps For Your !teamClass !y'-'")
        return 
0;
    }
    
    new 
user_flags pev(idpev_flags)
    if (!(
user_flags FL_ONGROUND))
    {
        
engfunc(EngFunc_EmitSoundidCHAN_ITEMCantPlantTrap_Sound1.0ATTN_NORM0PITCH_NORM)
                
client_print(idprint_center"!g[Heavy] !yTrap Installation Is !gCancelled")
        return 
0;
    }
    
    new 
Float:origin[3]
    
pev(idpev_originorigin)
    
origin[2] -= (user_flags FL_DUCKING) ? 18.0 36.0
    
    
if (get_too_close_traps(origin))
    {
        
engfunc(EngFunc_EmitSoundidCHAN_ITEMCantPlantTrap_Sound1.0ATTN_NORM0PITCH_NORM)
                
client_print(idprint_center"!g[Heavy] !yTrap Installation Is !gCancelled")
        return 
0;
    }
    
    
client_print(idprint_center"")
    
    new 
ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
    if (!
ent) return -1;
    
    
set_pev(entpev_classname"ZOMBIE_TRAP_ENT")
    
set_pev(entpev_solidSOLID_TRIGGER)
    
set_pev(entpev_movetypeMOVETYPE_FLY)
    
set_pev(entpev_sequence0)
    
set_pev(entpev_frame0.0)
    
set_pev(entpev_iuser1id
    
set_pev(entpev_iuser20)
    
set_pev(entpev_iuser30)
    
set_pev(entpev_iuser40)
    
    new 
Float:mins[3] = { -20.0, -20.00.0 }
    new 
Float:maxs[3] = { 20.020.030.0 }
    
engfunc(EngFunc_SetSizeentminsmaxs)
    
    
engfunc(EngFunc_SetModelentTrap_Model)
    
    
fm_set_rendering(entkRenderFxGlowShell000kRenderTransAlpha0)
    
    
set_pev(entpev_originorigin)
    
    
trap_entity ent
    
    xs_vec_copy
(origintrap_origin)
    
    return 
1;
}

public 
trap_complete(taskid)
{
    new 
id taskid TASK_SET_TRAP
    
    show_user_taskbar
(id0)
    
    if (
pev_valid(set_trap_ent[id]))
    {
        
set_pev(set_trap_ent[id], pev_iuser21)
        
user_has_traps[id]--
        
set_user_traps_data(idset_trap_ent[id])
        
        
client_print(idprint_center"!g[Heavy] !yYour !gTrap !yHas Been !teamSuccesfully !gInstalled")
    }

        if (
user_has_traps[id] > 0)
               
ChatColor(id"!g[Heavy] !yYou still have %i !gtraps!"user_has_traps[id]) 
    else
              
ChatColor(id"!g[Heavy] !yYou Can't !teamInstall !gTraps Anymore Wait For Next !teamInfection"
    
    
#if defined SUPPORT_BOT_TO_USE
    
if (is_user_bot(id))
    {
        
set_pev(idpev_flags, (pev(idpev_flags) & ~FL_FROZEN))
        
bot_next_check_time[id] = get_gametime() + 10.0
    
}
    
#endif
    
    
user_set_trap[id] = false
    set_trap_ent
[id] = 0
}

public 
remove_trap(args[1])
{
    new 
ent args[0]
    
    if (
pev_valid(ent))
    {
        new 
classname[32]
        
pev(entpev_classnameclassnamecharsmax(classname))
        if (!
equal(classname"ZOMBIE_TRAP_ENT"))
            return;
        
        new 
catched_player pev(entpev_iuser4)
        if (
user_be_catched[catched_player] && catched_trap_ent[catched_player] == ent)
        {
            
clear_user_sprite(catched_player)
            
set_pev(catched_playerpev_flags, (pev(catched_playerpev_flags) & ~FL_FROZEN))
            
user_be_catched[catched_player] = false
            catched_trap_ent
[catched_player] = 0
        
}
        
        
engfunc(EngFunc_RemoveEntityent)
    }
}

public 
zp_user_humanized_post(id)
{
    if (
user_set_trap[id])
    {
        
stop_set_trap(id)
        
        
#if defined SUPPORT_BOT_TO_USE
        
if (pev(idpev_flags) & FL_FROZEN)
            
set_pev(idpev_flags, (pev(idpev_flags) & ~FL_FROZEN))
        
#endif
    
}
    
    
remove_task(id+TASK_IDLE_SOUND)
    
reset_traps_owner(id)
    
reset_vars(id)

}

public 
TaskIdleSound(id)
{
    
id -= TASK_IDLE_SOUND
    
if(is_user_alive(id))
    {
        
emit_sound(idCHAN_STATICsound_idle[random(sizeof(sound_idle))], VOL_NORMATTN_NORM0PITCH_NORM)
        
set_task(random_float(MIN_IDLE_TIME,MAX_IDLE_TIME), "TaskIdleSound"id+TASK_IDLE_SOUND)
    }
}  

public 
client_connect(id)
{
    
reset_vars(id)
}

public 
client_disconnect(id)
{
    if (
user_set_trap[id])
    {
        
stop_set_trap(id)
        
        
#if defined SUPPORT_BOT_TO_USE
        
if (pev(idpev_flags) & FL_FROZEN)
            
set_pev(idpev_flags, (pev(idpev_flags) & ~FL_FROZEN))
        
#endif
    
}
    
    if (
user_be_catched[id])
    {
        
clear_user_sprite(id)
        
set_pev(idpev_flags, (pev(idpev_flags) & ~FL_FROZEN))
    }

    
remove_task(id+TASK_IDLE_SOUND)
    
reset_vars(id)
}

public 
event_NewSpawn(id)
{
    if (
user_set_trap[id])
    {
        
stop_set_trap(id)
        
        
#if defined SUPPORT_BOT_TO_USE
        
if (pev(idpev_flags) & FL_FROZEN)
            
set_pev(idpev_flags, (pev(idpev_flags) & ~FL_FROZEN))
        
#endif
    
}
    
    if (
user_be_catched[id])
    {
        
clear_user_sprite(id)
        
set_pev(idpev_flags, (pev(idpev_flags) & ~FL_FROZEN))
    }
    
    
reset_vars(id)
}

public 
event_Death()
{
    new 
id read_data(2)
    if (!(
<= id <= g_maxplayers))
        return;
    
    if (
user_set_trap[id])
    {
        
stop_set_trap(id)
        
        
#if defined SUPPORT_BOT_TO_USE
        
if (pev(idpev_flags) & FL_FROZEN)
            
set_pev(idpev_flags, (pev(idpev_flags) & ~FL_FROZEN))
        
#endif
    
}
    
    if (
user_be_catched[id])
    {
        
clear_user_sprite(id)
        
set_pev(idpev_flags, (pev(idpev_flags) & ~FL_FROZEN))
    }
    
    
reset_traps_owner(id)
    
reset_vars(id)
}

public 
event_RoundStart()
{
    
remove_task(TASK_REMOVE_TRAP)
    
remove_all_traps()
}

get_too_close_traps(const Float:origin[3])
{
    new 
bool:findentFloat:ent_origin[3]
    
find false
    ent 
= -1
    
while ((ent fm_find_ent_by_class(ent"ZOMBIE_TRAP_ENT")))
    {
        if (
pev(entpev_iuser2) == 1)
        {
            
pev(entpev_originent_origin)
            if (
get_distance_f(originent_origin) <= 50.0)
                
find true
        
}
    }
    
    if (!
find) return 0;
    
    return 
1;
}

set_user_traps_data(idtrap_ent)
{
    new 
bool:find false
    
    
for (new 0Max_Trapsi++)
    {
        if (
user_traps_ent[id][i] == 0)
        {
            
user_traps_ent[id][i] = trap_ent
            find 
true
            
break;
        }
    }
    
    if (!
find) return 0;
    
    return 
1;
}

reset_traps_owner(id)
{
    new 
classname[32], owner
    
for (new 0Max_Trapsi++)
    {
        if (
user_traps_ent[id][i] > && pev_valid(user_traps_ent[id][i]))
        {
            
pev(user_traps_ent[id][i], pev_classnameclassnamecharsmax(classname))
            
owner pev(user_traps_ent[id][i], pev_iuser1)
            
            if (
equal(classname"ZOMBIE_TRAP_ENT") && owner == id)
                
set_pev(user_traps_ent[id][i], pev_iuser10)
        }
    }
}

remove_all_traps()
{
    new 
ent = -1
    
while ((ent fm_find_ent_by_class(ent"ZOMBIE_TRAP_ENT")))
    {
        
engfunc(EngFunc_RemoveEntityent)
    }
}

reset_vars(id)
{
    
user_has_traps[id] = 0
    user_set_trap
[id] = false
    set_trap_ent
[id] = 0
    user_be_catched
[id] = false
    catched_trap_ent
[id] = 0
    
    
for (new 0Max_Trapsi++)
        
user_traps_ent[id][i] = 0
}

stock fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16)
{
    new 
Float:RenderColor[3];
    
RenderColor[0] = float(r);
    
RenderColor[1] = float(g);
    
RenderColor[2] = float(b);
    
    
set_pev(entitypev_renderfxfx);
    
set_pev(entitypev_rendercolorRenderColor);
    
set_pev(entitypev_rendermoderender);
    
set_pev(entitypev_renderamtfloat(amount));
    
    return 
1;
}

stock fm_find_ent_by_class(index, const classname[])
{
    return 
engfunc(EngFunc_FindEntityByStringindex"classname"classname
}

stock PlaySound(id, const sound[])
{
    if (
equal(sound[strlen(sound)-4], ".mp3"))
        
client_cmd(id"mp3 play ^"sound/%s^""sound)
    else
        
client_cmd(id"spk ^"%s^""sound)
}

stock user_screen_shake(idamplitude 4duration 2frequency 10)
{
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenShake_id)
    
write_short((1<<12)*amplitude
    
write_short((1<<12)*duration)
    
write_short((1<<12)*frequency)
    
message_end()
}

stock show_user_taskbar(idtime)
{
    
message_begin(MSG_ONE_UNRELIABLEg_msgBarTime_id)
    
write_short(time)
    
message_end()
}

stock show_user_sprite(id, const sprite_index)
{
    
message_begin(MSG_ALLSVC_TEMPENTITY)
    
write_byte(TE_PLAYERATTACHMENT
    
write_byte(id)
    
write_coord(45)
    
write_short(sprite_index)
    
write_short(32767)
    
message_end()
}

stock clear_user_sprite(id)
{
    
message_begin(MSG_ALLSVC_TEMPENTITY)
    
write_byte(TE_KILLPLAYERATTACHMENTS)
    
write_byte(id)
    
message_end()
}

stock bool:fm_is_point_visible(index, const Float:point[3], ignoremonsters 1)
{
    new 
Float:start[3], Float:dest[3];
    
pev(indexpev_originstart);
    
pev(indexpev_view_ofsdest);
    
xs_vec_add(startdeststart);
    
    
engfunc(EngFunc_TraceLinestartpointignoremonstersindex0);
    
    new 
Float:fraction;
    
get_tr2(0TR_flFractionfraction);
    if (
fraction == 1.0)
        return 
true;
    
    
get_tr2(0TR_vecEndPosdest);
    if ((
dest[0] == point[0]) && (dest[1] == point[1]) && (dest[2] == point[2]))
        return 
true;
    
    return 
false;
}

stock create_user_sprite(id, const Float:originF[3], sprite_indexscale)
{
    
message_begin(MSG_ONESVC_TEMPENTITY_id)
    
write_byte(TE_SPRITE)
    
engfunc(EngFunc_WriteCoordoriginF[0])
    
engfunc(EngFunc_WriteCoordoriginF[1])
    
engfunc(EngFunc_WriteCoordoriginF[2])
    
write_short(sprite_index)
    
write_byte(scale)
    
write_byte(200)
    
message_end()
}

stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((
entity engfunc(EngFunc_FindEntityByStringentity"classname"classname)) && (pev(entitypev_owner) != owner)) {}
    
    return 
entity;
}

stock Float:get_weapon_next_pri_attack(entity)
{
    return 
get_pdata_float(entityOFFSET_flNextPrimaryAttackOFFSET_LINUX_WEAPONS)
}

stock set_weapon_next_pri_attack(entityFloat:time)
{
    
set_pdata_float(entityOFFSET_flNextPrimaryAttacktimeOFFSET_LINUX_WEAPONS)
}

stock Float:get_weapon_next_sec_attack(entity)
{
    return 
get_pdata_float(entityOFFSET_flNextSecondaryAttackOFFSET_LINUX_WEAPONS)
}

stock set_weapon_next_sec_attack(entityFloat:time)
{
    
set_pdata_float(entityOFFSET_flNextSecondaryAttacktimeOFFSET_LINUX_WEAPONS)
}

stock Float:get_weapon_idle_time(entity)
{
    return 
get_pdata_float(entityOFFSET_flTimeWeaponIdleOFFSET_LINUX_WEAPONS)
}

stock set_weapon_idle_time(entityFloat:time)
{
    
set_pdata_float(entityOFFSET_flTimeWeaponIdletimeOFFSET_LINUX_WEAPONS)
}

#if defined SUPPORT_BOT_TO_USE
public bot_use_traps(id)
{
    static 
targethitzonedistance
    target 
get_valid_aim_target(idhitzonedistance)
    
    if (!
user_set_trap[id])
    {
        static 
Float:time
        time 
get_gametime()
        
        if (
target && (500 <= distance <= 1000) && time >= bot_next_check_time[id])
        {
            if (
random_num(1100) > 85)
            {
                if (
do_set_trap(id))
                    
set_pev(idpev_flags, (pev(idpev_flags) | FL_FROZEN))
            }
            
            
bot_next_check_time[id] = time 1.0
        
}
    }
    else
    {
        static 
Float:user_origin[3], Float:fdistance
        pev
(idpev_originuser_origin)
        
user_origin[2] = set_trap_origin[id][2]
        
fdistance get_distance_f(user_originset_trap_origin[id])
        
        if ((
target && distance <= 200) || fdistance 18.0)
        {
            
stop_set_trap(id)
            
set_pev(idpev_flags, (pev(idpev_flags) & ~FL_FROZEN))
        }
    }
}

public 
event_Damage(id)
{
    new 
attackerweaponhitzone
    attacker 
get_user_attacker(idweaponhitzone)
    
    if (!(
<= attacker <= g_maxplayers) || !is_user_connected(attacker) || !is_user_alive(attacker
    || 
attacker == id)
        return;
    
    new 
damage read_data(2)
    
    if (
is_user_bot(id) && damage 0)
    {
        new 
Float:origin1[3], Float:origin2[3], distance
        pev
(idpev_originorigin1)
        
pev(attackerpev_originorigin2)
        
distance floatround(get_distance_f(origin1origin2))
        
        if (
distance 500 || damage 100)
        {
            if (
user_set_trap[id])
            {
                
stop_set_trap(id)
                
set_pev(idpev_flags, (pev(idpev_flags) & ~FL_FROZEN))
            }
        }
    }
}

get_valid_aim_target(id, &hitzone, &distance)
{
    new 
targetaim_hitzone
    get_user_aiming
(idtargetaim_hitzone)
    if (!(
<= target <= g_maxplayers) || !is_user_alive(target) || zp_get_user_zombie(target))
        return 
0;
    
    
hitzone aim_hitzone
    
new Float:origin1[3], Float:origin2[3]
    
pev(idpev_originorigin1)
    
pev(targetpev_originorigin2)
    
distance floatround(get_distance_f(origin1origin2), floatround_round)
    
    return 
target;
}
#endif

public roundStart()
{
    for (new 
1<= g_maxplayersi++)
    {
        
is_cooldown[i] = 0
        is_cooldown_time
[i] = floatround(g_revenge_cooldown)
        
remove_task(i)
    }
}

public 
fw_EmitSound(idchannel, const sample[], Float:volumeFloat:attnflagspitch)
{
    if(!
is_user_connected(id))
    return 
FMRES_HANDLED;    
    
    if (
sample[0] == 'h' && sample[1] == 'o' && sample[2] == 's' && sample[3] == 't' && sample[4] == 'a' && sample[5] == 'g' && sample[6] == 'e')
    return 
FMRES_SUPERCEDE;
    
    
    if(
zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_heavy && !zp_get_user_nemesis(id))
    {
        if (
sample[7] == 'd' && ((sample[8] == 'i' && sample[9] == 'e') || (sample[8] == 'e' && sample[9] == 'a')))
        {
        
emit_sound(idCHAN_STATICsound_die[random(sizeof(sound_die))], VOL_NORMATTN_NORM0PITCH_NORM)
        }
    }
    return 
FMRES_IGNORED;
}

stock ChatColor(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4")
    
replace_all(msg190"!y""^1")
    
replace_all(msg190"!team""^3")
    
    if (
idplayers[0] = id; else get_players(playerscount"ch")
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }

full code
dalimnassar is offline
Send a message via Skype™ to dalimnassar
dalimnassar
Member
Join Date: Aug 2017
Location: Tunisia
Old 09-17-2017 , 12:58   Re: Host_Error: PF_precache_sound_I: Bad string '
Reply With Quote #4

Quote:
Originally Posted by DjSoftero View Post
show the strings
can u btw fix it for me please
dalimnassar is offline
Send a message via Skype™ to dalimnassar
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 09-17-2017 , 14:05   Re: Host_Error: PF_precache_sound_I: Bad string '
Reply With Quote #5

uhm, for me it compiled just fine. only a bunch of loose indentations, and sound_burn isn`t used. try updating the compiler and inc files
__________________
retired chump
DjSoftero is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 09-17-2017 , 14:36   Re: Host_Error: PF_precache_sound_I: Bad string '
Reply With Quote #6

lol he said he get host error
not compile error
host errors is error come in game
killerZM is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 09-18-2017 , 09:11   Re: Host_Error: PF_precache_sound_I: Bad string '
Reply With Quote #7

sorry for misunderstanding.


i guess the error comes from this:
PHP Code:
new const sound_infect[] = {"ultra_energyzm/big/infect011.wav","ultra_energyzm/big/infect021.wav","ultra_energyzm/big/infect031.wav"
in my opinion it should be a 2d array
__________________
retired chump
DjSoftero is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 09-18-2017 , 11:55   Re: Host_Error: PF_precache_sound_I: Bad string '
Reply With Quote #8

Quote:
Ok, this is an odd, and deadly error. Basically, the map will compile fine. When you attempt to run the map, everything seems great, however before it loads, it crashes back to the main screen. When you press the console button, all it says is this:

Host_Error: PF_precache_model_I: Bad string"

Now, I am guessing it's an entity problem, (dur), but being more specific is starting to be a little more difficult. This is what good o'l Tommy says:

Host_Error: Bad String

This rare error only happens in game/server mode when sprites, models, sounds, or text strings (but not all strings!) are initialized and precached. If the string/name for the sprite, model, sound, or miscellaneous text string either starts with a non-printable ASCII character, or is 0 length (ie: starts with a non-printable null ASCII character), then the error will occur.
Solution: search thru entities like env_glow, env_sprite, ambient_generic, env_shooter, etc. - anything the engine has to precache a file for the bad name.

This is a svencoop map which uses a ton of custom sounds, and models. Now, the odd thing is that it says it's a naming problem. However, when I do entity check, and even ripent the bsp, I can't find any problems with any of the characters!

Somebody, please shed some light on my problem, or offer to lend me a hand! I already have two people trying to find the problem. The faster it is solved, the faster my map can be completed.

If I get any more information, or find a fix for it, I'll put it up.
killerZM is offline
Don Marlboro
Junior Member
Join Date: Sep 2016
Location: Albania
Old 09-30-2017 , 07:06   Re: Host_Error: PF_precache_sound_I: Bad string '
Reply With Quote #9

Delete constants and use only precache.
Don Marlboro is offline
Send a message via Skype™ to Don Marlboro
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 01:41.


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