Author Topic: Denying Levelbank  (Read 1523 times)

Remy Lebeau

  • Sr. Member
  • ****
  • Posts: 497
    • View Profile
Denying Levelbank
« on: March 13, 2015, 11:20:08 PM »
So I wanted to create a race that people can't levelbank.

I used the DN_ShowLevelbank denyable, and can block it that way.

However, if you go onto another race, then open the levelbank menu, then change race (via a chat command), you can still put levels into this race.  The denyable blocks the menu, but not the actual levels...

Any ideas for how I could block this?

Thanks.

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: Denying Levelbank
« Reply #1 on: March 14, 2015, 02:29:53 PM »
have the level bank action check for race flags

race flags can be anything since its a string

after War3Source_Engine_PlayerLevelbank.sp

if(W3GetRaceMaxLevel(race)<=War3_GetLevel(client,race)){
                War3_ChatMessage(client,"%T","Your race is already maxed",client);
                return;
}

for something like

if race has flag ("nolevelbank")
{
//print some error
return;
}

Remy Lebeau

  • Sr. Member
  • ****
  • Posts: 497
    • View Profile
Re: Denying Levelbank
« Reply #2 on: March 15, 2015, 12:03:59 AM »
Hm, that could work for one of my races (that is no levelbank).  This race however I wanted to make it after a certain level...  Can I use the denyable system at that point?

Revan

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Denying Levelbank
« Reply #3 on: March 15, 2015, 06:46:01 AM »
Yup.
Just create a new denyable, when someone uses levelbank use W3Denyable. In the W3Deny callback you can then do your checks.
Like here
« Last Edit: March 15, 2015, 07:52:27 AM by Revan »
#war3source on gamesurge

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: Denying Levelbank
« Reply #4 on: March 15, 2015, 09:23:32 AM »
add your own constant (append to end so that values dont shift)

you can merge with trunk because it doesnt affect any existing bhavior

https://github.com/War3Source/War3Source/blob/master/addons/sourcemod/scripting/W3SIncs/War3Source_Constants.inc#L131

El Diablo

  • Hero Member
  • *****
  • Posts: 1126
    • View Profile
    • War3Evo
Re: Denying Levelbank
« Reply #5 on: March 15, 2015, 11:50:33 AM »
So I wanted to create a race that people can't levelbank.

I used the DN_ShowLevelbank denyable, and can block it that way.

However, if you go onto another race, then open the levelbank menu, then change race (via a chat command), you can still put levels into this race.  The denyable blocks the menu, but not the actual levels...

Any ideas for how I could block this?

Thanks.

You really should force a player's menu to close anytime they change to another menu or do something else in war3source.

Best way is to record the current player's menu handle in the war3source system, check if they are currently viewing a war3source menu, and if so... Force cancel that menu before a player activates any other command in war3source.

War3source needs that update, cause players can get away with a lot more than just level banks.
« Last Edit: March 15, 2015, 11:53:59 AM by El Diablo »

Revan

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Denying Levelbank
« Reply #6 on: March 15, 2015, 03:39:13 PM »
Force cancel that menu before a player activates any other command in war3source.

No because there is no need for this. Just add checks if any are missing.
It's as simple as adding a new constant to the enum like Ownz said.


War3source needs that update, cause players can get away with a lot more than just level banks.
Would you care to elaborate what player can get away with?
#war3source on gamesurge

Remy Lebeau

  • Sr. Member
  • ****
  • Posts: 497
    • View Profile
Re: Denying Levelbank
« Reply #7 on: March 24, 2015, 03:34:42 AM »
Submitted a fix for this issue to github.

Necavi

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
Re: Denying Levelbank
« Reply #8 on: March 24, 2015, 04:08:57 AM »
Accepted