Raised This Month: $ Target: $400
 0% 

No search string specified


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
GhostMan
Senior Member
Join Date: Jun 2012
Old 06-30-2012 , 19:03   No search string specified
Reply With Quote #1

PHP Code:
 #include <amxmisc>
 #pragma semicolon 1

 #define MAX_PLAYERS 32

 #define COMMAND_NEW -1
 #define COMMAND_FIRST 0

 
enum
 
{
    
COMM_CID,        //where in the command string is the command id
    
COMM_CMD        //where in the command string the total command starts (must be last)
 
}

 
enum
 
{
    
REPL_NONE,        //didnt find anything to replace @'s
    
REPL_USERID,    //replace @'s with userids
    
REPL_AUTHID,    //replace @'s with authids
    
REPL_NICK,        //replace @'s with nicknames
 
}

 
enum _:SAY_TYPES
 
{
    
SAY_NONE,        //Said nothing special
    
SAY_SLASH,        //Said started with /
    
SAY_QUESTION,    //Said started with ?
    
SAY_AT,            //Said started with @
    
SAY_BACKSLASH,    //Said started with backslash
 
}

 new const 
SayChars[SAY_TYPES] =
 {
    
'^0',
    
'!',
    
'?',
    
'@',
    
'\'
 };

 new Array:PreviousSlashes[MAX_PLAYERS+1];
 new Array:Repeaters[MAX_PLAYERS+1];

 new ss_showcmd;

 public plugin_init()
 {
    new const PLUGNAME[] =            "SmartSlash";
    new const AUTHOR[] =            "Emp`";
    new const VERSION[] =            "0.51";
    register_plugin(PLUGNAME, VERSION, AUTHOR);

    set_pcvar_string( register_cvar(PLUGNAME,VERSION,FCVAR_SERVER|FCVAR_SPONLY), VERSION );

    register_clcmd("say","CmdSay");

    for( new i; i<MAX_PLAYERS+1; i++ )
    {
        PreviousSlashes[i] = ArrayCreate(64, 1);
        Repeaters[i] = ArrayCreate(64, 1);
    }

    ss_showcmd = register_cvar("ss_showcmd", "1");

    //Repeaters only for cstrike
    if( cstrike_running() )
        register_event("HLTV", "event_new_round", "a", "1=0", "2=0");
 }

 public client_disconnect(id)
 {
    //When someone leaves, make sure no one else see'
s their previous things
    ArrayClear
PreviousSlashes[id] );
    
ArrayClearRepeaters[id] );
 }

 public 
CmdSay(id)
 {
    new 
said[192];
    
read_args(said,191);
    
remove_quotes(said);
    return 
SayHandleidsaid );
 }

 
SayHandleidsaid[192] )
 {
    new 
say_type SAY_NONE;

    
//Check for what type of say it was
    
for( new iSAY_TYPESi++ )
    {
        if( 
said[0] == SayChars[i] )
        {
            
say_type i;
            break;
        }
    }

    
//If nothing special was said
    
if( say_type == SAY_NONE )
    {
        return 
PLUGIN_CONTINUE;
    }

    
//Check if it was only a slash (to do previous slashes)
    
if( said[1] == '^0' && say_type == SAY_SLASH )
    {
        
//Get how many are in the array so we can iterate through them all
        
new size ArraySize(PreviousSlashes[id]);

        
//If they don't have any previous commands, don't do anything
        
if( !size )
        {
            return 
PLUGIN_CONTINUE;
        }

        
//String for which number in the array it is
        
new item_data[128];

        
//Create a menu for previous slashes
        
new menu menu_create("/""menu_handler");

        
//Iterate through all previous slashes
        
for( new isizei++ )
        {
            
//get a previous slash
            
ArrayGetString(PreviousSlashes[id], isaid63);

            
//store the information we want to pass
            
formatexitem_data127"%d %d %s"said[COMM_CID], isaid[COMM_CMD] );

            
//add it to the menu
            
menu_additem(menusaid[COMM_CMD], item_data);
        }

        
//Display the menu
        
menu_display(idmenu);

        
//Don't show the chat message, but let other plugins detect it
        
return PLUGIN_HANDLED_MAIN;
    }

    
