Battlefield Play4Free weapon limiter script

v0.3.1 2013-08-22 21:30 UTC


Battlefield Play4Free limiter script based on bfp4f-rcon class.


  • PHP Interpreter
  • Database (Script supports 2 types of DB)
    • MySQL, PostgreSQL or other database possible to connect via PDO.
    • ... or MongoDB (You need to install ext-mongo for PHP)


  • Webserver (if you would like to run it continuously via web-browser instead of running in console/cmd/terminal)


You may install bfp4f-limiter in two different ways. With Composer (package dependency manager for php) or just manually.

Installtion guide was made for Windows OS. It may be also reproduced on LAMP or MAMP easily. If you have installed or you owned already webserver with php you may skip first 2 steps.

Manual Installation

  1. Download EasyPHP (php development) or other webserver with php interperter and mysql database (googlit: wamp php mysql).
  2. Install it.
  3. Download bfp4f-rcon ("Download .zip" button on right sidebar). Extract it.
  4. Download bfp4f-limiter from stable branch ("Download .zip" button on right sidebar). Extract it.
  5. Merge it to one folder.
├── composer.json
├── DB-mongo.php
├── DB-pdosql.php
├── limiter-browser.php
├── limiter-config.php
├── limiter-console.php
├── limiter-script.php
├── limiter.sql
├── loop-limiter.sh
└── src
    └── T4G
        └── BFP4F
            └── Rcon
                ├── Base.php
                ├── Chat.php
                ├── Players.php
                ├── Server.php
                ├── Stats.php
                └── Support.php
  1. Open limiter-config.php in your text/code editor.
  2. Comment (add two slashes //) at the beginnig of the line 29
  3. Uncomment (delete two slashes) on lines 31-35.
  4. Configure connection to database on lines 39-45. Password is supposed to be empty as default on many WAMPs. If you are sure (googlit) you don't have password to your mysql database leave "" as no password.
  5. Configure RCON conection
  6. Open phpmyadmin (look for it in easyphp's tray menu).
  7. Create new database called "limiter".
  8. Enter this database.
  9. Import "limiter.sql" (Tab called import > upload .sql).
  10. Move this directory to your ProgramFiles/EasyPHP/htdocs (web) folder.
  11. Start Apache and MySQL services .
  12. Run it in browser typing http://localhost/limiter-browser.php.

Installation finished. Now look up for configuration.


In limiter-config.php you have very long list what you could change and configure it as you prefer.

Please notice that mm_iga/mm_kicker has usually predefined default kick message (usually it is piqus you are being kicked (reason: Unknown)). Each kick message in limiter-config.php will only replace word Unknown.


You may run script continously running via browser or terminal. There are some webhostings which allows to run CRON script minutely, also this method is supported and recomended.

Running via browser. If you installed completely limiter script you may type in address bar http://localhost/path/to/limiter-browser.php

Running via console is much easier if you have ever used it to run php scripts. If you have exported to $PATH (System Env. Variable) location to your php(.exe) binary you may enter folder where you have installed limiter then execute php limiter-console.php or sh loop-limiter.sh in terminal/console/cmd.exe/powershell. You don't have to export this variable. You could just type "global" path to php(.exe) i.e C:/ProgramFiles/PHP/5.4/php.exe C:/Users/Admin/Webdocs/bfp4f-limiter/limiter-console.php.

It is worth noting that sh command is not supported out of the box in Windows OS. You could install GIT Bash (Mingw) form http://git-scm.com/ which includes many useful commands like sh, ssh over openssh, grep, find, git etc. etc.


Project has been added to Packagist. You may invoke composer create-project piqus/bfp4f-limiter:dev-stable


Feel free to modify code. Each patch is moderated so don't be shy and share your idea! ;-)