Raised This Month: $ Target: $400
 0% 

Calling Functions from other plugins


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Damocles
Member
Join Date: Jan 2005
Old 02-03-2005 , 06:00   Calling Functions from other plugins
Reply With Quote #1

Right this is a simple enough question, but its the first time ive done it and i cant get it to work :/

OK, what i want to do is call a function in one plugin from another plugin. In this instance i want to modify my ATAC plugin to send a message to my IRC plugin.

So in my IRC plugin ive added this code:

Code:
register_srvcmd("amx_ircmsg_kick", "inform_kick") public inform_kick() {         if (INFORMKICK)     {           new channel[64]         get_cvar_string("amx_irc_chan", channel, 63)         new victim[32]         read_argv(1, victim, 31)         new output[1024]         format(output, 1023, "PRIVMSG %s :4[cz]1 %s : Kicking %s For TK Violations^n", channel, victim)         socket_send(connection, output, 1023)     }   }

And in my ATAC plugin ive added this:

Code:
server_cmd("amx_ircmsg_kick %s", kName)

Now, when this function should be called by the ATAC plugin it doesnt work. When i try to force it to work by typing the 'amx_ircmsg_kick' command by hand i get these errors:

Quote:
rcon amx_ircmsg_kick Test
L 02/03/2005 - 10:48:48: [AMXX] Run time error 25 (parameter error) (plugin "ircbot.amxx") - debug not enabled.
L 02/03/2005 - 10:48:48: String formatted incorrectly - parameter 6 (total 5)
L 02/03/2005 - 10:48:48: [AMXX] To enable debug mode, add " debug" after the plugin name in plugins.ini (without quot
So how can i get this to work?? Thanks for any help

Damo.
Damocles is offline
 



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


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