Author Topic: [Request] Disable new map voting on admin command  (Read 2183 times)

0 Members and 1 Guest are viewing this topic.

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
[Request] Disable new map voting on admin command
« on: February 11, 2010, 11:27:00 am »
Hey, can anyone script this for me? Let the command be /disable. I need this since im owner of Climb server and sometimes players keep changing maps when they are too hard for them. Anywayz I hope someone will find few minutes and script this.

This log from #soldat.devs might come in handy
Quote
01[19:23] <Bonecrusher`> is there any possibility to disable /votemap command?
01[19:23] <Bonecrusher`> or map voting when it already began
01[19:23] <Bonecrusher`> ?
[19:24] <minus> setting percentage to 100?
[19:24] <minus> 101% :D
[19:26] <Boblekonvolutt> shouldnt that be scriptable?
01[19:27] <Bonecrusher`> yea im thinking about a script
[19:27] <Boblekonvolutt> just returning true in onplayercommand if text matches /votemap*?
01[19:27] <Bonecrusher`> coz i have this climb server
[19:27] <minus> mhm
[19:27] <Boblekonvolutt> not sure if going through the menu and voting that way works in the same way
[19:27] <Boblekonvolutt> but it probably should
01[19:27] <Bonecrusher`> and sometimes i dont want players to vote other map
01[19:28] <Bonecrusher`> so i need a script which can disable/enable it on cmd
01[19:28] <Bonecrusher`> just wondering if its possible
02[19:30] * Quits: minus (~minus@p5DC704E8.dip0.t-ipconnect.de) (Signed off)
[19:31] <Boblekonvolutt> of course
« Last Edit: February 11, 2010, 11:29:52 am by Bonecrusher »

Im chill like that

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: [Request] Disable new map voting on admin command
« Reply #1 on: February 11, 2010, 12:15:20 pm »
Just disable map voting in the soldat.ini and if you ever want voting use a script like !nextmap ?
There are other worlds than these

Offline KEEN

  • Major
  • *
  • Posts: 95
  • soldat champagne
    • Soldat Argentina
Re: [Request] Disable new map voting on admin command
« Reply #2 on: February 11, 2010, 12:15:46 pm »
You could try something like this, I don't know if it works ... just an idea

test and error, friend xD


Code: [Select]
function OnCommand(ID: Byte; Text: string): boolean;
begin
if (Text = '/mapvote 0') then
begin
Command('/vote% 101');
WriteLn('Not allow map voting.');
end;
if (Text = '/mapvote 1') then
begin
Command('/vote% 60'); // or your percentage of vote favorite
WriteLn('Allow map voting.');
end;
end;
« Last Edit: February 11, 2010, 12:17:42 pm by KEEN »

Offline Stuffy

  • Soldier
  • **
  • Posts: 182
  • Very stuffy.
    • Climb-Zone Forum
Re: [Request] Disable new map voting on admin command
« Reply #3 on: February 11, 2010, 12:17:28 pm »
Here it is, its the !nextmap script by curt, but I modified it so you can do /startvote and /stopvote.
The truth is out there? Does anyone know the URL?
The URL is here

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: [Request] Disable new map voting on admin command
« Reply #4 on: February 11, 2010, 12:20:20 pm »
Just disable map voting in the soldat.ini and if you ever want voting use a script like !nextmap ?
Here it is, its the !nextmap script by curt, but I modified it so you can do /startvote and /stopvote.

well i have !nextmap script already with /off command, I'd rather not disable map voting since players want to vote custom map from time to time. I need a script which can disable map voting on purpose like when im playin or some player asks me to disable it when im online @ arsse

Im chill like that

Offline KEEN

  • Major
  • *
  • Posts: 95
  • soldat champagne
    • Soldat Argentina
Re: [Request] Disable new map voting on admin command
« Reply #5 on: February 11, 2010, 12:21:34 pm »
You could try something like this, I don't know if it works ... just an idea

test and error, friend xD


Code: [Select]
function OnCommand(ID: Byte; Text: string): boolean;
begin
if (Text = '/mapvote 0') then
begin
Command('/vote% 101');
WriteLn('Not allow map voting.');
end;
if (Text = '/mapvote 1') then
begin
Command('/vote% 60'); // or your percentage of vote favorite
WriteLn('Allow map voting.');
end;
end;

or change vote percentage to 0, might work well

Offline Stuffy

  • Soldier
  • **
  • Posts: 182
  • Very stuffy.
    • Climb-Zone Forum
Re: [Request] Disable new map voting on admin command
« Reply #6 on: February 11, 2010, 12:26:15 pm »
oh sorry, you mean /votemap command and not !nextmap  :P

but I think keens idea wont work, because /vote% just affects the votes after an map restart ore not?
The truth is out there? Does anyone know the URL?
The URL is here

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: [Request] Disable new map voting on admin command
« Reply #7 on: February 11, 2010, 12:31:49 pm »
Would be awesome if anyone can script this, thats the only thing im missing in my server

Im chill like that

Offline KEEN

  • Major
  • *
  • Posts: 95
  • soldat champagne
    • Soldat Argentina
