AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Gamedata Hook AMX 1.9 (https://forums.alliedmods.net/showthread.php?t=324397)

colossus 05-15-2020 02:17

Gamedata Hook AMX 1.9
 
Hi, how to hook this

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <gameconfig>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "colossus"

new GameConfig:gameConfig
new HookGiveDefaultItems

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
    
gameConfig LoadGameConfigFile("modules.games/game.cstrike")
    
HookGiveDefaultItems GameConfGetOffset(gameConfig"GiveDefaultItems")
    
server_print("a%d b%d"gameConfigHookGiveDefaultItems)
}

public 
GiveDefaultItems(id) {
    
client_print(idprint_chat"Testtt")
    return 
PLUGIN_CONTINUE


Output:
a1 b-1

rtxa 05-16-2020 01:26

Re: Gamedata Hook AMX 1.9
 
Quote:

Originally Posted by colossus (Post 2700230)
Hi, how to hook this

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <gameconfig>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "colossus"

new GameConfig:gameConfig
new HookGiveDefaultItems

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
    
gameConfig LoadGameConfigFile("modules.games/game.cstrike")
    
HookGiveDefaultItems GameConfGetOffset(gameConfig"GiveDefaultItems")
    
server_print("a%d b%d"gameConfigHookGiveDefaultItems)
}

public 
GiveDefaultItems(id) {
    
client_print(idprint_chat"Testtt")
    return 
PLUGIN_CONTINUE


Output:
a1 b-1

Explain what you want to do, because you aren't hooking anything, you are just getting a value from a game file (in this case, an offset).

colossus 05-21-2020 19:45

Re: Gamedata Hook AMX 1.9
 
bump

Bugsy 05-22-2020 08:46

Re: Gamedata Hook AMX 1.9
 
Someone asked you a question that you didn't respond to....

colossus 05-29-2020 13:02

Re: Gamedata Hook AMX 1.9
 
hook givedefaultitems cssdk

Bugsy 05-29-2020 18:10

Re: Gamedata Hook AMX 1.9
 
Quote:

Originally Posted by rtxa (Post 2700450)
Explain what you want to do, because you aren't hooking anything, you are just getting a value from a game file (in this case, an offset).

Quote:

Originally Posted by colossus (Post 2702990)
hook givedefaultitems cssdk

Don't speak in code. Tell us what you are trying to do, not how you think it has to be done.


All times are GMT -4. The time now is 20:34.

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