Raised This Month: $ Target: $400
 0% 

Array/String


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-31-2015 , 11:28   Re: Array/String
Reply With Quote #5

[ Problem fixed ] using #4 Method

anyway i have new problem...

i'm sorry for being annoying...

PHP Code:
public _register_vip_flag_info(pluginargc// native
{
    new 
vFlag[2], sString[32], sLinex
    get_string
(1vFlagcharsmax(vFlag))
    
get_string(2sStringcharsmax(sString))
    
    if(!
strlen(vFlag) || !strlen(sString))
    {
        
log_error(AMX_ERR_NATIVE"Error #Native register_vip_flag_info")
        return
    }
    
    static 
sFile[64], sBuffer[2024], sOutput[4], sInfo[2020]
    
get_localinfo("amxx_configsdir"sFilecharsmax(sFile))
    
formatex(sFilecharsmax(sFile), "%s/%s"sFileinfo_file)
    
    if(!
file_exists(sFile))
    {
        
log_error(AMX_ERR_NOTFOUND"File ^"%s^" is not found!"sFile)
        return
    }
    
    new 
fp fopen(sFile"rt")
    
    while(!
feof(fp) && access_flags)
    {
        
sLine ++
        
        
fgets(fpsBuffercharsmax(sBuffer))
        
        if(
sBuffer[0] == ';' || (sBuffer[0] & sBuffer[1] == '/'))
        {
            continue;
        }
        
        while(!
feof(fp))
        {
            
strbreak(sBuffersOutputcharsmax(sOutput), sInfocharsmax(sInfo))
            
remove_quotes(sOutput)
            
            
server_print("sOutput: %c - %c" sOutput[0], vFlag[0])
            
            if(
sOutput[0] == vFlag[0])
            {
                
formatex(sStringcharsmax(sString), "%s, "sString)
                
add(sBuffercharsmax(sBuffer), sString)
                
write_file(sFilesBuffersLine-1)
                return
            }
        }
        
        
x++;
        
formatex(sBuffercharsmax(sBuffer), "^"%c^" ; %s, "vFlag[0], sString)
        
write_file(sFilesBuffer)
    }
    
fclose(fp)

write in file .... firsting first this native search if vflag is already created..... in the file.txt
then if its created, print info like this "FLAG="a" ; "Extra Health", "Gravity", "

in each plugin when using that native, it been used like this

Example:-
PHP Code:
new const flag_info[] = "Access ability to predator class"

public flag_creation()
{
     
register_flag_info("a"flag_info)

"FLAG="a" ; "Extra Health", "Gravity", "Access ability to predator class", "
and it will be printed like that in the file

Last edited by Natsheh; 08-31-2015 at 14:50.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
 



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 22:14.


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