08.03.2013, 09:24
First of all, thank you for reading this.
Alright, I've been creating my own house system and it used to work perfectly but now it does not. ( Still at the beginning though ) When I type /buyhouse it constantly tells me I am not at any house.
NOTE: It currently has no price involved, as I test every line I add and now it does not work.
Alright, I've been creating my own house system and it used to work perfectly but now it does not. ( Still at the beginning though ) When I type /buyhouse it constantly tells me I am not at any house.
pawn Код:
if (strcmp("/buyhouse", cmdtext, true, 10) == 0)
{
for( new i = 0; i <= MAX_HOUSES; i++)
{
format(file, sizeof(file), "House_%d.ini", i );
x = dini_Float(file, "enterX");
y = dini_Float(file, "enterY");
z = dini_Float(file, "enterZ");
forSale = dini_Get(file, "ForSale");
if(IsPlayerInRangeOfPoint(playerid, 3.0, x ,y ,z ))
{
if(strval(forSale) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: This house is not for sale!");
GetPlayerName(playerid, name, sizeof(name));
if(strval(name) == strval(dini_Get(file, "Owner"))) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You may not buy your own house!");
SendClientMessage(playerid, 0xFFFFFFFF, "gsdgsdgsdsdgsdgsdgsdg");
atHouse[playerid] = true;
}
if(atHouse[playerid] == false) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You are not at any house.");
}
return 1;
}