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

My guess is
Quote:
Originally Posted by ******
pawn Код:
new
    // The name of the file, can be any string variable or literal.
    fileToWrite[] = "mine.INI",
   
    // "INI_Open" returns a variable with tag "INI".
    INI:iniFile = INI_Open(fileToWrite);
Reply
#3

How to get capture point? can someone help me to get that script? please ...
Reply
#4

Try change "#define HousePath "Houses/%i.ini" to #define HousePath "Houses/%s.ini"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)