//Backslashes (to turn off repeaters)
    
if( say_type == SAY_BACKSLASH )
    {
        
//Repeater menu
        
if( said[1] == '^0' )
        {
            
//Get how many are in the array so we can iterate through them all
            
new size ArraySize(Repeaters[id]);

            
//If they don't have any repeater commands, don't do anything
            
if( !size )
            {
                return 
PLUGIN_CONTINUE;
            }

            
//Change it to a slash command
            
said[0] = SayChars[SAY_SLASH];

            
//String for which number in the array it is
            
new item_data[128];

            
//Create a menu for repeater
            
new menu menu_create("Repeaters""menu_handler");

            
//Iterate through all repeater
            
for( new isizei++ )
            {
                
//get a repeater
                
ArrayGetString(Repeaters[id], isaid63);

                
//store the information we want to pass
                
formatexitem_data127"REPEAT %s"said );

                
//add it to the menu
                
menu_additem(menusaiditem_data);
            }

            
//Display the menu
            
menu_display(idmenu);
        }
        else
        {
            
//Change it to a slash command
            
said[0] = SayChars[SAY_SLASH];

            
//Get how many are in the array so we can iterate through them all
            
new size ArraySizeRepeaters[id] );

            
//Save the entire command for later use
            
if( size )
            {
                
ArrayInsertStringBefore(Repeaters[id], 0said);
            }
            else
            {
                
ArrayPushString(Repeaters[id], said);
            }
        }

        
//Don't show the chat message, but let other plugins detect it
        
return PLUGIN_HANDLED_MAIN;
    }

    
//For getting information about available commands
    
new info[64], cmd[32], eflagsflags get_user_flags(id);

    
// HACK: ADMIN_ADMIN is never set as a user's actual flags, so those types of commands never show
    
if (flags && !(flags ADMIN_USER))
    {
        
flags |= ADMIN_ADMIN;
    }

    new 
clcmdsnum get_concmdsnum(flagsid);

    
//If it was an @ say, keep track of the message
    
if( say_type == SAY_AT )
    {
        new 
command[64];
        
formatexcommand63"say %s"said );

        
//Get the command id
        
new cid;
        
//iterate through all detected client commands
        
for( new i<= clcmdsnumi++ )
        {
            
get_concmdicmd31eflagsinfo0flagsid );
            if( 
equalcmd"say" ) )
            {
                
cid i;
                break;
            }
        }

        
//Save it for later
        
SaveCommand(idcidcommand);

        return 
PLUGIN_CONTINUE;
    }

    
//get the first command, put the rest in said
    //note we skip the slash by using said[1]
    
new said_cmd[32];
    
strbreaksaid[1], said_cmd31said191 );

    new 
char_numchar_loccmdstr_len;

    
//store information about the commands
    
new Array:command_array ArrayCreate(11);

    
//store the names of commands so we can check for duplicates
    
new Trie:command_trie TrieCreate();

    
//iterate through all detected client commands
    
for( new i<= clcmdsnumi++ )
    {
        
get_concmdicmd31eflagsinfo0flagsid );

        
//Check for "_", char_loc will be the location of "_", therefore char_loc+1 will check the partial string
        //Example command: "amx_kick"
        //Input: "/kick"

        //Check for "/", char_loc will be the location of "/", therefore char_loc+1 will check the partial string
        //Example command: "say /help"
        //Input: "/help"

        //Check for exact command, char_loc will be -1, therefore char_loc+1 will be 0, so it will check entire string
        //Example command: "amxmodmenu"
        //Input: "/amxmodmenu"

        //Assume it doesn't have a special character
        
char_loc = -1;

        
//Only check for special characters if it is not a question
        
if( say_type == SAY_SLASH )
        {
            
//Get the string length so we can iterate through all its characters without going over
            
cmdstr_len strlencmd );

            
//Iterate through all the characters looking for any special character
            
