AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   DeathMsg (https://forums.alliedmods.net/showthread.php?t=294692)

Adomaz1 03-05-2017 07:03

DeathMsg
 
How can I make a diffrent DeathMsg? It already shows that the player was killed by worldspawn in the console, but how can I make that it would show worldspawn ingame instead of a knife? I searched for answers and found that it has something to do with TruncatedWeaponName, but I didn't find something similar in what I want. :s

Bugsy 03-05-2017 11:13

Re: DeathMsg
 
Not 100% sure what you want your end result to be. Have you tried:

make_deathmsg( idKiller , idVictim , headshot (0 or 1) , "knife")

Natsheh 03-05-2017 12:01

Re: DeathMsg
 
Try to hook ham killed pre. And check if user commiting a suicide and check the dmgbits and do new sucide deathmsg etc.

georgik57 03-06-2017 02:48

Re: DeathMsg
 
Post your code.

Adomaz1 03-06-2017 08:42

Re: DeathMsg
 
I want to do something like this(the photo isn't mine):
http://i294.photobucket.com/albums/m...m3ts/sprit.jpg

In the console it shows that the player has been killed by a hegrenade, but not in the game. It just shows a worldspawn icon which I don't want. Instead of it I want it to show a hegrenade icon.

I tried doing it with make_deathmsg but it just makes an extra deathmsg so it looks like that the player has killed the enemy two times lol

Code:

public player_death()
{
new id = read_data(2);

if(!is_user_connected(id))
return PLUGIN_CONTINUE;

switch(us_get_zombie_class(id))
{
                case CLASS_ID_BOOMER:
                {       
                        emit_sound( id, CHAN_STREAM, explode_sounds[ random_num( 0, 2 ) ], 1.0, ATTN_NORM, 0, PITCH_HIGH )
                       
                        gBoom(id);
                       
                        for(new i = 1; i <= 32; i++)
                        {
                                if( !is_valid_ent(i) || !is_user_alive(i) || !is_user_connected(i) || us_get_user_zombie(i) || get_entity_distance(id, i) > get_pcvar_num(cvar_boomer_explodedist))
                                        continue;
                               
                                message_begin(MSG_ONE, g_msgid_ScreenFade, _, i)
                                write_short(get_pcvar_num(cvar_boomer_wakeuptime))
                                write_short(get_pcvar_num(cvar_boomer_wakeuptime))
                                write_short(0x0004)
                                write_byte(79)
                                write_byte(180)
                                write_byte(61)
                                write_byte(255)
                                message_end()
                               
                                if( get_pcvar_num( cvar_boomer_victimrender ) )
                                        set_rendering( i, kRenderFxGlowShell, 79, 180, 61, kRenderNormal, 25 )
                               
                                new iGrenade = create_entity("weapon_hegrenade");
                                if(pev_valid(iGrenade))
                                {
                                        new Float:fDamage = get_pcvar_float(cvar_boomer_boom_damage);
                                        ExecuteHam(Ham_TakeDamage, i, iGrenade, id, fDamage, DMG_GRENADE);
                                        remove_entity(iGrenade);
                                }

                                set_task(get_pcvar_float(cvar_boomer_wakeuptime), "victim_wakeup", i+TASKID_WAKE_UP);
                        }
                }
        }
return PLUGIN_CONTINUE;
}

I tried to do it like this but it didn't work :s

Code:

message_begin(MSG_ONE, gmsgWeaponList, {0,0,0}, id)
write_byte(1); // status (0=hide, 1=show, 2=flash)
write_string("hegrenade"); // tried weapon_hegrenade, grenade, weapon_grenade but it didn't work
write_byte(0); // red
write_byte(255); // green
write_byte(0); // blue
message_end();


hellmonja 03-06-2017 10:50

Re: DeathMsg
 
PHP Code:

register_message(get_user_msgid("DeathMsg"), "Message_DeathMsg");
...
public 
Message_DeathMsg(msg_idmsg_destid)
{
    static 
attackervictimweapon[24];
    
    
attacker read_data(1);
    
victim read_data(2);
    
read_data(4weapon23);

    if(!
is_user_connected(attacker))
        return 
PLUGIN_CONTINUE
        
    
if(equali(weapon"aug") && g_user_has_[attacker]))
        
set_msg_arg_string(4"katana");

    return 
PLUGIN_CONTINUE


I just based this on your sample screenshot, thus the "aug" is replaced by the "katana". You'll also need your own custom sprite and edit the hud.txt in cstrike/sprites folder for this to work...

PRoSToTeM@ 03-07-2017 08:17

Re: DeathMsg
 
You should use grenade instead of hegrenade and weapon_hegrenade.

killerZM 03-07-2017 13:08

Re: DeathMsg
 
i can make new icon for death ? like i had my own weapon and i want to change icon to be someting else
hellmonja way is right ?

klippy 03-07-2017 13:54

Re: DeathMsg
 
You can but only for yourself (client-side), it's not something that clients can just download.

killerZM 03-08-2017 09:32

Re: DeathMsg
 
i cant just make a txt file and put sprite resolution . etc in it ?


All times are GMT -4. The time now is 21:03.

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