Jump to content

Recommended Posts

Posted (edited)

What do you mean where do they get it, you either make it yourself or you pay someone to do the job for you, there isn't public resource like this for RAGEMP that I know of.

This script in total with server and clientside code has max 100 lines.

EDIT: @Xabiwas faster 😴

Edited by Kopra
fast duck
  • 2 weeks later...
  • 1 month later...
Posted

I created this script and it isn't too hard to make. I basically just check if the player is aiming at a NPC that works at the store and then start/end the robbery based on that

let pedType = ped.getVariable("pedType");
if (pedType == "storeWorker") {
    if (ped.handle == mp.game.player.getEntityIsFreeAimingAt()) {
        mp.events.callRemote("startStoreRobbery", ped);
        robbing = true;
    }
}

 

And then on the server side I create a Set per store/worker to hold all of the players robbing it. The code looks something similar to this

robbers = new Set();

mp.events.add('startStoreRobbery', (player, ped) => {
    if (ped.getVariable("pedType") != "storeWorker" || robbers.has(player)) {
        return;
    }

    robbers.add(player);
});

 

I started by making a system for only a single player to rob the store first and then extended it to multiple players

  • Mask 1

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...