20.10.2009, 10:21
I was trying to make a house system with dini
Coцrdinates work, Price works... everything works.
If I make a new House, in the file stand: Owner=nobody
And if somebody want to buy the house:
But if I type /buyhouse there stands: This house is already bought.
Can anyone help me?
Coцrdinates work, Price works... everything works.
If I make a new House, in the file stand: Owner=nobody
And if somebody want to buy the house:
pawn Код:
format(HInfo[houseid][owner], 24, dini_Get(Huis, "Owner"));
if(strcmp(cmd,"/buyhouse",true)==0)
{
if(PlayerToPoint(3.0, playerid, HInfo[houseid][iconx],HInfo[houseid][icony],HInfo[houseid][iconz]))
{
if(strcmp(HInfo[houseid][owner], "nobody", true))
{
if(GetPlayerMoney(playerid) >= HInfo[houseid][price])
{
new pname[24];
GetPlayerName(playerid, pname, 24);
format(string, sizeof(string), "You are now the owner of houseid: %d !!!", HInfo[houseid][hHouseid]);
SendClientMessage(playerid, GROEN, string);
dini_Set(Huis, "Owner", pname);
}
else
{
SendClientMessage(playerid, ROOD, "You don't have enough money.");
}
}
else
{
SendClientMessage(playerid, ROOD, "This house is already bought.");
}
}
else
{
SendClientMessage(playerid, ROOD, "You are not at an house.");
}
return 1;
}
Can anyone help me?