Help me please (Y_INI)
#1

Hey guys

I have the code:

PHP код:
#define APATH "/ATM/%i.ini" 
PHP код:
public OnPlayerEditObject(playeridplayerobjectobjectidresponseFloat:fXFloat:fYFloat:fZFloat:fRotXFloat:fRotYFloat:fRotZ)
{
    new 
Float:oldXFloat:oldYFloat:oldZFloat:oldRotXFloat:oldRotYFloat:oldRotZ;
    
    if(
response == EDIT_RESPONSE_FINAL)
    {
        new 
id;
        
GetObjectPos(objectidoldXoldYoldZ), GetObjectRot(objectidoldRotXoldRotYoldRotZ);
        
        for(new 
1MAX_ATM;h++)
        {
             
id h;
        break;
        }
        
       
AtmInfo[id][aPosX] = oldXAtmInfo[id][aPosY] = oldYAtmInfo[id][aPosZ] = oldZ;
       
AtmInfo[id][aPosRX] = oldRotXAtmInfo[id][aPosRY] = oldRotYAtmInfo[id][aPosRZ] = oldRotZ;
        
          new 
file4[40];
            
format(file4sizeof(file4), APATHid);
        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);
    }

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...
Reply
#2

Can you show me APATH please?

You have to count the files which you have in your folder in scriptfiles, and add 1 to make another file with a bigger number.
Reply
#3

Here:

PHP код:
#define APATH "/ATM/%i.ini" 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)