for( char_num 0char_num cmdstr_lenchar_num++ )
            {
                
//Check for special characters
                
switch( cmd[char_num] )
                {
                    
//These are the special characters
                    
case '_''/''.'' ':
                    {
                        
char_loc char_num;
                    }
                    case 
'^0':
                    {
                        break;
                    }
                }
            }
        }

        
//Check against the current command
        //If it is a question, show any that contain the phrase said
        
if( equalsaid_cmdcmdchar_loc+] ) || ( say_type == SAY_QUESTION && containcmdsaid_cmd ) != -) )
        {
            
//Check to see the command has not been added before
            //This can happen if two seperate plugins register the same command (eg. amx_ban)
            
if( !TrieKeyExists(command_triecmd) )
            {
                
ArrayPushCell(command_arrayi);
                
TrieSetCell(command_triecmdi);
                continue;
            }
        }
    }

    
//Destroy the trie since we don't need it anymore
    
TrieDestroy(command_trie);

    
//How many matches were there
    
new matches_num ArraySize(command_array);

    
//Add question since we want to make the menu if it was a question
    
switch( matches_num say_type SAY_SLASH )
    {
        case 
0:
        {
            
//no matches found

            //destroy the array
            
ArrayDestroy(command_array);

            
//let them say what they said
            
return PLUGIN_CONTINUE;
        }
        case 
1:
        {
            
//no matches found for the question
            
if( say_type == SAY_QUESTION )
            {
                
//destroy the array
                
ArrayDestroy(command_array);

                
//let them say what they said
                
return PLUGIN_CONTINUE;
            }

            
//which command is it?
            
new cid ArrayGetCell(command_array0);

            
//only one match found, do that first match
            
get_concmdcidcmd31eflagsinfo63flagsid );

            
//Get the entire command
            
new total_cmd[64];
            
formatex(total_cmd63"%s %s"cmdsaid);

            
//Execute the command
            
ExecCommandidcidtotal_cmd );

            
//Save the entire command for later use
            
SaveCommand(idcidtotal_cmd);
        }
        default:
        {
            
//make the menu title
            
formatex(cmd31"%c%s %s"SayChars[say_type], said_cmdsaid);
            new 
menu menu_create(cmd"menu_handler");

            new 
ciditem_name[64], item_data[128];

            
//iterate through all matches and add them to the menu
            
for( new imatches_numi++ )
            {
                
cid ArrayGetCell(command_arrayi);

                
//get the command name, if it is a question get the info too
                
get_concmdcidcmd31eflagsinfo, (say_type == SAY_QUESTION) ? 63 0flagsid );

                
//store the information we want to pass
                
formatexitem_data127"%d %d %s %s"cidCOMMAND_NEWcmdsaid );

                if( 
say_type == SAY_QUESTION )
                {
                    
formatex(item_name63"%s %s"cmdinfo);
                    
menu_additem(menuitem_nameitem_data);
                }
                else
                {
                    
menu_additem(menucmditem_data);
                }
            }

            
//display the menu of choices
            
menu_display(idmenu);
        }
    }

    
//Destroy the array
    
ArrayDestroy(command_array);

    
//Don't show the chat message, but let other plugins detect it
    
return PLUGIN_HANDLED_MAIN;
 }

 public 
menu_handler(idmenuitem)
 {
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
accessdata[128], iName[1], callback;
    
menu_item_getinfo(menuitemaccessdata,127iName,0callback);

    
//lets destroy it now since we dont need it anymore
    
menu_destroy(menu);

    
//If they are destroying a repeater
    
if( equaldata"REPEAT") )
    {
        
//Get how many are in the array so we can iterate through them all
        
new size ArraySizeRepeaters[id] );

        
//Save the entire command for later use
        
if( size )
        {
            
//Check to make sure it is not something they have done before
            
new temp_string[64];
            for( new 
ii<sizei++ )
            {
                
ArrayGetString(Repeaters[id], itemp_string63);
                if( 
equaltemp_stringdata[7] ) )    //check after the space
                
{
                    
ArrayDeleteItem(Repeaters[id], i);
                    
client_print(idprint_chat"Deleted Repeater: %s"data[7]);
                    break;
                }
            }
        }
        return 
