May 09, 2021, 12:31:58 pm

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Due to a rise in bot activity, new posters need to be approved before posting.

Join the community Discord server!

Pages: [1]

Author Topic: NameChangeAlertV2- "The Kill Log Update"  (Read 2075 times)

Machidro

  • 2013 Haxxy Award Winner
  • *
  • Karma: 5
  • Offline Offline
  • Posts: 1675
  • Gardicolo time is over.
NameChangeAlertV2- "The Kill Log Update"
« on: February 28, 2013, 10:47:42 pm »



If a person changes their name while in a game with you, this alerts you of what they were previously and what they are now.

Useful for staying aware of who you're playing with and, for those from that FR request a while back who were complaining about namejackers, finding out who decided to alias you.

Version 2: We now use the kill log in order to pass on information instead of pop ups.

Code: [Select]
//Plugin: NameChangeAlert
//Function: If someone changes their name, you get a message.
//Good for staying aware and catching people aliasing as you.

object_event_add(Player,ev_create,0,'
//wait 2 seconds before namechecks
oldname="";
global.justjoinedserver=0;
global.namechanger=-1;
global.namechangedfrom="";
global.namechangedto="";
');

object_event_add(Player,ev_step,ev_step_begin,'
//on server joining, prevent popup clusterfucking
if id=global.myself
{
//dont start checking for name changes for two seconds
if global.justjoinedserver!=60
{
global.justjoinedserver+=1;
}

//and on the second second, start checking to see if people are name changing.
if global.justjoinedserver=59
with (Player)
{
{
oldname=name;
}
}
}

//if the names changed and youve been on the server for 2 seconds, notify you on a name change
if name!=oldname && global.justjoinedserver>=60
{
global.namechanger=id;
global.namechangedfrom=oldname;
global.namechangedto=name;

        with (KillLog) {
            map = ds_map_create();
            ds_map_add(map, "name1", global.namechangedfrom);
            ds_map_add(map, "team1", global.namechanger.team);
            ds_map_add(map, "weapon", -1);
            ds_map_add(map, "string", " has changed his name to ");
            ds_map_add(map, "name2", global.namechangedto);
            ds_map_add(map, "team2", global.namechanger.team);
            ds_map_add(map, "inthis", 1);
                        
            ds_list_add(kills, map);
            
            if (ds_list_size(kills) > 5) {
                ds_map_destroy(ds_list_find_value(kills, 0));
                ds_list_delete(kills, 0);
            }
            
            alarm[0] = 30*5;
        }

oldname=name;
}


');
« Last Edit: March 02, 2013, 07:50:53 pm by Machidro »
Logged
A CHALLENGER HAS ARRIVED.

Saniblues

  • Onion Knight
  • Administrator
  • *****
  • Karma: -1305
  • Offline Offline
  • Posts: 12416
Re: NameChangeAlert
« Reply #1 on: March 01, 2013, 04:24:51 pm »

Why would you use the Notification window for something as common as name changing?

Part of me wants to write an automatic name randomizing script just because I'm that angry.
Logged
Quote from: mop
Quote from: MR MAGN3TIC
I don't like it.  :nah:
Oh, well, you might as well pack up and stop now, because he doesn't like it
I'm bored out of my skull, Lets play a different game!
Lets take a visit down below And cast the world in flames!

Machidro

  • 2013 Haxxy Award Winner
  • *
  • Karma: 5
  • Offline Offline
  • Posts: 1675
  • Gardicolo time is over.
Re: NameChangeAlert
« Reply #2 on: March 01, 2013, 07:02:33 pm »

Because chat doesn't work yet and I can't put it there instead?

I hate it too, but I picked it because it's functional. Any reasonable alternatives?
Logged
A CHALLENGER HAS ARRIVED.

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3492
  • she's never quite as dead as you think
Re: NameChangeAlert
« Reply #3 on: March 02, 2013, 01:48:45 pm »

You could use a server-sent plugin to display the name change more discreetly, or something?

Actually, wait, scrap the server-sent. Just use a client-side plugin. And you could have your server send it to clients as an optional plugin.
Logged
aka Andrea.

did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

Orangestar

  • Veteran Member
  • ******
  • Karma: 2
  • Offline Offline
  • Posts: 4671
  • That's why I didn't delete this account.
    • Clicky Clicky
Re: NameChangeAlert
« Reply #4 on: March 02, 2013, 05:04:56 pm »

It's not possible to put it in the kill log is it?

Machidro

  • 2013 Haxxy Award Winner
  • *
  • Karma: 5
  • Offline Offline
  • Posts: 1675
  • Gardicolo time is over.
Re: NameChangeAlert
« Reply #5 on: March 02, 2013, 05:29:56 pm »

There's an "EventWriteInLog" script, but it looks like it can only be passed arguments for specific, preprogrammed events; there's no wildcard for me to edit like with the current Notice system.
Logged
A CHALLENGER HAS ARRIVED.

Port

  • Junior Member
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 82
    • portify.github.io
Re: NameChangeAlert
« Reply #6 on: March 02, 2013, 06:55:57 pm »

There's an "EventWriteInLog" script, but it looks like it can only be passed arguments for specific, preprogrammed events; there's no wildcard for me to edit like with the current Notice system.

You could abuse kills.

recordKillInLog(x, y, false, WEAPON_BUBBLE);

x would have to be a temporarily added player with a blank name.
y would have to be a temporarily added player with a name such as "foo changed name to bar".

It wouldn't be very efficient though considering the need to make new fake players.
Logged
portify@neko.im

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3492
  • she's never quite as dead as you think
Re: NameChangeAlert
« Reply #7 on: March 02, 2013, 07:11:12 pm »

Does it take IDs or objects? If the latter, you could just do:

z = instance_create(0,0,Player);
z.name = "";
p = instance_create(0,0,Player);
p.name = "blah";
recordKillInLog(z, p, false, WEAPON_BUBBLE);


...right?
Logged
aka Andrea.

did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

Machidro

  • 2013 Haxxy Award Winner
  • *
  • Karma: 5
  • Offline Offline
  • Posts: 1675
  • Gardicolo time is over.
Re: NameChangeAlert
« Reply #8 on: March 02, 2013, 07:50:25 pm »

Updated, name changes are now in the kill log. Names are appropriately colored and work as expected.
Logged
A CHALLENGER HAS ARRIVED.

cmb

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 337
  • Mario Bros
Re: NameChangeAlertV2- "The Kill Log Update"
« Reply #9 on: March 02, 2013, 08:10:50 pm »

 :yaymoney:
yes!
good bye notices
hello kill log :smiley16:

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3492
  • she's never quite as dead as you think
Re: NameChangeAlertV2- "The Kill Log Update"
« Reply #10 on: March 02, 2013, 08:19:31 pm »

That's awesome! :z6:
Logged
aka Andrea.

did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

Real

  • New Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 39
Re: NameChangeAlertV2- "The Kill Log Update"
« Reply #11 on: March 04, 2013, 03:19:22 pm »

Make this RM compatible. <3
Logged

Machidro

  • 2013 Haxxy Award Winner
  • *
  • Karma: 5
  • Offline Offline
  • Posts: 1675
  • Gardicolo time is over.
Re: NameChangeAlertV2- "The Kill Log Update"
« Reply #12 on: March 04, 2013, 05:20:02 pm »

Already should be, just stick it in RM's plugin folder.
Logged
A CHALLENGER HAS ARRIVED.
Pages: [1]
 

Page created in 0.026 seconds with 36 queries.