Y_ini, load error
#1

Why is it that this code doesn't work
Код:
#define MAX_TP 20
new place[8];

INI:Teleports[](playerid, name[], value[]){ // input, output, sizeof, output
	INI_String(place, GetString, sizeof(GetString));
	return 0;
}

stock ShowTeleports(playerid){
	new i;
	for(i = 0; i < MAX_TP; i++){
		format(place, sizeof(place), "Place%d", i);
		INI_Load("Teleports.ini", true, playerid);
		printf(GetString);			
	}
	#pragma unused playerid
	return 1;
}
file
Код:
Place0 = Tierra Robada
Place1 = San Fierro
Place2 = Los Santos
Place3 = Las Venturas
Place4 = Whetstone
When I do the code above it will print me "Tierra Robada" 20 times while I format the place[] correct. Cause when I do it like this
Код:
#pragma unused TP_Places

new place[8];

INI:Teleports[](playerid, name[], value[]){ // input, output, sizeof, output
	INI_String(place, GetString, sizeof(GetString));
	return 0;
}

stock ShowTeleports(playerid){
	strpack(place, "Place0");
	INI_Load("Teleports.ini", true, playerid);
	printf(GetString);
	strpack(place, "Place1");
	INI_Load("Teleports.ini", true, playerid);
	printf(GetString);	
	return 1;
}
it prints "Tierra Robada" and "San Fierro" Although the place[] has the same value here it gives the right result. That's just not fair x3 ! Does this mean I have to configure all the 20 places like that?
Reply


Messages In This Thread
Y_ini, load error - by StilThere - 01.06.2011, 19:23
Re: Y_ini, load error - by StilThere - 02.06.2011, 17:16
Re: Y_ini, load error - by StilThere - 02.06.2011, 21:24
Re: Y_ini, load error - by StilThere - 06.06.2011, 09:29
Re: Y_ini, load error - by StilThere - 06.06.2011, 12:20
Re: Y_ini, load error - by StilThere - 08.06.2011, 11:54
Re: Y_ini, load error - by StilThere - 29.06.2011, 13:11

Forum Jump:


Users browsing this thread: 1 Guest(s)