Skip to content

Instantly share code, notes, and snippets.

@DemmyDemon
DemmyDemon / mark.pl
Created May 17, 2013 21:06
Just a little irssi script to add a marker line to the chat.
#!/usr/bin/perl
use strict;
use warnings;
use Irssi;
our $VERSION = 0.1;
our %IRSSI = (
authors => 'Fredrik "Demonen" Vold',
contact => 'fredrik@webkonsept.com',
name => 'mark',
@DemmyDemon
DemmyDemon / perlcore.pl
Created October 28, 2013 14:48
Just a quick way to check if a module is in Perl's core
#!/usr/bin/perl
use warnings;
use strict;
use Module::CoreList;
die "Heh, specify a module?\n" unless @ARGV;
foreach my $module (@ARGV){
my @modules = Module::CoreList->find_modules($module);
if (@modules){
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>KonseptBooks</artifactId>
<groupId>KonseptCraft</groupId>
<version>0.7-SNAPSHOT</version>
@DemmyDemon
DemmyDemon / pGetAimedLocation.lua
Created January 28, 2018 15:33
Slightly wrong vector math. WTF.
function pGetAimedLocation(range)
range = range or 100
local playerPed = PlayerPedId()
local location = GetEntityCoords(playerPed,true)
local rot = GetGameplayCamRot(0)
local pitch = math.rad(rot.x)
local roll = rot.y -- We can ignore this one, as it has no bearing on the final location
local yaw = math.rad(rot.z)
@DemmyDemon
DemmyDemon / sv.lua
Created April 26, 2018 07:58
Swedish translation of ESX Real Estate Agent Job
Locales['en'] = {
['properties'] = 'properties',
['property'] = 'property',
['clients'] = 'clients',
['remove_comp_money'] = 'remove company money',
['dep_money'] = 'deposit money',
['wash_money'] = 'wash money',
['realtor'] = 'real Estate Agent',
['amount_withdraw'] = 'amount of withdrawal',
['invalid_amount'] = 'invalid amount',
@DemmyDemon
DemmyDemon / pTeleport.lua
Last active March 30, 2019 14:15
pTeleport2d
function pTeleport2d(x,y,heading)
x = x + 0.0
y = y + 0.0
heading = heading or 0.0
heading = heading + 0.0
local camHeading = GetGameplayCamRelativeHeading()
local camPitch = GetGameplayCamRelativePitch()
DoScreenFadeOut(500)
function pGetInput(title,maxLength,defaultText,callback,mustMatch)
Citizen.CreateThread(function()
DisplayOnscreenKeyboard(
0, -- Input type
title, -- Window title
"P2", -- Unknown?
defaultText, -- Default text
"",
"",
"",
local known = {
CEventNetworkEntityDamage = {[1] = 'target entity',[2] = 'source entity',[4] = 'fatal damage', [5] = 'weapon used'},
CEventNetworkVehicleUndrivable = {},
}
AddEventHandler('gameEventTriggered',function(name,args)
local me = PlayerId()
local myPed = PlayerPedId()
local myVehicle = GetVehiclePedIsIn(myPed)
if known[name] then
if IsDuplicityVersion() then
local PICKUP_ID = math.abs(GetHashKey(GetCurrentResourceName())+math.random(-15000,15000))
local PICKUP_CALLBACKS = {}
function pRegisterPickup(player,x,y,z,modelHash,callback)
TriggerClientEvent(GetCurrentResourceName()..':make-registered-pickup',player,x,y,z,PICKUP_ID,modelHash)
log(type(callback),'stored as',PICKUP_ID)
PICKUP_CALLBACKS[PICKUP_ID] = callback
PICKUP_ID = PICKUP_ID + 1
end
function findFlatbed(heap)
local list = {}
heap.playerLocation = GetEntityCoords(heap.playerPed)
local found,vehicle,distance,vehicleLocation = pGetClosestVehicleToPed(heap.playerPed,5)
if found and distance <= config.interactRange then
for i,model in ipairs(config.flatbeds) do
if IsVehicleModel(vehicle,model) then
if GetVehicleNumberOfPassengers(vehicle) == 0 and IsVehicleSeatFree(vehicle,-1) then