JS Server Fake Pickups 1.0.0

NozmaD

Администратор
Команда форума
Администратор
Сообщения
164
Баллы
208
1596204173889.png

Этот ресурс добавляет возможность создавать классические пикапы в стиле GTA, которые мы все любим.

Видео:

Требуется RAGE Multiplayer 1.1.0 и выше.

Установка:

Поместите загруженные файлы в соответствующие места
Добавить require('fake-pickups') в client_packages/index.js

Скачать:

Пожалуйста, Войдите или Зарегистрируйтесь, что бы увидеть скрытый контент.


Пример скрипта:
C-подобный:
// setLightData calls are optional and you don't have to use them, just makes the pickups stand out at night time.
const moneyPickup = mp.fakePickups.new("ex_prop_exec_cashpile", new mp.Vector3(1571.681, 3163.909, 40.331), 1.0, 5000);
moneyPickup.setLightData(114, 204, 114, 2.0, 2.5, 15.0);

const healthPickup = mp.fakePickups.new("prop_ld_health_pack", new mp.Vector3(1568.648, 3166.397, 40.331), 1.0, 5000);
healthPickup.setLightData(53, 154, 71, 2.0, 2.5, 15.0);

const armorPickup = mp.fakePickups.new("prop_armour_pickup", new mp.Vector3(1567.359, 3169.639, 40.331), 1.0, 5000);
armorPickup.setLightData(93, 182, 229, 2.0, 2.5, 15.0);

const weaponPickup = mp.fakePickups.new("w_mg_combatmg", new mp.Vector3(1569.465, 3172.773, 40.331), 1.0, 5000);
weaponPickup.setLightData(255, 133, 85, 2.0, 2.5, 15.0);

// You're better off using custom properties with your pickup instance, this code is for testing purposes.
mp.events.add("playerCollectFakePickup", (player, pickup, cancel) => {
    if (pickup === moneyPickup) {
        player.outputChatBox("You picked up some money.");
    } else if (pickup === healthPickup) {
        if (player.health >= 75) {
            player.outputChatBox("You're just fine, no need to waste a health pack.");
      
            // Doing cancel.cancel = true; prevents the pickup from being marked as collected.
            cancel.cancel = true;
            return;
        }

        player.health = 100;
        player.outputChatBox("Health refilled.");
    } else if (pickup === armorPickup) {
        if (player.armour > 0) {
            player.outputChatBox("You already have armor.");
      
            // Doing cancel.cancel = true; prevents the pickup from being marked as collected.
            cancel.cancel = true;
            return;
        }

        player.armour = 100;
        player.outputChatBox("You picked up some armor.");
    } else if (pickup === weaponPickup) {
        player.giveWeapon(mp.joaat("weapon_combatmg"), 9999);
        player.outputChatBox("You picked up Combat MG.");
    }
});

mp.events.add("fakePickupSpawn", (pickup) => {
    switch (pickup.model) {
        case mp.joaat("ex_prop_exec_cashpile"):
            mp.players.broadcast("The money pickup has respawned.");
        break;

        case mp.joaat("prop_ld_health_pack"):
            mp.players.broadcast("The health pickup has respawned.");
        break;

        case mp.joaat("prop_armour_pickup"):
            mp.players.broadcast("The body armor pickup has respawned.");
        break;

        case mp.joaat("w_mg_combatmg"):
            mp.players.broadcast("The Combat MG pickup has respawned.");
        break;
    }
});
 
Автор
rootcause
Верх