August 04, 2021, 01:57:52 am

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 [2]

Author Topic: Rocket jump grief prevention  (Read 4194 times)

Silent Boom

  • Lucky Member
  • *******
  • Karma: 17
  • Offline Offline
  • Posts: 1013
Re: Rocket jump grief prevention
« Reply #15 on: March 21, 2013, 01:09:50 am »

change this

isrj = string_copy(mapstring,1,3);
if isrj = "rj_"

to

isrj = string_copy(mapstring,1,4);
if isrj = "gg2_"


and this
if player.class == CLASS_SPY or player.class == CLASS_HEAVY or player.class == CLASS_PYRO
to
if player.class == CLASS_SNIPER or player.class == CLASS_HEAVY

And it will only allow snipers and heavies on any map with the "gg2_" prefix
Doesn't that prevent snipers and heavies?
Shouldn't it be "not equal"?

I'm not exactly sure how GML works, but here's my take.
(I'm just assuming what the functions are doing, and that GML uses !=)
Code: [Select]
object_event_add(GameServer, ev_step, ev_step_end, '

var mapstring;
mapstring = string(global.currentMap)
var isrj;
isrj = string_copy(mapstring,1,12);

if isrj = "gg2_DuckHunt"
with Character
{

  if player.class != CLASS_SNIPER or player.class != CLASS_HEAVY
  {
    sendEventPlayerDeath(player, player, noone, BID_FAREWELL);
    doEventPlayerDeath(player, player, noone, BID_FAREWELL);
  }
}
')

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
Re: Rocket jump grief prevention
« Reply #16 on: March 21, 2013, 01:12:16 am »

it needs to be:

player.class != CLASS_SNIPER and player.class != CLASS_HEAVY

If you "or" two bools whose truths are mutually exclusive, you will always result in false.
« Last Edit: March 21, 2013, 01:56:11 am by Phantom Brave »
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

Silent Boom

  • Lucky Member
  • *******
  • Karma: 17
  • Offline Offline
  • Posts: 1013
Re: Rocket jump grief prevention
« Reply #17 on: March 21, 2013, 01:17:20 am »

Oops.

Code: [Select]
object_event_add(GameServer, ev_step, ev_step_end, '

var mapstring;
mapstring = string(global.currentMap)
var isrj;
isrj = string_copy(mapstring,1,12);

if isrj = "gg2_DuckHunt"
with Character
{
  if player.class != CLASS_SNIPER and player.class != CLASS_HEAVY
  {
    sendEventPlayerDeath(player, player, noone, BID_FAREWELL);
    doEventPlayerDeath(player, player, noone, BID_FAREWELL);
  }
}
')

Edit: Wait. Depending on how the game handles classes, this could send people into an infinite loop of deaths...
« Last Edit: March 21, 2013, 01:22:20 am by Silent Boom »
Logged

cmb

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 337
  • Mario Bros
Re: Rocket jump grief prevention
« Reply #18 on: March 21, 2013, 09:55:00 am »

Oops.

Code: [Select]
object_event_add(GameServer, ev_step, ev_step_end, '

var mapstring;
mapstring = string(global.currentMap)
var isrj;
isrj = string_copy(mapstring,1,12);

if isrj = "gg2_DuckHunt"
with Character
{
  if player.class != CLASS_SNIPER and player.class != CLASS_HEAVY
  {
    sendEventPlayerDeath(player, player, noone, BID_FAREWELL);
    doEventPlayerDeath(player, player, noone, BID_FAREWELL);
  }
}
')

Edit: Wait. Depending on how the game handles classes, this could send people into an infinite loop of deaths...

add this after
doEventPlayerDeath
Code: [Select]
  ds_list_find_index(global.players, player.id)
  if player.team == TEAM_RED {
  player.class = CLASS_HEAVY}
  else{
  player.class = CLASS_SNIPER}
  ServerPlayerChangeclass(player.id, player.class, global.sendBuffer

Lorgan

  • Retired Randomizer Mod Developer
  • Resident Miku
  • *****
  • Karma: 27
  • Offline Offline
  • Posts: 3657
    • My own website
Re: Rocket jump grief prevention
« Reply #19 on: March 21, 2013, 11:17:30 am »

yeah sorry silent boom, wasn't really thinking.
Logged
Unfortunately, turning a section into a communist oppressive regime is not against the forum rules, so there is really nothing we can do.
Quote from: steam
21:08 - Hullusorsa: lorgan, when will you buy us the keys?
21:09 - Lorgan: i'm waiting for greece to collapse so the value of the euro drops
21:09 - Lorgan: not even joking

Kalir

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 488
  • no one here
Re: Rocket jump grief prevention
« Reply #20 on: April 16, 2013, 09:03:30 pm »

This still has a problem, it's been spitting errors on Soviet Giraffe any time a RJ map comes up. I think it's tied to reporting the class-change clientside?
Logged
Praise Cheibriados.
Pages: 1 [2]
 

Page created in 0.039 seconds with 51 queries.