[ Problem fixed ] using #4 Method
anyway i have new problem...
i'm sorry for being annoying...
PHP Code:
public _register_vip_flag_info(plugin, argc) // native
{
new vFlag[2], sString[32], sLine, x
get_string(1, vFlag, charsmax(vFlag))
get_string(2, sString, charsmax(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", sFile, charsmax(sFile))
formatex(sFile, charsmax(sFile), "%s/%s", sFile, info_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) && x < access_flags)
{
sLine ++
fgets(fp, sBuffer, charsmax(sBuffer))
if(sBuffer[0] == ';' || (sBuffer[0] & sBuffer[1] == '/'))
{
continue;
}
while(!feof(fp))
{
strbreak(sBuffer, sOutput, charsmax(sOutput), sInfo, charsmax(sInfo))
remove_quotes(sOutput)
server_print("sOutput: %c - %c" , sOutput[0], vFlag[0])
if(sOutput[0] == vFlag[0])
{
formatex(sString, charsmax(sString), "%s, ", sString)
add(sBuffer, charsmax(sBuffer), sString)
write_file(sFile, sBuffer, sLine-1)
return
}
}
x++;
formatex(sBuffer, charsmax(sBuffer), "^"%c^" ; %s, ", vFlag[0], sString)
write_file(sFile, sBuffer)
}
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