AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how to replace A-Z -> a-z (https://forums.alliedmods.net/showthread.php?t=132003)

biscuit628 07-10-2010 22:10

how to replace A-Z -> a-z
 
PHP Code:

public say_handled(id)
{
    
replace(A..B..C..D..E..F..G...etc)
    
//to a..b..c..d..e..f..g


thanks for help.

Bugsy 07-10-2010 22:21

Re: how to replace A-Z -> a-z
 
Quote:

Originally Posted by biscuit628 (Post 1234971)
PHP Code:

public say_handled(id)
{
    
replace(A..B..C..D..E..F..G...etc)
    
//to a..b..c..d..e..f..g


thanks for help.

http://www.amxmodx.org/funcwiki.php?go=func&id=60

PattyBiena 07-11-2010 03:49

Re: how to replace A-Z -> a-z
 
PHP Code:

#include <amxmodx>
#include <amxmisc>

new g_maxplayersg_msgSayText

public plugin_init()
{
    
register_clcmd("say""hooksay")
    
    
g_maxplayers get_maxplayers()
    
g_msgSayText get_user_msgid("SayText")
}

public 
hooksay(id)
{
    new 
Messages[192], SzAlive is_user_alive(id)
    
read_args(Messages191)
    
remove_quotes(Messages); strtolower(Messages)
    
    new 
name[33]
    
get_user_name(idname32)
    
    if(!(
Messages[0] == '@' || !strlen(Messages)))
        return 
PLUGIN_CONTINUE;
    
    (
SzAlive format(Messages191"^3%s: ^1%s"nameMessages) : format(Messages191"^1*DEAD* ^3%s: ^1%s"nameMessages))
    
    for(new 
1<= g_maxplayersi++)
    {
        if(!
is_user_connected(i))
            continue;
        
        if(
SzAlive && is_user_alive(i) || !SzAlive && !is_user_alive(i))
        {
            
message_begin(MSG_ONEg_msgSayText, {000}, i);
            
write_byte(id);
            
write_string(Messages);
            
message_end();
        }
    }
    
    return 
PLUGIN_HANDLED




All times are GMT -4. The time now is 07:05.

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