Re: [Request] Disable new map voting on admin command
« Reply #8 on: February 11, 2010, 12:38:27 pm »
When you change with /vote% command, the variable ruled it until the server is restarted or you use the /vote% command again

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: [Request] Disable new map voting on admin command
« Reply #9 on: February 11, 2010, 12:41:25 pm »
well thx KEEN ill try that

Im chill like that

Offline KEEN

  • Major
  • *
  • Posts: 95
  • soldat champagne
    • Soldat Argentina
Re: [Request] Disable new map voting on admin command
« Reply #10 on: February 11, 2010, 12:44:23 pm »
ok! returns to tell us if you do it!

Offline Stuffy

  • Soldier
  • **
  • Posts: 182
  • Very stuffy.
    • Climb-Zone Forum
Re: [Request] Disable new map voting on admin command
« Reply #11 on: February 11, 2010, 12:52:39 pm »
ore try this:
Code: [Select]
const
Color = $FFD700;

var
Enable : boolean;


function OnPlayerCommand(ID: Byte; Text: string): boolean;

begin

if (GetPiece(Text,' ',0) = '/votemap') and not (Enable) then begin
WriteConsole(ID, 'Vote is disabled atm.',Color);
Result := true;
end;
end;

function OnCommand(ID: Byte; Text: string): boolean;

begin

if Text = '/disable' then begin
WriteConsole(ID, 'Vote is now disabled!',Color);
Enable := false;
end else
if Text = '/enable' then begin
Enable := true;
WriteConsole(ID, 'Vote is now enabled!',Color);
end;
end;

but it just disables the /votemap command, you still are able to vote a mpa over the menu so...
The truth is out there? Does anyone know the URL?
The URL is here

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: [Request] Disable new map voting on admin command
« Reply #12 on: February 11, 2010, 12:54:31 pm »
Quote
but it just disables the /votemap command, you still are able to vote a mpa over the menu so...

I dont think if players on my server know the /votemap command ;d but thanks a lot anyway

Im chill like that

Offline KEEN

  • Major
  • *
  • Posts: 95
  • soldat champagne
    • Soldat Argentina
Re: [Request] Disable new map voting on admin command
« Reply #13 on: February 11, 2010, 01:00:28 pm »
Stuffy, the script works when the vote has been selected from menu?

Offline Stuffy

  • Soldier
  • **
  • Posts: 182
  • Very stuffy.
    • Climb-Zone Forum
Re: [Request] Disable new map voting on admin command
« Reply #14 on: February 11, 2010, 01:30:12 pm »
Nope, and thats the point, I think its impossible, because its programmed into the soldat-engine.
The truth is out there? Does anyone know the URL?
The URL is here

Offline JFK

  • Camper
  • ***
  • Posts: 255
    • My TraxInSpace Account
Re: [Request] Disable new map voting on admin command
« Reply #15 on: February 11, 2010, 01:33:48 pm »
This seems interesting.

What I read from this topic:
solution 1: Disable the /votemap command, this doesn't work because voting a map using the menu is still possible.
solution 2: Set vote% to 101 and use a custom votemap script. Problem here is that vote% also affects the vote-kick, although that could be scripted as well.
solution 3: Just use the /vote% command and don't use a script at all, again also disables vote-kick.

I can think of a third radical solution. A server that runs without safe mode can alter filenames using the Shell_Exec command. You could change all filenames of the maps, so they can't be accessed by the server. Only the next map in line of maplist.txt should keep it's original filename, or maybe regain it just before the end of the round.
I know this idea is kinda insane, but maybe it'll inspire a bit.
Come join: EliteCTF
Listen to: My Music

Offline Stuffy

  • Soldier
  • **
  • Posts: 182
  • Very stuffy.
    • Climb-Zone Forum
Re: [Request] Disable new map voting on admin command
« Reply #16 on: February 11, 2010, 01:45:35 pm »
uff, so if you do /disable it will change the names of all maps to xctf_* and just keeps the Nexmap-Map name normal, and if you do /enable it changes the mapnames back to the old ones? So you have to do a list with the old mapnames.
The truth is out there? Does anyone know the URL?
The URL is here

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: [Request] Disable new map voting on admin command
« Reply #17 on: February 11, 2010, 02:17:41 pm »
@JFK: I must congratulate you on your unique thought. Your option fixes all those 'issues' :D

Offline KEEN

  • Major
  • *
  • Posts: 95
  • soldat champagne
    • Soldat Argentina
Re: [Request] Disable new map voting on admin command
« Reply #18 on: February 12, 2010, 11:41:13 am »
Ah... I didn't think that /vote% command would affect votekick percentage too... Bonecrusher, if you don't matter this, you can choose to set /vote% directly or make a script like my idea...

But, if you want to make more complete... try to make a script with /enable = changes all names on /maps folder and write mapslist.txt (with new names) and when you run /disable = rewrite mapslist.txt to original list after changes the map names to original name

Also you can bring your script to see if we can help ...

Offline Stuffy

  • Soldier
  • **
  • Posts: 182
  • Very stuffy.
    • Climb-Zone Forum
Re: [Request] Disable new map voting on admin command
« Reply #19 on: February 12, 2010, 12:24:59 pm »
no changing the names in the mapslist wont work because map votes dont need the mapslist
The truth is out there? Does anyone know the URL?
The URL is here