PLUGIN_HANDLED;
    }

    new 
szCid[10], szPrev[10];
    
strbreak(dataszCid,9data127);
    
strbreak(dataszPrev,9data127);

    new 
cid str_to_numszCid );
    new 
prev_num str_to_numszPrev );

    
//Execute the command
    
ExecCommandidciddata );

    
//If it's not at the front
    
if( prev_num )
    {
        
//If it is not new, delete the old position
        
if( prev_num != COMMAND_NEW )
        {
            
//Delete the old one
            
ArrayDeleteItem(PreviousSlashes[id], prev_num);
        }

        
SaveCommand(idciddata);
    }

    return 
PLUGIN_HANDLED;
 }

 
SaveCommand(idcidcommand[])
 {
    new 
save_array[64];
    
save_array[COMM_CID] = cid;
    
copy(save_array[COMM_CMD], 63-COMM_CMDcommand );

    
//Get how many are in the array so we can iterate through them all
    
new size ArraySizePreviousSlashes[id] );

    
//Save the entire command for later use
    
if( size )
    {
        
//Check to make sure it is not something they have done before
        
new temp_string[64], bool:deleted;
        for( new 
ii<sizei++ )
        {
            
ArrayGetString(PreviousSlashes[id], itemp_string63);
            if( 
equaltemp_stringsave_array ) )
            {
                
ArrayDeleteItem(PreviousSlashes[id], i);
                
deleted true;
                break;
            }
        }

        if( 
size == && deleted )
        {
            
ArrayPushString(PreviousSlashes[id], save_array);
        }
        else
        {
            
ArrayInsertStringBefore(PreviousSlashes[id], 0save_array);
        }
    }
    else
    {
        
ArrayPushString(PreviousSlashes[id], save_array);
    }
 }

 
ExecCommand(idcidcommand[])
 {
    new 
info[64], cmd[32], eflagsflags get_user_flags(id);
    new 
temp;

    
// HACK: ADMIN_ADMIN is never set as a user's actual flags, so those types of commands never show
    
if (flags && !(flags ADMIN_USER))
    {
        
flags |= ADMIN_ADMIN;
    }

    
get_concmdcidcmd31eflagsinfo63flagsid );

    
//Find which type to replace with
    
new replace_type REPL_NONE;
    if( 
containinfo"userid" ) != -)        //best way
        
replace_type REPL_USERID;
    else if( 
containinfo"authid" ) != -)    //second best way
        
replace_type REPL_AUTHID;
    else if( 
containinfo"nick" ) != -)    //back up way
        
replace_type REPL_NICK;
    else if( 
containinfo"name" ) != -)    //super back up way
        
replace_type REPL_NICK;
    else if( 
containinfo"player" ) != -)    //super duper back up way
        
replace_type REPL_USERID;
    else if( 
containinfo"target" ) != -)    //super duper duper back up way
        
replace_type REPL_USERID;
    else if( 
containinfo"user" ) != -)    //super duper duper duper back up way
        
replace_type REPL_USERID;


    
//If they put an @ in their command
    
new command_at containcommand"@" );
    if( 
replace_type != REPL_NONE && command_at != -)
    {
        
// @ was said, give them a menu of options
        
if( command[command_at+1] == ' ' || command[command_at+1] == '^0' )
        {
            new 
temp_command[128], temp_replace[32], stuff_len;

            
stuff_len formatextemp_command127"%d %d "cidCOMMAND_FIRST );

            
copytemp_command[stuff_len], 127-stuff_lencommand );
            
replace(temp_command[stuff_len+command_at], 127-stuff_len"@""\r@\y");
            new 
menu menu_createtemp_command[stuff_len], "menu_handler" );

            
//Add @ALL
            
copytemp_command[stuff_len], 127-stuff_lencommand );
            
replace(temp_command[stuff_len+command_at], 127"@""@ALL");
            
menu_additem(menu"@ALL"temp_command);

            
//store the names of teams so we can check for duplicates
            
new Trie:team_trie TrieCreate();

            
//Iterate through all players and add their teams
            
