02.07.2012, 19:05
Hey guys
I have the code:
If the previous file name: 1, it should create a file named 2.
but this does not happen
First, it creates a file named, and with repeated use he writes in the first file.
Help me please...
I have the code:
PHP код:
#define APATH "/ATM/%i.ini"
PHP код:
public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
new Float:oldX, Float:oldY, Float:oldZ, Float:oldRotX, Float:oldRotY, Float:oldRotZ;
if(response == EDIT_RESPONSE_FINAL)
{
new id;
GetObjectPos(objectid, oldX, oldY, oldZ), GetObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
for(new h = 1; h < MAX_ATM;h++)
{
id = h;
break;
}
AtmInfo[id][aPosX] = oldX, AtmInfo[id][aPosY] = oldY, AtmInfo[id][aPosZ] = oldZ;
AtmInfo[id][aPosRX] = oldRotX, AtmInfo[id][aPosRY] = oldRotY, AtmInfo[id][aPosRZ] = oldRotZ;
new file4[40];
format(file4, sizeof(file4), APATH, id);
new INI:File = INI_Open(file4);
INI_SetTag(File,"data");
INI_WriteFloat(File,"PosX", AtmInfo[id][aPosX]);
INI_WriteFloat(File,"PosY", AtmInfo[id][aPosY]);
INI_WriteFloat(File,"PosZ", AtmInfo[id][aPosZ]);
INI_WriteFloat(File,"PosRX",AtmInfo[id][aPosRX]);
INI_WriteFloat(File,"PosRY",AtmInfo[id][aPosRY]);
INI_WriteFloat(File,"PosRZ",AtmInfo[id][aPosRZ]);
INI_Close(File);
CancelEdit(playerid);
}
}
but this does not happen
First, it creates a file named, and with repeated use he writes in the first file.
Help me please...