AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Player Feedback [SQL] (https://forums.alliedmods.net/showthread.php?t=327292)

MSWS 09-10-2020 07:40

Player Feedback [SQL]
 
1 Attachment(s)
Hello, this is my first plugin however I do believe that it has a fair amount of usefulness for server administrators who want to get player feedback on other members of their server. I've created a plugin that allows players to do !like and !dislike on other players with a message.

Features:
  • (Obviously) No SQL Injection
  • MySQL and SQLite Support
  • Complete configurability over cooldowns
  • Useful messages that say how long their cooldown is
  • Cooldowns use the database to prevent players from bypassing it

Installation:
Move the Feedback.xms file into your \csgo\addons\sourcemod\plugins folder.
Create a new feedback database under your csgo\addons\sourcemod\configs\databases.cfg, it can be either MySQL or SQLite (other database types untested).

ConVars / Configuration:
sm_cooldown_like - Seconds of delay between being able to use sm_like
sm_cooldown_dislike - Seconds of delay between being able to use sm_dislike
sm_cooldown_shared - If 1, both sm_like and sm_dislike will be under the same cooldown
sm_cooldown_global - If 1, cooldown is for giving feedback to any player instead of the same player
sm_cooldown_simple - If not 0, the cooldown does not sync with database, is global, and shared (overrides shared and global convars)

Commands:
sm_like [Player] [Message] - Gives positive feedback towards a player
sm_dislike [Player] [Message] - Gives negative feedback towards a player
[ADMIN_ROOT] sm_deletefeedback [Steam64] - Deletes all feedback from a player
[ADMIN_ROOT] sm_clearfeedback [Steam64] - Deletes all feedback towards a player

GitHub: https://gist.github.com/MSWS/2ed64b4...49595638f10123

Trum 09-10-2020 11:17

Re: Player Feedback [SQL]
 
Very cool, good job! Definetly gonna use this on my user panel project.

Judge_Duck 09-10-2020 17:35

Re: Player Feedback [SQL]
 
L 09/10/2020 - 14:32:47: [SM] Blaming: Feedback.smx
L 09/10/2020 - 14:32:47: [SM] Call stack trace:
L 09/10/2020 - 14:32:47: [SM] [0] IsClientConnected
L 09/10/2020 - 14:32:47: [SM] [1] Line 339, /home/forums/content/files/3/0/3/3/0/4/183634.attach::assignAliases
L 09/10/2020 - 14:32:47: [SM] [2] Line 46, /home/forums/content/files/3/0/3/3/0/4/183634.attach::OnPluginStart
L 09/10/2020 - 14:32:47: [SM] Unable to load plugin "Feedback.smx": Error detected in plugin startup (see error logs)



We've got our maxplayers set to 34 is probably the cause I'm guessing.

Psyk0tik 09-10-2020 20:42

Re: Player Feedback [SQL]
 
Quote:

Originally Posted by Judge_Duck (Post 2717394)
L 09/10/2020 - 14:32:47: [SM] Blaming: Feedback.smx
L 09/10/2020 - 14:32:47: [SM] Call stack trace:
L 09/10/2020 - 14:32:47: [SM] [0] IsClientConnected
L 09/10/2020 - 14:32:47: [SM] [1] Line 339, /home/forums/content/files/3/0/3/3/0/4/183634.attach::assignAliases
L 09/10/2020 - 14:32:47: [SM] [2] Line 46, /home/forums/content/files/3/0/3/3/0/4/183634.attach::OnPluginStart
L 09/10/2020 - 14:32:47: [SM] Unable to load plugin "Feedback.smx": Error detected in plugin startup (see error logs)



We've got our maxplayers set to 34 is probably the cause I'm guessing.

You left out the most crucial and helpful part of that error log, which is the "Exception reported" line.

Judge_Duck 09-11-2020 09:37

Re: Player Feedback [SQL]
 
L 09/11/2020 - 06:34:44: [SM] Exception reported: Client index 34 is invalid
L 09/11/2020 - 06:34:44: [SM] Blaming: Feedback.smx
L 09/11/2020 - 06:34:44: [SM] Call stack trace:
L 09/11/2020 - 06:34:44: [SM] [0] IsClientConnected
L 09/11/2020 - 06:34:44: [SM] [1] Line 339, /home/forums/content/files/3/0/3/3/0/4/183634.attach::assignAliases
L 09/11/2020 - 06:34:44: [SM] [2] Line 46, /home/forums/content/files/3/0/3/3/0/4/183634.attach::OnPluginStart
L 09/11/2020 - 06:34:44: [SM] Unable to load plugin "Feedback.smx": Error detected in plugin startup (see error logs)


That's my fault, was getting rushed out the door when I posted yesterday and didn't catch that. But the index 34 was what made me think it might be a maxplayers issue. Am going to look it at this morning and report back.

Judge_Duck 09-11-2020 09:49

Re: Player Feedback [SQL]
 
L 09/11/2020 - 06:45:31: [SM] Exception reported: Client index 31 is invalid
L 09/11/2020 - 06:45:31: [SM] Blaming: Feedback.smx
L 09/11/2020 - 06:45:31: [SM] Call stack trace:
L 09/11/2020 - 06:45:31: [SM] [0] IsClientConnected
L 09/11/2020 - 06:45:31: [SM] [1] Line 339, /home/forums/content/files/3/0/3/3/0/4/183634.attach::assignAliases
L 09/11/2020 - 06:45:31: [SM] [2] Line 46, /home/forums/content/files/3/0/3/3/0/4/183634.attach::OnPluginStart
L 09/11/2020 - 06:45:31: [SM] Unable to load plugin "Feedback.smx": Error detected in plugin startup (see error logs)


Just tried to run with our maxplayers set to 30, and got a similar error. So my theory on maxplayers=34 breaking the plugin is incorrect.

SSheriFF 09-11-2020 12:16

Re: Player Feedback [SQL]
 
Change
PHP Code:

for (int i 1MAXPLAYERSi++) 

To
PHP Code:

for (int i 1<= MaxClientsi++) 


Judge_Duck 09-11-2020 12:34

Re: Player Feedback [SQL]
 
That fixed it for me, thank you!


All times are GMT -4. The time now is 05:30.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.