Error compile,undefined symbol/argument mismatch
#1

Код:
forward VipCount();
public VipCount()
{
    static tmp[128];
    new File:ss=fopen(FILE_VIP,io_read);

    while(fread(ss,tmp))
    {
        if(strfind(tmp, "=") != -1)
        {
            DOF2_SetInt(FILE_VIP, strtok(strr,0,'='), strval(tmp)-1);
        }
    }
    fclose(ss);
    return 1;
}
Error:
Код:
error 017: undefined symbol "strr"
When I give new str[128]; shows up:
Код:
error 035: argument type mismatch (argument 2)
Reply
#2

Quote:
Originally Posted by Creax
Посмотреть сообщение
Код:
forward VipCount();
public VipCount()
{
    static tmp[128];
    new File:ss=fopen(FILE_VIP,io_read);

    while(fread(ss,tmp))
    {
        if(strfind(tmp, "=") != -1)
        {
            DOF2_SetInt(FILE_VIP, strtok(strr,0,'='), strval(tmp)-1);
        }
    }
    fclose(ss);
    return 1;
}
Error:
Код:
error 017: undefined symbol "strr"
When I give new str[128]; shows up:
Код:
error 035: argument type mismatch (argument 2)
where did you use this?
Код:
 VipCount()
Reply
#3

Код:
forward MinutaFunc();
public MinutaFunc()
{

	gettime(Hours, Minutes);

	if(Hours == 23 && Minutes == 59){
		VipCount();
	}
	return 1;
}
Reply
#4

Help?
Reply
#5

I suggest using some already existing ini system

pawn Код:
forward VipCount();
public VipCount()
{
    static tmp[128], str[127], pos;
    //Using io_read on nonexisting file will crash the server
    if(fexist(FILE_VIP)) {
        new File:ss = fopen(FILE_VIP,io_read);
        while(fread(ss,tmp))
        {
            pos = strfind(tmp, "=");
            if(pos != -1) {
                strmid(str, tmp, pos+1, strlen(tmp));  
                strmid(tmp, tmp, 0, pos-1);            
                DOF2_SetInt(FILE_VIP, tmp, strval(str)-1);
            }
        }
        fclose(ss);
    }
    return 1;
}
Not best solution, but whatever
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)