Skip to content

Instantly share code, notes, and snippets.

@Y-Less
Y-Less / modelsizes.inc
Last active December 11, 2015 04:09
Collision information for all the objects in the game.
This file has been truncated, but you can view the full file.
/*
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
@Y-Less
Y-Less / foreach.inc
Last active August 29, 2015 13:56
New version of "foreach.inc" - currently incomplete. At this point I'm just cleaning up the code quite a lot, then I've got a load of ideas for features to implement.
/**--------------------------------------------------------------------------**\
===========================
foreach efficient looping
===========================
Description:
Provides efficient looping through sparse data sets, such as connected
players. Significantly improved from the original version to be a generic
loop system, rather then purely a player loop system. When used for
players this has constant time O(n) for number of connected players (n),
unlike standard player loops which are O(MAX_PLAYERS), regardless of the
@Y-Less
Y-Less / gist:2cb79a656f6dc8c95e58
Created March 25, 2015 22:22
"foreach" syntax test
Test:y_iter_Syntax1()
{
new
Iterator:Test1_y_tter<100>;
Iter_Add(Test1_y_tter, 11);
Iter_Add(Test1_y_tter, 12);
Iter_Add(Test1_y_tter, 13);
Iter_Add(Test1_y_tter, 16);
Iter_Add(Test1_y_tter, 19);
@Y-Less
Y-Less / gtadef.inc
Created March 26, 2015 17:18
All GTA vehicle and SAMP player colours.
/**--------------------------------------------------------------------------**\
==========================
y_colours - X11 colours!
==========================
Description:
This holds the colour information that used to be part of the text system
but which is far more useful than just for text. This now supports the full
set of X11 colours, both by name and by definition. You can also define
your own if you so choose (up to 32 - should be enough given that this
includes the X11 colours).
@Y-Less
Y-Less / test.bat
Last active October 24, 2017 08:04
Run YSI tests with a load of compiler settings.
@echo off
set MODE=YSI_TEST
set TARGET=
set COMPILER=
:get_args
if "%~1"=="" goto :args_got
if /I "%~1"=="-m" set MODE=%~2& shift
if /I "%~1"=="--mode" set MODE=%~2& shift
@Y-Less
Y-Less / SPAWN_TEST.bat
Last active October 24, 2017 08:02
Spawn a single compile and run.
@echo off
set MODE=%~1
set TARGET=%~2
set FLAGS=%~3
set NAME=%MODE%%TARGET%
call :setup
call :build
@Y-Less
Y-Less / cs.bat
Last active June 8, 2016 23:36
Compiler switch (now works with just original).
@echo OFF
rem Get the target compiler - defaults to just swapping with no parameter
if "%1"=="" (
if exist "oldpawncc.exe" (
set TO="old"
) else (
set TO="new"
)
) else (
@Y-Less
Y-Less / YSI_TEST.pwn
Created April 11, 2015 17:37
YSI test script.
#if !defined _DEBUG
#define _DEBUG -1
#endif
#define FIXES_Single 0
#tryinclude "..\compile_flags.txt"
#if !defined COMPILE_FLAGS
#define COMPILE_FLAGS "Pawno"
#endif
@Y-Less
Y-Less / botsync.inc
Created April 12, 2015 15:44
Botsync updated for new foreach versions.
/*----------------------------------------------------------------------------*-
==========================
NPC script communication
==========================
Description:
This code provides a system to communicate with bots via files. It uses
locks to ensure only one script may communicate at once - bots and the main
server run in separate processes so it is possible to read and write from
the files at the same time if locks are not used.
@Y-Less
Y-Less / MenuDSL.pwn
Created July 31, 2015 16:48
SA:MP Menu DSL core
// This bit isn't important.
enum MENU_ITEM_DATA
{
bool:MENU_ITEM_TITLE,
bool:MENU_ITEM_DISABLED,
MENU_ITEM_DATA_TEXT[32],
MENU_ITEM_CHILD,
MENU_ITEM_PARENT,
MENU_ITEM_SIBLING
// All your other menu item data.