AlliedModders

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

MeliMeli 06-27-2023 01:19

Fake DeathMsg Attacker == Victim
 
Can someone tell me if this method of sending a fake death message after zombies are selected by the game is safe? I had tried another method before, but there were zombies on the same team as the humans

PHP Code:

new g_GameModeInfectionID
new g_MsgDeathMsgg_MsgScoreAttrib

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_MsgDeathMsg get_user_msgid("DeathMsg")
    
g_MsgScoreAttrib get_user_msgid("ScoreAttrib")
}

public 
plugin_cfg()
{
    
g_GameModeInfectionID zp_gamemodes_get_id("Infection Mode")
}

public 
zp_fw_core_infect_post(idattacker)
{
    
// Set custom grenade model
    
new current_mode zp_gamemodes_get_current()
    if (
current_mode != g_GameModeInfectionID)
        return;
    
    
SendDeathMsg(attackerid)
    
FixDeadAttrib(id)
}

// Send Death Message for infections
SendDeathMsg(attackervictim)
{
if(
attacker == victim){
    
message_begin(MSG_BROADCASTg_MsgDeathMsg)
    
write_byte(attacker// killer
    
write_byte(victim// victim
    
write_byte(0// headshot flag
    
write_string("teammate"// killer's weapon
    
message_end()
}
}

// Fix Dead Attrib on scoreboard
FixDeadAttrib(id)
{
message_begin(MSG_BROADCASTg_MsgScoreAttrib)
write_byte(id// id
write_byte(0// attrib
message_end()



Napoleon_be 07-11-2023 13:48

Re: Fake DeathMsg Attacker == Victim
 
Testing it would be my advise if u already searched and didn't find any solutions.


All times are GMT -4. The time now is 10:23.

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