Skip to content

Instantly share code, notes, and snippets.

@SDraw
SDraw / MirrorUtils.cs
Last active August 2, 2024 20:07
Simple utility class to mirror Unity's transforms along global planes
using UnityEngine;
public static class MirrorUtils
{
public enum MirrorPlane
{
OXY = 0,
OXZ,
OYZ
}
<?xml version="1.0"?>
<!DOCTYPE binary_file_format SYSTEM "BinaryFileFormat.dtd">
<binary_file_format name="RAFv2" type_name="" comment="" expr="" default_byte_order="little" default_read_only="false" default_char_set="ansi" web_site="https://github.com/SDraw/run-on-coal/wiki/RAF-structure">
<data type="int" name="FPS" format="unsigned" len="4" display=""/><data type="int" name="Duration" format="unsigned" len="4" display=""/>
<data type="int" name="BonesCount" format="unsigned" len="4" display=""/><for name="Bone" count="BonesCount" stop_test="" type_name="" comment=""><struct name="" type_name="" comment="" expr=""><data type="int" name="KeyframeCount" format="unsigned" len="4" display=""/><for name="Keyframe" count="KeyframeCount" stop_test="" type_name="" comment=""><struct name="" type_name="" comment="" expr=""><struct name="Position" type_name="" comment="" expr=""><data type="real" name="X" format="ieee" len="4" display=""/><data type="real" name="Y" format="ieee" len="4" display=""/><data type="rea
<?xml version="1.0"?>
<!DOCTYPE binary_file_format SYSTEM "BinaryFileFormat.dtd">
<binary_file_format name="RMFv3" type_name="" comment="" expr="" default_byte_order="little" default_read_only="false" default_char_set="ansi" web_site="https://github.com/SDraw/run-on-coal/wiki/RMF-structure">
<data type="string" name="Header" len="3" format="default" display=""/>
<data type="int" name="Type" format="signed" byte_order="little" len="1" display=""/><data type="real" name="GeometrySphereRadius" format="ieee" len="4" display=""/><data type="int" name="MaterialCount" format="unsigned" len="4" display=""/><for name="Material" count="MaterialCount" stop_test="" type_name="" comment=""><struct name="" type_name="" comment="" expr=""><data type="int" name="MaterialType" format="unsigned" len="1" display=""/><struct name="MaterialParams" type_name="" comment="" expr=""><data type="real" name="Param1" format="ieee" len="4" display=""/><data type="real" name="Param2" format="ieee" len="4" display=""/><data type="real" n
@SDraw
SDraw / photo.py
Last active February 12, 2018 16:06 — forked from knowuh/photo.py
#----------------------------------------------------------
# File photo.py - cubify a named image in project.
# @knowuh (Noah Paessel) http://bit.ly/photoblend
# License: MIT ( http://opensource.org/licenses/MIT )
#----------------------------------------------------------
import bpy
from random import uniform
@SDraw
SDraw / gist:7964730
Last active December 31, 2015 09:09
[MTA] L\R level
local handl = nil
local sx,_ = guiGetScreenSize()
local colors = { tocolor(255,0,0),tocolor(0,255,0) }
function clientRenderFunc()
if(handl) then
local ls,rs = getSoundLevelData(handl)
if(ls ~= false) then
dxDrawRectangle(sx/2-10,0,10,128*(ls/32768),colors[1])
dxDrawRectangle(sx/2+10,0,10,128*(rs/32768),colors[2])
@SDraw
SDraw / gist:7964716
Last active December 31, 2015 09:09
[MTA] Waveform
local handl = nil
local sx,_ = guiGetScreenSize()
local colors = { tocolor(255,0,0),tocolor(0,255,0) }
function clientRenderFunc()
if(handl) then
dxDrawRectangle(sx/2,0,1,256,tocolor(255,255,255,127))
local bt = getSoundWaveData(handl,512)
if(not bt) then return end
for i=1,127 do
@SDraw
SDraw / gist:7964711
Last active December 31, 2015 09:09
[MTA] FFT
local handl = nil
local sx,_ = guiGetScreenSize()
local colors = { tocolor(255,0,0),tocolor(0,255,0) }
function clientRenderFunc()
if(handl) then
dxDrawRectangle(sx/2,0,1,256,tocolor(255,255,255,127))
local bt = getSoundFFTData(handl,2048,257)
if(not bt) then return end
for i=1,256 do
@SDraw
SDraw / 3dspd.pwn
Last active July 4, 2019 19:46
3D speedometer for SA-MP. Similar to JC2MP speedometer, but without rotation.
#define FILTERSCRIPT
#include <a_samp>
#include <streamer>
new SpdObj[MAX_PLAYERS][2];
new bool:UpdateSpeed[MAX_PLAYERS] = {false,...};
public OnPlayerConnect(playerid)
{
UpdateSpeed[playerid] = false;
@SDraw
SDraw / Dialog Chat
Last active December 19, 2015 00:09
Chat in dialog Idea: Folleah Code: SDraw
#define FILTERSCRIPT
#include <a_samp>
#undef MAX_PLAYERS
#define MAX_PLAYERS (10)
#define FOREACH_NO_BOTS
#include <foreach>
#define LIST (10)
#define INBOX (11)
new Iterator:InChat<MAX_PLAYERS>;
new Lines[10][128] = {"\n","\n","\n","\n","\n","\n","\n","\n","\n","\n"};
@SDraw
SDraw / Weapon Fun
Last active December 18, 2015 15:19
Fun with Desert Eagle :3
#define FILTERSCRIPT
#include <a_samp>
forward Fly(playerid,Float:f);
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
if(newkeys&KEY_FIRE || newkeys&KEY_FIRE && newkeys&KEY_HANDBRAKE)
{
if(GetPlayerWeapon(playerid) == 24)