Jump to content

Not working simple code


0xNull

Recommended Posts

Hello, i am writing simple code, with the spawned the car after the player joined to the server. Why he dont work?

Code:

let spawnPoints = require('./spawn_points.json').SpawnPoints;

mp.events.add('playerDeath', (player) => {
    player.spawn(spawnPoints[Math.floor(Math.random() * spawnPoints.length)]);
    player.health = 100;
});
mp.events.add('playerJoin', (player, _, vehName) =>{
    player.spawn(spawnPoints[Math.floor(Math.random() * spawnPoints.length)]);
    player.outputChatBox(`You joined!`);
    player.customData = {};
    let pos = player.position;
    pos.x += 2;
    player.customData.vehicle = mp.vehicles.new(mp.joaat(t20), pos);
  });
mp.events.add('playerChat', (player, message) => {
    mp.players.broadcast(`${player.name}[ID ${player.id}]: ${message}`);
});
 

Error:

ReferenceError: t20 is not defined
    player.customData.vehicle = mp.vehicles.new(mp.joaat(t20), pos);

 

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