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

Hooking FN_PutInServer


Post New Thread Reply   
 
Thread Tools Display Modes
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 01-11-2013 , 20:05   Re: Hooking FN_PutInServer
Reply With Quote #11

You have to use exactly the same definition as the prototypein header files.

Quote:
void FN_ClientPutInServer(edict_t *pEntity);
Don't change variable names.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 01-11-2013 , 22:41   Re: Hooking FN_PutInServer
Reply With Quote #12

Quote:
Originally Posted by joropito View Post
You have to use exactly the same definition as the prototypein header files.
Don't change variable names.
Ok.

My actual code:
PHP Code:
#ifndef __MAIN_H__
#define __MAIN_H__

#include "amxxmodule.h"

#include "CString.h"

void FN_ClientPutInServeredict_t *pEntity )
{
    
SERVER_PRINT"testtttttttttttttttttttttttttttttttttttttttttt" );
}

#endif 
I'm still getting compiling errors.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 01-11-2013 , 23:12   Re: Hooking FN_PutInServer
Reply With Quote #13

Show the errors...

Also you have to set meta result
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.

Last edited by joropito; 01-11-2013 at 23:12.
joropito is offline
Send a message via MSN to joropito
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 01-11-2013 , 23:15   Re: Hooking FN_PutInServer
Reply With Quote #14

Quote:
Originally Posted by joropito View Post
Show the errors...

Also you have to set meta result
What's that?

Errors:
https://forums.alliedmods.net/showpo...38&postcount=7
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
jim_yang
Veteran Member
Join Date: Aug 2006
Old 01-12-2013 , 00:00   Re: Hooking FN_PutInServer
Reply With Quote #15

remove this
Code:
#ifndef __MAIN_H__
#define __MAIN_H__
#endif
no idea why you add this in your source file.
That means if you don't define __MAIN_H__, your source file is empty
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>

Last edited by jim_yang; 01-12-2013 at 00:00.
jim_yang is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 01-12-2013 , 02:06   Re: Hooking FN_PutInServer
Reply With Quote #16

Quote:
Originally Posted by jim_yang View Post
remove this
Code:
#ifndef __MAIN_H__
#define __MAIN_H__
#endif
no idea why you add this in your source file.
That means if you don't define __MAIN_H__, your source file is empty
ifndef means If isn't defined so I think it's ok but I tried removing it but I still getting errors.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
bboygrun
CHOMP
Join Date: May 2010
Location: France
Old 01-12-2013 , 02:45   Re: Hooking FN_PutInServer
Reply With Quote #17

He meant :

"That means if you define __MAIN_H__, your source file is empty"
__________________
bboygrun is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 01-12-2013 , 02:50   Re: Hooking FN_PutInServer
Reply With Quote #18

Quote:
Originally Posted by bboygrun View Post
He meant :

"That means if you define __MAIN_H__, your source file is empty"
Btw didn't work:/
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-12-2013 , 04:02   Re: Hooking FN_PutInServer
Reply With Quote #19

Attach the whole project, it will be more fast to see.
__________________
Arkshine is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 01-12-2013 , 08:51   Re: Hooking FN_PutInServer
Reply With Quote #20

Better use of meta plugin :p

PHP Code:
static META_FUNCTIONS gMetaFunctionTable;
C_DLLEXPORT    int    Meta_Attach(PLUG_LOADTIME nowMETA_FUNCTIONS *pFunctionTablemeta_globals_t *pMGlobalsgamedll_funcs_t *pGamedllFuncs)
{
    
gpMetaGlobals pMGlobals;

    
gMetaFunctionTable.pfnGetEntityAPI2_Post GetEntityAPI2_Post;
    
    
memcpy(pFunctionTable, &gMetaFunctionTablesizeof(META_FUNCTIONS));

    return(
TRUE);

PHP Code:
DLL_FUNCTIONS gFunctionTable;
C_DLLEXPORT    int    GetEntityAPI2(DLL_FUNCTIONS *pFunctionTableint *interfaceVersion)
{
    
memset(&gFunctionTable0sizeof(DLL_FUNCTIONS));

    
gFunctionTable.pfnClientPutInServer ClientPutInServer;

    
memcpy(pFunctionTable, &gFunctionTablesizeof(DLL_FUNCTIONS));

    return 
1;

PHP Code:
void ClientPutInServeredict_t *pEntity )
{
    
SERVER_PRINT"ClientPutInServer" );

__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
Reply



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 08:19.


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