Hey guys.
Problem with "setTimeout"... When i using only while(true), it's working OK or when i using only setTimerout(); it's working OK , too. BUT! When i using setTimeout and while , together.. it's not working. How I should do script, for Timer int while()? sorry for my English.
mp.events.add("playerEnterColshape", (player, shape) => {
if(shape == CarrierShape){
player.notify('You started downloading cargo-box. ');
vehicle.colshape = true;
while(true){ // it's check vehicle on colshape
setTimeout(() => {
vehicle.width += 10;
player.call('cargoveh',[vehicle.width]);
player.vehicle.setVariable('width',vehicle.width);
player.outputChatBox('Downloading : ' + player.vehicle.getVariable('width'));
if(vehicle.width >= 500) break;
},1000);
}
}
});