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

New message started when msg '23' has not been sent yet


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 04-04-2021 , 08:12   New message started when msg '23' has not been sent yet
Reply With Quote #1

Hi, can someone help me with this knife plugin? When im trying to hit a zombie with this knife it gives me this error as in the title of this topic.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#include <xs>

#define NAME        "::Knife Generator ::"
#define VERSION        "1.0"
#define AUTHOR        "Zombie-Mod.ru"


#define KNIFE_NAME    "Golden knife"
#define KNIFE_COST    5

#define SEC_DMG        4.0
#define PRIM_DMG    3.0
#define SEC_HEAD_DMG    10.0
#define PRIM_HEAD_DMG    5.0

static const v_knife[] = "models/zombie_plague/v_knife_shine.mdl"
static const p_knife[] = "models/zombie_plague/p_knife.mdl"

static g_Item_Knife
static bool:Knife[33]

public 
plugin_init()
{
    
register_plugin(NAMEVERSIONAUTHOR)
    
    
g_Item_Knife zp_register_extra_item(KNIFE_NAMEKNIFE_COSTZP_TEAM_HUMAN)
    
    
register_event("CurWeapon""ChangeModel""be""1=1")
    
RegisterHam(Ham_TakeDamage"player""TakeDamage_Pre"0)
    
RegisterHam(Ham_TakeDamage"player""TakeDamage_Post"1)
    
RegisterHam(Ham_Player_PreThink"player""PreThink")
}
public 
zp_user_infected_post(idKnife[id] = false
public zp_extra_item_selected(iditemid)
{
    if(
itemid == g_Item_Knife)
    {    if(
Knife[id]) return ZP_PLUGIN_HANDLED
        engclient_cmd
(id"weapon_knife")
        
Knife[id] = true
        change
(id)
    }
    return 
PLUGIN_CONTINUE
}

public 
ChangeModel(id)
{
    if(!
is_user_alive(id) || zp_get_user_zombie(id))
        return
        
    static 
weaponid
    weaponid 
read_data(2)
    
    if(!
Knife[id] || weaponid != CSW_KNIFE)
        return
        
    
change(id)
}

public 
TakeDamage_Pre(victiminflictorattackerFloat:damagedamagetype)
{
    if(!
is_user_alive(attacker))
    return 
HAM_IGNORED
        
    
if(!Knife[attacker] || get_user_weapon(attacker) != CSW_KNIFE)
     return 
HAM_IGNORED
    
    
new hittarget
    get_user_aiming
(attackertargethit)

    new 
bool:head = (hit == HIT_HEAD)
    new 
Float:mult_dmg 1.0
    
if(pev(attackerpev_buttonIN_ATTACK))
        
mult_dmg head PRIM_HEAD_DMG PRIM_DMG
    
else
        
mult_dmg head SEC_HEAD_DMG SEC_DMG
    SetHamParamFloat
(4damage mult_dmg)
    return 
HAM_HANDLED
}

public 
TakeDamage_Post(victiminflictorattackerFloat:damagedamagetype)
{
    if(!
is_user_alive(attacker) || !is_user_alive(victim)) 
    return 
HAM_IGNORED
        
    
if(!Knife[attacker] || get_user_weapon(attacker) != CSW_KNIFE)
     return 
HAM_IGNORED
        
    
new Float:Origin[3], Float:Origin2[3], Float:Velocity[3]
    
pev(attackerpev_originOrigin)
    
pev(victimpev_originOrigin2)
    
xs_vec_sub(Origin2OriginVelocity)
    
xs_vec_normalize(VelocityVelocity)
    if(
Velocity[2] <= 100.0)
        
Velocity[2] = random_float(150.0250.0)
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
    
write_byte(TE_BLOODSPRITE);
    
engfunc(EngFunc_WriteCoordOrigin2[0])
    
engfunc(EngFunc_WriteCoordOrigin2[1])
    
engfunc(EngFunc_WriteCoordOrigin2[2])
    
set_pev(victimpev_velocityVelocity)
    return 
HAM_HANDLED
}

public 
PreThink(id)
{
    if(!
is_user_alive(id)) return HAM_IGNORED
    
if(!Knife[id]) return HAM_IGNORED
    
if(get_user_weapon(id) != CSW_KNIFE
    {
        
set_pev(idpev_gravityget_cvar_float("zp_human_gravity"))
        
set_pev(idpev_maxspeedget_cvar_float("zp_human_speed"))
        return 
HAM_IGNORED
    
}
    return 
HAM_HANDLED
}

public 
plugin_precache()
{
    
precache_model(v_knife)
    
precache_model(p_knife)
}

change(id)
{
    
set_pev(idpev_viewmodel2v_knife)
    
set_pev(idpev_weaponmodel2p_knife)

HowToRuski is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 04-04-2021 , 11:26   Re: New message started when msg '23' has not been sent yet
Reply With Quote #2

Code:
    message_begin(MSG_BROADCAST, SVC_TEMPENTITY); // Line 99     write_byte(TE_BLOODSPRITE);     engfunc(EngFunc_WriteCoord, Origin2[0])     engfunc(EngFunc_WriteCoord, Origin2[1])     engfunc(EngFunc_WriteCoord, Origin2[2])
    message_end() //?
    set_pev(victim, pev_velocity, Velocity)     return HAM_HANDLED
__________________
Black Rose is offline
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 04-06-2021 , 10:39   Re: New message started when msg '23' has not been sent yet
Reply With Quote #3

Quote:
Originally Posted by Black Rose View Post
Code:
    message_begin(MSG_BROADCAST, SVC_TEMPENTITY); // Line 99     write_byte(TE_BLOODSPRITE);     engfunc(EngFunc_WriteCoord, Origin2[0])     engfunc(EngFunc_WriteCoord, Origin2[1])     engfunc(EngFunc_WriteCoord, Origin2[2])
    message_end() //?
    set_pev(victim, pev_velocity, Velocity)     return HAM_HANDLED
Idk whats that all line about ... (not my plugin lol) but i removed it all... Now it works. With your fix it just closes my bot game unlike the first error i got.

Last edited by HowToRuski; 04-06-2021 at 10:45.
HowToRuski 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 00:40.


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