for( new i=1i<=MAX_PLAYERSi++ )
            {
                
//Make sure the player is connected
                
if( is_user_connected(i) )
                {
                    
//Avoid the UNASSIGNED team
                    
if( get_user_team(itemp_replace[1], 30) )
                    {
                        
//Make sure it hasn't been added yet
                        
if( !TrieKeyExists(team_trietemp_replace[1]) )
                        {
                            
copytemp_command[stuff_len], 127-stuff_lencommand );
                            
temp_replace[0] = '@';
                            
replacetemp_command[stuff_len+command_at], 127"@"temp_replace);

                            
menu_additem(menutemp_replacetemp_command);

                            
TrieSetCell(team_trietemp_replace[1], 1);
                        }
                    }
                }
            }

            
//No longer need the trie, get rid of it
            
TrieDestroy(team_trie);

            for( new 
i=1i<=MAX_PLAYERSi++ )
            {
                if( 
is_user_connected(i) )
                {
                    switch( 
replace_type )
                    {
                        case 
REPL_USERID:    formatextemp_replace31"#%d"get_user_userid(i) );
                        case 
REPL_AUTHID:    get_user_authid(itemp_replace31);
                        case 
REPL_NICK:        get_user_name(itemp_replace31);
                    }
                    
copytemp_command[stuff_len], 127-stuff_lencommand );
                    
replacetemp_command[stuff_len+command_at], 127-stuff_len"@"temp_replace);

                    
//We want to see player names in the menu
                    
if( replace_type != REPL_NICK )
                        
get_user_name(itemp_replace31);

                    
menu_additem(menutemp_replacetemp_command);
                }
            }

            
//display the menu of choices
            
menu_display(idmenu);

            return;
        }

        
//If the command does not support @'s
        
if( containinfo"@" ) == -)
        {
            
//If trying for all players
            
if( equalicommand[command_at+1], "ALL") )
            {
                for( new 
i=1i<=MAX_PLAYERSi++ )
                {
                    if( 
is_user_connected(i) )
                    {
                        
DoCmd(idcommand[command_at], replace_typeicommand);
                    }
                }
                new 
name[32], message[128];
                
get_user_name(idname31);
                
formatex(message127"%s used ^"%s^" through Smart Slash."namecommand);
                
set_task(0.5"delay_print"0message128);
                return;
            }
            
//Detect for teams (eg. @A @C @CT @T @M @R etc.)
            
else
            {
                new 
detectedteamname[5];
                for( new 
i=1i<=MAX_PLAYERSi++ )
                {
                    if( 
is_user_connected(i) )
                    {
                        
get_user_team(iteamname4);
                        if( 
equalicommand[command_at+1], teamname) )
                        {
                            
DoCmd(idcommand[command_at], replace_typeicommand);
                            
detected++;
                        }
                    }
                }
                if( 
detected )
                {
                    new 
name[32], message[128];
                    
get_user_name(idname31);
                    
formatex(message127"%s used ^"%s^" through Smart Slash."namecommand);
                    
set_task(0.5"delay_print"0message128);
                    return;
                }
            }
        }
    }

    
//Check for correct names
    
if( containinfo"nick" ) != -|| containinfo"name" ) != -|| containinfo"player" ) != -)
    {
        
//Go through each argument
        
new left[32], arg_numcommand_left[32], command_right[64], iplayer;
        while( 
containinfo">" ) != -)
        {
            
strtok(infoleft31info63'>');
            
arg_num++;
            if( 
containleft"nick" ) != -|| containleft"name" ) != -|| containleft"player" ) != -)
            {
                
//Get a temp copy of the command
                
copycommand_right63command );

                
//Get the argument they put for the nick
                
for( i=0<= arg_numi++ )
                {
                    
strbreak(command_rightcommand_left31command_right63);
                }

                
//Get the first player with the name
                
player find_player("bl",command_left);

                
//If it can find no players or two different players
                
