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:-
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FNkVQm01.png&hash=050767ae541212d7adfe8471e5bd4d5548158979)
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();
}
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
You didn't even understand what he mean
ONTOPIC: Nice work!
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
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
The "!" Perfix commands could be prepare easily just put your cmds in onPlayerCommand2
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.
Quote from: Thijn on Sep 08, 2015, 05:55 AMQuote 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
Can u give me the prefix slice?
You can copy that thing from any 0.3 script., atm i am on phone
:P Okay
can u give me any link, I never search for sh!t in forums
warchiefs 2.0 ( 0.3 script ) (http://vcmp.liberty-unleashed.co.uk/forum/index.php?topic=1597.0)
Thanks, But i did it in my own way using this snippet
Stop spamming, why edit button is made than?
I merged them, can;t u see?
function onPlayerCommand(player, command, text)
{
if (command == "c") return onPlayerCCommand(player, split(text, ' ')[0], split(text, ' ').remove(0));
}
function onPlayerCCommand(player, command, textarray)
{
if (command == "kill") player.Health = 0;
}
Note: the last parameter of onPlayerCCommand is an array not string
Also it isn't tested
Ahh, yopu can do it through onPlayerChat XD