Skip to content

Commit

Permalink
some update
Browse files Browse the repository at this point in the history
  • Loading branch information
fl0werD committed Feb 5, 2024
1 parent 901c795 commit fa28fc0
Show file tree
Hide file tree
Showing 241 changed files with 14,542 additions and 2,173 deletions.
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"cacheVariables": {
"BUILD_SHARED_LIBS": "OFF",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"DEFAULT_OUTPUT_DIR": "C:/Program Files (x86)/Steam/steamapps/common/Half-Life/cstrike/addons/amxmodx/modules"
"DEFAULT_OUTPUT_DIR": "C:\\Users\\fl0wer\\Desktop\\hlds_win\\cstrike\\addons\\amxmodx\\modules"
}
},
{
Expand Down
50 changes: 19 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,31 @@
## What is this?
ReZombie is a modification for the Counter-Strike game based on the original Zombie Plague modification using modern technologies and deeper integration over the game library.

## Goals of the project
* Develop a modification architecture from scratch with the experience of previous years.
* Minimum dependencies between plugins.
* Extended API for plugins and minimum boilerplate code coverage.

## Requirements
ReHLDS, ReGameDLL, Metamod-r (or Metamod-P), AMX Mod X, ReAPI.
* Tip: Recommend using the latest versions.

## How can I help the project?
Just install it on your game server and report problems you faced.

## Acknowledgments
Thanks to projects: ReGameDLL_CS, AMX Mod X, ReAPI<br/>
Thanks to humans: wellasgood, Nvoymax, Alex, DANDY, steelzzz, Droads, Nordic Warrior, kostikovkirill, CaHTuK, Bodom, DimaS, bristol, wopox1337, PurposeLess and others.<br/>

Unlimited Player Classes & Sub-Classes<br/>
Weapons System (a wrapper for custom weapon based on default weapon) for weapons, knives and grenades.<br/>
Advanced Knives System for custom melee and knives<br/>
Grenade System (easy way to createEntities your own grenades)<br/>
Grenade System (easy way to create your own grenades)<br/>

## Вопрос - ответ
Вопрос: Неправильно работают хитбоксы (например: не попадает в голову, одинаковый урон).<br/>
Ответ:
https://developer.valvesoftware.com/wiki/$hbox

## Цвета
Возможное использование
> CSSColorParser::parse(" rgba (255, 128, 12, 0.5)");
Color [ 255, 128, 12, 0.5 ]
> CSSColorParser::parse("#fff");
Color [ 255, 255, 255, 1 ]
> CSSColorParser::parse("#ff0011");
Color [ 255, 0, 17, 1 ]
> CSSColorParser::parse("slateblue");
Color [ 106, 90, 205, 1 ]
> CSSColorParser::parse("blah");
Color [ 0, 0, 0, 1 ]
> CSSColorParser::parse("ffffff");
Color [ 0, 0, 0, 1 ]
### Система цветов
Для AMXX API возможно использовать следующие шаблоны значений цветов:\
Цвета можно указывать следующими методами:
- Шестнадцатеричные цвета: `#fff`, `#ff0011`
- RGB цвета: `rgb(255, 128, 12)`
- RGBA цвета: `rgba(255, 128, 12, 1.0)`, `rgba(255, 128, 12, 100%)`

Будут интерпретированы как массив значений { 255, 128, 12, 255 }

**Предопределенные названия цветов**: можно указать конкретное имя цвета из списка [140 названий цветов](https://www.w3schools.com/cssref/css_colors.php)\
**Создание своих цветов цвета**: создать свой цвет и использовать его в других плагинах.<br>
create_color("название цвета", "значение цвета")

_Примечание_: alpha будет интерпретироваться как alpha, brightness или игнорироваться там, где нет возможности указать это значение.

## Acknowledgments
Thanks to projects: ReGameDLL_CS, AMX Mod X, ReAPI<br/>
Thanks to humans: wellasgood, Nvoymax, Alex, DANDY, steelzzz, Droads, Nordic Warrior, kostikovkirill, CaHTuK, Bodom, DimaS, bristol, wopox1337, PurposeLess and others.<br/>
87 changes: 87 additions & 0 deletions extra/addons/amxmodx/scripting/.vscode/build.sh
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"
40 changes: 40 additions & 0 deletions extra/addons/amxmodx/scripting/.vscode/tasks.json
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 extra/addons/amxmodx/scripting/core/rz_languages_helper.sma

This file was deleted.

85 changes: 85 additions & 0 deletions extra/addons/amxmodx/scripting/include/rezombie.inc
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)
Loading

0 comments on commit fa28fc0

Please sign in to comment.