September 08, 2025, 10:15:23 am

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Wondering where all the forums have gone?

Join the community Discord server!

Pages: [1]

Author Topic: smite.gml  (Read 2222 times)

notajf

  • Guest
smite.gml
« on: June 01, 2012, 08:15:51 pm »

As server host, while spectating, click someone to smite them. Everyone (except them for some reason I can't figure out) will see "X hath been smitten", and they will be gibbed. Also, even though you're spectating, it will show up as YOU killing them in the kill log. :D

Code: [Select]
object_event_add(Character, ev_step, 0, '
    if(distance_to_point(mouse_x, mouse_y)<25 and global.isHost and global.myself.team == TEAM_SPECTATOR) {
        if (mouse_check_button(mb_left)) {
            mouse_clear(mb_left);
            ServerMessageString(player.name + " hath been smitten", global.eventBuffer);
            with (NoticeO) {
                instance_destroy();
            }
            notice = instance_create(0, 0, NoticeO);
            notice.notice = NOTICE_CUSTOM;
            notice.message = player.name + " hath been smitten";
            hp = 0;
            lastDamageSource = Rocket;
            lastDamageDealer = global.myself;
        }
    }
');

(Update 2015-07-06: this version of the code won't work with modern GG2, but I posted a fixed version below)
« Last Edit: July 06, 2015, 10:00:30 am by ajf »
Logged

billymaze

  • Veteran Member
  • ******
  • Karma: 10
  • Offline Offline
  • Posts: 6732
Re: smite.gml
« Reply #1 on: June 01, 2012, 09:32:33 pm »

Can you please have it be shift-click or something? Accidentally gibbing someone might get annoying :drool:
Logged

Humble Master

  • 2012 Haxxy Award Winner
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 1262
  • Maker of Drakora
Re: smite.gml
« Reply #2 on: June 01, 2012, 10:30:55 pm »

This could really lead to host abuse. If you have ever played RM you will know what I'm talking about.
Logged
Finally returned

notajf

  • Guest
Re: smite.gml
« Reply #3 on: June 02, 2012, 04:13:42 am »

Can you please have it be shift-click or something? Accidentally gibbing someone might get annoying :drool:
Well, ir's only when you're spectating. You could easily make it right-click.

And yes this could be abused and probably will be.
« Last Edit: August 31, 2025, 05:02:15 pm by MedO »
Logged

Mysteria

  • New Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
  • ...
Re: smite.gml
« Reply #4 on: June 03, 2012, 09:07:29 am »

If you are smart enough, you can change the part where it sais mb_left to mb_middle, and you can then only smite people by pressing down the middle mouse wheel.

Also, if you want to be able to smite while playing, change the TEAM_SPECTATE to TEAM_RED or TEAM_BLUE. make sure you put BLUE not BLU, BLU will not work.

And if you want to decrease their hp to say, 1 if they are being stupid on your server, change the hp to 1.

You can also change the Hath been smitten to something else. Like "Noob Has Been Exploded For Annoying Everyone" :D.

I Think Its Pretty Awesome   :z5: :z6: :z9:
Logged

notajf

  • Guest
Re: smite.gml
« Reply #5 on: June 03, 2012, 10:26:37 am »

If you are smart enough, you can change the part where it sais mb_left to mb_middle, and you can then only smite people by pressing down the middle mouse wheel.

Also, if you want to be able to smite while playing, change the TEAM_SPECTATE to TEAM_RED or TEAM_BLUE. make sure you put BLUE not BLU, BLU will not work.

And if you want to decrease their hp to say, 1 if they are being stupid on your server, change the hp to 1.

You can also change the Hath been smitten to something else. Like "Noob Has Been Exploded For Annoying Everyone" :D.

I Think Its Pretty Awesome   :z5: :z6: :z9:
Thanks!

But I made it spectator so you don't accidentally kill people and so it's harder to abuse your powers :/
Logged

Mysteria

  • New Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
  • ...
Re: smite.gml
« Reply #6 on: June 04, 2012, 11:00:07 am »

Yea, host abuse can get annoying sometimes   :z4: :z4: :z4: D:
Logged

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3415
  • she's never quite as dead as you think
Re: smite.gml
« Reply #7 on: July 06, 2015, 09:15:32 am »

So this is broken in modern GG2 because of the eventBuffer->sendBuffer rename, and also because damage sources work differently now (thanks for helping me there, Derpduck). Luckily, it's a two-line fix.



Code: [Select]
object_event_add(Character, ev_step, 0, '
    if(distance_to_point(mouse_x, mouse_y)<25 and global.isHost and global.myself.team == TEAM_SPECTATOR) {
        if (mouse_check_button(mb_left)) {
            mouse_clear(mb_left);
            ServerMessageString(player.name + " hath been smitten", global.sendBuffer);
            with (NoticeO) {
                instance_destroy();
            }
            notice = instance_create(0, 0, NoticeO);
            notice.notice = NOTICE_CUSTOM;
            notice.message = player.name + " hath been smitten";
            hp = 0;
            lastDamageSource = DAMAGE_SOURCE_ROCKETLAUNCHER;
            lastDamageDealer = global.myself;
        }
    }
');

Happy gibbing!
« Last Edit: July 06, 2015, 10:02:13 am by ajf »
Logged
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.
Pages: [1]
 

Page created in 0.039 seconds with 31 queries.