Skip to content

Instantly share code, notes, and snippets.

import * as alt from 'alt';
import * as path from 'path';
import cors from 'cors';
import http from 'http';
import express from 'express';
import chalk from 'chalk';
import request from 'request';
import { userIsVerified } from '../discord/bot';
const htmlPath = path.join(alt.getResourcePath('life'), 'server/express/html');
@Stuyk
Stuyk / gist:eaf4c9aa908d069c74a8ee24b36a55e8
Created March 23, 2020 16:34
Shooting Range Job Framework
import * as alt from 'alt';
import { Interaction } from '../systems/interaction.js';
import { Job, Objectives, ObjectiveFlags } from '../systems/job.js';
import { PedStream } from '../systems/pedstream.js';
import { distance } from '../utility/vector.js';
import { addXP } from '../systems/skills.js';
import { shuffle } from '../utility/array.js';
let bestTime = null;
let bestTimeOwner = null;
# Thanks to CodeWalker for the code to read .ypt files: https://github.com/dexyfex/CodeWalker
#
# Format:
# [asset_name]
# effect_name_1
# effect_name_2
#
[core]
bul_gravel_heli
@Stuyk
Stuyk / _manifest.ymf
Created March 12, 2020 17:08
Template Files for MLOs created by Breze & Tarkayne
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<CPackFileMetaData>
<MapDataGroups/>
<HDTxdBindingArray/>
<imapDependencies/>
<imapDependencies_2>
<Item>
<imapName>YMAP_NAME</imapName>
<manifestFlags>INTERIOR_DATA</manifestFlags>
<itypDepArray>
<?xml version="1.0" encoding="UTF-8"?>
<CDataFileMgr__ContentsOfDataFileXml>
<disabledFiles />
<includedXmlFiles />
<includedDataFiles />
<dataFiles>
<Item>
<filename>dlc_stuyk:/objects.rpf</filename>
<fileType>RPF_FILE</fileType>
<overlay value="false" />
AP1_01_B_IntRefRange
AP1_01_C_NoFog
AirRaceBoost01
AirRaceBoost02
AmbientPUSH
ArenaEMP
ArenaEMP_Blend
ArenaWheelPurple01
ArenaWheelPurple02
Bank_HLWD
@Stuyk
Stuyk / database.js
Last active April 9, 2020 00:21
MongoDB Wrapper for alt:V
import * as alt from 'alt';
import mongodb from 'mongodb';
import config from './configuration.json';
const MongoClient = mongodb.MongoClient;
const ObjectID = mongodb.ObjectID;
let instance;
export default class ConnectionInfo {
/**
const letters = '12345abcdefghijklmnopqrstuvwxyz';
function randomName(length) {
let newName = '';
for (let i = 0; i < length; i++) {
let number = Math.floor(Math.random() * letters.length - 2) + 2;
newName += letters[number];
}
return newName;
}
import * as alt from 'alt';
import * as chat from 'chat';
import * as mongov from 'mongo-v';
console.log('=> Started Events');
const spawnLoc = {x: -1136.07, y: -3044.18, z: 14.1};
const loggedInPlayers = [];
alt.on('playerConnect', (player) => {
import * as alt from 'alt';
import * as chat from 'chat';
import * as mongov from 'mongo-v';
console.log('=> Started Commands');
// Example of data being created for reference
/*
var exampleData = {
username: '',