![]() |
Metamod Plugin Programming Tutorial linux
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 |
Re: Metamod Plugin Programming Tutorial linux
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. |
Re: Metamod Plugin Programming Tutorial linux
well I don't think there is a "GCC 2.96"...
http://ftp.gnu.org/gnu/gcc/ |
Re: Metamod Plugin Programming Tutorial linux
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] |
Re: Metamod Plugin Programming Tutorial linux
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 |
Re: Metamod Plugin Programming Tutorial linux
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+0x18): 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?! |
Re: Metamod Plugin Programming Tutorial linux
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 |
Re: Metamod Plugin Programming Tutorial linux
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 ? |
Re: Metamod Plugin Programming Tutorial linux
thx for your help pierre marie :)
|
All times are GMT +2. The time now is 15:59. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.