Raised This Month: $ Target: $400
 0% 

SayText problem.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 02-14-2016 , 02:30   SayText problem.
Reply With Quote #1

I'm tryng to make a plugin who block multiple prints( an user who prints more times the same text ).


Problem is acting in the next way: Is check and let first propozition(when i entry to server) THEN IT's BLOCKING Everything without scan, or is a wrong formating string message, i realy dunno...

Here's the code:

Code:
/*     Credits:         ConnorMcLeod    - SayText code         Bugsy - string copy/formating for each client. */ #include <amxmodx> new const PLUGIN[]  =   "Block Multiple Prints",      VERSION[]  =   "v0.1",      AUTHOR[]   =   "Craxor" new gLastUserMessage[33][120], bool:StringCopied[33]; new const BlockMsg[]    =   "**** Multiple Prints Detected! ****"; public plugin_init( ) {     register_plugin     (         .plugin_name    =   PLUGIN,         .version    =   VERSION,         .author     =   AUTHOR     );     register_message(get_user_msgid("SayText"),"Message_SayText"); } public client_putinserver( id ) {     StringCopied[ id ] = false;     gLastUserMessage[id][0] = EOS; } public Message_SayText(msgId,msgDest,msgEnt) {     new Msg[65], id = get_msg_arg_int(1);     get_msg_arg_string(2, Msg, charsmax(Msg));     if( is_user_connected( id ) )         {         if( equal( Msg, gLastUserMessage[id] ) )             set_msg_arg_string(2, BlockMsg);         else             set_msg_arg_string(2, Msg );           if( StringCopied[ id ] == false )         {             copy( gLastUserMessage[id], charsmax( gLastUserMessage[] ), Msg );             StringCopied[ id ] = true;         }             else if( StringCopied[id] == true )         {             formatex( gLastUserMessage[id], charsmax( gLastUserMessage[] ), Msg );         }     } }

Last edited by Craxor; 02-14-2016 at 03:56.
Craxor is offline
Send a message via ICQ to Craxor
 



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 09:24.


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