Raised This Month: $51 Target: $400
 12% 

[REQ] Feedback plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shustas
SourceMod Donor
Join Date: May 2007
Location: London
Old 12-10-2008 , 12:34   [REQ] Feedback plugin
Reply With Quote #1

Could somebody make a plugin for a public sm_feedback msg command, similar the one was in amxx? So that users could leave msg about the server. It should be stored in txt file in the logs dir. It should have antiflood protection as well.


Want to leave feedback about the server? write sm_feedback ^"your feedback^" in the console!


Thank you
__________________
shustas is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 12-10-2008 , 15:09   Re: [REQ] Feedback plugin
Reply With Quote #2

Code:
#include <sourcemod> #include <sdktools> public Plugin:myinfo = {     name = "New SM Plugin",     author = "SAMURAI",     description = "",     version = "0.1",     url = "" } new Float:g_fLastUse[ MAXPLAYERS + 1 ] ; #define TIME_INTERVAL 300.0 new String:g_szLogFile[ 256 ]; public OnPluginStart() {     RegConsoleCmd("sm_feedback",fn_commandFeedback); } public OnConfigsExecuted() {     BuildPath( Path_SM , g_szLogFile , sizeof( g_szLogFile ), "configs/feedback.txt" ); } public Action:fn_commandFeedback( id, args ) {     new Float:f_curTime = GetGameTime() ;         if( f_curTime < g_fLastUse[ id ] - TIME_INTERVAL )     {         ReplyToCommand( id , "You have to wait %d seconds for using sm_feedhack again",TIME_INTERVAL);         return Plugin_Handled ;     }         g_fLastUse[ id ] = f_curTime ;         static String:sz_Arg[ 128 ];     GetCmdArgString( sz_Arg, sizeof( sz_Arg ) ) ;         new Handle:i_hFile = OpenFile( g_szLogFile, "at" ) ;         WriteFileLine( i_hFile, sz_Arg ) ;     CloseHandle( i_hFile ) ;     return Plugin_Handled ; }

Command : sm_feedback "blah your feedback"
Code:
#define TIME_INTERVAL 300.0
A flood prevent, time interval for using command again

Feedback file : configs/feedback.txt
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
shustas
SourceMod Donor
Join Date: May 2007
Location: London
Old 12-10-2008 , 15:39   Re: [REQ] Feedback plugin
Reply With Quote #3

wow, nice thank you
__________________
shustas is offline
shustas
SourceMod Donor
Join Date: May 2007
Location: London
Old 12-10-2008 , 15:43   Re: [REQ] Feedback plugin
Reply With Quote #4

Can you add this ad as hint msg to it:

Want to leave feedback about the server? write sm_feedback ^"your feedback^" in the console!


And what about the msg size protection?
__________________

Last edited by shustas; 12-10-2008 at 15:48.
shustas is offline
Lebson506th
Veteran Member
Join Date: Jul 2008
Old 12-10-2008 , 23:29   Re: [REQ] Feedback plugin
Reply With Quote #5

Use an advertisement plugin to put whatever ads you want in your server.

!feedback "asdasdasd"

will work in chat too.
__________________
My Plugins
Spray Tracer by Nican, maintained by me
Simple TK Manager
DoD:S Admin Weapons

Links
Resistance and Liberation (A HL2 Multiplayer Modification)
Lebson506th is offline
shustas
SourceMod Donor
Join Date: May 2007
Location: London
Old 12-11-2008 , 02:21   Re: [REQ] Feedback plugin
Reply With Quote #6

OK, so what about the message size protection? Can you limmit it?
__________________
shustas is offline
Lebson506th
Veteran Member
Join Date: Jul 2008
Old 12-11-2008 , 07:32   Re: [REQ] Feedback plugin
Reply With Quote #7

Right now it's limited to 128 characters.

static String:sz_Arg[ 128 ];
__________________
My Plugins
Spray Tracer by Nican, maintained by me
Simple TK Manager
DoD:S Admin Weapons

Links
Resistance and Liberation (A HL2 Multiplayer Modification)
Lebson506th is offline
shustas
SourceMod Donor
Join Date: May 2007
Location: London
Old 12-11-2008 , 12:30   Re: [REQ] Feedback plugin
Reply With Quote #8

OK, thanks
__________________
shustas is offline
Jason Argo
Member
Join Date: Apr 2008
Location: Sydney, Australia
Old 12-13-2008 , 22:54   Re: [REQ] Feedback plugin
Reply With Quote #9

Hi SAMURAI16,

Awesome plugin this will be very useful to me and I'm sure a lot of other servers. I'd just thought I say it would be great if it logged the SteamIDs of the player that made the feedback. Thanks for a great plugin.

It seems the flood protection isn't working for me, I checked to make sure the indentation is the same as what you have posted. The "You have to wait… message doesn't appear in console or chat when repeating the feedback message and it allows for me to spam and all the messages are written to the feedback.txt file. I have the latest 1.1 snapshot and I'm running it on a CSS Linux server. Does the flood protection work for you shustas?
__________________

"Computers in the future may have only 1,000 vacuum tubes and perhaps only weigh 1.5 tonnes"


- Popular Mechanics magazine, March 1949.
Jason Argo is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 12-14-2008 , 01:30   Re: [REQ] Feedback plugin
Reply With Quote #10

well here it is with steamid update and chars limit
Code:
#include <sourcemod> #include <sdktools> public Plugin:myinfo = {     name = "New SM Plugin",     author = "SAMURAI",     description = "",     version = "0.2",     url = "" } new Float:g_fLastUse[ MAXPLAYERS + 1 ] ; #define TIME_INTERVAL 300.0 #define MAX_CHARACTERS 40 new String:g_szLogFile[ 256 ]; public OnPluginStart() {     RegConsoleCmd("sm_feedback",fn_commandFeedback); } public OnConfigsExecuted() {     BuildPath( Path_SM , g_szLogFile , sizeof( g_szLogFile ), "configs/feedback.txt" ); } public Action:fn_commandFeedback( id, args ) {     new Float:f_curTime = GetGameTime() ;         if( f_curTime < g_fLastUse[ id ] - TIME_INTERVAL )     {         ReplyToCommand( id , "You have to wait %d seconds for using sm_feedhack again",TIME_INTERVAL);         return Plugin_Handled ;     }         g_fLastUse[ id ] = f_curTime ;         static String:sz_Arg[ 128 ], String:sz_AuthID[ 64 ], String:sz_NewText[ 128 ];     GetCmdArgString( sz_Arg, sizeof( sz_Arg ) ) ;         if( strlen( sz_Arg ) > MAX_CHARACTERS )     {         ReplyToCommand( id, "You can't use more than %d characters",MAX_CHARACTERS);         return Plugin_Handled ;     }         GetClientAuthString( id, sz_AuthID, sizeof( sz_AuthID ) );     FormatEx( sz_NewText, sizeof( sz_NewText ), "(%s) : %s",sz_AuthID, sz_Arg );         new Handle:i_hFile = OpenFile( g_szLogFile, "at" ) ;         WriteFileLine( i_hFile, sz_NewText ) ;     CloseHandle( i_hFile ) ;     return Plugin_Handled ; }

Code:
#define MAX_CHARACTERS 40
Max lenght of feedback, with spaces also
In feedback.txt will appear (steamid) : my feedback
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:29.


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