if( !player || player != find_player("blj",command_left) )
                {
                    new 
menu = -1;
                    new 
temp_replace[32], temp_command[128], stuff_len;

                    
stuff_len formatextemp_command127"%d %d "cidCOMMAND_FIRST );
                    
copytemp_command[stuff_len], 127-stuff_lencommand );

                    
//Get the first space in the command
                    //We need this so we dont replace names into the command name
                    //For example if they do /slap a
                    //We want the second a (after the space) to be replaced
                    
new space_loc containtemp_command[stuff_len], " " );

                    new 
clean_lenclean_left[32], clean_name[32];
                    
clean_len CleanStringcommand_leftclean_left31 );

                    for( 
i=1i<=MAX_PLAYERSi++ )
                    {
                        if( 
is_user_connected(i) )
                        {
                            
//Get the name of the player and clean it
                            
get_user_name(itemp_replace31);
                            
CleanStringtemp_replaceclean_name31 );

                            
//Now check if its close to what they had
                            
if( !clean_len || containi(clean_nameclean_left) != -)
                            {
                                switch( 
replace_type )
                                {
                                    case 
REPL_USERID:    formatextemp_replace31"#%d"get_user_userid(i) );
                                    case 
REPL_AUTHID:    get_user_authid(itemp_replace31);
                                    case 
REPL_NICK:        {} //do nothing because temp_replace is already the nick
                                
}
                                
copytemp_command[stuff_len], 127-stuff_lencommand );
                                
replace(temp_command[stuff_len+space_loc], 127-stuff_lencommand_lefttemp_replace);

                                
//We want to see player names in the menu
                                
if( replace_type != REPL_NICK )
                                    
get_user_name(itemp_replace31);

                                if( 
menu == -)
                                    
menu menu_createcommand"menu_handler" );

                                
menu_additem(menutemp_replacetemp_command);
                            }
                        }
                    }

                    
//If the menu was ever created
                    
if( menu != -)
                    {
                        
//display the menu of choices
                        
menu_display(idmenu);

                        return;
                    }
                }
            }
            
            if(++
temp 10000)
            {
                
log_amx("uzstrigo ExecCommand");
                break;
            }

        }
    }

    
//The command does not have @ or the command supports @
    
DoCmd(id""REPL_NONE0command);
 }
 
 public 
delay_printmessage[] )
    
client_print(0print_chatmessage);
 
 
DoCmd(idreplace_string[], replace_typeplayercommand[])
 {
    new 
temp_command[128];
    
copy(temp_command127command);

    if( 
replace_type != REPL_NONE && player )
    {
        new 
temp_replace[32];

        switch( 
replace_type )
        {
            case 
REPL_USERID:    formatextemp_replace31"#%d"get_user_userid(player) );
            case 
REPL_AUTHID:    get_user_authid(playertemp_replace31);
            case 
REPL_NICK:        get_user_name(playertemp_replace31);
        }

        
//If what we are replacing has a space after it, only replace up to the space
        
new replace_full[128], space_loc;
        
copy(replace_full127replace_string);
        
space_loc containreplace_full" " );
        if( 
space_loc != -)
        {
            
replace_full[space_loc] = '^0';
        }

        
replace(temp_command127replace_fulltemp_replace);
    }

    
//let them know the command they smart slashed (if it wasn't replacing anything)
    
if( replace_type == REPL_NONE && get_pcvar_numss_showcmd ) )
        
client_printidprint_centertemp_command );

    
//engclient_cmd would be better here, however, it only works for commands from the game (doesnt work for commands from AMXX)
    
client_cmdidtemp_command );
 }

 
