Raised This Month: $12 Target: $400
 3% 

View Poll Results: What do you think of this thread?
Good. 34 60.71%
I don't like it. 5 8.93%
It's nice, but the information is not enough. 17 30.36%
Voters: 56. You may not vote on this poll

[TUTORIAL] Writing an Extension (AMX Mod X Module) + Screenshots [May 15, 2014]


Post New Thread Reply   
 
Thread Tools Display Modes
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 05-12-2014 , 13:56   Re: [TUTORIAL] Writing an Extension (AMX Mod X Module) + Screenshots [Mar 18, 2014]
Reply With Quote #21

Ok i've decided to use VMLite to host Ubuntu dekstop, but claudiuhks can you please explain more detail about how to setup that vm and which hard disk type do i choose, and where is the output location of the virtual drive? I already got ubuntu dekstop ISO.

Thanks.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 05-13-2014 , 05:21   Re: [TUTORIAL] Writing an Extension (AMX Mod X Module) + Screenshots [Mar 18, 2014]
Reply With Quote #22

Yo,
Ok i've install ubuntu on my vmware work station, but now i got this error while using "make" command.
error


Makefile


If i using Makefile from claudiu, i will get the same error too.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-13-2014 , 05:33   Re: [TUTORIAL] Writing an Extension (AMX Mod X Module) + Screenshots [Mar 18, 2014]
Reply With Quote #23

Try to run: apt-get install gcc g++ clang to get everything.

You can also use AMBuild to buld AMXX and its modules: https://wiki.alliedmods.net/Building_AMX_Mod_X
__________________

Last edited by Arkshine; 05-13-2014 at 05:33.
Arkshine is offline
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 05-31-2014 , 14:27   Re: [TUTORIAL] Writing an Extension (AMX Mod X Module) + Screenshots [May 15, 2014]
Reply With Quote #24

Code:
HLSDK = /home/emanuel/amxx_mm_hlsdk/hlsdk/multiplayer
MM_ROOT = /home/emanuel/amxx_mm_hlsdk/metamod/metamod
CURRENT_DIR = /home/emanuel/amxx_mm_hlsdk/amxx/dlls/fun

INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \
    -I$(MM_ROOT) -I$(HLSDK)/common -I$(CURRENT_DIR) -I$(CURRENT_DIR)/sdk

PROJECT = $(CURRENT_DIR)/fun_amxx_i386.so

OBJECTS = $(CURRENT_DIR)/sdk/amxxmodule.cpp \
    $(CURRENT_DIR)/fun.cpp

FLAGS = -DNDEBUG -O2 -funroll-loops -fomit-frame-pointer -pipe \
    -fvisibility=hidden -fvisibility-inlines-hidden -DLINUX \
    -shared -m32 -lm -ldl -DPAWN_CELL_SIZE=32 -DJIT -DASM32 \
    -DHAVE_STDINT_H -fno-strict-aliasing -fno-exceptions \
    -fno-rtti -s -Wno-delete-non-virtual-dtor -static-libgcc \
    -D_snprintf=snprintf -D_strcpy=strcpy -D_strcat=strcat \
    -D_snprintf_s=snprintf -D_strncpy=strncpy -D_strncat=strncat \
    -D_stricmp=strcasecmp -D_strcmp=strcmp -D_strncmp=strncmp \
    -D_strnicmp=strncasecmp -DFALSE=0U -DTRUE=1U -Dstrnicmp=strncasecmp \
    -Dstricmp=strcasecmp -DBOOL=bool -DINT=int -DFLOAT=float -DREAL=float \
    -DPCHAR=char* -DPVOID=void* -DPINT=int* -DPFLOAT=float* \
    -DCONST=const -DCHAR=char -DVOID=void -DPREAL=float* -DPBOOL=bool* \
    -DHANDLE=void*

default:
    gcc $(OBJECTS) $(FLAGS) $(INCLUDE) -o $(PROJECT)
