Well, heres the command, but i didnt fully include the whole code of it, as i spend a lot of time making it and don't want others to use it:
pawn Код:
CMD:buyhouse(playerid, params[])
{
for(new hi = 0; hi < sizeof(HInfo); hi++)
{
if(IsPlayerInRangeOfPoint(playerid, 3, HInfo[hi][heX],HInfo[hi][heY],HInfo[hi][heZ]))
{
if(!strcmp(HInfo[hi][hOwnedBy], "None") || HInfo[hi][hForSale] == 1)
{
if(pInfo[playerid][Logged] == 0)
{
SendClientMessage(playerid, COLOR_RED, "You are not logged in!");
return 1;
}
else //Can purchase it.
{
if(pInfo[playerid][pHouse1] > 0 && pInfo[playerid][pHouse2] > 0) { SendClientMessage(playerid, COLOR_RED, "You cannot have more than 2 houses!"); return 1; }
if(pInfo[playerid][pHouse1] == 0)
{
if(!strcmp(HInfo[hi][hOwnedBy], "None"))
{
if(HInfo[hi][hDefaultPrice] > pInfo[playerid][pMoney])
{
SendClientMessage(playerid, COLOR_RED, "You cannot afford to purchase this house!");
return 1;
}
return 1;
}
if(HInfo[hi][hPrice] > pInfo[playerid][pMoney])
{
SendClientMessage(playerid, COLOR_RED, "You cannot afford to purchase this house!");
return 1;
}
if(isonline == 1) //he is online
{
new CHECKNAME[MAX_PLAYER_NAME];
for(new i = 0; i<MAX_PLAYERS; i++)
{
GetPlayerName(i, CHECKNAME, MAX_PLAYER_NAME);
if(!strcmp(CHECKNAME, HInfo[hi][hOwnedBy]))
{
if(IsHouse1 == 0 && IsHouse2 == 0) //CANCEL HOUSE PURCHASE.
{
SendClientMessage(playerid, COLOR_RED, "An unknown error occured while fetching house owners data.");
return 1;
}
if(IsHouse1 == 1)
{
return 1;
}
else if(IsHouse2 == 1)
{
return 1;
}
}
}
}
else //he is offline
{
if(house1id == hi)
{
return 1;
}
else
{
if(house2id == hi)
{
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "An error occured getting the current house owners data.");
return 1;
}
}
}
}
if(pInfo[playerid][pHouse2] == 0)
{
if(!strcmp(HInfo[hi][hOwnedBy], "None"))
{
if(HInfo[hi][hDefaultPrice] > pInfo[playerid][pMoney])
{
SendClientMessage(playerid, COLOR_RED, "You cannot afford to purchase this house!");
return 1;
}
return 1;
}
if(HInfo[hi][hPrice] > pInfo[playerid][pMoney])
{
SendClientMessage(playerid, COLOR_RED, "You cannot afford to purchase this house!");
return 1;
}
{
{
{
{
SendClientMessage(playerid, COLOR_RED, "An unknown error occured while fetching house owners data.");
return 1;
}
if(IsHouse1 == 1)
{
return 1;
}
else if(IsHouse2 == 1)
{
return 1;
}
}
}
}
else //he is offline
{
if(house1id == hi)
{
return 1;
}
else
{
{
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "An error occured getting the current house owners data.");
return 0;
}
}
}
}
}
}
}
return 1;
}
CMD:reloadhouses(playerid, params[])
{
if(pInfo[playerid][pAdmin] >= 6)
{
for(new i=0;i<MAX_HOUSES;i++)
{
ReloadHouse(i);
}
SendClientMessage(playerid, COLOR_WHITE, "You have reloaded all houses.");
AdminLog(playerid, "/reloadhouses", "Reloaded Houses", "Houses");
return 1;
}
else
{
return 0;
}
return 1;
}
*I only removed the things inside the brackets and stuff, nothing else.*