01.06.2011, 19:23
(
Последний раз редактировалось StilThere; 01.06.2011 в 21:27.
)
Why is it that this code doesn't work
file
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
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?
Код:
#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; }
Код:
Place0 = Tierra Robada Place1 = San Fierro Place2 = Los Santos Place3 = Las Venturas Place4 = Whetstone
Код:
#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; }