new INI:AD_FILE = INI_Open("ADArenas/AmmuLS.ini"); if(AD_FILE != INI_NO_FILE){ INI_SetTag(AD_FILE, "AD_ATTACKER"); INI_WriteFloat(AD_FILE, "A_X", 1267.2345); INI_WriteFloat(AD_FILE, "A_Y", -1411.1877); INI_WriteFloat(AD_FILE, "A_Z", 12.8666); INI_SetTag(AD_FILE, "AD_DEENDER"); INI_WriteFloat(AD_FILE, "D_X", 1259.3921); INI_WriteFloat(AD_FILE, "D_Y", -1403.4626); INI_WriteFloat(AD_FILE, "D_Z", 13.0036); INI_SetTag(AD_FILE, "CHECKPOINT"); INI_WriteFloat(AD_FILE, "CP_X", 1267.2631); INI_WriteFloat(AD_FILE, "CP_Y", -1265.8411); INI_WriteFloat(AD_FILE, "CP_Z", 13.3806); INI_Close(AD_FILE); }
[CHECKPOINT] CP_Z=0.00000000000000000000000000000000000000000000000000000000000000 CP_Y=0.000000 CP_X=0.00000000000000000000000000000000000000000000000000000000000000 [AD_DEENDER] D_Z=0.00000000000000000000000000000000000000000000000000000000000000 D_Y=0.000000 D_X=0.00000000000000000000000000000000000000000000000000000000000000 [AD_ATTACKER] A_Z=0.00000000000000000000000000000000000000000000000000000000000000 A_Y=0.000000 A_X=0.00000000000000000000000000000000000000000000000000000000000000
It's out of order cause your appending to a file aka adding to the file the bottom of the file is your first line.
Try making a new variable then assign the value to it rather than just typing it in inside the WriteFloat. |
new Float:AmmuLs_attacker[3] = {float0, float1, float2};
INI_Write(AD_FILE, "CP_XYZ", "1267.2631,-1265.8411,13.3806");
//get coords from string with sscanf
new dest[64], Float:x, Float:y, Float:z;
INI_Get(AD_FILE, "CP_XYZ", dest);
sscanf(dest, "p<,>fff", x, y, z);
Store coords as string and try.
See this example: pawn Code:
|