Results 1 to 7 of 7

Thread: Libcod

  1. #1
    Private
    Join Date
    Mar 2019
    Posts
    16
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Libcod

    Hello again, sorry for spamming, but I've got a problem while running my server with libcod


    PHP Code:
     #!/bin/bash

    sv_maxclients="24"
    fs_game="sdpammode"
    fs_homepath="/root/cod2"
    cod="/root/cod2/cod2_lnxded"
    com_hunkMegs="256"
    config="server.cfg"
    cracked="1"
    net_port="28960"


    args=\
    "+set fs_homepath \"$fs_homepath\" "\
    "+set sv_cracked $cracked "\
    "+set fs_game $fs_game "\
    "+set net_port $net_port "\
    "+set com_hunkMegs $com_hunkMegs "\
    "+set sv_maxclients $sv_maxclients "\
    "+set fs_basepath \"$fs_homepath\" "\
    "+exec $config"

    LD_PRELOAD="/root/libcod/bin/libcod2_1_3.so" $cod $args +set g_gametype sd +map mp_toujane 

    I've saved that as a .sh file and added it to " /root "

    so, after I try to run it, an error appears

    Code:
    ./server.sh: line 2: $'\r': command not found
    ./server.sh: line 11: $'\r': command not found
    ./server.sh: line 12: $'\r': command not found
    : No such file or directoryfs_homepath "/root/cod2
    ./server.sh: line 15: $'+set sv_cracked 1\r \r': command not found
    ./server.sh: line 16: $'+set fs_game sd_polat_bigjump\r \r': command not found
    ./server.sh: line 17: $'+set net_port 28960\r \r': command not found
    ./server.sh: line 18: $'+set com_hunkMegs 256\r \r': command not found
    ./server.sh: line 19: $'+set sv_maxclients 24\r \r': command not found
    : No such file or directoryfs_basepath "/root/cod2
    ./server.sh: line 21: $'+exec 1qaz.cfg\r\r': command not found
    ./server.sh: line 22: $'\r': command not found
    : No such file or directory/cod2/cod2_lnxded

    Please, help me to solve this problem! I need libcod for my server

  2. The Following User Says Thank You to nerdiiii For This Useful Post:

    kung foo man (26th March 2019)

  3. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Dont edit your .sh file on windows, it adds a \r\n at the end of each line, whereas linux expects a \n only.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  4. The Following User Says Thank You to IzNoGoD For This Useful Post:

    nerdiiii (25th March 2019)

  5. #3
    Private
    Join Date
    Mar 2019
    Posts
    16
    Thanks
    2
    Thanked 3 Times in 3 Posts
    I tried to do it through
    Code:
    nano run.sh
    and edited it, but it shows the same error

  6. #4
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by nerdiiii View Post
    I tried to do it through
    Code:
    nano run.sh
    and edited it, but it shows the same error
    delete the line ends in nano, then add them back in. It should fix up the errors you're seeing.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  7. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    kung foo man (26th March 2019),nerdiiii (25th March 2019)

  8. #5
    Private
    Join Date
    Mar 2019
    Posts
    16
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Thank you so much man! it's working

  9. #6
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    Quote Originally Posted by IzNoGoD View Post
    Dont edit your .sh file on windows, it adds a \r\n at the end of each line, whereas linux expects a \n only.
    i think dos2unix cant fix it
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  10. #7
    ... connecting
    Join Date
    Jul 2019
    Posts
    9
    Thanks
    1
    Thanked 4 Times in 3 Posts
    Notepad++ is every developers friend on Windows - your basic free lightweight replacement for quick edits with some power functions. Linux files? Just right click on 'Windows (CR LF)' on the right bottom of the screen and click 'Unix (LF)'. Problem solved!

    You must be into SM if you like to use VIM (or into a lesser extend Nano) on your Linux terminal. Windows is my daily driver and sometimes I wonder what the hell I'm doing in those terminals and VIM where I just can launch open Notepad++ directly from SSH on my Windows machine. I guess I'm into SM .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •