Jump to content

Create variables at server start for every vehicle


Freamee

Recommended Posts

Hi.

I want to create temporary variables on every vehicle at server start.

Id make use of it as temporary trunks or i dont know.


But i can not figure out, how to call the variables or even set it.

global.KocsiCsomagtartok = function()
{
  mp.vehicles.forEach((vehicleid=> {
    vid = vehicle.id;
    vehicle.setVariable("Material"0);
    console.log(`Kocsi ideiglenes csomagtartok lekrealva ${vid}`);
  });
}
 
mp.events.addCommand("kocsi", (player=> {
 
  let id = KozeliKocsi(player5);
  if(id == nullreturn player.pushChat("Nincs a közeledben!");
 
  player.call("csomagtarto", [id]);
 
  let matik = vehicle[id].getVariable('Material');
  let marik = vehicle[id].getVariable('Marihuana');
 
  player.pushChat(`Material: ${matik}`);
  player.pushChat(`Marihuana: ${marik}`);
});
KocsiCsomagtartok();
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...