Skip to content

Instantly share code, notes, and snippets.

@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; }
@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 / 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 / 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 / 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: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 / 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;