Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Senior Member
    Join Date
    Oct 2015
    Location
    Germany
    Posts
    203

    [BF4] voteban function > proconrulz > !voteban for in-game-chat + admin protection

    PROCONRULZ > BF4 > !voteban function

    here is my !voteban function for bf4. this code works in proconrulz. any player can start a voteban by type "!VOTEBAN PLAYERNAME" in the bf4 in-game-chat. the voteban needs a yes votes from 25% from all player in 300 seconds to ban the bad player.


    INSTALLATION
    copy and paste the code in proconrulz.
    if you want, you can give players a voteban protection (e.g. admins, vips). put the playername in the %clan_list%


    HOW TO USE
    any player in bf4 can start a voteban by type "!voteban playername" in the in-game-chat.
    the voteban needs a yes votes from 25% from all player in 300 seconds to ban the bad player for 1 day.


    PROCONRULZ CODE
    Code:
    ###### 9.1 > !voteban <playername>  (Timeout 300Sec. - 1 day time ban)    ###############
    
    # SETTINGS: %voteban_enable_min_players%, %voteban_min_votes_to_kick%, %server_vip_list%
    
    # INFO: In this list you can put bf4 playernames with voteban protection (admins):
    On Say; ServerFirst; Set %server_vip_list% "@@[email protected]@[email protected]@[email protected]@[email protected]@"
    
    #VIP SLOT PLUGIN - vip player votekick protection
    On Spawn; PlayerFirst; if %ini_vipslotmanager_%p%% != 0; Set %server_vip_list% %server_vip_list% %p%@@
    
    
    On Say;Text !voteban,!votekick,!yes,!no;
        If %voteban_mylastvoteban_vote_time% != %server_global_voteban_vote_time%; Set %voteban_vote_reg% 0
    
    # INFO: Initiate a voteban after in-game-chat request (!voteban playername):
    On Say;Text !voteban,!votekick;
        PlayerFirst; Set %voteban_enable_min_players% 7
        Set %tmp_players_online% %ts1% + %ts2%
        Set %voteban_min_votes_to_kick% 6
        if %tmp_players_online% > 18; Set %voteban_min_votes_to_kick% 8
        if %tmp_players_online% > 24; Set %voteban_min_votes_to_kick% 10
        if %tmp_players_online% > 30; Set %voteban_min_votes_to_kick% 12
        if %tmp_players_online% > 50; Set %voteban_min_votes_to_kick% 14
        Set %tmp_admin_cmd_stopper% 0; 
        If %server_global_voteban_vote_on% == 1; If %tmp_admin_cmd_stopper% != 1; Say !voteban %server_voteban_votetarget% in progress. Type !yes OR !no; Say YES (%server_votebans_yes_vote%)  NO (%server_votebans_no_vote%)  REQ (%server_voteban_votesneeded%);
        If %server_global_voteban_vote_on% != 1; If %tmp_admin_cmd_stopper% != 1; If %tmp_players_online% < %voteban_enable_min_players%; Say !voteban disabled! (min. %voteban_enable_min_players% players required); Set %tmp_admin_cmd_stopper% 1
        If %server_global_voteban_vote_on% != 1; If %tmp_admin_cmd_stopper% != 1; If %tmp_players_online% >= %voteban_enable_min_players%; If %targettext% != none; If %targettext% != %p%; If %targettext% != 0; Set %server_voteban_votesneeded% %voteban_min_votes_to_kick%; Set %server_voteban_votetarget% none;TargetPlayer; Set %server_voteban_votetarget% %t%; If %server_voteban_votetarget% != none; If %server_voteban_votetarget% != %p%; If %server_voteban_votetarget% != 0; Not If %server_vip_list% contains @@%server_voteban_votetarget%@@; If %my_votespam_counter% < 2; Set %server_global_voteban_vote_time% %seconds%; Set %server_global_voteban_vote_on% 1; Set %voteban_vote_reg% 0; Set %server_votebans_yes_vote% 0; Set %server_votebans_no_vote% 0; Say ###########################; Say ###########################; Say #######         VOTEBAN        #######; Say ###########################; Yell 25 !voteban %server_voteban_votetarget% > Vote by type !yes OR !no; Say %p% initiate a vote to ban %server_voteban_votetarget% - Vote by type !yes OR !no; Incr %my_votespam_counter%; Log [^b^8!voteban^0^n] %p% initiate a vote to ban ^b^8%server_voteban_votetarget%^0^n  -  Players total: %tmp_players_online%  -  Votes req.: %voteban_min_votes_to_kick%
        If %server_global_voteban_vote_on% != 1; If %tmp_admin_cmd_stopper% != 1; If %tmp_players_online% >= %voteban_enable_min_players%; If %server_voteban_votetarget% != none; If %server_voteban_votetarget% != %p%; If %server_voteban_votetarget% != 0; If %server_vip_list% contains @@%server_voteban_votetarget%@@; Say !voteban %server_voteban_votetarget% CANCELED (!VIP SLOT players are protected); Incr %my_votespam_counter%
        If %server_global_voteban_vote_on% != 1; If %tmp_admin_cmd_stopper% != 1; If %tmp_players_online% >= %voteban_enable_min_players%; If %server_voteban_votetarget% != none; If %server_voteban_votetarget% != %p%; If %server_voteban_votetarget% != 0; Incr %my_votespam_counter%; If %my_votespam_counter% > 3; Say %p% you can NOT start a !voteban again (spam protection); PlayerCount 1; PlayerSay %p% stop your !voteban spam! Next time KICK; PlayerYell %p% stop your !voteban spam! Next time KICK; Kill 100; PlayerCount 4; Say %p% KICKED !voteban spam; Kick %p% KICKED for !voteban spam; 
        Set %tmp_vb_error% 1; If %server_voteban_votetarget% != none; If %server_voteban_votetarget% != 0; If %server_voteban_votetarget% != %p%; Set %tmp_vb_error% 0
        if %tmp_vb_error% == 1; If %tmp_admin_cmd_stopper% != 1; PlayerSay ERROR: Playername not found. Just type ANY UNIQUE part of the name e.g. !voteban <playername>
    
    # INFO: count yes votes. ban the voted player for 1 day (86400 seconds) 
    On Say;Text !yes;If %server_global_voteban_vote_on% == 1;
        If %voteban_vote_reg% == 1;PlayerSay Your vote is already registered; PlayerSay YES (%server_votebans_yes_vote%)  NO (%server_votebans_no_vote%)  REQ (%server_voteban_votesneeded%)
        If %voteban_vote_reg% != 1; Incr %server_votebans_yes_vote%;Say !voteban %server_voteban_votetarget% > Type !yes OR !no; Say YES (%server_votebans_yes_vote%)  NO (%server_votebans_no_vote%)  REQ (%server_voteban_votesneeded%); PlayerSay %p% thanks for your vote; Set %voteban_vote_reg% 1; Set %voteban_mylastvoteban_vote_time% %server_global_voteban_vote_time%; 
        If %server_votebans_yes_vote% >= %server_voteban_votesneeded%; Yell %server_voteban_votetarget% BANNED for 1 day by vote; Log ^b^8[!voteban] %server_voteban_votetarget% BANNED for 1 day by vote^0^n; Say %server_voteban_votetarget% BANNED for 1 day by vote; Set %voteban_vote_reg% 0; Set %server_global_voteban_vote_on% 0; TargetPlayer %server_voteban_votetarget%;TargetAction TempBan 86400 %server_voteban_votetarget% > banned 1 day by vote; Set %server_voteban_votetarget% none; 
    
    # INFO: votes to not ban
    On Say;Text !no;If %server_global_voteban_vote_on% == 1;
        If %voteban_vote_reg% == 1;PlayerSay Your vote is already registered; PlayerSay YES (%server_votebans_yes_vote%)  NO (%server_votebans_no_vote%)  REQ (%server_voteban_votesneeded%)
        If %voteban_vote_reg% != 1;Incr %server_votebans_no_vote% ;Say !voteban %server_voteban_votetarget% > Type !yes OR !no; Say YES (%server_votebans_yes_vote%)  NO (%server_votebans_no_vote%)  REQ (%server_voteban_votesneeded%); PlayerSay %p% thanks for your vote; Set %voteban_vote_reg% 1; Set %voteban_mylastvoteban_vote_time% %server_global_voteban_vote_time%
        If %server_votebans_no_vote% >= %server_voteban_votesneeded%; Say !voteban %server_voteban_votetarget% CANCELED by vote; Set %server_voteban_votetarget% none; Set %voteban_vote_reg% 0; Set %server_global_voteban_vote_on% 0
    
    # INFO: Stop voteban after 300Sec. (need a kill-event for reset)
    On Spawn; If %server_global_voteban_vote_on% == 1; If %server_global_voteban_vote_time% + 300 < %seconds%; Say !voteban %server_voteban_votetarget% FAILED (timeout, player will stay); Set %server_voteban_votetarget% none; Set %voteban_vote_reg% 0; Set %server_global_voteban_vote_on% 0
    On Leave; If %server_global_voteban_vote_on% == 1; If %server_voteban_votetarget% == %p%;Say !voteban %server_voteban_votetarget% CANCELED (player left the server); Set %server_voteban_votetarget% none; Set %voteban_vote_reg% 0; Set %server_global_voteban_vote_on% 0
    
    ###   !voteban END    ###
    CHANGELOG:
    15.06.2017 removed votes in percentage. add spam protection
    04.10.2016 count yes votes in percentage
    Last edited by maxdralle; 07-07-2017 at 06:59.

  2. #2
    i will give a try this afternoon, tnx :-)

  3. #3
    Community Contributor
    Join Date
    Nov 2011
    Posts
    2,946
    This looks like a plugin enhancement.

  4. #4
    this works for BFHL ?


    Thank you

  5. #5
    Senior Member
    Join Date
    Oct 2015
    Location
    Germany
    Posts
    203
    it works perfect for bf4. i thinks for bfhl also

  6. #6
    Where can i download the plugin from??

  7. #7

    Arrow how to install

    @Tubbs02:

    1) Download (link below) and install 'ProconRulz V44j1'-Plugin to your ProconLayer

    https://forum.myrcon.com/showthread....-admin-actions

    2) Download voteban_function.txt (attachment below) and copy it to your 'Plugins/BF4' folder

    voteban_function.txt

    3) Start procon client, go to tab "Plugins"

    4) mark ProconRulz, click on tab "Plugin Settings"
    4.1) mark row "Rulz.txt filenames
    4.2) click on the three point button [...] to oben array editor (1 in screenshot)
    4.3) hit return to create a new line
    4.4) write the following line: voteban_function.txt
    4.5) click 'OK'
    5) enable ProconRulz with checkbox (2 in screenshot)

    voteban_funtion.PNG

    should be work

    cheers

    //Crowdy

  8. #8
    I am sorry for this noobish questions, but where it says "if you want, you can give players a voteban protection (e.g. admins, vips). put the playername in the %VIPList%" -- how do I do that? Is that automatically done by having folks in the Reserved Slot list in procon? If not, then how do I add people to this VIP list?

  9. #9
    Quote Originally Posted by SmackDaddy View Post
    I am sorry for this noobish questions, but where it says "if you want, you can give players a voteban protection (e.g. admins, vips). put the playername in the %VIPList%" -- how do I do that? Is that automatically done by having folks in the Reserved Slot list in procon? If not, then how do I add people to this VIP list?
    You add names manually into the code. So if anyone plans on keep adding or removing new Admins or whoever to be protected from this voteban rule alot, i suggest copy the entire code to "Rules" list and not the "Rulz.txt filenames".

    To add Playernames who will be protected from this rule, find the code part shown below in the original code (at the beginning) and simply add names to the code shown below. I colored the names in red so you know where to add them. Put "@@" between every name you add.

    Code:
    # INFO: In this list you can put bf4 playernames with voteban protection (admins):
    On Spawn;PlayerFirst;
        Set %VIPList% "@@SuperSniper@@BigBoyBerlin@@TopCamper0815@@LostFluppy1984@@"
        Set %VotebanTimeoutSec% 60
        Set %server_votesneeded% 5

  10. #10
    BuRockK - thank you very much for the info!

 

 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •