Float Bug
#1

hy, i have a bug on this code.. please help me !

Код:
stock LoadMachines()
{
		for(new i; i<MAX_OBJECTS; i++)
		{
			if (VendingType[i] != -1) DestroyObject(i);
		}
    	new File:hFile;
    	new tmpres[MAX_STRING],i=0;

		new machinetype;
    	new Float:x;
    	new Float:y;
    	new Float:z;
    	new Float:a;

    	new file[256];
    	format(file,256,"/RatMachines/machines.txt");
        hFile = fopen(file, io_read);
        if (hFile)
        {
        tmpres[0]=0;
        while (fread(hFile, tmpres)) {
            StripNewLine(tmpres);
            if (tmpres[0]!=0) {
                machinetype = strval(strtok(tmpres,i,','));
                //spawn X
                x = Float:floatstr(strtok(tmpres,i,','));
                //spawn Y
                y = Float:floatstr(strtok(tmpres,i,','));
                //spawn Z
                z = Float:floatstr(strtok(tmpres,i,','));
                //rotation x
                a = Float:floatstr(strtok(tmpres,i,','));
                if (machinetype == 0)VendingType[CreateObject(955,x,y,z,0,0,a)] = 0;
				if (machinetype == 1)VendingType[CreateObject(18885,x,y,z,0,0,a)] = 1;
				if (machinetype == 2)VendingType[CreateObject(1515,x,y,z,0,0,a)] = 2;
				if (machinetype == 3)VendingType[CreateObject(2942,x,y,z,0,0,a)] = 3;
            }
            tmpres[0]=0;
            i=0;
        }
        }
        fclose(hFile);
        return 1;
}


C:\Users\Alex\Desktop\***.pwn(2653) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\***.pwn(2655) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\***.pwn(2657) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\***.pwn(2659) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\***.pwn(2661) : warning 202: number of arguments does not match definition

That its on this code

               machinetype = strval(strtok(tmpres,i,','));
                //spawn X
                x = Float:floatstr(strtok(tmpres,i,','));
                //spawn Y
                y = Float:floatstr(strtok(tmpres,i,','));
                //spawn Z
                z = Float:floatstr(strtok(tmpres,i,','));
                //rotation x
                a = Float:floatstr(strtok(tmpres,i,','));
help please
Reply
#2

Isn't Float:a = floatstr(strtok(tmpres,i,',')); <- that's the example for one of these code. Just do it to all.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)