Liberty Unleashed

Scripting => Script Releases => Topic started by: Merkel on June 13, 2013, 07:04:10 pm

Title: Public Command with ! (VC for LU)
Post by: Merkel on June 13, 2013, 07:04:10 pm
Public Commands with ! from Vice City Multiplayer

I like VCMP and I created a script with ! for Fans of Vice city (xD)

Download:

http://adf.ly/QTU9i (http://adf.ly/QTU9i)

Errors:

In the Console say: "ERROR WRONG NUMBER OF PARAMETERS"
And work! L0L
Title: Re: Public Command with ! (VC for LU)
Post by: sasha19323 on June 13, 2013, 07:50:27 pm
LMAO ;D
Same code is included in VCMP Squirrel Server. You've just renamed command function.
Title: Re: Public Command with ! (VC for LU)
Post by: Thijn on June 14, 2013, 07:10:31 pm
Why are you releasing something if it has errors?
Title: Re: Public Command with ! (VC for LU)
Post by: sasha19323 on June 14, 2013, 08:24:41 pm
For cmds with ! use this:
Code: [Select]
function onPlayerChat( player, text )
{
local backupText = text;
local firstChar = backupText.slice( 0, 1 );
if (  firstChar == "!" )
{
// The following function makes any ! commands go to the OnPlayerCommand handler
local splittext = text.slice( 1 );
local params = split( splittext, " " );
if ( params.len() == 1 ) onPlayerCommand( player, params[ 0 ], "" );
else
{
splittext = splittext.slice( splittext.find( " " ) + 1 );
onPlayerCommand( player, params[ 0 ], splittext );
}
}
}
function onPlayerCommand(player, cmd, text)
{
// Your cmds here
}