Saving problem
#1

When I /createhouse somewhere it saves in the Scriptfiles only once as %i

pawn Код:
#define HousePath "Houses/%i.ini"

new hCount;

CMD:createhouse(playerid, params[])
{
    if(pInfo[playerid][Admin]==3)
    {
        new hPrice,id=hCount;
        if(sscanf(params,"i",hPrice)) return SendClientMessage(playerid,COLOR_GRAY,"USAGE: /createhouse [price]");
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid,x,y,z);
        hInfo[id][Price] = hPrice;
        hInfo[id][Owned] = 0;
        hInfo[id][Xpos] = x;
        hInfo[id][Ypos] = y;
        hInfo[id][Zpos] = z;
        hInfo[id][World] = GetPlayerVirtualWorld(playerid);
        format(hInfo[id][Owner],24,"Dale");
        SendClientMessage(playerid,-1,"House created");
        hEnter[id] = CreateDynamicCP(x,y,z,1.5,GetPlayerVirtualWorld(playerid));
        hExit[id] = CreateDynamicCP(443.9237,509.4609,1001.4195,1.5,GetPlayerVirtualWorld(playerid));
       
        new str[100];
        new INI:file = INI_Open(HousePath);
        INI_WriteInt(file,"Price",hPrice);
        INI_WriteInt(file,"Owned",0);
        INI_WriteFloat(file,"Xpos",x);
        INI_WriteFloat(file,"Ypos",y);
        INI_WriteFloat(file,"Zpos",z);
        INI_WriteInt(file,"World",GetPlayerVirtualWorld(playerid));
        INI_WriteString(file,"Owner","Dale");
        INI_Close(file);
        format(str,sizeof(str),"Owned: No \nPrice: $%i",hPrice);
        hInfo[id][Label] = Create3DTextLabel(str,COLOR_GREEN,x,y,z,7,GetPlayerVirtualWorld(playerid));
        hCount++;
    }
    return 1;
}
Reply


Messages In This Thread
Saving problem - by Noles2197 - 13.02.2013, 22:18
Re: Saving problem - by austin070 - 13.02.2013, 23:21
Re: Saving problem - by macparas - 14.02.2013, 04:00
Re: Saving problem - by ]Rafaellos[ - 14.02.2013, 11:10

Forum Jump:


Users browsing this thread: 3 Guest(s)