Raised This Month: $51 Target: $400
 12% 

Edit return value set_native_filter.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
artist
Member
Join Date: Nov 2013
Old 12-15-2017 , 01:24   Edit return value set_native_filter.
Reply With Quote #1

PHP Code:
#include <amxmodx>

native get_pl_value(id)

public 
plugin_init()
{
    
register_clcmd("say / value""functions")
}
public 
plugin_natives()
{
    
set_native_filter("native_filter")
}
public 
native_filter(natives[], indextrap)
{
    if(
equal(natives"get_pl_value")) return PLUGIN_HANDLED
    
return PLUGIN_CONTINUE
}
public 
functions(id)
{
    
client_print(idprint_chat"%i"get_pl_value(id))

If there is no module with function get_pl_value, the message will output 0.
Is it possible to make it inferred -1?
artist is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 12-15-2017 , 09:24   Re: Edit return value set_native_filter.
Reply With Quote #2

I don't think it's possible, but you can use this very basic method:

Code:
new iPlVal = get_pl_value(id); if (!iPlVal)       iPlVal = -1;

Better check if the library exists.

Last edited by CrazY.; 12-15-2017 at 09:26.
CrazY. is offline
Reply



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 00:52.


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