Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Remu on Jul 02, 2016, 03:25 PM

Title: No commands work
Post by: Remu on Jul 02, 2016, 03:25 PM
I recently downloaded a blank server for VC:MP. There was already heal, goto bring cmd Functions

I added the following there after those if s on OnPlayerCommands(player, cmd, text)
else if(cmd == "hello")
{
     MessagePlayer(" Hello", player);
}
Screenshots : ------>http://imgur.com/a/0nBis vist the5re. Two screenshots
In the game If i do /hello it doesn't works but /heal works

Note: I downloaded Blank Server made by Stormeus (Seby)

Main.nut - the File I edited
Title: Re: No commands work
Post by: Xmair on Jul 02, 2016, 04:10 PM
@sseebbyy is not @Stormeus, and your code seems fine to me, do you receive any error?
Title: Re: No commands work
Post by: King on Jul 02, 2016, 04:49 PM
did you check whether you posted that cmd in separate line or inside a command?
Title: Re: No commands work
Post by: Finch Real on Jul 02, 2016, 05:08 PM
Use this I think so Your Code has some error or might you are doing mistake
else if ( cmd == "hey" )
{
MessagePlayer( "Sup Mate" , player );
}
Title: Re: No commands work
Post by: NicusorN5 on Jul 02, 2016, 05:45 PM
It's just the same thing, we need the entire code...
Title: Re: No commands work
Post by: Mötley on Jul 02, 2016, 08:48 PM
function UnknownCommand(player) {

   MessagePlayer( "[#ffffff]Unknown command! Type /cmds", player);
}

function onPlayerCommand(player, cmd, text) {
 
  if (cmd == "hello") {
    MessagePlayer( "[#ffffff]Hello there player[#ff80ff]!!!!!", player);
    return true;
  }
 
  if (cmd =="cmds") {
    MessagePlayer( "[#8000ff][Commands]", player);
    MessagePlayer( "[#ffffff]/hello", player);
    return true;
  }

 
  UnknownCommand(player);

  return false;

}
Title: Re: No commands work
Post by: Remu on Jul 03, 2016, 02:38 AM
I think I did something wrong in main.nut. When I opened server32.exe. I watched Console:

WARNING: Failed TO Load Main.nut.


So I again downloaded blank server and copied the main.nut to my server folder. replaced it Now If I put a command, It works.

BTW Thanks for helping me.


Solved

But I want a list of all Player.Functions()

All the functions and Variables like PLayer.cash, player.spawn() like that.

Please Give ME the list of all

Title: Re: No commands work
Post by: Mötley on Jul 03, 2016, 02:55 AM
http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions

That's a jump to majority of the functions, I wish I could just simply paste or write these functions.

Please make sure to have valid scripting during your quest, I do not know what you know in general. But don;t feel dumb if you have a method of scripting you want improved, The method I used in my command above is what I prefer. It's always best to ensure what your doing is proper scripting or you could have a laggy server to who knows,..