Creating House Problem.... Writing A File With SII
#9

Quote:
Originally Posted by axxelac
Посмотреть сообщение
What that guy said
I already have that included but i still get errors


I put SII.inc in my YSI folder and also done

#include <YSI/SII>


I got it working from the way TzAKS said im just getting errors from this now.....


pawn Код:
CMD:buy(playerid,params[])
{
    for(new i = 0; i < MAX_HOUSES;i++)//Loop threw all houses.
    {
        if(!IsPlayerInRangeOfPoint(playerid,8.0,HInfo[i][XPos],HInfo[i][YPos],HInfo[i][ZPos])) continue;//Check if the player is near a house checkpoint
        if(GetPlayerMoney(playerid) < HInfo[i][Price]) return SendClientMessage(playerid,-1,"You don't have enough money");//Checking the players money, to see if he has enough to buy the house.
        if(HInfo[i][Owned] == 1) return SendClientMessage(playerid,-1,"This house is already owned");//Checking if the house is already owned.
        HInfo[i][Owned] = 1;//Setting the house owned var to 1.
        new file[60],pName[24],string[100];//Creating the necessary vars.
        GetPlayerName(playerid,pName,sizeof(pName));//Retrieving the player's name.
        format(HInfo[i][Owner],24,"%s",pName);//Setting the House Owner's var
        format(file,sizeof(file),"FHouse/Houses/%i.ini",i);//Formating the house file
        INI_Open(file);//Opening the house file
        INI_WriteInt("Owned",1);//Setting in the ini file "Owned" to 1
        INI_WriteString("Owner",pName);//Setting the "Owner" to the player's name.
        //INI_Save();//Saving the ini
        INI_Close();//Closing the ini
        format(string,sizeof(string),"Owned: Yes \nPrice: %i \nOwner: %s",HInfo[i][Price],pName);//Formating the string, so we can update the label of the house
        Update3DTextLabelText(HInfo[i][HouseLabel],0xFF0000FF,string);//Updating the label with a red color
        return 1;
    }
    SendClientMessage(playerid,-1,"You aren't near a house!");
    return 1;
}

The errors i am getting are


Код:
(1316) : error 035: argument type mismatch (argument 1)
(1317) : error 035: argument type mismatch (argument 1)
Line 1316 : INI_WriteInt("Owned",1);//Setting in the ini file "Owned" to 1
Line 1317 : INI_WriteString("Owner",pName);//Setting the "Owner" to the player's name.


Please Help Me Please
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)