Skip to content

Instantly share code, notes, and snippets.

Server Information

Canonical Invite Link: https://discord.gg/samp Spread the word!

- Rules -

Staff have the right to kick/ban if they believe such action is justified. In general, warnings will be issued and discussed with users first.

  • Respect - Just don't be a dick. Banter is fine but don't be hateful or harrass users.
  • Topics - Conversations diverge and that's fine but if someone says move channel, move. Memes in #memes only.
@Vince0789
Vince0789 / db.pwn
Created July 8, 2021 16:45
SA-MP MySQL Connect
/**
* <summary>
* Gets the current database handle. This method acts like a singleton; if a
* connection doesn't exist, one is created.
* </summary>
* <returns>
* MySQL database handle.
* </returns>
*/
stock MySQL:GetDatabaseHandle()
@Vince0789
Vince0789 / pawn.json
Last active December 9, 2021 19:08
Snippets for vscode
{
"if": {
"prefix": "if",
"body": "if(${condition})\n{\n\t$0\n}"
},
"else": {
"prefix": "else",
"body": "else\n{\n\t$0\n}"
},
"enum": {
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
for (int i = 1; i <= 100; i++)
{
@Vince0789
Vince0789 / samp03svr
Last active January 9, 2020 22:57
Configuration file for logrotate to rotate SA-MP server logs.
/path/to/server/server_log.txt {
daily
rotate 30
dateext
extension .txt
olddir /var/log/samp03svr
missingok
compress
create
postrotate
@Vince0789
Vince0789 / rules.v4
Last active August 13, 2024 11:39 — forked from jirutka/rules-both.iptables
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <[email protected]>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# create a new chain
iptables -N SAMPQUERY
# check that incomming packet is a samp query packet and divert to the new chain
# this inserts the rule as the first in the chain, but should probably be a bit further down (e.g. after checking lo interface)
iptables -I INPUT -p udp \! -f -m udp --dport 7777 -m conntrack --ctstate NEW,ESTABLISHED -m u32 --u32 "0x0>>0x16&0x3c@0x8=0x53414d50" -j SAMPQUERY
# only allow connection from ephemeral source ports
# connection attempts from ports outside this range are likely rogue clients
iptables -A SAMPQUERY -p udp --sport 49152:65535 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
<?php
/**
* Converts a column name into the corresponding index (A = 0, B = 1, AA = 26, etc).
*
* @param string $name
* @return int
*/
function getColumnIndexFromName($name)
{
$chars = array_map(function($char) { return ord($char); }, str_split(strtoupper($name)));
www.youtube.com
www.youtub%65.com
www.youtu%62e.com
www.youtu%62%65.com
www.yout%75be.com
www.yout%75b%65.com
www.yout%75%62e.com
www.yout%75%62%65.com
www.you%74ube.com
www.you%74ub%65.com
0000
0001 AIRPORT THRW_BARL_THRW
0002 ATTRACTORS STEPSIT_IN
0003 ATTRACTORS STEPSIT_LOOP
0004 ATTRACTORS STEPSIT_OUT
0005 BAR BARCUSTOM_GET
0006 BAR BARCUSTOM_LOOP
0007 BAR BARCUSTOM_ORDER
0008 BAR BARMAN_IDLE
0009 BAR BARSERVE_BOTTLE