Skip to content

Instantly share code, notes, and snippets.

@Stuyk
Stuyk / gist:753d88065717715cfb32d6e9eb61c8fc
Created March 16, 2019 22:25
Dynamic Jobs - Video 19 - 21
namespace Main
{
public class Main : Events.Script
{
public static MarkerInstance NextObjective { get; set; } = null;
public static float Player_Money { get; set; } = 0;
public static int ResX = 0;
public static int ResY = 0;
public static int tick = 0;
@Stuyk
Stuyk / gist:00e1cd450929f39fba888f3ae0cc1a69
Created March 18, 2019 13:02
RAGE:MP C# Tutorials - 22 -> 23
[Command("inventory")]
public void CMD_Inventory(Client client)
{
PlayerStats pStats = PlayerHelper.GetPlayerStats(client);
if (pStats == null)
return;
List<Item> items = pStats.GetItems();
@Stuyk
Stuyk / Meta.xml
Created April 8, 2019 12:47
Websocket.cs is what you use in your resource. The rest are how to load StuykSocket.dll as a resource.
<meta>
<info name="StuykSocket" author="Stuyk" type="script" />
<script src="StuykSocket.dll"/>
<export class="StuykSocket" event="onSocketMessageRecieved" />
</meta>
@Stuyk
Stuyk / gist:2ed612997088854125945eb570b47c0d
Last active April 11, 2019 15:32
Get By Collection / Selection Collection
/// <summary>
/// Get an entire collection by Type.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public static List<T> GetCollection<T>()
{
try
{
using (var db = new LiteDatabase($"{DatabaseHelper.DatabasePath}/Database.db"))
@Stuyk
Stuyk / ObjectSync.cs
Created April 16, 2019 16:46
SyncHelper.cs (Clientside) <-> ObjectSync.cs (Serverside)
using System;
using System.Collections.Generic;
using System.Text;
using GTANetworkAPI;
namespace WhateverYouWant.ServerClientEvents
{
public class ObjectSync : Script
{
[RemoteEvent("UpdateObjects")]
@Stuyk
Stuyk / MenuBuilder
Last active April 30, 2019 19:54
Not complete that's for sure.
/* Created by STUYK.
* Easily allows the creation of Menus in a grid space.
* With various components including InputBoxes and Draggables.
* Components are easy to write and are inherited easily.
*/
using RAGE;
using RageFont = RAGE.Game.Font;
using Ui = RAGE.Game.Ui;
using System;
@Stuyk
Stuyk / RealScreenRes
Created May 15, 2019 18:28
Small update to screen res so it supports mouse inconsistencies and such.
using RAGE;
using System;
using System.Collections.Generic;
using System.Text;
namespace CoffeeVClient.Utility
{
public struct Vector2
{
public int X { get; set; }
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: '',
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) => {
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;
}