CleanString( const string[], output[], len )
 {
    new 
PosInPosOut;
    new 
temp;

    while( 
PosOut len )
    {
        switch( 
string[PosIn] )
        {
            
//End of string
            
case '^0':
            {
                
output[PosOut] = '^0';
                break;
            }

            
//Skip spaces and underscores
            
case ' ''_':
            {
                
PosIn++;
                continue;
            }

            
//Advanced characters (take more than one character to represent another character)
            
case '|':
            {
                if( 
string[PosIn+1] == '<' )
                    
output[PosOut] = 'k';
                else if( 
string[PosIn+1] == '>' )
                    
output[PosOut] = 'p';
                else if( 
string[PosIn+1] == ')' )
                    
output[PosOut] = 'd';
                else if( 
string[PosIn+1] == '2' )
                    
output[PosOut] = 'r';
                else if( 
string[PosIn+1] == '3' )
                    
output[PosOut] = 'b';
                else
                    
output[PosOut] = 'l';
            }
            case 
'(':
            {
                if( 
string[PosIn+1] == ')' )
                    
output[PosOut] = 'o';
                else
                    
output[PosOut] = 'c';
            }
            case 
'[':
            {
                if( 
string[PosIn+1] == ']' )
                    
output[PosOut] = 'o';
                else
                    
output[PosOut] = 'c';
            }
            case 
'{':
            {
                if( 
string[PosIn+1] == '}' )
                    
output[PosOut] = 'o';
                else
                    
output[PosOut] = 'c';
            }
            case 
'\':
            {
                if( string[PosIn+1] == '
/' )
                    output[PosOut] = '
v';
                else
                    output[PosOut] = '
l';
            }

            //Similar characters
            case '
A', '@':
                output[PosOut] = '
a';
            case 'B', '
8':
                output[PosOut] = 'b';
            case '
C', '<':
                output[PosOut] = '
c';
            case '
D':
                output[PosOut] = '
d';
            case '
E', '3':
                output[PosOut] = '
e';
            case '
F':
                output[PosOut] = '
f';
            case '
G':
                output[PosOut] = '
g';
            case '
H':
                output[PosOut] = '
h';
            case '
I', '!':
                output[PosOut] = '
i';
            case '
J':
                output[PosOut] = '
j';
            case '
K':
                output[PosOut] = '
k';
            case '
L', '1':
                output[PosOut] = '
l';
            case '
M':
                output[PosOut] = '
m';
            case '
N':
                output[PosOut] = '
n';
            case '
O', '0':
                output[PosOut] = '
o';
            case '
P':
                output[PosOut] = '
p';
            case '
Q':
                output[PosOut] = '
q';
            case '
R':
                output[PosOut] = '
r';
            case '
S', '$', '5':
                output[PosOut] = '
s';
            case '
T', '7', '+':
                output[PosOut] = '
t';
            case '
U':
                output[PosOut] = '
u';
            case '
V':
                output[PosOut] = '
v';
            case '
W':
                output[PosOut] = '
w';
            case '
X':
                output[PosOut] = '
x';
            case '
Y':
                output[PosOut] = '
y';
            case '
Z':
                output[PosOut] = '
z';

            //Other Characters should just be copied
            default:
                output[PosOut] = string[PosIn];
        }
        PosIn++;
        PosOut++;
        
        if(++temp > 10000)
        {
            log_amx("uzstrigo CleanString");
            break;
        }
    }
    return PosOut;
 }

 public event_new_round()
 {
    new i, size, command[192];
    for( new id; id<=MAX_PLAYERS; id++ )
    {
        if( is_user_connected(id) )
        {
            size = ArraySize( Repeaters[id] );
            for( i=0; i < size; i++ )
            {
                ArrayGetString(Repeaters[id], i, command, 191);
                SayHandle( id, command );
            }
        }
    }
 } 
Download link > http://forums.alliedmods.net/attachm...5&d=1255026505
Quote:
L 06/29/2012 - 16:39:35: No search string specified.
L 06/29/2012 - 16:39:35: [AMXX] Displaying debug trace (plugin "smart_slash.amxx")
L 06/29/2012 - 16:39:36: [AMXX] Run time error 10: native error (native "replace")
L 06/29/2012 - 16:39:36: [AMXX] [0] smart_slash.sma::ExecCommand (line 723)
L 06/29/2012 - 16:39:36: [AMXX] [1] smart_slash.sma::SayHandle (line 358)
L 06/29/2012 - 16:39:36: [AMXX] [2] smart_slash.sma::CmdSay (line 83)

Last edited by GhostMan; 07-01-2012 at 06:00.
GhostMan 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 15:18.


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