make -f /home/emanuel/amxx_mm_hlsdk/amxx/dlls/fun/Makefile
is this correct?


Everything else that the directory is not found
__________________
Destro- is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 11-10-2014 , 01:04   Re: [TUTORIAL] Writing an Extension (AMX Mod X Module) + Screenshots [May 15, 2014]
Reply With Quote #25

Hello guys.

Windows posibble compiling .so modules? How to, i get this error:


Edit:

Next try:

Code:
C:\Users\user\Downloads\kiki\kiki>gcc main.cpp sdk/amxxmodule.cpp main.h c
hooker.h -Isdk -Imod/metamod/metamod -Imod/hlsdk/public -Imod/hlsdk/pm_share -Im
od/hlsdk/dlls -Imod/hlsdk/engine -Imod/hlsdk/common -shared -o test.so
In file included from main.cpp:4:0:
sdk/amxxmodule.h:97:35: error: conflicting declaration 'typedef long int int32_t
'
         typedef long int          int32_t;
                                   ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\stdint.h:9:0,
                 from c:\mingw\include\process.h:18,
                 from c:\mingw\include\unistd.h:13,
                 from mod/metamod/metamod/osdep.h:230,
                 from mod/metamod/metamod/dllapi.h:41,
                 from mod/metamod/metamod/meta_api.h:40,
                 from sdk/amxxmodule.h:17,
                 from main.cpp:4:
c:\mingw\include\stdint.h:31:14: error: 'int32_t' has a previous declaration as
'typedef int int32_t'
 typedef int  int32_t;
              ^
In file included from main.cpp:4:0:
sdk/amxxmodule.h:98:35: error: conflicting declaration 'typedef long unsigned in
t uint32_t'
         typedef unsigned long int uint32_t;
                                   ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\stdint.h:9:0,
                 from c:\mingw\include\process.h:18,
                 from c:\mingw\include\unistd.h:13,
                 from mod/metamod/metamod/osdep.h:230,
                 from mod/metamod/metamod/dllapi.h:41,
                 from mod/metamod/metamod/meta_api.h:40,
                 from sdk/amxxmodule.h:17,
                 from main.cpp:4:
c:\mingw\include\stdint.h:32:20: error: 'uint32_t' has a previous declaration as
 'typedef unsigned int uint32_t'
 typedef unsigned   uint32_t;
                    ^
In file included from main.cpp:5:0:
chooker.h: In member function 'void* CMemory::SearchSymbolByAddress(char*, void*
)':
chooker.h:390:95: error: 'GetModuleHandleEx' was not declared in this scope
     if( GetModuleHandleEx( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, ( LPCSTR )li
baddr, &module ) )

               ^
chooker.h:392:47: error: invalid conversion from 'FARPROC {aka int (__attribute_
_((__stdcall__)) *)()}' to 'void*' [-fpermissive]
      void* s = GetProcAddress( module, symbol );
                                               ^
chooker.h: In member function 'void* CMemory::GetLibraryFromAddress(void*)':
chooker.h:437:95: error: 'GetModuleHandleEx' was not declared in this scope
     if( GetModuleHandleEx( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, ( LPCSTR )li
baddr, &module ) )

               ^
In file included from sdk/amxxmodule.cpp:40:0:
sdk/amxxmodule.h:97:35: error: conflicting declaration 'typedef long int int32_t
'
         typedef long int          int32_t;
                                   ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\stdint.h:9:0,
                 from c:\mingw\include\process.h:18,
                 from c:\mingw\include\unistd.h:13,
                 from mod/metamod/metamod/osdep.h:230,
                 from mod/metamod/metamod/dllapi.h:41,
                 from mod/metamod/metamod/meta_api.h:40,
                 from sdk/amxxmodule.h:17,
                 from sdk/amxxmodule.cpp:40:
