Author Topic: Public Command with ! (VC for LU)  (Read 1396 times)

Merkel

  • Jr. Member
  • **
  • Posts: 89
  • Karma: +4/-10
    • View Profile
Public Command with ! (VC for LU)
« 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

Errors:

In the Console say: "ERROR WRONG NUMBER OF PARAMETERS"
And work! L0L
Westwood Studios

The best studios company in strategy videogames.

sasha19323

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +25/-24
    • View Profile
Re: Public Command with ! (VC for LU)
« Reply #1 on: June 13, 2013, 07:50:27 pm »
LMAO ;D
Same code is included in VCMP Squirrel Server. You've just renamed command function.
« Last Edit: June 13, 2013, 09:01:56 pm by sasha19323 »

Thijn

  • Tester
  • Sr. Member
  • ****
  • Posts: 531
  • Karma: +27/-16
    • View Profile
Re: Public Command with ! (VC for LU)
« Reply #2 on: June 14, 2013, 07:10:31 pm »
Why are you releasing something if it has errors?

sasha19323

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +25/-24
    • View Profile
Re: Public Command with ! (VC for LU)
« Reply #3 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
}

 

© Liberty Unleashed Team.