error 035: argument type mismatch (argument 1)
#1

Код:
#define Loop(%0,%1) \
	for(new %0 = 0; %0 != %1; %0++)
//==============================================

		                        if(rcInfo[raceinc] != true && rcInfo[racestar] != true)
		                        {
		                            new string[20];
		                            format(string, sizeof(string), "%s", inputtext);
		                            rcInfo[namebuild] = string, rcInfo[buildrace] = true, rcInfo[playercreaterc] = playerid;
		                            //..
		                            new INI:File = INI_Open(FolderRaces(inputtext));
		                            INI_SetTag(File, "Information race");
		                            INI_WriteString(File, "name", inputtext);
		                            INI_WriteInt(File, "checkpoints", 0);
		                            INI_WriteInt(File, "vehicle", 0);
		                            INI_WriteFloat(File, "sizeveh", 0.0);
		                            INI_WriteFloat(File, "angleveh", 0.0);
   		   			   Loop(x, 5)
     					  {
					    format(string, sizeof(string), "BestRacerTime_%d", x);
			Error	>>	    dini_Set(File, bstring, "0");
					    format(string, sizeof(string), "BestRacer_%d", x);
			Error	>>	    dini_Set(File, bstring, "noone");
					    }
		                            INI_Close(File);
: error 035: argument type mismatch (argument 1)
: error 035: argument type mismatch (argument 1)

Anyone please Fast




Thank You
Reply
#2

What hell! You cant access Y_INI formated files from dini.

Its simple though:
pawn Код:
dini_Set(FolderRaces(inputtext), string, "0");
And you are ploting a var bstring which is not created, might be string instead.

I wonder why dont you use Y_INI for that purpose too?
pawn Код:
INI_WriteString(File, string, "0");
Reply
#3

See the correct dini_set format here https://sampwiki.blast.hk/wiki/Useful_Functions#dini_Set
So the correct code would be :
PHP код:
dini_Set(FolderRaces(inputtext), bstring"0");
dini_Set(FolderRaces(inputtext), bstring"noone"); 
EDIT: too late some one already posted solution
Reply
#4

i want to loop the statement
Reply
#5

You can't do that, you can use Dini and ini file at the same time but do not use variables for the same file.

PHP код:
if(rcInfo[raceinc] != true && rcInfo[racestar] != true)
{
    new 
string[20];
    
format(stringsizeof(string), "%s"inputtext);
    
rcInfo[namebuild] = stringrcInfo[buildrace] = truercInfo[playercreaterc] = playerid;
                                    
//..
    
new INI:File INI_Open(FolderRaces(inputtext)); // new ini
    
INI_SetTag(File"Information race");
    
INI_WriteString(File"name"inputtext);
    
INI_WriteInt(File"checkpoints"0);
    
INI_WriteInt(File"vehicle"0);
    
INI_WriteFloat(File"sizeveh"0.0);
    
INI_WriteFloat(File"angleveh"0.0);
    
INI_Close(File); // close

    
Loop(x5)
    {
        
// new var file dini ("dini read and write( e.g=5)" ini(e.g = 5).).
        
format(stringsizeof(string), "BestRacerTime_%d"x);
        
dini_Set(Filebstring"0");
        
format(stringsizeof(string), "BestRacer_%d"x);
        
dini_Set(Filebstring"noone");
    } 
You should use INI for the two if it is the same system.

PHP код:
if(rcInfo[raceinc] != true && rcInfo[racestar] != true)
{
    new 
string[20];
    
format(stringsizeof(string), "%s"inputtext);
    
rcInfo[namebuild] = stringrcInfo[buildrace] = truercInfo[playercreaterc] = playerid;
                                    
//..
    
new INI:File INI_Open(FolderRaces(inputtext)); // new ini
    
INI_SetTag(File"Information race");
    
INI_WriteString(File"name"inputtext);
    
INI_WriteInt(File"checkpoints"0);
    
INI_WriteInt(File"vehicle"0);
    
INI_WriteFloat(File"sizeveh"0.0);
    
INI_WriteFloat(File"angleveh"0.0);
    
    for(new 
x!= 55++)
    {
        
strdel(string020);
        
format(stringsizeof(string), "BestRacerTime_%d"x);
        
INI_WriteString(Filestring"data save ?");
        
        
strdel(string020);
        
format(stringsizeof(string"BestRacer_%d"x);
        
INI_WriteString(Filestring"data save ?");
    }
    
INI_Close(File); // close

Reply
#6

The solution by Juan is correct, but why are you trying to use YINI and dini in the same script? Also, YINI's file variable will not work in a dini function. Their file variable dont even use the same tag.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)