Raised This Month: $ Target: $400
 0% 

clean up the say msgs :)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
noob
Junior Member
Join Date: Jun 2004
Old 04-22-2005 , 16:29   clean up the say msgs :)
Reply With Quote #1

as the topic says.. i want to have every first letter of the sentence be uppercase,
add a space after every dot if not already done,
and add a dot to the end (couldnt figure this out)

but ingame it does nothing
Code:
#include <amxmodx> new isreal public plugin_init() {     register_plugin("Clean Say", "1.0", "noob")     register_clcmd("say", "check_say", 0) } public check_say(id) {     if(!isreal) {                       // dont stop the msg sent by the plugin         isreal = 1         return PLUGIN_CONTINUE     }     isreal = 0     new arg[64]     read_args(arg,63)     cleanit(arg[63])     client_cmd(id, "say %s", arg)                   // repeat the clean string as say     return PLUGIN_HANDLED } stock cleanit(arg[]) {     if(equal(arg[0],"@"))                       // this is meant to adminchat plugin, abort         return arg     new leftsay[64], rightsay[64]     ucfirst(arg[63])                        // make the first letter uppercase     for(new i = 0; i < 63; ++i) {         if(equal(arg[i], ".")) {             if(equal(arg[i-1],".") || equal(arg[i+1],"."))  // check if there were 2 dots in a row. if found, skip it                 continue             strtok(arg, leftsay,63, rightsay,63, '.')   // split the saying to two parts             ucfirst(rightsay[63])               // make the first letter after the dot uppercase             format(arg,63, "%s. %s", leftsay, rightsay) // join them together again         }     }     return arg }
noob is offline
 



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:58.


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