Avoiding "!" Prefix

Started by soulshaker, Sep 07, 2015, 12:24 PM

Previous topic - Next topic

soulshaker

As we know that we generally use "/" prefix now but some players still tries to use "!" prefix. So to avoid that, we can tell players that "!" prefix is removed from your server(if you really removed it) like this:-



function onPlayerChat( player, text )
{
    local msg
    if ( text ) msg = text.tolower();
        {
        if ( text )
        { 
                if ( text.slice( 0, 1 ) == "!" )
                {
                        local i = NumTok( text, " " ), xp = null;
                       
                        if ( i == 1 ) MessagePlayer("[#EE3B3B]>> Error - [#FFFFFE]The server uses / prefix for commands. Try [#00EEEE]/"+ text.slice( 1 ) ,player);
                }
                }
        }             
        return 1;
}
 
function NumTok(string, separator)
{
    local tokenized = split(string, separator);
    return tokenized.len();
    local s = split(string, separator);
    return s.len();
}

FinchDon

Yeah I have that system in my server but i don't know why

when i type !deposit then nothing happen when i type /deposit it show nick money

I am using Warchief's Deposit Command
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

KAKAN

You didn't even understand what he mean
ONTOPIC: Nice work!
oh no

soulshaker

Quote from: KAKAN on Sep 07, 2015, 05:31 PMYou didn't even understand what he mean
And I too didn't even understand what he mean!! :P

KAKAN

Ahh, let me tell, Some servers have their prefix with '/' like /commands instead of !commands
So if anyone types !commands, the system will message us to use /commands, as we don't have '!' key on our prefix as we do in 0.3
oh no

MacTavish

The "!" Perfix commands could be prepare easily just put your cmds in onPlayerCommand2

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

Thijn

Quote from: Kusanagi on Sep 08, 2015, 05:31 AMThe "!" Perfix commands could be prepare easily just put your cmds in onPlayerCommand2
And then what? There's no event that will call that. So unless you make something on your onPlayerChat function, this aint gonna do much.

MacTavish

Quote from: Thijn on Sep 08, 2015, 05:55 AM
Quote from: Kusanagi on Sep 08, 2015, 05:31 AMThe "!" Perfix commands could be prepare easily just put your cmds in onPlayerCommand2
And then what? There's no event that will call that. So unless you make something on your onPlayerChat function, this aint gonna do much.

I know @Thijn but there are many newbies who are still using warcheifs so just putting cmds in command2 will work for them

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

KAKAN

Can u give me the prefix slice?
oh no

MacTavish

You can copy that thing from any 0.3 script., atm i am on phone

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

KAKAN

oh no

KAKAN

can u give me any link, I never search for sh!t in forums
oh no

MacTavish


Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

KAKAN

Thanks, But i did it in my own way using this snippet
oh no

Xmair

Stop spamming, why edit button is made than?

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD