AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   clean up the say msgs :) (https://forums.alliedmods.net/showthread.php?t=12716)

noob 04-22-2005 16:29

clean up the say msgs :)
 
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 }

XxAvalanchexX 04-22-2005 18:32

Change
Code:
cleanit(arg[63])
to
Code:
cleanit(arg)

Twilight Suzuka 04-22-2005 23:53

This will handle the say, and resend it, over and over.

noob 04-23-2005 06:47

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

got to try this, thanks for ur reply :)


All times are GMT -4. The time now is 09:58.

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