INI_ParseFile
#12

You want a command where is saving it??

pawn Код:
CMD:createhouse(playerid,params[])
{
    if(!IsPlayerAdmin(playerid)) return NotAdmin(playerid);
    new HousePrice,id = HouseCount, HouseLevel, opis[50];
    if(sscanf(params,"iis[128]",HousePrice, HouseLevel, opis)) return Usage(playerid, "/createhouse [Cijena] [Level] [Opis Kuce]");
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    HouseInfo[id][Price] = HousePrice;
    HouseInfo[id][Level] = HouseLevel;
    HouseInfo[id][Owned] = 0;
    HouseInfo[id][XPos] = x;
    HouseInfo[id][YPos] = y;
    HouseInfo[id][ZPos] = z;
    HouseInfo[id][VirtualWorld] = GetPlayerVirtualWorld(playerid);
    format(HouseInfo[id][Opis], 50, "%s", opis);
    format(HouseInfo[id][Owner],24,"Nitko");
    SendClientMessage(playerid, -1, ""#COL_BLUE"[House Kuca] Nova kuca je napravljena na vasoj poziciji!");
    HouseEnter[id]  = CreatePickup(1273, 23, x,y,z,GetPlayerVirtualWorld(playerid));
    HouseExit[id] = CreatePickup(1239, 23, 443.9237,509.4609,1001.4195,GetPlayerVirtualWorld(playerid));
    new file[40],labelstring[256];
    format(file,sizeof(file),"House/Kuce/%i.ini",id);
    new INI:kuca = INI_Open(file);
    INI_WriteInt(kuca, "Cijena",HousePrice);
    INI_WriteInt(kuca, "Level",HouseLevel);
    INI_WriteInt(kuca, "Zauzeto",0);
    INI_WriteInt(kuca, "VirtualWorld",GetPlayerVirtualWorld(playerid));
    INI_WriteFloat(kuca, "XPos",x);
    INI_WriteFloat(kuca, "YPos",y);
    INI_WriteFloat(kuca, "ZPos",z);
    INI_WriteString(kuca, "Vlasnik","Nitko");
    INI_WriteString(kuca, "Opis",opis);
    INI_Close(kuca);
    format(labelstring,sizeof(labelstring),"Vlasnik: Nitko \nCijena: %i\nLevel: %i\nVrsta kuce: %s",HousePrice, HouseLevel, opis);
    HouseInfo[id][HouseLabel] = Create3DTextLabel(labelstring,0xFF0000FF,x,y,z,25.0,GetPlayerVirtualWorld(playerid));
    HouseCount++;
    return 1;
}
or that:

pawn Код:
Cijena = 100
Level = 1
Zauzeto = 0
VirtualWorld = 0
XPos = 2802.431396
YPos = -1936.273925
ZPos = 13.546875
Vlasnik = Nitko
Opis = Velika Kuca
Reply


Messages In This Thread
INI_ParseFile - by Speed - 10.12.2011, 14:03
Re: INI_ParseFile - by FireCat - 11.12.2011, 10:47
Re: INI_ParseFile - by TheArcher - 11.12.2011, 11:27
Re: INI_ParseFile - by Speed - 11.12.2011, 15:22
Re: INI_ParseFile - by PlayHard - 11.12.2011, 17:56
Re: INI_ParseFile - by Speed - 11.12.2011, 18:34
Re: INI_ParseFile - by PlayHard - 11.12.2011, 18:56
Re: INI_ParseFile - by Speed - 11.12.2011, 19:02
Re: INI_ParseFile - by PlayHard - 11.12.2011, 19:14
Re: INI_ParseFile - by Speed - 12.12.2011, 05:51
Re: INI_ParseFile - by TheArcher - 12.12.2011, 15:16
Re: INI_ParseFile - by Speed - 12.12.2011, 16:07
Re: INI_ParseFile - by Speed - 14.12.2011, 11:00
Re: INI_ParseFile - by Speed - 14.12.2011, 11:36

Forum Jump:


Users browsing this thread: 1 Guest(s)