SII Wont Load The File
#1

hello i created tea system, its saving on sctiptfiles/tea but its didnt loaded

code

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>//tnx to sa-mp team
#include <streamer>
#include <zcmd> // tnx to zeek
#include <SII>




#define MAX_TEA 20

#define Loop(%0,%1) for(new %0 = 0; %0 < %1; %0++)


public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    LoadTea();
    return 1;
}


enum TInfo
{
    Owner,
    OffX,
    OffY,
    OffZ,
    RotX,
    RotY,
    RotZ,
    TId,
}
new TeaInfo[MAX_TEA][TInfo];


new TeaEntrance[MAX_TEA];

CMD:createtea(playerid,params[])
{
 Loop(t, MAX_TEA)
  {
    GetPlayerPos(playerid,Float:TeaInfo[t][OffX],Float:TeaInfo[t][OffY],Float:TeaInfo[t][OffZ]);
    CreateDynamicObject(728,Float:TeaInfo[t][OffX],Float:TeaInfo[t][OffY],Float:TeaInfo[t][OffZ]-1,Float:TeaInfo[t][RotX],Float:TeaInfo[t][RotX],Float:TeaInfo[t][RotX]);
    CreateDynamicCP(Float:TeaInfo[t][OffX],Float:TeaInfo[t][OffY],Float:TeaInfo[t][OffZ] , 1.0, 0);
    new file[40];
    new HID;
    HID = TeaInfo[t][TId] += 1;
    format(file, sizeof(file), "Tea/%i.ini", HID);
    INI_Open(file);
    new name[MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, name, sizeof(name));
    INI_WriteString("Owner",name);
    INI_WriteFloat("posX", Float:TeaInfo[t][OffX]);
    INI_WriteFloat("posY", Float:TeaInfo[t][OffY]);
    INI_WriteFloat("posZ", Float:TeaInfo[t][OffZ]);
    INI_WriteFloat("RotX", Float:TeaInfo[t][RotX]);
    INI_WriteFloat("RotY", Float:TeaInfo[t][RotY]);
    INI_WriteFloat("RotZ", Float:TeaInfo[t][RotZ]);
    INI_Save();
    INI_Close();
    new Text3D:Text[MAX_TEA];
    new textstring[138];
    format(textstring, sizeof(textstring), "Owner: %s\nId: %d",name,TeaInfo[t][TId]);
    Text[t] = CreateDynamic3DTextLabel(textstring, 0x008080FF, Float:TeaInfo[t][OffX],Float:TeaInfo[t][OffY],Float:TeaInfo[t][OffZ], 40.0, 0, 0);
  }
 return 1;
}






stock LoadTea()
{
    new file[60];
    for(new i = 0; i < MAX_TEA;i++)
    {
        format(file,sizeof(file),"Tea/%i.ini",i);
        if(!INI_Exist(file)) continue;
        INI_Open(file);
        INI_ReadString(TeaInfo[i][Owner], "Owner");
        TeaInfo[i][OffX] = INI_ReadInt("posX");
        TeaInfo[i][OffY] = INI_ReadInt("posX");
        TeaInfo[i][OffZ] = INI_ReadInt("posX");
        TeaInfo[i][RotX] = INI_ReadInt("RotX");
        TeaInfo[i][RotY] = INI_ReadInt("RotY");
        TeaInfo[i][RotZ] = INI_ReadInt("RotZ");
        new Text3D:Text[MAX_TEA];
        new textstring[138];
        format(textstring, sizeof(textstring), "Owner: %s\nId: %d",TeaInfo[i][Owner],TeaInfo[i][TId]);
        Text[i] = CreateDynamic3DTextLabel(textstring, 0x008080FF, Float:TeaInfo[i][OffX],Float:TeaInfo[i][OffY],Float:TeaInfo[i][OffZ], 40.0, 0, 0);
        TeaEntrance[i] = CreateDynamicCP(Float:TeaInfo[i][OffX], Float:TeaInfo[i][OffY], Float:TeaInfo[i][OffZ], 1.0);
        CreateDynamicObject(728,Float:TeaInfo[i][OffX],Float:TeaInfo[i][OffY],Float:TeaInfo[i][OffZ],Float:TeaInfo[i][RotX],Float:TeaInfo[i][RotX],Float:TeaInfo[i][RotX]);
        INI_Close();
    }
    return 1;
}
help please ?
Reply
#2

That code is not loading anything from the file, it is writing...

pawn Код:
Float:TeaInfo[t][OffX] = INI_ReadFloat("posX");
This will read "posX" and put the value in the variable.
Reply
#3

nice its working !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)