Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing Metamod gameinfo.gi file #12

Open
jpcapone opened this issue Dec 24, 2023 · 2 comments
Open

Installing Metamod gameinfo.gi file #12

jpcapone opened this issue Dec 24, 2023 · 2 comments

Comments

@jpcapone
Copy link

I am running your image of CS2 in a docker I would like to add metamod. Following the instructions to install Metamod it says to copy the addons folder over and then edit the gameinfo.gi (instructions here https://cs2major.com/article.php?id=22) file in the /game/csgo directory. When I open the file and search for "Game_LowViolence" I don't find it. Also, there is a remark saying "DO NOT EDIT THIS FILE DIRECTLY - YOU PROBABLY WANT TO EDIT CSGO_CORE/GAMEINFO.GI"

Any suggestions for getting metamod working?

@dqeq
Copy link

dqeq commented Oct 15, 2024

use that code in entrypoint.sh

#add metamod
FILE="$CS2_DIR/game/csgo/gameinfo.gi"
LINE="Game    csgo/addons/metamod"
chmod u=rwx,g=rwx,o=r "${FILE}"
echo "Checking if line exists in the file"

if grep -q "$LINE" "$FILE"
then
    echo "Line found in the file."
else
    echo "Line NOT found in the file. Adding now."
    awk -v n="$LINE" 'BEGIN{p=1}/[[:space:]]*Game[[:space:]]*csgo/ {if(p) {print n; p=0}} {print}' $FILE > tmpfile && mv tmpfile $FILE
    # Проверяем, была ли линия успешно добавлена
    if grep -q "$LINE" "$FILE"
    then
        echo "Line successfully added."
    else
        echo "Failed to add line. Please check file permissions."
    fi
fi

@Soren90
Copy link
Owner

Soren90 commented Oct 18, 2024

I've been planning to add the possibility to opt-in to metamod. But I just haven't been involved in any events lately, so I haven't prioritized it. But if that's something you would find helpful, I can look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants