.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Enhancement Workshop > Metamod and metamod plugins
Metamod and metamod plugins Plugins and improvements for the metamod server-side mod

Reply
 
Thread Tools
Metamod Plugin Programming Tutorial linux
Old
  (#1)
SnakePr0luck0r
Guest
 
Status:
Posts: n/a
Default Metamod Plugin Programming Tutorial linux - 06-10-2004

i am searching for a metamod plugins programming tutorial for linux.
i am skilled in c++ but not much i only would like to code a plugin for linux that changes the mp_timelimit to 30 or anything like this.

i hope someone is friendly and can paste me a source code for this and how to compile .
i understand a detail of the source from the examples from metamod.org ( stub/wdmisc_plugin ) but i don't know how to compile on linux.

bye snakepr0luck0r
  
Reply With Quote
Re: Metamod Plugin Programming Tutorial linux
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Metamod Plugin Programming Tutorial linux - 06-10-2004

There is not much difference between a Windows and a Linux metamod plugin, because metamod already abstracts all the OS-specific declarations. We have some very simple plugins here in the filebase, almost all of which come with source code. Just grab one and see for yourself

Note that you must have GCC 2.95 or 2.96 to compile a working plugin for Linux, because the GCC 3.x series are known not to work.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Metamod Plugin Programming Tutorial linux
Old
  (#3)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: Metamod Plugin Programming Tutorial linux - 07-10-2004

well I don't think there is a "GCC 2.96"...
http://ftp.gnu.org/gnu/gcc/
  
Reply With Quote
Re: Metamod Plugin Programming Tutorial linux
Old
  (#4)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: Metamod Plugin Programming Tutorial linux - 07-10-2004

yea there is..
it was never released because it was mostly a beta..
but RedHat released it with one of their versions and got MANY complaints about the compiler being "broken" but it actually wasn't.. it was just that it was compiled with strict regulations on what it compiles...
[edit]
http://www.redhat.com/advice/speaks_gcc.html
[/edit]

Last edited by sPlOrYgOn; 07-10-2004 at 06:30..
  
Reply With Quote
Re: Metamod Plugin Programming Tutorial linux
Old
  (#5)
SnakePr0luck0r
Guest
 
Status:
Posts: n/a
Default Re: Metamod Plugin Programming Tutorial linux - 07-10-2004

i downloaded hlsdk-2.3 and unziped it
my gcc version: "gcc version 2.95.4 20011002 (Debian prerelease)"
got one of the examples from the database called playerlog_mm.cpp .

i compile with:
g++ -o playerlog_mm.so playerlog_mm.cpp -I /root/pl/hlsdk-2.3/multiplayer/dlls -I /root/pl/hlsdk-2.3/multiplayer/common -I /root/pl/hlsdk-2.3/multiplayer/cl_dll -I /root/pl/hlsdk-2.3/multiplayer/dedicated -I /root/pl/hlsdk-2.3/multiplayer/dmc -I /root/pl/hlsdk-2.3/multiplayer/engine -I /root/pl/hlsdk-2.3/multiplayer/game_shared -I /root/pl/hlsdk-2.3/multiplayer/network -I /root/pl/hlsdk-2.3/multiplayer/pm_shared -I /root/pl/hlsdk-2.3/multiplayer/ricochet -I /root/pl/hlsdk-2.3/multiplayer/utils

don't know how to add the path to my searchpath i only know -I

but there are some compileing errors:

meta_api.h:40: dllapi.h: No such file or directory
meta_api.h:41: engine_api.h: No such file or directory
meta_api.h:42: plinfo.h: No such file or directory
meta_api.h:43: mutil.h: No such file or directory
meta_api.h:44: osdep.h: No such file or directory

can't find in hlsdk these files where can i download them?

thx snake
  
Reply With Quote
Re: Metamod Plugin Programming Tutorial linux
Old
  (#6)
SnakePr0luck0r
Guest
 
Status:
Posts: n/a
Default Re: Metamod Plugin Programming Tutorial linux - 07-10-2004

ah forgott the source of metamod mhh but now this errors are there

In file included from /root/pl/hlsdk-2.3/multiplayer/dlls/meta_api.h:41,
from playerlog_mm.cpp:13:
/root/pl/metamod-1.17.2/metamod/engine_api.h:261: syntax error before `*'
/root/pl/metamod-1.17.2/metamod/engine_api.h:262: syntax error before `*'
/root/pl/metamod-1.17.2/metamod/engine_api.h:437: syntax error before `*'
/root/pl/metamod-1.17.2/metamod/engine_api.h:438: syntax error before `*'


strange!? i edite the file and make // before the line
then this error appears:

/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x1: undefined reference to `main'
collect2: ld returned 1 exit status


don't know what these errors are?!
i only want to compile an example from the filebase?!
  
Reply With Quote
Re: Metamod Plugin Programming Tutorial linux
Old
  (#7)
SnakePr0luck0r
Guest
 
Status:
Posts: n/a
Default Re: Metamod Plugin Programming Tutorial linux - 07-10-2004

mhh now it works

i only have 2 questions
which functions i need for exec a command for example mp_timelimit 30
and how can i wirte something after connection of a client in the console
void ClientPutInServer (edict_t *pEntity)
{
LOG_CONSOLE (PLID, "%s: Client-Connected", Plugin_info.name);
}
won't work only the server see it .

thx snake
  
Reply With Quote
Re: Metamod Plugin Programming Tutorial linux
Old
  (#8)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Metamod Plugin Programming Tutorial linux - 07-10-2004

There is a macro to execute arbitrary server commands.

SERVER_COMMAND ("your_command_here\n");

it calls pfnServerCommand()

You can get a client's name by looking it up in the engine's string table using the STRING() macro.

STRING (pClientEdict->v.netname)

pClientEdict being an edict_t pointer.

I don't understand what you want exactly. WHEN do you want your mp_timelimit command to be executed ?



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Metamod Plugin Programming Tutorial linux
Old
  (#9)
SnakePr0luck0r
Guest
 
Status:
Posts: n/a
Default Re: Metamod Plugin Programming Tutorial linux - 09-10-2004

thx for your help pierre marie
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com