No commands work

Started by Remu, Jul 02, 2016, 03:25 PM

Previous topic - Next topic

Remu

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

Xmair

@sseebbyy is not @Stormeus, and your code seems fine to me, do you receive any error?

Credits to Boystang!

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

King

did you check whether you posted that cmd in separate line or inside a command?

Finch Real

Use this I think so Your Code has some error or might you are doing mistake
else if ( cmd == "hey" )
{
MessagePlayer( "Sup Mate" , player );
}
My Snipet Showroom

http://pastebin.com/5KKuU5cg

NicusorN5

It's just the same thing, we need the entire code...

Mötley

#5
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;

}

Remu

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


Mötley

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,..