Skip to content

Instantly share code, notes, and snippets.

View ziggi's full-sized avatar
🏠
Working from home

Sergei Marochkin ziggi

🏠
Working from home
View GitHub Profile
@ziggi
ziggi / pawn.tmLanguage.json
Created September 27, 2026 12:06
pawn.tmLanguage.json
{
"comment": "\n\t\t\thttps://github.com/abusalimov/SublimeCImproved\n\n\t\t\tDerived from C.tmLanguage - the original TextMate and Sublime Text\n\t\t\tsyntax definition.\n\n\t\t\tThe MIT License (MIT)\n\n\t\t\tCopyright (c) 2013-2014 Eldar Abusalimov\n\t\t\tModified for the Pawn Language by Sergei Marochkin 2016\n\n\t\t\tPermission is hereby granted, free of charge, to any person obtaining a copy of\n\t\t\tthis software and associated documentation files (the \"Software\"), to deal in\n\t\t\tthe Software without restriction, including without limitation the rights to\n\t\t\tuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n\t\t\tthe Software, and to permit persons to whom the Software is furnished to do so,\n\t\t\tsubject to the following conditions:\n\n\t\t\tThe above copyright notice and this permission notice shall be included in all\n\t\t\tcopies or substantial portions of the Software.\n\n\t\t\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
@ziggi
ziggi / dcpu16.tmLanguage.json
Last active September 27, 2026 11:41
dcpu16.tmLanguage.json
{
"name": "dcpu16",
"scopeName": "source.assembly.dcpu16",
"fileTypes": [
"dasm",
"dasm16",
"dcpu16"
],
"patterns": [
{
@ziggi
ziggi / pawn.sublime-syntax
Last active November 3, 2025 17:56
pawn.sublime-syntax
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: pawn
file_extensions:
- pawn
- inc
- p
scope: source.c
stock rgba2bgra(color)
{
return
(color & 0xFF)
| ((color & 0xFF00) << 16)
| (color & 0xFF0000)
| ((color >> 16) & 0xFF00);
}
@ziggi
ziggi / cmd_id.pwn
Last active April 9, 2017 21:05
/id <part of nickname>
CMD:id(playerid, params[])
{
#if !defined COMMAND_ID_MAX_MATCHES
#define COMMAND_ID_MAX_MATCHES 10
#endif
new
ids[COMMAND_ID_MAX_MATCHES];
if (sscanf(params, "?<MATCH_NAME_PARTIAL=1>u[" #COMMAND_ID_MAX_MATCHES "]", ids)) {
stock Float:frandom(Float:max)
{
return floatdiv(float(random(0)), floatdiv(float(cellmax), max));
}
@ziggi
ziggi / GetTickDiff.pwn
Last active February 5, 2024 18:56
Function to calculate the time elapsed between the two calls GetTickCount(), given the possibility of overflow passed values.
stock GetTickDiff(newtick, oldtick)
{
if (oldtick > newtick) {
return (cellmax - oldtick + 1) - (cellmin - newtick);
}
return newtick - oldtick;
}
@ziggi
ziggi / proxdetector.pwn
Last active January 4, 2023 08:56
SA-MP ProxDetector function
stock ProxDetector(playerid, Float:max_range, color, const string[], Float:max_ratio = 1.6)
{
new
Float:pos_x,
Float:pos_y,
Float:pos_z,
Float:range,
Float:range_ratio,
Float:range_with_ratio,
clr_r, clr_g, clr_b,
@ziggi
ziggi / fix_getvpcd.pwn
Created November 23, 2015 14:32
GetVehicleParamsCarDoors fix (beta)
/*
About: GetVehicleParamsCarDoors fix (beta)
Author: ziggi
*/
#if !defined _samp_included
#error Include a_samp.inc first
#endif
#include <a_samp>
/*
Consts
*/
#define TESTING_STRING " oc, ococ,ococ,ococ,oc oc,ococ,ococ,ococ,ococ,ococ,oco"
#define RESULT_STRING "oc,ococ,ococ,ococ,ococ,ococ,ococ,ococ,ococ,ococ,oco"
const PROFILE_ITERATIONS_MAJOR = 1000;