Skip to content

Instantly share code, notes, and snippets.

View d0p3t's full-sized avatar
❤️
be nice

Remco d0p3t

❤️
be nice
View GitHub Profile
@d0p3t
d0p3t / server.config.js
Created March 10, 2020 09:25
Using mongoose with FiveM
const webpack = require("webpack");
const Q3Rcon = require("quake3-rcon");
const config = require("./.local.json");
const rcon = new Q3Rcon({
address: config.ip || "127.0.0.1",
port: config.port || 30120,
password: config.password
});
const compiler = webpack({
-- Client side events that are abused with TriggerEvent
local ForbiddenClientEvents = {
"ambulancier:selfRespawn",
"bank:transfer",
"esx_ambulancejob:revive",
"esx-qalle-jail:openJailMenu",
"esx_jailer:wysylandoo",
"esx_policejob:getarrested",
"esx_society:openBossMenu",
"esx:spawnVehicle",
local lastDied = os.time()
local maxLastDiedAllowed = 300 -- 5 minutes
AddEventHandler(
"gameEventTriggered",
function(eventName, data)
if eventName ~= "CEventNetworkEntityDamage" then
return
end
local victim = data[1]
import UserManager from '../classes/managers/userManager';
import { Ban } from '../models';
const utils = require('../utils');
on('playerConnecting', (playerName: string, setKickReason: any, deferrals: any) => {
const netId = (global as any).source;
@d0p3t
d0p3t / letsencrypt_2018.md
Created February 5, 2019 10:47 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@d0p3t
d0p3t / Display.cs
Last active October 5, 2018 20:15
Snippet of PLAYER_SWITCH translated to C# from https://gist.github.com/speedium666/a8b81fd6d9039fb8a191d8d0bb8c7388
public static async Task StartSwitch(Vector4 fromWh, Vector4 toWh, int model)
{
try
{
var from = new Vector3(fromWh.X, fromWh.Y, fromWh.Z);
var to = new Vector3(toWh.X, toWh.Y, toWh.Z);
var playerPed = Game.PlayerPed;
var switchModel = new Model(model);
var switchType = GetIdealPlayerSwitchType(from.X, from.Y, from.Z, to.X, to.Y, to.Z);
var switchFlag = 1024;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CitizenFX.Core;
using CitizenFX.Core.Native;
@d0p3t
d0p3t / game_agent.py
Created October 4, 2017 23:43
Version 1 DDQN Cloney
# =============================
# -----------DQN TODO ---------
# =============================
def setup_play_ddqn(self):
self.plugin_path = offshoot.config["file_paths"]["plugins"]
context_classifier_path = f"{self.plugin_path}/SerpentCloneyGameAgentPlugin/files/ml_models/cloney_context_classifier.model"
context_classifier = CNNInceptionV3ContextClassifier(input_shape=(288, 512, 3))
context_classifier.prepare_generators()
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
DQN Setup Steps Cloney
1. init dqn in setup_play()
2. ?????? enter_train_mode() (WHAT IS DIFFERENCE BETWEEN RUN OBSERVER TRAIN)
3. next_step()?????????
4. build_frame_stack() and then / or update_frame_stack()??
5. pick_action(RANDOM or PREDICTED at % 20) how to format action mapping
6. now observe = next_step()?????
7. append_to_replay_memory() how to use reward parameter????
8. calculate_target_error() how to use observation parameter from previous step???