house owned variable not saving (y_INI)
#3

Quote:
Originally Posted by azzerking
Посмотреть сообщение
What is it storing in the ini? Is it writing it as 0 or leaving it blank, by that i mean is it like hOwned 0 or just "hOwned" and the value blank? If so, then when you are buying your house its not updating the house variables data.

also check that the data is being wrote to the right file and not somewhere else.

Maybe try checking it again, hope this helps
oh, sorry. I forgot to add those. Here you go

Код:
CMD:buyhouse(playerid,params[])
{
	if(IsPlayerInRangeOfPoint(playerid,2,HouseInfo[PlayerInfo[playerid][pHouse]][hEnterx],HouseInfo[PlayerInfo[playerid][pHouse]][hEntery],HouseInfo[PlayerInfo[playerid][pHouse]][hEnterz])) return SendClientMessage(playerid,COLOR_RED,"You own this house already.");
 	if(PlayerInfo[playerid][pHouse]!=-1) return SendClientMessage(playerid,COLOR_RED,"You own a property already. Sell it first.");
        for(new i=0;i<MAX_HOUSES;i++)
	{
	    if(IsValidHouse(i))
	    {
	        if(IsPlayerInRangeOfPoint(playerid,2,HouseInfo[i][hEnterx],HouseInfo[i][hEntery],HouseInfo[i][hEnterz]))
	   	{
	   	    if(PlayerInfo[playerid][pCash]<HouseInfo[i][hPrice]) return SendClientMessage(playerid,COLOR_RED,"You don't have enough money to buy this house.");
	   	    PlayerInfo[playerid][pCash]=PlayerInfo[playerid][pCash]-HouseInfo[i][hPrice];
                    SetPlayerCash(playerid,PlayerInfo[playerid][pCash]);
	   	    PlayerInfo[playerid][pHouse]=i;
	   	    HouseInfo[i][hOwned]=1;
	           SendClientMessage(playerid,COLOR_GREEN,"You successfully bought this property.");
	        }
	    }
	}
	return 1;
}
Reply


Messages In This Thread
house owned variable not saving (y_INI) - by PDChaseOfficial - 25.12.2012, 21:47
Re: house owned variable not saving (y_INI) - by azzerking - 25.12.2012, 21:55
Re: house owned variable not saving (y_INI) - by PDChaseOfficial - 25.12.2012, 21:59

Forum Jump:


Users browsing this thread: 2 Guest(s)