.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Metamod and metamod plugins (http://forums.bots-united.com/forumdisplay.php?f=15)
-   -   Plugin interacting with AMX (http://forums.bots-united.com/showthread.php?t=1335)

FrostyCoolSlug 10-04-2004 23:33

Plugin interacting with AMX
 
I was thinking of coding a 'Sockets' plugin, which allow things like AMX to create sockets, and send data, for example, an IRC script. I was wondering if it is possible (and easy) to get this to interact with AMX or other plugins?

Any info provided will be useful :)

thanks in advance

Pierre-Marie Baty 11-04-2004 20:45

Re: Plugin interacting with AMX
 
If it's about "advanced" programming like sockets and network IO, why not coding a metamod plugin directly in C/C++, instead of that AMX small stuff ?

FrostyCoolSlug 12-04-2004 01:09

Re: Plugin interacting with AMX
 
thats what i was going to do, however, i wanted AMX to have some sorta control over it, so that people can get it to do what they want, it would be for things like custom scripts. For example, when the plugin was loaded into metamod, it would give AMX smallscript some 'new' functions of some kind. so the script could use the sockets provided by the plugin. If you get what i'm saying :p

Pierre-Marie Baty 12-04-2004 07:59

Re: Plugin interacting with AMX
 
I understand perfectly, however I'm not sure this is feasible. AMX's small script is compiled by AMX itself into bytecode, which is then interpreted. You can't add new opcodes and tell AMX that your external plugin is in charge of handling them, and AMX won't know how to compile your new instructions into bytecodes.

You can still decide to pass commands and instructions elseway. For example, your plugin could feature some simple "send" and "rcv" client commands, that would send and read bytes from a socket, and you could either call them from the server console by hand (great for testing) or through an AMX script by issuing a ClientCommand. It's ugly, but it can work.

FrostyCoolSlug 12-04-2004 08:03

Re: Plugin interacting with AMX
 
ok, thanks for the help, you gave me pretty much what i wanted :p

I'll have to find a different way to do it ;)


All times are GMT +2. The time now is 12:07.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.