Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Take care of your mental health. Sometimes you just need a strong break.

Stuyk Stuyk

💭
Take care of your mental health. Sometimes you just need a strong break.
View GitHub Profile
View gist:753d88065717715cfb32d6e9eb61c8fc
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 Mar 18, 2019
RAGE:MP C# Tutorials - 22 -> 23
View gist:00e1cd450929f39fba888f3ae0cc1a69
[Command("inventory")]
public void CMD_Inventory(Client client)
{
PlayerStats pStats = PlayerHelper.GetPlayerStats(client);
if (pStats == null)
return;
List<Item> items = pStats.GetItems();
@Stuyk
Stuyk / gist:2ed612997088854125945eb570b47c0d
Last active Apr 11, 2019
Get By Collection / Selection Collection
View gist:2ed612997088854125945eb570b47c0d
/// <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 Apr 16, 2019
SyncHelper.cs (Clientside) <-> ObjectSync.cs (Serverside)
View ObjectSync.cs
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 Apr 30, 2019
Not complete that's for sure.
View MenuBuilder
/* 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
Small update to screen res so it supports mouse inconsistencies and such.
View RealScreenRes
using RAGE;
using System;
using System.Collections.Generic;
using System.Text;
namespace CoffeeVClient.Utility
{
public struct Vector2
{
public int X { get; set; }
@Stuyk
Stuyk / Meta.xml
Created Apr 8, 2019
Websocket.cs is what you use in your resource. The rest are how to load StuykSocket.dll as a resource.
View Meta.xml
<meta>
<info name="StuykSocket" author="Stuyk" type="script" />
<script src="StuykSocket.dll"/>
<export class="StuykSocket" event="onSocketMessageRecieved" />
</meta>
View commands.mjs
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: '',
View events.mjs
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) => {
View gist:f4588e8f98f20f13a330660a4f8c9d42
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;
}