Raised This Month: $ Target: $400
 0% 

clean up the say msgs :)


Post New Thread Reply   
 
Thread Tools Display Modes
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
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-22-2005 , 18:32  
Reply With Quote #2

Change
Code:
cleanit(arg[63])
to
Code:
cleanit(arg)
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 04-22-2005 , 23:53  
Reply With Quote #3

This will handle the say, and resend it, over and over.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
noob
Junior Member
Join Date: Jun 2004
Old 04-23-2005 , 06:47  
Reply With Quote #4

XxAvalanchexX: will it fix the whole plugin .
Twilight Suzuka: that's why i have the 'isreal' thingy.

got to try this, thanks for ur reply
noob is offline
Reply


Thread Tools
Display Modes

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