Jump to content

veers

Members
  • Posts

    19
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by veers

  1. I got it to work. Thanks. Is there any way to force the script to wait for the promise to get the value?
  2. The folder path is: RAGEMP/server-files/node_modules/@eisengrind/v-rpc/ragemp There is no server error, but the game can't find the client callServerSync function. Do i have to copy the v-rpc/ragemp/client folder somewhere else too?
  3. I copied the @eisengrind folder into the client_packages as well but it said "vrpc.callServerSync is not a function"
  4. To return a value i need to use sync? When to use async?
  5. I got the "require" part but i don't know how to use it in script. Please write a script example.
  6. player.call("phone:callbackNumber", [number]); [] was missing!
  7. Could anyone do anything useful with createMissionTrain command? I wanted to do train traffic but i don't think that's possible with clientside.
  8. And why createMissionTrain is a client-side command, not server-side?
  9. But why works only with mp.game.invoke?
  10. My experiments: You can't use integer for speed. 3.7, 3.8, 3.9 works but 4.0 not. 4.1, 4.2 ... 4.9 works but 5.0 not etc.
  11. Still getting "is not function" error. mp.events.add("playerCommand", (command) => { const args = command.split(/[ ]+/); const commandName = args[0]; args.shift(); if (commandName === "train") { if(!mp.game.streaming.hasModelLoaded(mp.game.joaat("freight"))) mp.game.streaming.requestModel(mp.game.joaat("freight")); while(!mp.game.streaming.hasModelLoaded(mp.game.joaat("freight"))) mp.game.wait(0); if(!mp.game.streaming.hasModelLoaded(mp.game.joaat("freightcar"))) mp.game.streaming.requestModel(mp.game.joaat("freightcar")); while(!mp.game.streaming.hasModelLoaded(mp.game.joaat("freightcar"))) mp.game.wait(0); if(!mp.game.streaming.hasModelLoaded(mp.game.joaat("freightgrain"))) mp.game.streaming.requestModel(mp.game.joaat("freightgrain")); while(!mp.game.streaming.hasModelLoaded(mp.game.joaat("freightgrain"))) mp.game.wait(0); if(!mp.game.streaming.hasModelLoaded(mp.game.joaat("freightcont1"))) mp.game.streaming.requestModel(mp.game.joaat("freightcont1")); while(!mp.game.streaming.hasModelLoaded(mp.game.joaat("freightcont1"))) mp.game.wait(0); if(!mp.game.streaming.hasModelLoaded(mp.game.joaat("freightcont2"))) mp.game.streaming.requestModel(mp.game.joaat("freightcont2")); while(!mp.game.streaming.hasModelLoaded(mp.game.joaat("freightcont2"))) mp.game.wait(0); if(!mp.game.streaming.hasModelLoaded(mp.game.joaat("freighttrailer"))) mp.game.streaming.requestModel(mp.game.joaat("freighttrailer")); while(!mp.game.streaming.hasModelLoaded(mp.game.joaat("freighttrailer"))) mp.game.wait(0); const speed = 5.0; train = mp.game.vehicle.createMissionTrain(15, 2693.93408203125, 3067.782958984375, 41.46901321411133, false); mp.game.invoke('0xAA0BC91BE0B796E3', train, speed); mp.game.invoke('0x16469284DB8C62B5', train, speed); train.setTrainSpeed(speed); train.setTrainCruiseSpeed(speed); } }); I don't know what can be the problem.
  12. Type error: setTrainSpeed is not a function.
  13. But mp.events.add is client-side, mp.events.addCommand is server-side.
  14. So anyone could help with vehicle.setTrainSpeed error?
  15. Train models have to be loaded before you use the script command. mp.game.streaming.requestModel(mp.game.joaat("freight")); mp.game.streaming.requestModel(mp.game.joaat("freightcar")); mp.game.streaming.requestModel(mp.game.joaat("freightgrain")); mp.game.streaming.requestModel(mp.game.joaat("freightcont1")); mp.game.streaming.requestModel(mp.game.joaat("freightcont2")); mp.game.streaming.requestModel(mp.game.joaat("freighttrailer"));
  16. I solved the problem but there is another one. When i try to use the 'vehicle.setTrainSpeed' script command i get an error that 'vehicle.setTrainSpeed' is not a function. I do not know how to stop the train. What's the problem with that command?
  17. mp.events.add("playerCommand", (command) => { const args = command.split(/[ ]+/); const commandName = args[0]; args.shift(); if (commandName === "train") { mp.game.vehicle.createMissionTrain(15, 1838.1046142578125, 3528.820556640625, 38.384864807128906, true); } });
  18. Hi! The createMissionTrain command crashes the server. I don't know if it's my fault or the command's.
×
×
  • Create New...