RSSy MYGO.pl Opublikowano Październik 23, 2018 o 18:57 RSSy Udostępnij Opublikowano Październik 23, 2018 o 18:57 RW Polls A plugin aimed to help server administrators decide what's best for the server. A way of bringing you closer to server playersWhat does it do? This plugin shows a specific set of questions, that you define, to your players. The information is stored in a mysql database and can be viewed on console. Furthermore, it also lets your players submit additional feedback by using !feedbackWhat do I need? Sourcemod (It has been developed on version 1.9, but should work on 1.8 or 1.7) MySQL database (doesn't work on SQLite, not yet) Where do I start from? If you already have a MySQL database and know how to set things up, then skip to the next step Spoiler You can choose any kind of REMOTE MySQL hosting, if you already have a web hosting that you pay for, that should work perfectly. However free web hosts don't work as they disable remote database connection. For the purpose of this installation I will be using https://www.freemysqlhosting.net/ and the steps may differ from other hosts Step 1.1: Sign up for a free account Step 1.2: After signing up and logging in you should find yourself in the main panel, there you should select the nearest country to your server, save and start database. It should take a few minutes to setup the database.https://i.imgur.com/cJTlefW.png Everything you need to know will be emailed to you (given that you used a valid email address). Save that information somewhere as you will be needing it on step 2 Step 1.3 (optional): On the main panel, click "Follow this link for phpMyAdmin" (or just follow email instructions). This is where you can see everything stored in database. Go to /addons/sourcemod/configs/databases.cfg and create a new entry which should look sth like: Spoiler Code: "rwpolls" { "driver" "mysql" "host" "SERVERIP OR HOSTNAME" "database" "DBNAME" "user" "DBUSERNAME" "pass" "DBPASSWORD" //"timeout" "0" "port" "3306" } Upload rwpolls.cfg to /addons/sourcemod/configs/ and edit it to your questions. By default the file contains a question which you may want to remove/replace with yours Upload rwpolls.smx (click "GET PLUGIN" below) to /addons/sourcemod/plugins/ and restart your server, or a map change can do the trick, or just use this command: Code: sm_rcon sm plugins load rwpolls and you should be ready to go COMMANDS sm_showpolls - Gets a list of polls/questions and their search id. ROOT access required sm_getpolldata <SEARCHID> - Returns the results of a poll. Use sm_showpolls to get the SEARCHID. ROOT access requiredhttps://i.imgur.com/RPRxuLl.png sm_feedback <FEEDBACK> - Player command to submit feedback. !feedback /feedback should work aswell. You might want to use an ADS plugin to advertise this command. sm_getfeedbacks <PAGE> - Command to get feedbacks from database. ROOT access requiredhttps://i.imgur.com/ePMlZjW.png CVARS sm_rwpolls_feedback - Enable/Disable feedback feature, by default it is "1" (enabled) sm_rwpolls_feedbacktime - Minimum time in seconds needed to submit a feedback. I don't recommend you set this too low as players can spam the command. Default is "300" (equal to 5 minutes) Adding new polls Below is the default rwpolls.cfg, which you may want to modify. Spoiler Code: "Polls" { "How would you rate your experience in this server?" { "vgood" "Very good" "nice" "It is nice" "ok" "Meh, it's ok" "improve" "It needs improvements" "start" "120" "retry" "yes" } } "start" and "retry" are reserved keys for poll settings. "start" value determines when the vote should start after the player has connected (in seconds), needs to be different for each poll to prevent conflicts between polls "retry" value determines whether a vote should run if it failed or some conditions were not met (accepts only yes or no) Other keys are the options, the key acts like an ID (and is saved in database) and the value is the option that is sent to the player. The key should be unique among all questions. So, adding a new poll which starts after 1 minute looks like: Spoiler Code: "Polls" { "How would you rate your experience in this server?" { "vgood" "Very good" "nice" "It is nice" "ok" "Meh, it's ok" "improve" "It needs improvements" "start" "120" "retry" "yes" } "Q1" { "a1_1" "Answer 1_1" "a1_2" "Answer 1_2" "a1_3" "Answer 1_3" "a1_4" "Answer 1_4" "a1_5" "Answer 1_5" "a1_6" "Answer 1_6" "start" "60" "retry" "no" } } Additional screenshots Spoiler READ BELOW There is a maximum of 10 polls at a time, and 10 options per poll. However I DO NOT RECOMMEND you add more than 6 options per poll. Why? Because there are is a maximum of 6 items in a menu per page, which means the other items/options will be on the other page, which a player wont bother to switch to, thus resulting in "fake" data. Don't use a low "start" value, I don't recommend any values below 30. 60+ should be fine (depending on question) Make it a question, don't make it too long, same goes for the options Keep question IDs unique Even tho there is a cvar to use SQLite, it is non-functional, the reason is that I haven't tested whether the queries are compatible with SQLite or not. This plugin should in (my) theory work on other sourcemod servers, if you do test it, please let me know so I can update this to any game It is my first ever plugin for sourcemod, or any game ever, so any feedback would be appreciated. This plugin has been entirely developed on a working online server, during which time there have been 573+ unique genuine votes. Attached Files Get Plugin or Get Source (rwpolls.sp - 18.7 KB) rwpolls.cfg (485 Bytes) Wyświetl pełny artykuł Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi
Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto
Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.
Zarejestruj nowe konto
Załóż nowe konto. To bardzo proste!
Zarejestruj sięZaloguj się
Posiadasz już konto? Zaloguj się poniżej.
Zaloguj się