-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
241 changed files
with
14,542 additions
and
2,173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/bin/bash | ||
|
||
# Define color codes | ||
RED="\e[31m" | ||
ORANGE="\e[33m" | ||
GREEN="\e[32m" | ||
WHITE_BG="\e[47m" | ||
RESET="\e[0m" | ||
|
||
# Define directories | ||
destinationDir="C:/Users/fl0wer/Desktop/hlds_win/cstrike/addons/amxmodx" | ||
# destinationDir="D:/Games/SteamLibrary/steamapps/common/Half-Life/cstrike/addons/amxmodx" | ||
scriptingDir="$destinationDir/scripting" | ||
srcDir="$PWD" | ||
|
||
# Function to print colored messages | ||
print_color() { | ||
local color="$1" | ||
local message="$2" | ||
echo -e "${color}${message}${RESET}" | ||
} | ||
|
||
# Function to compile a .sma file | ||
compile_sma() { | ||
local smaFile="$1" | ||
local outputPluginDir="$2" | ||
|
||
pluginName=$(basename "${smaFile%.sma}") | ||
relativeDir=$(dirname "${smaFile#$srcDir}") | ||
|
||
outputPlugin="$outputPluginDir/${pluginName}.amxx" | ||
|
||
# Create the output plugin directory if it doesn't exist | ||
mkdir -p "$outputPluginDir" | ||
|
||
# Print the name of the .sma file with white background | ||
# print_color $WHITE_BG " - Compiling: $(basename $smaFile)" | ||
|
||
# Get the last modification time of the output plugin file | ||
lastModTime=$(stat -c %Y "$smaFile" 2>/dev/null) | ||
now=$(date +%s) | ||
diff=$((now-lastModTime)) | ||
|
||
# Check if the file exists and its last modification time is within the last minute | ||
if ! [ -f $outputPlugin ] || [ $diff -lt 60 ]; then | ||
# Compile the .sma file and capture its output, excluding the lines with version and copyright info | ||
compile_output=$("$scriptingDir/amxxpc" \ | ||
"$smaFile" \ | ||
-i"$srcDir" \ | ||
-i"$srcDir/include" \ | ||
-i"$srcDir/rezombie" \ | ||
-o"$outputPlugin" 2>&1 | grep -vE "AMX Mod X Compiler|Copyright|Could not locate output file") | ||
|
||
# Check if there are any errors or warnings in the compile output | ||
if echo "$compile_output" | grep -qi "error"; then | ||
error_lines=$(echo "$compile_output" | grep -i "error" | sed 's/.*scripting\///') | ||
warning_lines=$(echo "$compile_output" | grep -i "warning" | sed 's/.*scripting\///') | ||
print_color $RED "❌ $error_lines" | ||
if [ -n "$warning_lines" ]; then | ||
print_color $ORANGE "⚠️ $warning_lines" | ||
fi | ||
elif echo "$compile_output" | grep -qi "warning"; then | ||
warning_lines=$(echo "$compile_output" | grep -i "warning" | sed 's/.*scripting\///') | ||
print_color $ORANGE "⚠️ $warning_lines" | ||
else | ||
print_color $GREEN " ✅ Compiled: $(basename $smaFile)" | ||
fi | ||
# else | ||
# Skip processing the file if it has been modified within the last minute | ||
# print_color $ORANGE "Skipped: $(basename $smaFile) (not modified $((diff / 60)) min)" | ||
fi | ||
} | ||
|
||
# Find and compile all .sma files in the source directory and its subdirectories | ||
find "$srcDir" -name "*.sma" -type f | while read smaFile; do | ||
relativeDir=$(dirname "${smaFile#$srcDir}") | ||
outputPluginDir="$destinationDir/plugins$relativeDir" | ||
compile_sma "$smaFile" "$outputPluginDir" | ||
done | ||
|
||
#echo "" | ||
|
||
# Copy directories without confirmation with green messages | ||
#print_color $GREEN " - Copying configs..." | ||
#cp -rf "$srcDir/../configs"/* "$destinationDir/configs" | ||
#print_color $GREEN " - Copying data..." | ||
#cp -rf "$srcDir/../data"/* "$destinationDir/data" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Build AMX Mod X Plugins", | ||
"type": "shell", | ||
"command": "bash", | ||
"args": [".vscode/build.sh"], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
} | ||
], | ||
"presentation": { | ||
"echo": false, | ||
"reveal": "always", | ||
"focus": false, | ||
"panel": "dedicated", | ||
"showReuseMessage": false, | ||
"clear": true | ||
}, | ||
"problemMatcher": { | ||
"fileLocation": "autoDetect", | ||
"owner": "problem", | ||
"pattern": { | ||
// Group 1 - filename (absolute path for filename) | ||
// Group 2 - beginning line | ||
// Group 3 - ending line (optional) | ||
// Group 4 - error | warning (severity) | ||
// Group 5 - message | ||
"regexp": "(.+?)\\((\\d+)(?:\\s--\\s(\\d+))?\\)\\s:\\s(warning|error)\\s\\d+:\\s(.*)", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"severity": 4, | ||
"message": 5 | ||
} | ||
} | ||
} |
52 changes: 0 additions & 52 deletions
52
extra/addons/amxmodx/scripting/core/rz_languages_helper.sma
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#if defined _rezombie_included | ||
#endinput | ||
#endif | ||
|
||
#define _rezombie_included | ||
|
||
#pragma reqlib rezombie | ||
#if !defined AMXMODX_NOAUTOLOAD | ||
#pragma loadlib rezombie | ||
#endif | ||
|
||
/** | ||
* Constants | ||
*/ | ||
new const any:null = 0; | ||
stock const TO_ALL = 0; | ||
|
||
stock const MAX_HANDLE_LENGTH = 32; | ||
stock const MAX_LANGKEY_LENGTH = 32; | ||
stock const MAX_REFERENCE_LENGTH = 32; | ||
stock const MAX_PLAYER_MODEL_LENGTH = 32; | ||
stock const MAX_RESOURCE_PATH = 64; | ||
|
||
stock const DEFAULT_FOV = 90; | ||
|
||
stock const WEAPON_NOCLIP = -1; | ||
|
||
/** | ||
* Game teams | ||
*/ | ||
enum Team { | ||
TEAM_ZOMBIE = 1, | ||
TEAM_HUMAN = 2, | ||
TEAM_SPECTATOR, | ||
}; | ||
|
||
/** | ||
* Forward return types | ||
*/ | ||
enum { | ||
RZ_CONTINUE, | ||
RZ_SUPERCEDE, | ||
RZ_BREAK, | ||
}; | ||
|
||
enum HudChannel { | ||
TIMER_CHANNEL, | ||
PLAYER_INFO_CHANNEL, | ||
DAMAGER_CHANNEL, | ||
NOTICE_CHANNEL, | ||
}; | ||
|
||
#include <rezombie/rz_common> | ||
#include <rezombie/rz_game_rules> | ||
#include <rezombie/rz_modes> | ||
#include <rezombie/rz_player> | ||
#include <rezombie/rz_weapons> | ||
#include <rezombie/rz_models> | ||
#include <rezombie/rz_items> | ||
#include <rezombie/rz_map> | ||
#include <rezombie/rz_currency> | ||
#include <rezombie/rz_menu> | ||
|
||
stock const CBasePlayerWeapon_Members:m_Weapon_iRemainingShotsFired = m_Weapon_iFamasShotsFired | ||
stock const CBasePlayerWeapon_Members:m_Weapon_flNextRemainingShoot = m_Weapon_flFamasShoot | ||
|
||
stock register_commands(const commands[][], const handler[], const size = sizeof(commands)) { | ||
for (new command = 0; command < size; ++command) { | ||
register_clcmd(commands[command], handler) | ||
} | ||
} | ||
|
||
stock precache_sounds(const sounds[][], const size = sizeof(sounds)) { | ||
for (new sound = 0; sound < size; ++sound) { | ||
precache_sound(sounds[sound]) | ||
} | ||
} | ||
|
||
/** | ||
* You have to create len and text[] variables before call add_formatex | ||
*/ | ||
#define add_formatex(%0) len += formatex(text[len], charsmax(text) - len, %0) | ||
|
||
// bad with string | ||
#define bind_convar(%0,%1,%2) bind_pcvar_%0(create_cvar(%2), %1) |
Oops, something went wrong.