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

Solved death message error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 03-29-2018 , 13:03   death message error
Reply With Quote #1

I have this part of code:
PHP Code:
public take_damage(attackervictimFloat:damage)
{
    if (
get_user_health(victim) - damage <= 0)
        
util_kill(attackervictim);
    else
    {
        
fm_fakedamage(victim"drone"damageDMG_BULLET);
        static 
origin[3];
        
get_user_origin(victimorigin0);
        
message_begin(MSG_ONEget_user_msgid("Damage"), {000}, victim);
        
write_byte(0);         // Damage save
        
write_byte(floatround(damage));     // Damage take
        
write_long(DMG_BLAST);     // Damage type
        
write_coord(origin[0]);     // X
        
write_coord(origin[1]);     // Y
        
write_coord(origin[2]);     // Z
        
message_end();
        if (
get_user_team(attacker) == get_user_team(victim))
        {
            static 
name[32];
            
get_user_name(attackernamesizeof(name));
            
client_print(0print_chat"%s attacked a teammate"name);
        }
    }
}

util_kill(killervictim)
{
    if (
get_user_team(killer) != get_user_team(victim))
    {
        
user_silentkill(victim);
        
make_deathmsg(killervictim0"drone");

        
set_user_frags(killerget_user_frags(killer) + 1);

        new 
money cs_get_user_money(killer) + 300;
        if (
money >= 16000)
            
cs_set_user_money(killer16000);
        else
            
cs_set_user_money(killermoney1);
    }
    else
    {
        
user_silentkill(victim);
        
make_deathmsg(killervictim0"drone");
        
set_user_frags(killerget_user_frags(killer) - 1);
        new 
money cs_get_user_money(killer) - 3300;
        if (
money <= 0)
            
cs_set_user_money(killer0);
        else
            
cs_set_user_money(killermoney1);
    }

    
message_begin(MSG_BROADCASTget_user_msgid("ScoreInfo"));
    
write_byte(killer);             // Destination
    
write_short(get_user_frags(killer));     // Frags
    
write_short(cs_get_user_deaths(killer)); // Deaths
    
write_short(0);                 // Player class
    
write_short(get_user_team(killer));     // Team
    
message_end();
    
message_begin(MSG_BROADCASTget_user_msgid("ScoreInfo"));
    
write_byte(victim);             // Destination
    
write_short(get_user_frags(victim));     // Frags
    
write_short(cs_get_user_deaths(victim)); // Deaths
    
write_short(0);                 // Player class
    
write_short(get_user_team(victim));     // Team
    
message_end();
    static 
kname[32];
    static 
vname[32];
    static 
kteam[10];
    static 
vteam[10];
    static 
kauthid[32];
    static 
vauthid[32];

    
get_user_name(killerknamesizeof(kname));
    
get_user_team(killerkteamsizeof(kteam));
    
get_user_authid(killerkauthidsizeof(kauthid));

    
get_user_name(victimvnamesizeof(vname));
    
get_user_team(victimvteamsizeof(vteam));
    
get_user_authid(victimvauthidsizeof(vauthid));

    
log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with drone"
    
knameget_user_userid(killer), kauthidkteam
     
vnameget_user_userid(victim), vauthidvteam);

but in the second time I kill a player using that drone the server crash and give me this error:
new message started when msg '85' has not been sent yet.

Last edited by man_s_our; 03-29-2018 at 14:00.
man_s_our is offline
marcelowzd
Senior Member
Join Date: Feb 2011
Location: São Paulo, Brazil
Old 03-29-2018 , 13:44   Re: death message error
Reply With Quote #2

Which event are you using to get damage? If you're using HAM_TAKEDAMAGE, the parameters are wrong.
Also, there are more things you should be checking. For example, you need to make sure both are players.
__________________
marcelowzd is offline
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 03-29-2018 , 13:55   Re: death message error
Reply With Quote #3

Quote:
Originally Posted by marcelowzd View Post
Which event are you using to get damage? If you're using HAM_TAKEDAMAGE, the parameters are wrong.
Also, there are more things you should be checking. For example, you need to make sure both are players.
I'm sure that attacker is a player but not sure about the victim.
man_s_our is offline
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 03-29-2018 , 14:00   Re: death message error
Reply With Quote #4

fiexed it.
man_s_our 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 06:21.


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