Jump to content

keker code /veh not working


Recommended Posts

Hello. I use keker code. First call /veh vehicle is created and work. When i use command again destroy is called, but vehicle stay and new vehicle not spawned. No errors in console. I dont know what happend. I have not edited the code.

  "veh": (player, args) =>
        if(player.admin < 6) return player.outputChatBox("<span style='color:#ff2d00'>(!) Nu esti administrator!");
        if (typeof args[0] == 'undefined') return player.outputChatBox("<b style='color:#999'>(Syntax)</b> /veh [name]");
        if(!args[0].length) return player.outputChatBox("<b style='color:#999'>(Syntax)</b> /veh [name]");
		var pos = player.position;
		pos.x += 2.0;
		if(player.veh) {
		} else {

		player.veh = mp.vehicles.new(mp.joaat(args[0]), pos);
		player.veh.dimension = player.dimension;

        player.outputChatBox("You've spawn a " + args[0]);


Link to comment
Share on other sites

Use this:

	if(player.admin>=6&&typeof arg1!='undefined') {
      player.outputChatBox('You\'ve spawn a '+arg1);


Oh, yeah! Error was happend because player.veh only for read!

Use other variable.

Edited by kostya_nad
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...