AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ping hook (https://forums.alliedmods.net/showthread.php?t=114108)

RadiaX^ 01-01-2010 23:14

Ping hook
 
Good day to all of you.

I've been trying for about 6 hours on this one.
I'm currently using Amxmodx v1.5. Its not recommended, I know, but since all my home-made plugins wont work, I prefer using it rather than spending forever on porting it to 1.8.

I'm relatively new to the amx plugin-scene, but this is what I've got so far for changing the ping:
Code:

#include <amxmodx>
#include <fakemeta>

public plugin_init()
{
        register_plugin("-", "1", "-")
        register_forward(FM_UpdateClientData, "fw_UpdateClientData")
}

public fw_UpdateClientData(id)
{
        message_begin(8, 17, _, id)
        write_byte(1)
        write_short(100)
        write_byte(0)
        message_end()                       
}

I'm guessing its not a very effective code, but I stripped it down as much as I could without removing the effect of the addon. (Its confirmed working on amx v.1.8.)

Everything seem to work in this code except one small thing;
"register_forward", when I remove it, the plugin successfully loads, but of course it doesn't give the desired effect. And if I leave it, it tells me "bad load".

My question is, is there any other way to hook the scoreboard? Or is there another similar function on earlier versions of amxmod?

And oh, I've tried the debug, but it doesn't tell me that anything is wrong.

Thanks alot in advance.

RadiaX^ 01-02-2010 06:53

Re: Ping hook
 
If nobody knows how to do this, is there at least anyone who knows if its even possible in AMX v1.5?


All times are GMT -4. The time now is 04:03.

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