Help me with this command
#3

Quote:
Originally Posted by Calisthenics
Посмотреть сообщение
Because HouseInfo goes out of bounds. Replace with MAX_HOUSES+1 with sizeof (HouseInfo) in the loop.
When a player is in range of a house, set their interior and position and stop the loop using break;
Thank you so much.

But now i have problem with this command.

Код:
CMD:buyhouse(playerid,params[])
{
    for(new h=0;h<sizeof(HouseInfo);h++)
	{
	    if(IsPlayerInRangeOfPoint(playerid,1.0,HouseInfo[h][hEnterX],HouseInfo[h][hEnterY],HouseInfo[h][hEnterZ]))
	    {
     		if(GetPlayerMoney(playerid) >= HouseInfo[h][hPrice])
       		{
         		new hpath[256];
	            format(hpath,sizeof(hpath),"/Houses/%d.ini",h);
	            dini_IntSet(hpath,"hOwned",1);
	    		dini_Set(hpath,"hOwner",GetName(playerid));
	    		PlayerHouse[playerid] = h;
	    		Delete3DTextLabel(HouseInfo[h][Label]);
				LoadHouses();
				break;
            }
	    }
    }
    return 1;
}
It dont work.
Reply


Messages In This Thread
Help me with this command - by scripter112 - 10.12.2018, 13:30
Re: Help me with this command - by Calisthenics - 10.12.2018, 13:53
Re: Help me with this command - by scripter112 - 10.12.2018, 13:59

Forum Jump:


Users browsing this thread: 1 Guest(s)