c:\mingw\include\stdint.h:31:14: error: 'int32_t' has a previous declaration as
'typedef int int32_t'
 typedef int  int32_t;
              ^
In file included from sdk/amxxmodule.cpp:40:0:
sdk/amxxmodule.h:98:35: error: conflicting declaration 'typedef long unsigned in
t uint32_t'
         typedef unsigned long int uint32_t;
                                   ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\stdint.h:9:0,
                 from c:\mingw\include\process.h:18,
                 from c:\mingw\include\unistd.h:13,
                 from mod/metamod/metamod/osdep.h:230,
                 from mod/metamod/metamod/dllapi.h:41,
                 from mod/metamod/metamod/meta_api.h:40,
                 from sdk/amxxmodule.h:17,
                 from sdk/amxxmodule.cpp:40:
c:\mingw\include\stdint.h:32:20: error: 'uint32_t' has a previous declaration as
 'typedef unsigned int uint32_t'
 typedef unsigned   uint32_t;
                    ^
main.h:26:2: error: unknown type name 'bool'
  bool isBot;
  ^
main.h:27:2: error: unknown type name 'bool'
  bool inGame;
  ^
main.h:34:85: warning: 'struct sockaddr' declared inside parameter list [enabled
 by default]
 typedef size_t ( PASCAL *Func_Sendto )( int, const void*, size_t, int, const st
ruct sockaddr*, socklen_t );

     ^
main.h:34:85: warning: its scope is only this definition or declaration, which i
s probably not what you want [enabled by default]
main.h:36:100: warning: 'struct sockaddr' declared inside parameter list [enable
d by default]
 size_t PASCAL OnNewSendto( int socket, const void* message, size_t length, int
flags, const struct sockaddr* dest_addr, socklen_t dest_len );

                    ^
main.h:38:1: error: unknown type name 'bool'
 bool hookSendto  ( void );
 ^
main.h:40:1: error: unknown type name 'bool'
 bool messageGetString( const unsigned char* &msg, size_t &len, char* name, int
nlen );
 ^
main.h:40:45: error: expected ';', ',' or ')' before '&' token
 bool messageGetString( const unsigned char* &msg, size_t &len, char* name, int
nlen );
                                             ^
main.h:42:1: error: unknown type name 'bool'
 bool isBot   ( edict_t* pEntity );
 ^
main.h:42:16: error: unknown type name 'edict_t'
 bool isBot   ( edict_t* pEntity );
                ^
chooker.h:136:1: error: unknown type name 'class'
 class CMemory
 ^
chooker.h:137:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before
'{' token
 {
 ^
chooker.h:541:1: error: unknown type name 'class'
 class CFunc
 ^
chooker.h:542:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before
'{' token
 {
 ^
chooker.h:646:1: error: unknown type name 'class'
 class CHooker
 ^
chooker.h:647:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before
'{' token
 {
 ^
why the problem?
Attached Images
File Type: jpg compileerror.JPG (44.5 KB, 167 views)
__________________

Last edited by kiki33hun; 11-10-2014 at 08:31.
kiki33hun is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 11-10-2014 , 09:43   Re: [TUTORIAL] Writing an Extension (AMX Mod X Module) + Screenshots [May 15, 2014]
Reply With Quote #26

Of course not.
You need Linux to compile Linux shared libraries.

PHP Code:
gcc main.cpp sdk/amxxmodule.cpp main.h c
hooker
.-Isdk -Imod/metamod/metamod -Imod/hlsdk/public -Imod/hlsdk/pm_share -Im
od
/hlsdk/dlls -Imod/hlsdk/engine -Imod/hlsdk/common -shared -o test.so 
No .h files (main.h, chooker.h).
pm_share - did you mean pm_shared?
Also, add -I. and -I...
__________________

Last edited by claudiuhks; 11-10-2014 at 09:46.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Reply


Thread Tools
Display Modes

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


All times are GMT -4. The time now is 05:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode