SA-MP Forums Archive
Help me please (Y_INI) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me please (Y_INI) (/showthread.php?tid=356216)



Help me please (Y_INI) - JM_Millers - 02.07.2012

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...


Respuesta: Help me please (Y_INI) - [DOG]irinel1996 - 02.07.2012

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.


Re: Help me please (Y_INI) - JM_Millers - 02.07.2012

Here:

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