AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [solved] modify original deathMsg (https://forums.alliedmods.net/showthread.php?t=89863)

Hunter-Digital 04-11-2009 11:33

[solved] modify original deathMsg
 
How do I modify the killer's name right before the death message is sent ? or if that's not possible how do I block the original and name the player so I can send another fake one ?

Arkshine 04-11-2009 11:38

Re: modify original deathMsg
 
Use register_message().

Hunter-Digital 04-11-2009 12:16

Re: modify original deathMsg
 
Ok that's with blocking or modifying... but how about changing the name pretty quick without client_cmd() ? ... so that he has another name only in the death message ? :}

Hunter-Digital 04-13-2009 04:47

Re: modify original deathMsg
 
Can anyone help me with the above ?!
I would have tried to do this on my own but I can't search for the term "name" :|

Empowers 04-13-2009 06:51

Re: modify original deathMsg
 
Quote:

but how about changing the name pretty quick without client_cmd()
u can use
PHP Code:

set_pev(idpev_netname"NAME"


Hunter-Digital 04-13-2009 10:53

Re: modify original deathMsg
 
Doesn't work...

Code:

public testCmd(id)
{
set_pev(id, pev_netname, "Test")
make_deathmsg(id, 0, 0, "m4a1")
set_pev(id, pev_netname, "Test2")
set_task(0.1, "testDelay", id+512)
return PLUGIN_HANDLED
}

public testDelay(id) make_deathmsg(id-512, 0, 0, "m4a1")

shows my name every time... :? how about a message to change the player name in the scoreboard ?

Sn!ff3r 04-13-2009 11:30

Re: modify original deathMsg
 
PHP Code:

 stock set_user_nameid , const name[])  
  {    
     if (
is_user_connected(id)) {    
       
set_user_infoid "name" name 
     } 
  } 


Hunter-Digital 04-13-2009 11:33

Re: modify original deathMsg
 
That prints the "X changed name to Y"... isn't any other way without blocking that message ? just to tempchange the name really quick without anyone noticing ?

if that is not possible... how do I get the new name in client_infochanged(id) and block the message ? ... and without register_message because I want to send the death message again and I can't in another registered message and I don't want to extend this in 3 functions...

ConnorMcLeod 04-13-2009 11:54

Re: modify original deathMsg
 
This works for me :

PHP Code:

#include <amxmodx>
#include <engine>

#define PLUGIN "deathmsg"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd("say /test""test")
}

public 
test(id)
{
    new 
szName[32]
    
get_user_name(idszNamecharsmax(szName))

    
entity_set_string(idEV_SZ_netname"LoL")
    
set_user_info(id"name""LoL")

    
set_task(0.01"Reset_Name"idszNamestrlen(szName))
}

public 
Reset_Name(szName[], id)
{
    
make_deathmsg(idid1"m4a1")
    
entity_set_string(idEV_SZ_netnameszName)
    
set_user_info(id"name"szName)



Empowers 04-13-2009 12:02

Re: modify original deathMsg
 
re-read what he said:
Quote:

That prints the "X changed name to Y"...


All times are GMT -4. The time now is 02:25.

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