mp.events.add({
"default::CLIENT": () => {
let megaPed = mp.peds.new(mp.game.joaat("ig_benny"), new mp.Vector3(33.251, -1764.188, 29.313), -300, localPlayer.dimension);
let humanPed = mp.peds.new(mp.game.joaat("ig_benny"), new mp.Vector3(3637.214, 3757.952, 28.5164), -200, localPlayer.dimension);
},
"firstStage::CLIENT": () => {
colshape = mp.colshapes.newSphere(33.251, -1764.188, 29.313, 2, localPlayer.dimension);
colshape.id = 1;
},
"secondStage::CLIENT": () => {
colshape = mp.colshapes.newSphere(97.254, -1828.755, 25.945, 2, localPlayer.dimension);
colshape.id = 2;
blip = mp.blips.new(0, new mp.Vector3(97.254, -1828.755, 25.945), {
name: "Мотоцикл",
color: 60,
});
},
"thirdStage::CLIENT": () => {
colshape = mp.colshapes.newSphere(118.597, -705.733, 33.125, 2, localPlayer.dimension);
colshape.id = 3;
blip = mp.blips.new(0, new mp.Vector3(118.597, -705.733, 33.125), {
name: "Машина",
color: 60,
});
blip.setRoute(true);
},
"fourthStage::CLIENT": () => {
mp.events.callRemote("unlockVeh");
colshape.destroy();
blip.destroy();
colshape = mp.colshapes.newSphere(3637.214, 3757.952, 28.5164, 5, localPlayer.dimension);
colshape.id = 4;
blip = mp.blips.new(0, new mp.Vector3(3637.214, 3757.952, 28.5164), {
name: "Сдача машин",
color: 60,
});
blip.setRoute(true);
mp.events.call("toggleMinigameBrowser", false);
mp.events.call("unbindE");
},
playerEnterColshape: (colshape) => {
switch (colshape.id) {
case 1:
mp.events.call("toggleTextBrowser", true);
if (first) {
mp.events.call("bindBotKey");
}
first = false;
break;
case 2:
blip.destroy();
colshape.destroy();
mp.events.callRemote("thirdStage::SERVER");
mp.events.call("thirdStage::CLIENT");
break;
case 3:
mp.events.call("toggleTextBrowser", true);
mp.events.call("bindCarKey");
break;
case 4:
mp.events.callRemote("fourthStage::SERVER");
blip.destroy();
colshape.destroy();
first = true;
}
},
playerExitColshape: (colshape) => {
switch (colshape.id) {
case 1:
mp.events.call("toggleTextBrowser", false);
mp.events.call("unbindE");
break;
case 3:
mp.events.call("unbindE");
mp.events.call("toggleTextBrowser", false);
break;
}
},
});