Raised This Month: $ Target: $400
 0% 

[HELP] How to call a function from another plugin.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Starman
Junior Member
Join Date: Dec 2013
Old 06-08-2014 , 20:00   [HELP] How to call a function from another plugin.
Reply With Quote #1

Well, the truth is that I have searched several things on this subject on the internet, however, I can not make it work, it should be noted that all the codes that show them, are pure examples of something simple that I want to do.

In my research, I came across a native particle (callfunc_begin), however, did several tests using this but without any positive result, below, show you something I want to do.

PHP Code:
/* First plugin, since this function is called from another. */

public plugin_init()
{
    
register_plugin(BLA... BLA... BLA)
    
    
register_clcmd("say /call""CallFunction")
}

public 
CallFunction(id)
{
    new 
Settings callfunc_begin("Testing""UserAlive.amxx")
    
    if(
Settings 0)
    {
        
callfunc_push_int(id)
        
callfunc_end()
    }

In the code above, which would be the function would call another plugin:

PHP Code:
/* This is UserAlive.amxx */

public Testing(id)
{
    if(
is_user_alive(id))
    {
        
client_print(idprint_chat"You're alive.")
    }

In theory, I want to do is something very simple, I want to say a comment "say" the Call, which will produce the function of another plugin is occurring.

Do not know if I will understand, but I think the code should know what I want more age or younger, obviously this is something to try later. Actually, I need you to tell me I'm doing wrong, and how I must.

Thanks, and hopefully help someone
Starman 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 09:40.


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