28.01.2018, 15:37
I made a quick test and it works fine. What's the issue(s) you are getting from this?
My test code:
My test code:
PHP код:
#include <a_samp>
#include <zcmd>
func(ip[], name[]) {
if(strlen(dini_Get("records.cfg", ip)) == 0) {
dini_Set("records.cfg", ip, name);
}
else
{
if( strfind( dini_Get("records.cfg", ip), name, true) == -1 )
{
new string[256];
format(string,sizeof(string),"%s,%s", dini_Get("records.cfg",ip), name);
dini_Set("records.cfg", ip, string);
}
}
}
main() {
func("1.1.1.1", "test");
func("1.1.1.1", "test1");
func("1.1.1.1", "test2");
func("1.1.1.1", "test3");
func("1.1.1.1", "test4");
func("1.1.1.1", "test5");
}