Skip to content

Instantly share code, notes, and snippets.

View ohmypxl's full-sized avatar
💀

sui ohmypxl

💀
View GitHub Profile
@ohmypxl
ohmypxl / pm.p
Created April 12, 2023 07:17
Simple PM systema
#include <YSI_Coding\y_timers>
#include <YSI_Server\y_colours>
#include <YSI_Visual\y_commands>
// Gamemode Entry
main()
{
printf("Copyright (c) - 2023 Genesis Roleplay");
}
@ohmypxl
ohmypxl / tdtime.inc
Created December 25, 2022 05:44
Simple clock textdraw with overload macros
// Overload macros for UpdateTextDrawTime
#define UpdateTextDrawTime(%1) (_:UTDT0:UTDT1:UpdateTdOvrld(%1))
#define UTDT0:UTDT1:UpdateTdOvrld(%1,%8PlayerText%9:%2) UpdateTextDrawTime__(%2,%1)
#define UTDT1:UpdateTdOvrld(%8Text%9:%1) UpdateTextDrawTime__(%1)
UpdateTextDrawTime__({PlayerText, Text}:textdraw, extraid = INVALID_PLAYER_ID, tag = tagof(textdraw))
{
new hour, minute, second;
gettime(hour, minute, second);
@ohmypxl
ohmypxl / day1.pwn
Last active December 6, 2022 11:03
Pawn AOC day 1
#include <console>
#include <file>
#include <string>
stock sanitize(buffer[])
{
new pos = strfind(buffer, "\r\n");
buffer[pos] = EOS;
return 1;
@ohmypxl
ohmypxl / datetime.inc
Last active September 15, 2024 08:59
Simple get current date, nothing fancy.
/*
@Title: Datetime Script 1.0
@Author: Aiura
@License: MIT
@Date: February 24th, 2023
Feel free to copy and paste the code, but don't forget to put the credits at the top of the function
- Aiura
*/
@ohmypxl
ohmypxl / censorip.pwn
Last active November 12, 2022 06:04
Untested, by theory it should give output like: 192.168.x.1 or 156.242.xxx.xx1
CensorIp(ip[])
{
if (!IsValidIp(ip))
return 0;
for (new i = 0, j = strlen(ip), k = 0; i < j; i++)
{
if (ip[i] == '.')
{
k ++;
@ohmypxl
ohmypxl / app-install.sh
Last active October 18, 2022 23:20
Lutris wine app install/runner, for samp is okay.
#!/bin/sh
clear
echo "+----------------------+"
echo "| App Installer v0.3 |"
echo "| By: Aiura |"
echo "+----------------------+"
echo
# If supplied argument is not 1
@ohmypxl
ohmypxl / nametag.inc
Last active August 31, 2022 07:22
Nametag function with beautiful for() codes
void:TogglePlayerNameTag(playerid, bool:toggle)
{
for (
new
targetid = 0,
maxPlayers = GetMaxPlayers();
/* if (*/targetid < maxPlayers;/*) */
ShowPlayerNameTagForPlayer(
playerid,
@ohmypxl
ohmypxl / y_dialog_wrapper.inc
Last active August 24, 2022 14:01
YSI Dialog Wrapper
/*
This is ported from easyDialog.inc for easier usage
But this only works for public functions and dumbest idea ever
I could just use indirection internally but meh
- Aiura
*/
#if defined _inc_y_dialog_wrapper
@ohmypxl
ohmypxl / runonsave.json
Created August 3, 2022 16:16
Sampctl Run-on-Save
{
"emeraldwalk.runonsave": {
"shell": "/bin/bash",
"autoClearConsole": true,
"commands": [
{
"match": "\\.pwn$",
"isAsync": true,
"cmd": "sampctl build"
},
@ohmypxl
ohmypxl / sampctl-installer.sh
Last active October 29, 2022 16:32
Install sampctl dev branch
#!/bin/sh
show_banner() {
clear
echo "+------------------------+"
echo "| sampctl dev installer |"
echo "| version: 0.5 |"
echo "| by: Aiura |"
echo "+------------------------+"
echo